glsl: replace LowerPrecisionDerivatives with pipe caps
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36582>
This commit is contained in:
@@ -408,7 +408,7 @@ find_lowerable_rvalues_visitor::visit_enter(ir_expression *ir)
|
||||
stack.back().state = CANT_LOWER;
|
||||
|
||||
/* Don't lower precision for derivative calculations */
|
||||
if (!options->LowerPrecisionDerivatives &&
|
||||
if (!screen->shader_caps[stage].fp16_derivatives &&
|
||||
(ir->operation == ir_unop_dFdx ||
|
||||
ir->operation == ir_unop_dFdx_coarse ||
|
||||
ir->operation == ir_unop_dFdx_fine ||
|
||||
|
||||
@@ -367,10 +367,10 @@ standalone_compile_shader(const struct standalone_options *_options,
|
||||
for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_COMPUTE; i++) {
|
||||
((struct pipe_shader_caps*)&ctx->screen->shader_caps[i])->fp16 = true;
|
||||
((struct pipe_shader_caps*)&ctx->screen->shader_caps[i])->int16 = true;
|
||||
((struct pipe_shader_caps*)&ctx->screen->shader_caps[i])->fp16_derivatives = true;
|
||||
|
||||
struct gl_shader_compiler_options *options =
|
||||
&ctx->Const.ShaderCompilerOptions[i];
|
||||
options->LowerPrecisionDerivatives = true;
|
||||
options->LowerPrecisionConstants = true;
|
||||
options->LowerPrecisionFloat16Uniforms = true;
|
||||
options->LowerPrecision16BitLoadDst = true;
|
||||
|
||||
Reference in New Issue
Block a user