Module: Mesa
Branch: main
Commit: d42f9d94afc0d1e1e9ad2414634e4a0c7c04176b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d42f9d94afc0d1e1e9ad2414634e4a0c7c04176b

Author: Timothy Arceri <[email protected]>
Date:   Tue Dec 19 20:15:46 2023 +1100

glsl: copy precision val of function output params

We need to copy the precision to our temp values when converting
to nir or this information will be lost. This change fixes the new
test introduced in the following patch.

Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26755>

---

 src/compiler/glsl/glsl_to_nir.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/compiler/glsl/glsl_to_nir.cpp 
b/src/compiler/glsl/glsl_to_nir.cpp
index 8ea81fcb132..81e26ac004e 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -1635,6 +1635,7 @@ nir_visitor::visit(ir_call *ir)
       if (sig_param->data.mode == ir_var_function_out) {
          nir_variable *out_param =
             nir_local_variable_create(this->impl, sig_param->type, "param");
+         out_param->data.precision = sig_param->data.precision;
          nir_deref_instr *out_param_deref = nir_build_deref_var(&b, out_param);
          call->params[i] = nir_src_for_ssa(&out_param_deref->def);
       } else if (sig_param->data.mode == ir_var_function_in) {

Reply via email to