[Mesa-dev] [PATCH 4/6] i965/vec4: Handle MOV_INDIRECT in pack_uniform_registers

Michael Schellenberger Costa mschellenbergercosta at googlemail.com
Wed Apr 6 07:55:49 UTC 2016


Hi Jason,

Am 06.04.2016 um 06:11 schrieb Jason Ekstrand:
> ---
>  src/mesa/drivers/dri/i965/brw_vec4.cpp | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
> index e2aa109..6433fc5 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
> @@ -574,6 +574,24 @@ vec4_visitor::pack_uniform_registers()
>                                     BRW_GET_SWZ(inst->src[i].swizzle, c) + 1);
>           }
>        }
> +
> +      if (inst->opcode == SHADER_OPCODE_MOV_INDIRECT &&
> +          inst->src[0].file == UNIFORM) {
> +         assert(inst->src[2].file == BRW_IMMEDIATE_VALUE);
> +         assert(inst->src[0].subnr == 0);
> +
> +         unsigned bytes_read = inst->src[2].ud;
> +         assert(bytes_read % 4 == 0);
> +         unsigned vec4s_read = DIV_ROUND_UP(bytes_read, 16);
> +
> +         /* We just mark every register touched by a MOV_INDIRECT as being
> +          * fully used.  This ensures that it doesn't broken up piecewise by
There is an additional whitespace before This and "it doesn't broken up
" needs some love. Maybe "it doesnt get broken up"?
Michael
> +          * the next part of our packing algorithm.
> +          */
> +         int reg = inst->src[0].nr;
> +         for (unsigned i = 0; i < vec4s_read; i++)
> +            chans_used[reg + i] = 4;
> +      }
>     }
>  
>     int new_uniform_count = 0;



More information about the mesa-dev mailing list