[Mesa-dev] [PATCH 5/7] nvc0/ir: add support for SAMPLEMASK sysval
Ilia Mirkin
imirkin at alum.mit.edu
Wed Apr 23 20:48:53 PDT 2014
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
src/gallium/drivers/nouveau/codegen/nv50_ir.h | 1 +
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 1 +
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 4 ++++
src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp | 1 +
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp | 1 +
5 files changed, 8 insertions(+)
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h b/src/gallium/drivers/nouveau/codegen/nv50_ir.h
index 56b0115..c57729e 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h
@@ -362,6 +362,7 @@ enum SVSemantic
SV_CLIP_DISTANCE,
SV_SAMPLE_INDEX,
SV_SAMPLE_POS,
+ SV_SAMPLE_MASK,
SV_TESS_FACTOR,
SV_TESS_COORD,
SV_TID,
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index 0ec0b9a..2c302a7 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -348,6 +348,7 @@ static nv50_ir::SVSemantic translateSysVal(uint sysval)
case TGSI_SEMANTIC_THREAD_ID: return nv50_ir::SV_TID;
case TGSI_SEMANTIC_SAMPLEID: return nv50_ir::SV_SAMPLE_INDEX;
case TGSI_SEMANTIC_SAMPLEPOS: return nv50_ir::SV_SAMPLE_POS;
+ case TGSI_SEMANTIC_SAMPLEMASK: return nv50_ir::SV_SAMPLE_MASK;
default:
assert(0);
return nv50_ir::SV_CLOCK;
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
index ebdeee4..c7e9063 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
@@ -1447,6 +1447,10 @@ NVC0LoweringPass::handleRDSV(Instruction *i)
off);
break;
}
+ case SV_SAMPLE_MASK:
+ ld = bld.mkOp1(OP_PIXLD, TYPE_U32, i->getDef(0), bld.mkImm(0));
+ ld->subOp = NV50_IR_SUBOP_PIXLD_COVMASK;
+ break;
default:
if (prog->getType() == Program::TYPE_TESSELLATION_EVAL)
vtx = bld.mkOp1v(OP_PFETCH, TYPE_U32, bld.getSSA(), bld.mkImm(0));
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
index e74b25f..42013e5 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
@@ -255,6 +255,7 @@ static const char *SemanticStr[SV_LAST + 1] =
"CLIP_DISTANCE",
"SAMPLE_INDEX",
"SAMPLE_POS",
+ "SAMPLE_MASK",
"TESS_FACTOR",
"TESS_COORD",
"TID",
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
index 95ed849..c747f3e 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
@@ -284,6 +284,7 @@ TargetNVC0::getSVAddress(DataFile shaderFile, const Symbol *sym) const
case SV_GRIDID: return kepler ? 0x18 : ~0;
case SV_SAMPLE_INDEX: return 0;
case SV_SAMPLE_POS: return 0;
+ case SV_SAMPLE_MASK: return 0;
default:
return 0xffffffff;
}
--
1.8.3.2
More information about the mesa-dev
mailing list