nv50/ir/print: add missing VIEWPORT_MASK handling
authorKarol Herbst <kherbst@redhat.com>
Mon, 15 Jun 2020 00:35:20 +0000 (02:35 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 22 Jun 2020 11:41:31 +0000 (11:41 +0000)
Also add an STATIC_ASSERT so we catch those issues automatically.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5512>

src/gallium/drivers/nouveau/codegen/nv50_ir_print.cpp

index ce0d2507dc1e38a24d4542552a808553d47a682e..3381133dce41386c9607d86866ef0206fdd6a0a7 100644 (file)
@@ -297,7 +297,7 @@ static const char *CondCodeStr[] =
    "o"
 };
 
-static const char *SemanticStr[SV_LAST + 1] =
+static const char *SemanticStr[] =
 {
    "POSITION",
    "VERTEX_ID",
@@ -307,6 +307,7 @@ static const char *SemanticStr[SV_LAST + 1] =
    "VERTEX_COUNT",
    "LAYER",
    "VIEWPORT_INDEX",
+   "VIEWPORT_MASK",
    "Y_DIR",
    "FACE",
    "POINT_SIZE",
@@ -517,6 +518,8 @@ int Symbol::print(char *buf, size_t size, DataType ty) const
 int Symbol::print(char *buf, size_t size,
                   Value *rel, Value *dimRel, DataType ty) const
 {
+   STATIC_ASSERT(ARRAY_SIZE(SemanticStr) == SV_LAST + 1);
+
    size_t pos = 0;
    char c;