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:
Marek Olšák
2025-08-05 14:58:19 -04:00
parent 3b252cbe92
commit 7290cc6eef
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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 ||
+1 -1
View File
@@ -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;