shader: TXQ: Don't emit swizzle if we query the size of a buffer

The buffer size is not an vector, and consequently we can't add a swizzle
operator. (This was probably the reason why the write mask was only emmited
when the it was larger then 1 before).

v2: Also handle 1D and Shadow1D textures (Dave)

Fixes: 70dedae465
  shader: TXQ: also emit a write mask if only one bit is set.

Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Gert Wollny 6 years ago committed by Jakob Bornecrantz
parent 4cf8edd9bf
commit aa302e4b24
  1. 6
      src/vrend_shader.c

@ -1899,7 +1899,11 @@ static int emit_txq(struct dump_ctx *ctx,
} }
if (inst->Dst[0].Register.WriteMask & 0x7) { if (inst->Dst[0].Register.WriteMask & 0x7) {
snprintf(buf, 255, "%s%s = %s(textureSize(%s%s))%s;\n", dsts[0], get_wm_string(twm), get_string(dtypeprefix), srcs[sampler_index], bias, writemask); bool txq_returns_vec = (inst->Texture.Texture != TGSI_TEXTURE_BUFFER &&
inst->Texture.Texture != TGSI_TEXTURE_1D &&
inst->Texture.Texture != TGSI_TEXTURE_SHADOW1D);
snprintf(buf, 255, "%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 : "");
EMIT_BUF_WITH_RET(ctx, buf); EMIT_BUF_WITH_RET(ctx, buf);
} }
return 0; return 0;

Loading…
Cancel
Save