From 4b19c86de1e0e51ce00f21ee9ca2982fd21daf52 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 15 Jun 2018 12:31:02 +1000 Subject: [PATCH] shader: fix passing sampleid into interpolateAtSample Fixes some of the KHR-GL44.shader_multisample_interpolation.* fails. Tested-by: Jakob Bornecrantz --- 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 f1a20cf..f7bf853 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -2625,9 +2625,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,