panfrost: Add support for decoding gl_FrontFacing
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 31 Jul 2019 18:56:55 +0000 (11:56 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 1 Aug 2019 23:15:03 +0000 (16:15 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/include/panfrost-job.h
src/panfrost/pandecode/decode.c

index ffe1bf25aa4c45cad5813800b7927571c99d8113..9179ceff2ec2f0e82e961755bcc1cedfb32e8782 100644 (file)
@@ -788,6 +788,10 @@ struct mali_payload_set_value {
  * implemented as special attributes, denoted by MALI_ATTR_IMAGE. For images,
  * let shift=extra_flags=0. Stride is set to the image format's bytes-per-pixel
  * (*NOT the row stride*). Size is set to the size of the image itself.
+ *
+ * Special internal varyings (including gl_FrontFacing) are handled vai
+ * MALI_ATTR_INTERNAL, which has all fields set to zero and uses a special
+ * elements pseudo-pointer.
  */
 
 enum mali_attr_mode {
@@ -796,9 +800,14 @@ enum mali_attr_mode {
        MALI_ATTR_POT_DIVIDE = 2,
        MALI_ATTR_MODULO = 3,
        MALI_ATTR_NPOT_DIVIDE = 4,
-        MALI_ATTR_IMAGE = 5
+        MALI_ATTR_IMAGE = 5,
+        MALI_ATTR_INTERNAL = 6
 };
 
+/* Pseudo-address for gl_FrontFacing */
+
+#define MALI_VARYING_FRONT_FACING (0x20)
+
 /* This magic "pseudo-address" is used as `elements` to implement
  * gl_PointCoord. When read from a fragment shader, it generates a point
  * coordinate per the OpenGL ES 2.0 specification. Flipped coordinate spaces
index a44c37324772f78e415a7fdbf9a795f071013ace..080d650fc5ada28bd52ab7d1c0f8dcb0c2565f36 100644 (file)
@@ -382,6 +382,7 @@ static char *pandecode_attr_mode(enum mali_attr_mode mode)
                 DEFINE_CASE(MODULO);
                 DEFINE_CASE(NPOT_DIVIDE);
                 DEFINE_CASE(IMAGE);
+                DEFINE_CASE(INTERNAL);
         default:
                 return "MALI_ATTR_UNUSED /* XXX: Unknown stencil op, check dump */";
         }