compiler: add VARYING_SLOT_VIEWPORT_MASK
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 10 Apr 2020 17:47:05 +0000 (13:47 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 16 Apr 2020 00:12:00 +0000 (20:12 -0400)
See GL_NV_viewport_array2::gl_ViewportMask for how this is supposed
to work.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4529>

src/compiler/shader_enums.c
src/compiler/shader_enums.h
src/mesa/main/mtypes.h
src/mesa/program/prog_print.c

index 977be6b89e01a842548a57f0fbdb3aaf2cde0eb3..a2a5eb82a61f4d71ff69c5c7af22b8afb7a8ec99 100644 (file)
@@ -165,6 +165,7 @@ gl_varying_slot_name(gl_varying_slot slot)
       ENUM(VARYING_SLOT_BOUNDING_BOX0),
       ENUM(VARYING_SLOT_BOUNDING_BOX1),
       ENUM(VARYING_SLOT_VIEW_INDEX),
+      ENUM(VARYING_SLOT_VIEWPORT_MASK),
       ENUM(VARYING_SLOT_VAR0),
       ENUM(VARYING_SLOT_VAR1),
       ENUM(VARYING_SLOT_VAR2),
index bf10a14a881e71446331d526efb3ddd63a6c2973..56062894a947795c56beaaf3ca17ab28c784800d 100644 (file)
@@ -261,6 +261,7 @@ typedef enum
    VARYING_SLOT_BOUNDING_BOX0, /* Only appears as TCS output. */
    VARYING_SLOT_BOUNDING_BOX1, /* Only appears as TCS output. */
    VARYING_SLOT_VIEW_INDEX,
+   VARYING_SLOT_VIEWPORT_MASK, /* Does not appear in FS */
    VARYING_SLOT_VAR0, /* First generic varying slot */
    /* the remaining are simply for the benefit of gl_varying_slot_name()
     * and not to be construed as an upper bound:
@@ -343,6 +344,7 @@ const char *gl_varying_slot_name(gl_varying_slot slot);
 #define VARYING_BIT_TESS_LEVEL_INNER BITFIELD64_BIT(VARYING_SLOT_TESS_LEVEL_INNER)
 #define VARYING_BIT_BOUNDING_BOX0 BITFIELD64_BIT(VARYING_SLOT_BOUNDING_BOX0)
 #define VARYING_BIT_BOUNDING_BOX1 BITFIELD64_BIT(VARYING_SLOT_BOUNDING_BOX1)
+#define VARYING_BIT_VIEWPORT_MASK BITFIELD64_BIT(VARYING_SLOT_VIEWPORT_MASK)
 #define VARYING_BIT_VAR(V) BITFIELD64_BIT(VARYING_SLOT_VAR0 + (V))
 /*@}*/
 
index 7560a828b324c0b11c6449ae83786a676b8ab112..487e7e6f3262a264b158e05dadec0635338f326d 100644 (file)
@@ -105,6 +105,7 @@ _mesa_varying_slot_in_fs(gl_varying_slot slot)
    case VARYING_SLOT_TESS_LEVEL_INNER:
    case VARYING_SLOT_BOUNDING_BOX0:
    case VARYING_SLOT_BOUNDING_BOX1:
+   case VARYING_SLOT_VIEWPORT_MASK:
       return GL_FALSE;
    default:
       return GL_TRUE;
index 049bef2c634125865988137a85cf653a16b0a370..c34e6cf308a091b0ff6f566d6e45013ed0b2093b 100644 (file)
@@ -165,6 +165,7 @@ arb_input_attrib_string(GLuint index, GLenum progType)
       "fragment.(twenty-eight)", /* VARYING_SLOT_BOUNDING_BOX0 */
       "fragment.(twenty-nine)", /* VARYING_SLOT_BOUNDING_BOX1 */
       "fragment.(thirty)", /* VARYING_SLOT_VIEW_INDEX */
+      "fragment.(thirty-one)", /* VARYING_SLOT_VIEWPORT_MASK */
       "fragment.varying[0]",
       "fragment.varying[1]",
       "fragment.varying[2]",
@@ -297,6 +298,7 @@ arb_output_attrib_string(GLuint index, GLenum progType)
       "result.(twenty-eight)", /* VARYING_SLOT_BOUNDING_BOX0 */
       "result.(twenty-nine)", /* VARYING_SLOT_BOUNDING_BOX1 */
       "result.(thirty)", /* VARYING_SLOT_VIEW_INDEX */
+      "result.(thirty-one)", /* VARYING_SLOT_VIEWPORT_MASK */
       "result.varying[0]",
       "result.varying[1]",
       "result.varying[2]",