Add support for VK_EXT_fragment_shader_barycentric

This commit is contained in:
stusmith 2022-05-13 17:23:29 +01:00
parent 86ff4bca1d
commit ebf45697be
22 changed files with 3959 additions and 3710 deletions

View file

@ -275,6 +275,8 @@ enum TBuiltInVariable {
// barycentrics
EbvBaryCoordNV,
EbvBaryCoordNoPerspNV,
EbvBaryCoordEXT,
EbvBaryCoordNoPerspEXT,
// mesh shaders
EbvTaskCountNV,
EbvPrimitiveCountNV,
@ -479,8 +481,10 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
case EbvWorldToObject: return "WorldToObjectNV";
case EbvCurrentRayTimeNV: return "CurrentRayTimeNV";
case EbvBaryCoordNV: return "BaryCoordNV";
case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
case EbvBaryCoordEXT:
case EbvBaryCoordNV: return "BaryCoordKHR";
case EbvBaryCoordNoPerspEXT:
case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspKHR";
case EbvTaskCountNV: return "TaskCountNV";
case EbvPrimitiveCountNV: return "PrimitiveCountNV";

View file

@ -552,6 +552,7 @@ public:
perViewNV = false;
perTaskNV = false;
#endif
pervertexEXT = false;
}
void clearMemory()
@ -604,7 +605,8 @@ public:
bool isNoContraction() const { return false; }
void setNoContraction() { }
bool isPervertexNV() const { return false; }
void setNullInit() { }
bool isPervertexEXT() const { return pervertexEXT; }
void setNullInit() {}
bool isNullInit() const { return false; }
void setSpirvByReference() { }
bool isSpirvByReference() { return false; }
@ -615,6 +617,7 @@ public:
bool nopersp : 1;
bool explicitInterp : 1;
bool pervertexNV : 1;
bool pervertexEXT : 1;
bool perPrimitiveNV : 1;
bool perViewNV : 1;
bool perTaskNV : 1;
@ -663,12 +666,13 @@ public:
}
bool isAuxiliary() const
{
return centroid || patch || sample || pervertexNV;
return centroid || patch || sample || pervertexNV || pervertexEXT;
}
bool isPatch() const { return patch; }
bool isNoContraction() const { return noContraction; }
void setNoContraction() { noContraction = true; }
bool isPervertexNV() const { return pervertexNV; }
bool isPervertexEXT() const { return pervertexEXT; }
void setNullInit() { nullInit = true; }
bool isNullInit() const { return nullInit; }
void setSpirvByReference() { spirvByReference = true; }
@ -856,7 +860,7 @@ public:
case EShLangTessEvaluation:
return ! patch && isPipeInput();
case EShLangFragment:
return pervertexNV && isPipeInput();
return (pervertexNV || pervertexEXT) && isPipeInput();
case EShLangMeshNV:
return ! perTaskNV && isPipeOutput();
@ -2266,6 +2270,8 @@ public:
appendStr(" __explicitInterpAMD");
if (qualifier.pervertexNV)
appendStr(" pervertexNV");
if (qualifier.pervertexEXT)
appendStr(" pervertexEXT");
if (qualifier.perPrimitiveNV)
appendStr(" perprimitiveNV");
if (qualifier.perViewNV)