[Mesa-dev] [PATCH] glsl: Lower variable indexing of system value arrays; treat like inputs.

Ilia Mirkin imirkin at alum.mit.edu
Mon Apr 4 16:05:20 UTC 2016


For those (few, I'm sure) of us who are exceedingly lazy, what [glsl
ir] code ends up getting generated as a result of this?

int temp;
if (zero == 0) temp = gl_SampleMaskIn[0]
else leave temp undefined?

On Mon, Apr 4, 2016 at 5:08 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> Some system values, such as gl_SampleMaskIn[], may be arrays.
> lower_variable_index_to_cond_assign() did not handle this case and would
> hit an unreachable() assert.
>
> For now, lower when EmitNoIndirectInput is set.  We could potentially
> add another flag for system values, but I'm not sure how useful that
> would be.
>
> Fixes Piglit's new samplemaskin-indirect test.  Also fixes many ES31-CTS
> tests when OES_sample_variables is enabled.
>
> Cc: mesa-stable at lists.freedesktop.org
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/compiler/glsl/lower_variable_index_to_cond_assign.cpp | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp b/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp
> index 278d545..2391089 100644
> --- a/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp
> +++ b/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp
> @@ -385,6 +385,7 @@ public:
>        case ir_var_const_in:
>           return this->lower_temps;
>
> +      case ir_var_system_value:
>        case ir_var_shader_in:
>           /* The input array size is unknown at compiler time for non-patch
>            * inputs in TCS and TES. The arrays are sized to
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list