Fix resizing of gl_PrimitiveIndicesNV[] to max_primitives*geomSize

- This change also allows redeclaration of gl_PrimitiveIndicesNV and
  adds error checks against incorrect explicit array size.
- Also modifies gtests to check array bound limits and redeclare gl_PrimitiveIndicesNV[].
This commit is contained in:
Sahil Parmar
2019-02-11 15:12:13 -08:00
parent 05d12a9461
commit ab027bef3d
6 changed files with 106 additions and 64 deletions

View File

@@ -22,14 +22,16 @@ out gl_MeshPerVertexNV {
float gl_PointSize;
float gl_ClipDistance[4];
float gl_CullDistance[4];
} gl_MeshVerticesNV[];
} gl_MeshVerticesNV[MAX_VER]; // explicitly sized to MAX_VER
perprimitiveNV out gl_MeshPerPrimitiveNV {
int gl_PrimitiveID;
int gl_Layer;
int gl_ViewportIndex;
int gl_ViewportMask[];
} gl_MeshPrimitivesNV[];
} gl_MeshPrimitivesNV[]; // implicitly sized to MAX_PRIM
out uint gl_PrimitiveIndicesNV[]; // explicitly sized to MAX_PRIM * 3
void main()
{
@@ -63,4 +65,9 @@ void main()
gl_MeshPrimitivesNV[iid+1].gl_ViewportMask[0] = gl_MeshPrimitivesNV[iid].gl_ViewportMask[0];
BARRIER();
// check bound limits
gl_PrimitiveIndicesNV[0] = 1;
gl_PrimitiveIndicesNV[(MAX_PRIM * 3) - 1] = 2;
gl_PrimitiveCountNV = MAX_PRIM * 3;
}