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>
macos/master
Emma Anholt 3 years ago committed by Gert Wollny
parent addbd9c505
commit b904137c84
  1. 7
      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_predefined_no_emit = true;
ctx->inputs[i].glsl_no_index = true; ctx->inputs[i].glsl_no_index = true;
ctx->inputs[i].is_int = true; ctx->inputs[i].is_int = true;
ctx->inputs[i].type = VEC_INT;
ctx->inputs[i].override_no_wm = true; ctx->inputs[i].override_no_wm = true;
name_prefix = "gl_ViewportIndex"; name_prefix = "gl_ViewportIndex";
if (ctx->glsl_ver_required >= 140) 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_predefined_no_emit = true;
ctx->inputs[i].glsl_no_index = true; ctx->inputs[i].glsl_no_index = true;
ctx->inputs[i].is_int = true; ctx->inputs[i].is_int = true;
ctx->inputs[i].type = VEC_INT;
ctx->inputs[i].override_no_wm = true; ctx->inputs[i].override_no_wm = true;
ctx->shader_req_bits |= SHADER_REQ_LAYER; ctx->shader_req_bits |= SHADER_REQ_LAYER;
break; 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); get_tesslevel_as_source(src_buf, prefix, ctx->inputs[j].glsl_name, &src->Register);
} else { } else {
enum vrend_type_qualifier srcstypeprefix = stypeprefix; enum vrend_type_qualifier srcstypeprefix = stypeprefix;
if ((stype == TGSI_TYPE_UNSIGNED || stype == TGSI_TYPE_SIGNED) && if (ctx->inputs[j].type != VEC_FLOAT) {
ctx->inputs[j].is_int)
srcstypeprefix = TYPE_CONVERSION_NONE;
else if (ctx->inputs[j].type) {
if (stype == TGSI_TYPE_UNSIGNED) if (stype == TGSI_TYPE_UNSIGNED)
srcstypeprefix = UVEC4; srcstypeprefix = UVEC4;
else if (stype == TGSI_TYPE_SIGNED) else if (stype == TGSI_TYPE_SIGNED)

Loading…
Cancel
Save