[Mesa-dev] [PATCH] i965: Fix num_uniforms count for scalar GS.
Jason Ekstrand
jason at jlekstrand.net
Fri Nov 20 14:29:22 PST 2015
On Fri, Nov 20, 2015 at 2:01 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> I noticed that brw_vs.c does this.
>
> I believe the point is that nir->num_uniforms is either counted in
> scalar components (in scalar mode), or vec4 slots (in vector mode).
> But we want param_count to be in scalar components regardless, so
> we have to scale up in vector mode.
Yup.
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
> We don't have to scale up in scalar mode, though.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
> src/mesa/drivers/dri/i965/brw_gs.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
> index ad5b242..149b43b 100644
> --- a/src/mesa/drivers/dri/i965/brw_gs.c
> +++ b/src/mesa/drivers/dri/i965/brw_gs.c
> @@ -75,7 +75,9 @@ brw_codegen_gs_prog(struct brw_context *brw,
> * every uniform is a float which gets padded to the size of a vec4.
> */
> struct gl_shader *gs = prog->_LinkedShaders[MESA_SHADER_GEOMETRY];
> - int param_count = gp->program.Base.nir->num_uniforms * 4;
> + int param_count = gp->program.Base.nir->num_uniforms;
> + if (!compiler->scalar_stage[MESA_SHADER_GEOMETRY])
> + param_count *= 4;
>
> prog_data.base.base.param =
> rzalloc_array(NULL, const gl_constant_value *, param_count);
> --
> 2.6.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list