From 5d203c4ae03a4954bfa4f045862b3bf6312a532c Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Tue, 5 Sep 2023 11:13:35 +1000 Subject: [PATCH] glsl_to_nir: add more unhandled function types These are unhandled but were working ok because a mistake fixed in the following patch caused all functions to be skipped. Reviewed-by: Ian Romanick Part-of: --- src/compiler/glsl/glsl_to_nir.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 1ed5cf476cf..06a23365c52 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -172,6 +172,37 @@ public: unsupported = true; return visit_stop; } + + if (param->data.mode != ir_var_function_in && + param->data.mode != ir_var_const_in) + continue; + + /* SSBO and shared vars might be passed to a built-in such as an + * atomic memory function, where copying these to a temp before + * passing to the atomic function is not valid so we must replace + * these instead. Also, shader inputs for interpolateAt functions + * also need to be replaced. + * + * We have no way to handle this in NIR or the glsl to nir pass + * currently so let the GLSL IR lowering handle it. + */ + if (ir->is_builtin()) { + unsupported = true; + return visit_stop; + } + + /* For opaque types, we want the inlined variable references + * referencing the passed in variable, since that will have + * the location information, which an assignment of an opaque + * variable wouldn't. + * + * We have no way to handle this in NIR or the glsl to nir pass + * currently so let the GLSL IR lowering handle it. + */ + if (param->type->contains_opaque()) { + unsupported = true; + return visit_stop; + } } if (!glsl_type_is_vector_or_scalar(ir->return_type) &&