shader: Emit swizzle for "1D" textures on GLES

These textures are emulated by 2D textures and textureSize needs the swizzle
for the result to be assignable to a float value.

Fixes piglits on GLES hosts:
     textureSize * *sampler1D
     textureSize * *sampler1DShadow

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>

Reviewed-By: Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Gert Wollny 6 years ago
parent 718f338a3e
commit 0b9f2e4bf7
  1. 7
      src/vrend_shader.c

@ -1989,9 +1989,10 @@ static void emit_txq(struct dump_ctx *ctx,
}
if (inst->Dst[0].Register.WriteMask & 0x7) {
bool txq_returns_vec = (inst->Texture.Texture != TGSI_TEXTURE_BUFFER &&
inst->Texture.Texture != TGSI_TEXTURE_1D &&
inst->Texture.Texture != TGSI_TEXTURE_SHADOW1D);
bool txq_returns_vec = (inst->Texture.Texture != TGSI_TEXTURE_BUFFER) &&
(ctx->cfg->use_gles ||
(inst->Texture.Texture != TGSI_TEXTURE_1D &&
inst->Texture.Texture != TGSI_TEXTURE_SHADOW1D));
emit_buff(ctx, "%s%s = %s(textureSize(%s%s))%s;\n", dsts[0], get_wm_string(twm), get_string(dtypeprefix), srcs[sampler_index], bias,
txq_returns_vec ? writemask : "");
}

Loading…
Cancel
Save