nvc0/ir: add support for SAMPLEMASK sysval
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 24 Apr 2014 02:20:51 +0000 (22:20 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 26 Apr 2014 15:57:18 +0000 (11:57 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir.h
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp

index 56b01158a4abe4ff7feb628d72cd8ad9db570386..c57729e6343931e77797c512e8dab2265ffa180f 100644 (file)
@@ -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,
index 0ec0b9a179dc6e6f914e066371d72273709b21a6..2c302a7fe1a5dbdd93cebd249c53a4cba2c39b32 100644 (file)
@@ -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;
index ebdeee4050d1478c1083363ca4be31cb93b2b58d..c7e9063fe65a3c974e70e6432bf9799e1691971b 100644 (file)
@@ -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));
index e74b25f59c259356bb0088ab1ad1238d9753e48d..42013e51bfdf33cbfbe37e4c7df846a5d55bebf5 100644 (file)
@@ -255,6 +255,7 @@ static const char *SemanticStr[SV_LAST + 1] =
    "CLIP_DISTANCE",
    "SAMPLE_INDEX",
    "SAMPLE_POS",
+   "SAMPLE_MASK",
    "TESS_FACTOR",
    "TESS_COORD",
    "TID",
index 95ed849561c1d96fb4af3d7bf23966ddd12e6d6e..c747f3e17cbea20f42b33fddc4fbacb016be9c9a 100644 (file)
@@ -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;
    }