[Mesa-dev] [PATCH v2 02/73] nir: fix nir_lower_wpos_ytransform when gl_FragCoord is a system value
Jason Ekstrand
jason at jlekstrand.net
Wed Jul 5 19:16:10 UTC 2017
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
On Wed, Jul 5, 2017 at 3:47 AM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> ---
> src/compiler/nir/nir_lower_wpos_ytransform.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/compiler/nir/nir_lower_wpos_ytransform.c
> b/src/compiler/nir/nir_lower_wpos_ytransform.c
> index 873d259..771c6ff 100644
> --- a/src/compiler/nir/nir_lower_wpos_ytransform.c
> +++ b/src/compiler/nir/nir_lower_wpos_ytransform.c
> @@ -295,22 +295,24 @@ lower_load_sample_pos(lower_wpos_ytransform_state
> *state,
> static void
> lower_wpos_ytransform_block(lower_wpos_ytransform_state *state,
> nir_block *block)
> {
> nir_foreach_instr_safe(instr, block) {
> if (instr->type == nir_instr_type_intrinsic) {
> nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr);
> if (intr->intrinsic == nir_intrinsic_load_var) {
> nir_deref_var *dvar = intr->variables[0];
> nir_variable *var = dvar->var;
>
> - if (var->data.mode == nir_var_shader_in &&
> - var->data.location == VARYING_SLOT_POS) {
> + if ((var->data.mode == nir_var_shader_in &&
> + var->data.location == VARYING_SLOT_POS) ||
> + (var->data.mode == nir_var_system_value &&
> + var->data.location == SYSTEM_VALUE_FRAG_COORD)) {
> /* gl_FragCoord should not have array/struct derefs: */
> assert(dvar->deref.child == NULL);
> lower_fragcoord(state, intr);
> } else if (var->data.mode == nir_var_system_value &&
> var->data.location == SYSTEM_VALUE_SAMPLE_POS) {
> assert(dvar->deref.child == NULL);
> lower_load_sample_pos(state, intr);
> }
> } else if (intr->intrinsic == nir_intrinsic_interp_var_at_offset)
> {
> lower_interp_var_at_offset(state, intr);
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170705/a6781bc9/attachment.html>
More information about the mesa-dev
mailing list