summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-02-26 15:19:13 +1000
committerDave Airlie <airlied@gmail.com>2014-02-27 09:19:10 +1000
commita870675328c03e094fed938d74e20a6b9886f95d (patch)
treec4ae33c2979a2ae32b982168155c5d943a3d5c3f
parent1af385cfaa3afbdddf5614a59f9a16f05af9e513 (diff)
fix textureSize for multisample
-rw-r--r--src/gallium/renderer/graw_shader.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/renderer/graw_shader.c b/src/gallium/renderer/graw_shader.c
index 08064681749..d3bc474fa74 100644
--- a/src/gallium/renderer/graw_shader.c
+++ b/src/gallium/renderer/graw_shader.c
@@ -1139,10 +1139,12 @@ iter_instruction(struct tgsi_iterate_context *iter,
ctx->samplers[sreg_index].tgsi_sampler_type = inst->Texture.Texture;
if (inst->Texture.Texture == TGSI_TEXTURE_CUBE_ARRAY || inst->Texture.Texture == TGSI_TEXTURE_SHADOWCUBE_ARRAY)
ctx->uses_cube_array = TRUE;
- if (inst->Texture.Texture == TGSI_TEXTURE_2D_MSAA || inst->Texture.Texture == TGSI_TEXTURE_2D_ARRAY_MSAA)
+ if (inst->Texture.Texture == TGSI_TEXTURE_2D_MSAA || inst->Texture.Texture == TGSI_TEXTURE_2D_ARRAY_MSAA) {
ctx->uses_sampler_ms = TRUE;
+ } else
+ snprintf(bias, 64, ", int(%s.w)", srcs[0]);
sampler_index = 1;
- snprintf(buf, 255, "%s = %s(%s(textureSize(%s, int(%s))));\n", dsts[0], dstconv, dtypeprefix, srcs[sampler_index], srcs[0]);
+ snprintf(buf, 255, "%s = %s(%s(textureSize(%s%s)));\n", dsts[0], dstconv, dtypeprefix, srcs[sampler_index], bias);
emit_buf(ctx, buf);
break;
}