[virglrenderer-devel] [PATCH] shader: fix passing sampleid into interpolateAtSample

Jakob Bornecrantz jakob at collabora.com
Wed Jun 27 17:30:23 UTC 2018


On 2018-06-18 22:26, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> Fixes some of the
> KHR-GL44.shader_multisample_interpolation.* fails.

This does not cause any regressions on GLES[2|3] cts so is
Tested-by: Jakob Bornecrantz <jakob at collabora.com>

The changes looks good to me, tho I know a bit to little about that 
particular part to be super comfortable giving it my r-b.

Cheers, Jakob.

> ---
>   src/vrend_shader.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/vrend_shader.c b/src/vrend_shader.c
> index 2f342a4..0d81033 100644
> --- a/src/vrend_shader.c
> +++ b/src/vrend_shader.c
> @@ -3006,9 +3006,12 @@ get_source_info(struct dump_ctx *ctx,
>                      ctx->system_values[j].name == TGSI_SEMANTIC_PRIMID ||
>                      ctx->system_values[j].name == TGSI_SEMANTIC_VERTICESIN ||
>                      ctx->system_values[j].name == TGSI_SEMANTIC_INVOCATIONID ||
> -                   ctx->system_values[j].name == TGSI_SEMANTIC_SAMPLEID)
> -                  snprintf(srcs[i], 255, "%s(vec4(intBitsToFloat(%s)))", get_string(stypeprefix), ctx->system_values[j].glsl_name);
> -               else if (ctx->system_values[j].name == TGSI_SEMANTIC_TESSINNER ||
> +                   ctx->system_values[j].name == TGSI_SEMANTIC_SAMPLEID) {
> +		  if (inst->Instruction.Opcode == TGSI_OPCODE_INTERP_SAMPLE && i == 1)
> +		     snprintf(srcs[i], 255, "ivec4(%s)", ctx->system_values[j].glsl_name);
> +		  else
> +		     snprintf(srcs[i], 255, "%s(vec4(intBitsToFloat(%s)))", get_string(stypeprefix), ctx->system_values[j].glsl_name);
> +	       } else if (ctx->system_values[j].name == TGSI_SEMANTIC_TESSINNER ||
>                           ctx->system_values[j].name == TGSI_SEMANTIC_TESSOUTER) {
>                     snprintf(srcs[i], 255, "%s(vec4(%s[%d], %s[%d], %s[%d], %s[%d]))",
>                              prefix,
> 



More information about the virglrenderer-devel mailing list