diff options
author | Marek Olšák <[email protected]> | 2018-05-17 23:23:24 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-06-13 22:00:12 -0400 |
commit | e5e57c3a5e517d866be2a6fdaf6e9e59181838fd (patch) | |
tree | 34529318e575ada5aa1cd6ee1a52dc0623278831 /src/amd | |
parent | a2d4c8ff6df99e5bb68d82549747f8c7baad403e (diff) |
ac: handle undefined EQAA samples in ac_apply_fmask_to_sample
RADV might wanna use this helper too.
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 133003b779a..93ae273f900 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -2747,11 +2747,13 @@ void ac_apply_fmask_to_sample(struct ac_llvm_context *ac, LLVMValueRef fmask, final_sample = LLVMBuildMul(ac->builder, addr[sample_chan], LLVMConstInt(ac->i32, 4, 0), ""); final_sample = LLVMBuildLShr(ac->builder, fmask_value, final_sample, ""); + /* Mask the sample index by 0x7, because 0x8 means an unknown value + * with EQAA, so those will map to 0. */ final_sample = LLVMBuildAnd(ac->builder, final_sample, - LLVMConstInt(ac->i32, 0xF, 0), ""); + LLVMConstInt(ac->i32, 0x7, 0), ""); /* Don't rewrite the sample index if WORD1.DATA_FORMAT of the FMASK - * resource descriptor is 0 (invalid), + * resource descriptor is 0 (invalid). */ LLVMValueRef tmp; tmp = LLVMBuildBitCast(ac->builder, fmask, ac->v8i32, ""); |