diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2016-04-09 12:00:54 -0400 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2016-05-11 20:39:27 -0400 |
commit | ba3f0b6d5920165c735d51500544da8c29b09060 (patch) | |
tree | 1841622f00dda8dcd00a75a86eb89ffa252ecd1b /src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp | |
parent | f5fe9030021af830e6c4453f4ad1521cbb697c81 (diff) | |
download | external_mesa3d-ba3f0b6d5920165c735d51500544da8c29b09060.zip external_mesa3d-ba3f0b6d5920165c735d51500544da8c29b09060.tar.gz external_mesa3d-ba3f0b6d5920165c735d51500544da8c29b09060.tar.bz2 |
nvc0: fix gl_SampleMaskIn computation
The SAMPLEMASK semantic should only return the bits set covered by the
current invocation. However we were always retrieving the covmask, which
returns the covered samples of the whole pixel.
When not doing per-sample invocation, this is precisely what we want.
However when doing per-sample invocation, we have to select the
sampleid'th bit and only return that. Furthermore, this means that we
have to have a 1:1 correlation for invocations and samples.
This fixes most
dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.*
tests. A few failures remain due to disagreements about nr_samples==1
logic as well as what happens with MSAA x2 RTs when the shading fraction
is 0.5.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp index 9dc2e30..a43d7b1 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp @@ -894,6 +894,16 @@ CodeEmitterGM107::emitI2I() emitGPR (0x00, insn->def(0)); } +static void +selpFlip(const FixupEntry *entry, uint32_t *code, const FixupData& data) +{ + int loc = entry->loc; + if (data.force_persample_interp) + code[loc + 1] |= 1 << 10; + else + code[loc + 1] &= ~(1 << 10); +} + void CodeEmitterGM107::emitSEL() { @@ -915,9 +925,14 @@ CodeEmitterGM107::emitSEL() break; } + emitINV (0x2a, insn->src(2)); emitPRED(0x27, insn->src(2)); emitGPR (0x08, insn->src(0)); emitGPR (0x00, insn->def(0)); + + if (insn->subOp == 1) { + addInterp(0, 0, selpFlip); + } } void |