aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmma Anholt <emma@anholt.net>2021-09-10 16:08:30 -0700
committerGert Wollny <gw.fossdev@gmail.com>2021-09-16 20:35:49 +0000
commitb904137c845b0173082252fc5fae43cbc29a7100 (patch)
treeb78b422971837fb1abc780dab3399a51599557ab
parentaddbd9c5058dcc9d561b20ab747aed58c53499da (diff)
downloadvirglrenderer-b904137c845b0173082252fc5fae43cbc29a7100.tar.gz
Make sure that gl_Layer and gl_Viewport get necessary vec4 expansion.
Otherwise, if the consuming op was not the same signedness, you'd get a compile failure. Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
-rw-r--r--src/vrend_shader.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index f5c336b4..d5a8d227 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -1110,6 +1110,7 @@ iter_declaration(struct tgsi_iterate_context *iter,
ctx->inputs[i].glsl_predefined_no_emit = true;
ctx->inputs[i].glsl_no_index = true;
ctx->inputs[i].is_int = true;
+ ctx->inputs[i].type = VEC_INT;
ctx->inputs[i].override_no_wm = true;
name_prefix = "gl_ViewportIndex";
if (ctx->glsl_ver_required >= 140)
@@ -1125,6 +1126,7 @@ iter_declaration(struct tgsi_iterate_context *iter,
ctx->inputs[i].glsl_predefined_no_emit = true;
ctx->inputs[i].glsl_no_index = true;
ctx->inputs[i].is_int = true;
+ ctx->inputs[i].type = VEC_INT;
ctx->inputs[i].override_no_wm = true;
ctx->shader_req_bits |= SHADER_REQ_LAYER;
break;
@@ -4112,10 +4114,7 @@ get_source_info(struct dump_ctx *ctx,
get_tesslevel_as_source(src_buf, prefix, ctx->inputs[j].glsl_name, &src->Register);
} else {
enum vrend_type_qualifier srcstypeprefix = stypeprefix;
- if ((stype == TGSI_TYPE_UNSIGNED || stype == TGSI_TYPE_SIGNED) &&
- ctx->inputs[j].is_int)
- srcstypeprefix = TYPE_CONVERSION_NONE;
- else if (ctx->inputs[j].type) {
+ if (ctx->inputs[j].type != VEC_FLOAT) {
if (stype == TGSI_TYPE_UNSIGNED)
srcstypeprefix = UVEC4;
else if (stype == TGSI_TYPE_SIGNED)