From 547beeaaec848896ed6faf570176021515f8d893 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Fri, 17 Aug 2018 14:31:38 +0200 Subject: [PATCH] shader: Ensure that the AND operation has the same typed sources Closes: #26 Fixesy on GLES host: dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in. bits_unique_per_two_samples.multisample_texture_16 bits_unique_per_two_samples.multisample_texture_4 bits_unique_per_two_samples.multisample_texture_8 bits_unique_per_two_samples.singlesample_texture Signed-off-by: Gert Wollny Reviewed-by: Jakob Bornecrantz Signed-off-by: Dave Airlie --- src/vrend_shader.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index bac5392..4639556 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -3258,8 +3258,14 @@ get_source_info(struct dump_ctx *ctx, ctx->system_values[j].glsl_name, get_swiz_char(src->Register.SwizzleW)); sinfo->override_no_cast[i] = true; } else if (ctx->system_values[j].name == TGSI_SEMANTIC_SAMPLEMASK) { + const char *vec_type = "ivec4"; + if (ctx->cfg->use_gles && + (inst->Instruction.Opcode == TGSI_OPCODE_AND) && + (stype == TGSI_TYPE_UNSIGNED)) + vec_type = "uvec4"; ctx->shader_req_bits |= SHADER_REQ_SAMPLE_SHADING | SHADER_REQ_INTS; - snprintf(srcs[i], 255, "ivec4(%s, %s, %s, %s)", + snprintf(srcs[i], 255, "%s(%s, %s, %s, %s)", + vec_type, src->Register.SwizzleX == TGSI_SWIZZLE_X ? ctx->system_values[j].glsl_name : "0", src->Register.SwizzleY == TGSI_SWIZZLE_X ? ctx->system_values[j].glsl_name : "0", src->Register.SwizzleZ == TGSI_SWIZZLE_X ? ctx->system_values[j].glsl_name : "0",