shader: reswizzle size values for 1D texture arrays on GLES

Since the 1D texture arrays are emulated by using 2D texture
arrays the number of array layers is in the z component.

Fixes piglits on GLES:
  textureSize * *sampler1DArray

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 0b9f2e4bf7
commit d184b04097
  1. 7
      src/vrend_shader.c

@ -1993,6 +1993,13 @@ static void emit_txq(struct dump_ctx *ctx,
(ctx->cfg->use_gles ||
(inst->Texture.Texture != TGSI_TEXTURE_1D &&
inst->Texture.Texture != TGSI_TEXTURE_SHADOW1D));
if (ctx->cfg->use_gles &&
(inst->Texture.Texture == TGSI_TEXTURE_1D_ARRAY ||
inst->Texture.Texture == TGSI_TEXTURE_SHADOW1D_ARRAY)) {
writemask = ".xz";
}
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