compiler: Add enums for blend state
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Mon, 6 May 2019 01:58:56 +0000 (01:58 +0000)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Fri, 10 May 2019 15:49:01 +0000 (15:49 +0000)
We add enums corresponding to (GLES) blend state to shader_enums.h,
complementing the existing advanced blending enums in the file. This
allows us to represent blending state in a driver-agnostic, API-agnostic
way to permit lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
src/compiler/shader_enums.h

index ac293af45191bdec904e48922363c1cec9728606..47b1ca01dd64ac8fa7bcb69c65e4a00259009ebd 100644 (file)
@@ -753,6 +753,27 @@ enum gl_advanced_blend_mode
    BLEND_ALL            = 0x7fff,
 };
 
+enum blend_func
+{
+   BLEND_FUNC_ADD,
+   BLEND_FUNC_SUBTRACT,
+   BLEND_FUNC_REVERSE_SUBTRACT,
+   BLEND_FUNC_MIN,
+   BLEND_FUNC_MAX,
+};
+
+enum blend_factor
+{
+   BLEND_FACTOR_ZERO,
+   BLEND_FACTOR_SRC_COLOR,
+   BLEND_FACTOR_DST_COLOR,
+   BLEND_FACTOR_SRC_ALPHA,
+   BLEND_FACTOR_DST_ALPHA,
+   BLEND_FACTOR_CONSTANT_COLOR,
+   BLEND_FACTOR_CONSTANT_ALPHA,
+   BLEND_FACTOR_SRC_ALPHA_SATURATE,
+};
+
 enum gl_tess_spacing
 {
    TESS_SPACING_UNSPECIFIED,