summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2021-01-19 05:17:45 -0500
committerIlia Mirkin <imirkin@alum.mit.edu>2021-01-21 15:55:34 -0500
commit245a696741d2a4cd5f2aade38c2194e3030d659b (patch)
treef8aba9f001dea55a03995a0d703fdbf86a7df37f /src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
parent0773cd33c2bd14605eee471dd0dcc5306dd41cd4 (diff)
nvc0/ir: add fixup to deal with interpolateAtSample with non-MSAA
The spec calls to always use sample 0 in this case, whereas we can do undefined things for invalid sample id's in the MSAA case. Fixes dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_sample.non_multisample_buffer.sample_n_* Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8574>
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
index 0a82c6de20d..08863868b7a 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
@@ -1259,7 +1259,16 @@ void
nvc0_selpFlip(const FixupEntry *entry, uint32_t *code, const FixupData& data)
{
int loc = entry->loc;
- if (data.force_persample_interp)
+ bool val = false;
+ switch (entry->ipa) {
+ case 0:
+ val = data.force_persample_interp;
+ break;
+ case 1:
+ val = data.msaa;
+ break;
+ }
+ if (val)
code[loc + 1] |= 1 << 20;
else
code[loc + 1] &= ~(1 << 20);
@@ -1272,8 +1281,8 @@ void CodeEmitterNVC0::emitSELP(const Instruction *i)
if (i->src(2).mod & Modifier(NV50_IR_MOD_NOT))
code[1] |= 1 << 20;
- if (i->subOp == 1) {
- addInterp(0, 0, nvc0_selpFlip);
+ if (i->subOp >= 1) {
+ addInterp(i->subOp - 1, 0, nvc0_selpFlip);
}
}