summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-02-08 00:26:37 +0100
committerMarek Olšák <[email protected]>2017-02-10 11:27:50 +0100
commit8a2ae4153b39b93257f42b97adf27428fe2faaf6 (patch)
tree235d7b77afa7004870b1dc27d31063db93844447 /src
parent28c06b3ceb7455538da301e03c9e704902cc1056 (diff)
radeonsi: reduce the number of FMASK input coordinates
Before: image_load v3, v[0:3] ... After: image_load v3, v[0:1] ... Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index d898afd72d4..eb2efbb72c4 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -4395,16 +4395,12 @@ static void tex_fetch_args(
struct lp_build_context *uint_bld = &bld_base->uint_bld;
struct lp_build_emit_data txf_emit_data = *emit_data;
LLVMValueRef txf_address[4];
- unsigned txf_count = count;
+ /* We only need .xy for non-arrays, and .xyz for arrays. */
+ unsigned txf_count = target == TGSI_TEXTURE_2D_MSAA ? 2 : 3;
struct tgsi_full_instruction inst = {};
memcpy(txf_address, address, sizeof(txf_address));
- if (target == TGSI_TEXTURE_2D_MSAA) {
- txf_address[2] = bld_base->uint_bld.zero;
- }
- txf_address[3] = bld_base->uint_bld.zero;
-
/* Read FMASK using TXF. */
inst.Instruction.Opcode = TGSI_OPCODE_TXF;
inst.Texture.Texture = target;
@@ -4425,7 +4421,7 @@ static void tex_fetch_args(
txf_emit_data.output[0],
uint_bld->zero, "");
- unsigned sample_chan = target == TGSI_TEXTURE_2D_MSAA ? 2 : 3;
+ unsigned sample_chan = txf_count; /* the sample index is last */
LLVMValueRef sample_index4 =
LLVMBuildMul(gallivm->builder, address[sample_chan], four, "");