Hello,

i am starting a new branch called Vega-advance-blending.

The objective of this branch is implement advanced blending krhonos
specification.
If anyone has a different opinion let me know :).

Below you can see what i already have done in my local branch(a big
amount of code):


diff --git a/src/gallium/state_trackers/vega/api_params.c
b/src/gallium/state_trackers/vega/api_params.c
index db77fd9..c5ac8f8 100644
--- a/src/gallium/state_trackers/vega/api_params.c
+++ b/src/gallium/state_trackers/vega/api_params.c
@@ -25,6 +25,7 @@
  **************************************************************************/

 #include "VG/openvg.h"
+#include "VG/vgext.h"

 #include "vg_context.h"
 #include "paint.h"
@@ -160,7 +161,7 @@ void vgSeti (VGParamType type, VGint value)
       break;
    case VG_BLEND_MODE:
       if (value < VG_BLEND_SRC ||
-          value > VG_BLEND_ADDITIVE)
+          value > VG_BLEND_XOR_KHR)
          error = VG_ILLEGAL_ARGUMENT_ERROR;
       else {
          ctx->state.dirty |= BLEND_DIRTY;
diff --git a/src/gallium/state_trackers/vega/asm_fill.h
b/src/gallium/state_trackers/vega/asm_fill.h
index 9a06982..916af75 100644
--- a/src/gallium/state_trackers/vega/asm_fill.h
+++ b/src/gallium/state_trackers/vega/asm_fill.h
@@ -28,6 +28,7 @@
 #define ASM_FILL_H

 #include "tgsi/tgsi_ureg.h"
+#include <stdio.h>

 typedef void (* ureg_func)( struct ureg_program *ureg,
                             struct ureg_dst *out,
@@ -335,6 +336,647 @@ blend_lighten( struct ureg_program *ureg,
 }

 static INLINE void
+blend_overlay_khr( struct ureg_program *ureg,
+                   struct ureg_dst     *out,
+                   struct ureg_src     *in,
+                   struct ureg_src     *sampler,
+                   struct ureg_dst     *temp,
+                   struct ureg_src     *constant)
+{
+   unsigned label;
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+   ureg_ADD(ureg,
+            ureg_writemask(temp[2], TGSI_WRITEMASK_XYZ),
+            ureg_src(temp[1]), ureg_src(temp[1]));
+
+   ureg_SLT(ureg, temp[2], ureg_src(temp[2]),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+
+   ureg_MOV(ureg, ureg_writemask(temp[2], TGSI_WRITEMASK_W),
+            ureg_scalar(constant[1], TGSI_SWIZZLE_Y));
+
+
+   EXTENDED_BLENDER_OVER_FUNC
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_IF(ureg, ureg_src(temp[2]), &label);
+   ureg_MUL(ureg,
+            ureg_writemask(temp[2], TGSI_WRITEMASK_XYZ),
+            ureg_src(temp[0]), ureg_src(temp[1]));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[3]));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_ELSE(ureg, &label);
+   ureg_SUB(ureg, temp[2],
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W),
+            ureg_src(temp[1]));
+   ureg_SUB(ureg, temp[4], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_src(temp[0]));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[2]));
+   ureg_MUL(ureg, temp[4], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[2], TGSI_WRITEMASK_XYZ),
+            ureg_src(temp[4]), ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[3]));
+   ureg_ENDIF(ureg);
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+}
+
+static INLINE void
+blend_hardlight_khr( struct ureg_program *ureg,
+                     struct ureg_dst     *out,
+                     struct ureg_src     *in,
+                     struct ureg_src     *sampler,
+                     struct ureg_dst     *temp,
+                     struct ureg_src     *constant)
+{
+   unsigned label;
+
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+
+   ureg_ADD(ureg, temp[2], ureg_src(temp[0]), ureg_src(temp[0]));
+
+   ureg_SLT(ureg, temp[2], ureg_src(temp[2]),
+            ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_MOV(ureg,
+            ureg_writemask(temp[2], TGSI_WRITEMASK_W),
+            ureg_scalar(constant[1], TGSI_SWIZZLE_Y));
+
+   EXTENDED_BLENDER_OVER_FUNC
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_IF(ureg, ureg_src(temp[2]), &label);
+   ureg_MUL(ureg,
+            ureg_writemask(temp[2], TGSI_WRITEMASK_XYZ),
+            ureg_src(temp[0]), ureg_src(temp[1]));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[3]));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_ELSE(ureg, &label);
+   ureg_SUB(ureg, temp[2],
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W),
+            ureg_src(temp[1]));
+   ureg_SUB(ureg, temp[4], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_src(temp[0]));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[2]));
+   ureg_MUL(ureg, temp[4], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[2], TGSI_WRITEMASK_XYZ),
+            ureg_src(temp[4]), ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[3]));
+   ureg_ENDIF(ureg);
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+}
+
+static INLINE void
+blend_softlight_svg_khr( struct ureg_program *ureg,
+                     struct ureg_dst     *out,
+                     struct ureg_src     *in,
+                     struct ureg_src     *sampler,
+                     struct ureg_dst     *temp,
+                     struct ureg_src     *constant)
+{
+   unsigned label;
+   struct ureg_src imm, imm2, imm3;
+
+   imm  = ureg_imm4f(ureg, 8, 8, 8, 8);
+   imm2 = ureg_imm4f(ureg, 3, 3, 3, 3);
+   imm3 = ureg_imm4f(ureg, 0.5, 0.5, 0.5, 0.5);
+
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+
+   ureg_ADD(ureg, temp[2], ureg_src(temp[0]), ureg_src(temp[0]));
+
+   ureg_SLT(ureg, temp[2], ureg_src(temp[2]),
+            ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_MOV(ureg,
+            ureg_writemask(temp[2], TGSI_WRITEMASK_W),
+            ureg_scalar(constant[1], TGSI_SWIZZLE_Y));
+
+   EXTENDED_BLENDER_OVER_FUNC
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_IF(ureg, ureg_src(temp[2]), &label);
+   ureg_DIV(ureg, temp[2], ureg_src(temp[1]),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, temp[2], ureg_scalar(constant[1], TGSI_SWIZZLE_Y),
+            ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[4], ureg_src(temp[0]), ureg_src(temp[0]));
+   ureg_SUB(ureg, temp[4], ureg_src(temp[4]),
+            ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_SUB(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_src(temp[2]));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[1]), ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[3]));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+   ureg_ELSE(ureg, &label);
+
+   ureg_MUL(ureg, temp[2], ureg_src(temp[1]), imm);
+   ureg_SLE(ureg, temp[2], ureg_src(temp[2]),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_IF(ureg, ureg_src(temp[2]), &label);
+   ureg_DIV(ureg, temp[2], ureg_src(temp[1]),
ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, temp[2], ureg_scalar(constant[1], TGSI_SWIZZLE_Y),
ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[4], ureg_src(temp[0]), ureg_src(temp[0]));
+   ureg_SUB(ureg, temp[4], ureg_src(temp[4]),
ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_MUL(ureg, temp[4], ureg_src(temp[1]), imm);
+   ureg_DIV(ureg, temp[4], ureg_src(temp[4]),
ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, temp[4], imm2, ureg_src(temp[4]));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_SUB(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_src(temp[2]));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[1]), ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[3]));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_ELSE(ureg, &label);
+   ureg_MUL(ureg, temp[2], ureg_src(temp[1]),
ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_DIV(ureg, temp[4], ureg_src(temp[1]),
ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_POW(ureg, temp[4], ureg_src(temp[4]), imm3);
+   ureg_MUL(ureg, temp[4], ureg_src(temp[4]),
ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, temp[4], ureg_src(temp[4]), ureg_src(temp[1]));
+   ureg_ADD(ureg, temp[5], ureg_src(temp[0]), ureg_src(temp[0]));
+   ureg_SUB(ureg, temp[5], ureg_src(temp[5]),
ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_MUL(ureg, temp[4], ureg_src(temp[4]), ureg_src(temp[5]));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_ADD(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_XYZ),
ureg_src(temp[2]), ureg_src(temp[3]));
+   ureg_ENDIF(ureg);
+
+   ureg_ENDIF(ureg);
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+}
+
+static INLINE void
+blend_softlight_khr( struct ureg_program *ureg,
+                     struct ureg_dst     *out,
+                     struct ureg_src     *in,
+                     struct ureg_src     *sampler,
+                     struct ureg_dst     *temp,
+                     struct ureg_src     *constant)
+{
+   unsigned label;
+   struct ureg_src imm, imm2, imm3, imm4, imm5;
+
+   imm  = ureg_imm4f(ureg, 4, 4, 4, 4);
+   imm2 = ureg_imm4f(ureg, 3, 3, 3, 3);
+   imm3 = ureg_imm4f(ureg, 0.5, 0.5, 0.5, 0.5);
+   imm4 = ureg_imm4f(ureg, 16, 16, 16, 16);
+   imm5 = ureg_imm4f(ureg, 12, 12, 12, 12);
+
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+
+   ureg_ADD(ureg, temp[2], ureg_src(temp[0]), ureg_src(temp[0]));
+
+   ureg_SLT(ureg, temp[2], ureg_src(temp[2]),
+            ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_MOV(ureg,
+            ureg_writemask(temp[2], TGSI_WRITEMASK_W),
+            ureg_scalar(constant[1], TGSI_SWIZZLE_Y));
+
+   EXTENDED_BLENDER_OVER_FUNC
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_IF(ureg, ureg_src(temp[2]), &label);
+   ureg_DIV(ureg, temp[2], ureg_src(temp[1]),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, temp[2], ureg_scalar(constant[1], TGSI_SWIZZLE_Y),
+            ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[4], ureg_src(temp[0]), ureg_src(temp[0]));
+   ureg_SUB(ureg, temp[4], ureg_src(temp[4]),
+            ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_SUB(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_src(temp[2]));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[1]), ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[3]));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+   ureg_ELSE(ureg, &label);
+
+   ureg_MUL(ureg, temp[2], ureg_src(temp[1]), imm);
+   ureg_SLE(ureg, temp[2], ureg_src(temp[2]),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_IF(ureg, ureg_src(temp[2]), &label);
+   ureg_MUL(ureg, temp[2], imm4, ureg_src(temp[1]));
+   ureg_DIV(ureg, temp[2], ureg_src(temp[2]),
ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, temp[2], ureg_src(temp[2]), imm5);
+   ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[1]));
+   ureg_DIV(ureg, temp[2], ureg_src(temp[2]),
ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), imm2);
+   ureg_ADD(ureg, temp[4], ureg_src(temp[0]), ureg_src(temp[0]));
+   ureg_SUB(ureg, temp[4], ureg_src(temp[4]),
ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[1]));
+   ureg_MUL(ureg, temp[4], ureg_src(temp[1]),
ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_ADD(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[3]));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_ELSE(ureg, &label);
+   ureg_MUL(ureg, temp[2], ureg_src(temp[1]),
ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_DIV(ureg, temp[4], ureg_src(temp[1]),
ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_POW(ureg, temp[4], ureg_src(temp[4]), imm3);
+   ureg_MUL(ureg, temp[4], ureg_src(temp[4]),
ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, temp[4], ureg_src(temp[4]), ureg_src(temp[1]));
+   ureg_ADD(ureg, temp[5], ureg_src(temp[0]), ureg_src(temp[0]));
+   ureg_SUB(ureg, temp[5], ureg_src(temp[5]),
ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_MUL(ureg, temp[4], ureg_src(temp[4]), ureg_src(temp[5]));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_ADD(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_XYZ),
ureg_src(temp[2]), ureg_src(temp[3]));
+   ureg_ENDIF(ureg);
+
+   ureg_ENDIF(ureg);
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+}
+
+static INLINE void
+blend_colordodge_khr( struct ureg_program *ureg,
+                struct ureg_dst *out,
+                struct ureg_src *in,
+                struct ureg_src *sampler,
+                struct ureg_dst *temp,
+                struct ureg_src *constant)
+{
+   unsigned label;
+
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+
+   ureg_SLT(ureg, temp[2], ureg_src(temp[0]),
+            ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_MOV(ureg,
+            ureg_writemask(temp[2], TGSI_WRITEMASK_W),
+            ureg_scalar(constant[1], TGSI_SWIZZLE_Y));
+
+   EXTENDED_BLENDER_OVER_FUNC
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_IF(ureg, ureg_src(temp[2]), &label);
+   ureg_MUL(ureg, temp[2], ureg_src(temp[1]),
ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_DIV(ureg, temp[4], ureg_src(temp[0]),
ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, temp[4], ureg_scalar(constant[1], TGSI_SWIZZLE_Y),
ureg_src(temp[4]));
+   ureg_DIV(ureg, temp[4], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_MIN(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_ADD(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[3]));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+   ureg_ELSE(ureg, &label);
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[3]));
+   ureg_ENDIF(ureg);
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+
+}
+
+static INLINE void
+blend_colorburn_khr( struct ureg_program *ureg,
+                struct ureg_dst *out,
+                struct ureg_src *in,
+                struct ureg_src *sampler,
+                struct ureg_dst *temp,
+                struct ureg_src *constant)
+{
+   unsigned label;
+
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+   ureg_XOR(ureg, temp[4], ureg_src(temp[4]), ureg_src(temp[4]));
+   ureg_SGT(ureg, temp[2], ureg_src(temp[0]), ureg_src(temp[4]));
+
+   EXTENDED_BLENDER_OVER_FUNC
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_IF(ureg, ureg_src(temp[2]), &label);
+   ureg_SUB(ureg, temp[2], ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W),
+            ureg_src(temp[1]));
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_src(temp[2]));
+   ureg_DIV(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[0]));
+   ureg_MUL(ureg, temp[4], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_MIN(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_SUB(ureg, temp[2], ureg_src(temp[4]), ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[3]));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+   ureg_ELSE(ureg, &label);
+   ureg_MOV(ureg, temp[1], ureg_src(temp[3]));
+   ureg_ENDIF(ureg);
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+}
+
+static INLINE void
+blend_difference_khr( struct ureg_program *ureg,
+                      struct ureg_dst *out,
+                      struct ureg_src *in,
+                      struct ureg_src *sampler,
+                      struct ureg_dst *temp,
+                      struct ureg_src *constant)
+{
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+
+   ureg_MUL(ureg, temp[2], ureg_src(temp[0]),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_MUL(ureg, temp[4], ureg_src(temp[1]),
+            ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_MIN(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[2]));
+   ureg_SUB(ureg, temp[2], ureg_src(temp[1]), ureg_src(temp[2]));
+   ureg_ADD(ureg, temp[1], ureg_src(temp[0]), ureg_src(temp[2]));
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+}
+
+
+static INLINE void
+blend_subtract_khr( struct ureg_program *ureg,
+                    struct ureg_dst *out,
+                    struct ureg_src *in,
+                    struct ureg_src *sampler,
+                    struct ureg_dst *temp,
+                    struct ureg_src *constant)
+{
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+   ureg_SUB(ureg, temp[2], ureg_src(temp[1]), ureg_src(temp[0]));
+   ureg_XOR(ureg, temp[3], ureg_src(temp[3]), ureg_src(temp[3]));
+   ureg_MAX(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[3]));
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+}
+
+static INLINE void
+blend_invert_khr( struct ureg_program *ureg,
+                    struct ureg_dst *out,
+                    struct ureg_src *in,
+                    struct ureg_src *sampler,
+                    struct ureg_dst *temp,
+                    struct ureg_src *constant)
+{
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+   ureg_SUB(ureg, temp[2], ureg_scalar(constant[1], TGSI_SWIZZLE_Y),
+            ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_Y));
+   ureg_MUL(ureg, temp[2], ureg_src(temp[1]), ureg_src(temp[2]));
+   ureg_SUB(ureg, temp[3], ureg_scalar(constant[1], TGSI_SWIZZLE_Y),
+            ureg_src(temp[1]));
+   ureg_MUL(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_src(temp[3]));
+   ureg_ADD(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_XYZ),
+            ureg_src(temp[2]), ureg_src(temp[3]));
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+}
+
+static INLINE void
+blend_exclusion_khr( struct ureg_program *ureg,
+                    struct ureg_dst *out,
+                    struct ureg_src *in,
+                    struct ureg_src *sampler,
+                    struct ureg_dst *temp,
+                    struct ureg_src *constant)
+{
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+   EXTENDED_BLENDER_OVER_FUNC
+   ureg_MUL(ureg, temp[2], ureg_src(temp[0]),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_MUL(ureg, temp[4], ureg_src(temp[1]),
+            ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_MUL(ureg, temp[4], ureg_src(temp[0]), ureg_src(temp[1]));
+   ureg_ADD(ureg, temp[4], ureg_src(temp[4]), ureg_src(temp[4]));
+   ureg_SUB(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_ADD(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_XYZ),
+            ureg_src(temp[2]), ureg_src(temp[3]));
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+}
+
+static INLINE void
+blend_lineardodge_khr( struct ureg_program *ureg,
+                struct ureg_dst *out,
+                struct ureg_src *in,
+                struct ureg_src *sampler,
+                struct ureg_dst *temp,
+                struct ureg_src *constant)
+{
+   unsigned label;
+
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+
+   ureg_MUL(ureg, temp[2], ureg_src(temp[0]),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_MUL(ureg, temp[4], ureg_src(temp[1]),
+            ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_MUL(ureg, temp[4], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SLE(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+
+   EXTENDED_BLENDER_OVER_FUNC
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_IF(ureg, ureg_src(temp[2]), &label);
+   ureg_ADD(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_XYZ),
+            ureg_src(temp[0]), ureg_src(temp[1]));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+   ureg_ELSE(ureg, &label);
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_XYZ),
+            ureg_src(temp[2]), ureg_src(temp[3]));
+   ureg_ENDIF(ureg);
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+}
+
+static INLINE void
+blend_linearburn_khr( struct ureg_program *ureg,
+                struct ureg_dst *out,
+                struct ureg_src *in,
+                struct ureg_src *sampler,
+                struct ureg_dst *temp,
+                struct ureg_src *constant)
+{
+   unsigned label;
+
+   ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
+
+   ureg_MUL(ureg, temp[2], ureg_src(temp[0]),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_MUL(ureg, temp[4], ureg_src(temp[1]),
+            ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+   ureg_MUL(ureg, temp[4], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SGT(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[4]));
+
+   EXTENDED_BLENDER_OVER_FUNC
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+
+   ureg_IF(ureg, ureg_src(temp[2]), &label);
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[4], ureg_src(temp[0]), ureg_src(temp[1]));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_XYZ),
+            ureg_src(temp[4]), ureg_src(temp[2]));
+
+   label = ureg_get_instruction_number(ureg);
+   label += 2;
+   ureg_ELSE(ureg, &label);
+   ureg_MOV(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_XYZ),
+            ureg_src(temp[3]));
+   ureg_ENDIF(ureg);
+
+   ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
+            ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
+   ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
+            ureg_src(temp[3]), ureg_src(temp[2]));
+
+
+   ureg_MOV(ureg, *out, ureg_src(temp[1]));
+}
+
+
+static INLINE void
 premultiply( struct ureg_program *ureg,
                 struct ureg_dst *out,
                 struct ureg_src *in,
@@ -441,6 +1083,31 @@ static const struct shader_asm_info shaders_asm[] = {
     VG_TRUE,  1, 1, 2, 1, 0, 6},
    {VEGA_BLEND_LIGHTEN_SHADER, blend_lighten,
     VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_OVERLAY_KHR_SHADER, blend_overlay_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_HARDLIGHT_KHR_SHADER, blend_hardlight_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_SOFTLIGHT_SVG_KHR_SHADER, blend_softlight_svg_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_SOFTLIGHT_KHR_SHADER, blend_softlight_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_COLORDODGE_KHR_SHADER, blend_colordodge_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_COLORBURN_KHR_SHADER, blend_colorburn_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_DIFFERENCE_KHR_SHADER, blend_difference_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_SUBTRACT_KHR_SHADER, blend_subtract_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_INVERT_KHR_SHADER, blend_invert_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_EXCLUSION_KHR_SHADER, blend_exclusion_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_LINEARDODGE_KHR_SHADER, blend_lineardodge_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+   {VEGA_BLEND_LINEARBURN_KHR_SHADER, blend_linearburn_khr,
+    VG_TRUE,  1, 1, 2, 1, 0, 6},
+

    /* premultiply */
    {VEGA_PREMULTIPLY_SHADER, premultiply,
diff --git a/src/gallium/state_trackers/vega/shader.c
b/src/gallium/state_trackers/vega/shader.c
index 0e71a50..e33b730 100644
--- a/src/gallium/state_trackers/vega/shader.c
+++ b/src/gallium/state_trackers/vega/shader.c
@@ -126,7 +126,19 @@ static VGint blend_bind_samplers(struct vg_context *ctx,
    if (bmode == VG_BLEND_MULTIPLY ||
        bmode == VG_BLEND_SCREEN ||
        bmode == VG_BLEND_DARKEN ||
-       bmode == VG_BLEND_LIGHTEN) {
+       bmode == VG_BLEND_LIGHTEN ||
+       bmode == VG_BLEND_OVERLAY_KHR ||
+       bmode == VG_BLEND_HARDLIGHT_KHR ||
+       bmode == VG_BLEND_SOFTLIGHT_SVG_KHR ||
+       bmode == VG_BLEND_SOFTLIGHT_KHR ||
+       bmode == VG_BLEND_COLORDODGE_KHR ||
+       bmode == VG_BLEND_COLORBURN_KHR ||
+       bmode == VG_BLEND_DIFFERENCE_KHR ||
+       bmode == VG_BLEND_SUBTRACT_KHR ||
+       bmode == VG_BLEND_INVERT_KHR ||
+       bmode == VG_BLEND_EXCLUSION_KHR ||
+       bmode == VG_BLEND_LINEARDODGE_KHR ||
+       bmode == VG_BLEND_LINEARBURN_KHR) {
       struct st_framebuffer *stfb = ctx->draw_buffer;

       vg_prepare_blend_surface(ctx);
@@ -261,6 +273,43 @@ static void setup_shader_program(struct shader *shader)
    case VG_BLEND_LIGHTEN:
       shader_id |= VEGA_BLEND_LIGHTEN_SHADER;
       break;
+   case VG_BLEND_OVERLAY_KHR:
+      shader_id |= VEGA_BLEND_OVERLAY_KHR_SHADER;
+      break;
+   case VG_BLEND_HARDLIGHT_KHR:
+      shader_id |= VEGA_BLEND_HARDLIGHT_KHR_SHADER;
+      break;
+   case VG_BLEND_SOFTLIGHT_SVG_KHR:
+      shader_id |= VEGA_BLEND_SOFTLIGHT_SVG_KHR_SHADER;
+      break;
+   case VG_BLEND_SOFTLIGHT_KHR:
+      shader_id |= VEGA_BLEND_SOFTLIGHT_KHR_SHADER;
+      break;
+   case VG_BLEND_COLORDODGE_KHR:
+      shader_id |= VEGA_BLEND_COLORDODGE_KHR_SHADER;
+      break;
+   case VG_BLEND_COLORBURN_KHR:
+      shader_id |= VEGA_BLEND_COLORBURN_KHR_SHADER;
+      break;
+   case VG_BLEND_DIFFERENCE_KHR:
+      shader_id |= VEGA_BLEND_DIFFERENCE_KHR_SHADER;
+      break;
+   case VG_BLEND_SUBTRACT_KHR:
+      shader_id |= VEGA_BLEND_SUBTRACT_KHR_SHADER;
+      break;
+   case VG_BLEND_INVERT_KHR:
+      shader_id |= VEGA_BLEND_INVERT_KHR_SHADER;
+      break;
+   case VG_BLEND_EXCLUSION_KHR:
+      shader_id |= VEGA_BLEND_EXCLUSION_KHR_SHADER;
+      break;
+   case VG_BLEND_LINEARDODGE_KHR:
+      shader_id |= VEGA_BLEND_LINEARDODGE_KHR_SHADER;
+      break;
+   case VG_BLEND_LINEARBURN_KHR:
+      shader_id |= VEGA_BLEND_LINEARBURN_KHR_SHADER;
+      break;
+
    default:
       /* handled by pipe_blend_state */
       break;
diff --git a/src/gallium/state_trackers/vega/shader.h
b/src/gallium/state_trackers/vega/shader.h
index 847eee6..75319cc 100644
--- a/src/gallium/state_trackers/vega/shader.h
+++ b/src/gallium/state_trackers/vega/shader.h
@@ -28,6 +28,7 @@
 #define SHADER_H

 #include "VG/openvg.h"
+#include "VG/vgext.h"

 struct shader;
 struct vg_paint;
diff --git a/src/gallium/state_trackers/vega/shaders_cache.c
b/src/gallium/state_trackers/vega/shaders_cache.c
index f43fe6e..0474fde 100644
--- a/src/gallium/state_trackers/vega/shaders_cache.c
+++ b/src/gallium/state_trackers/vega/shaders_cache.c
@@ -333,23 +333,73 @@ create_shader(struct pipe_context *pipe,
       debug_assert(shaders_asm[11].id == VEGA_BLEND_LIGHTEN_SHADER);
       shaders[idx] = &shaders_asm[11];
       ++idx;
+   } else if ((id & VEGA_BLEND_OVERLAY_KHR_SHADER)) {
+      debug_assert(shaders_asm[12].id == VEGA_BLEND_OVERLAY_KHR_SHADER);
+      shaders[idx] = &shaders_asm[12];
+      ++idx;
+   } else if ((id & VEGA_BLEND_HARDLIGHT_KHR_SHADER)) {
+      debug_assert(shaders_asm[13].id == VEGA_BLEND_HARDLIGHT_KHR_SHADER);
+      shaders[idx] = &shaders_asm[13];
+      ++idx;
+   } else if ((id & VEGA_BLEND_SOFTLIGHT_SVG_KHR_SHADER)){
+      debug_assert(shaders_asm[14].id == VEGA_BLEND_SOFTLIGHT_SVG_KHR_SHADER);
+      shaders[idx] = &shaders_asm[14];
+      ++idx;
+   } else if ((id & VEGA_BLEND_SOFTLIGHT_KHR_SHADER)){
+      debug_assert(shaders_asm[15].id == VEGA_BLEND_SOFTLIGHT_KHR_SHADER);
+      shaders[idx] = &shaders_asm[15];
+      ++idx;
+   } else if ((id & VEGA_BLEND_COLORDODGE_KHR_SHADER)){
+      debug_assert(shaders_asm[16].id == VEGA_BLEND_COLORDODGE_KHR_SHADER);
+      shaders[idx] = &shaders_asm[16];
+      ++idx;
+   } else if ((id & VEGA_BLEND_COLORBURN_KHR_SHADER)){
+      debug_assert(shaders_asm[17].id == VEGA_BLEND_COLORBURN_KHR_SHADER);
+      shaders[idx] = &shaders_asm[17];
+      ++idx;
+   } else if ((id & VEGA_BLEND_DIFFERENCE_KHR_SHADER)){
+      debug_assert(shaders_asm[18].id == VEGA_BLEND_DIFFERENCE_KHR_SHADER);
+      shaders[idx] = &shaders_asm[18];
+      ++idx;
+   } else if ((id & VEGA_BLEND_SUBTRACT_KHR_SHADER)){
+      debug_assert(shaders_asm[19].id == VEGA_BLEND_SUBTRACT_KHR_SHADER);
+      shaders[idx] = &shaders_asm[19];
+      ++idx;
+   } else if ((id & VEGA_BLEND_INVERT_KHR_SHADER)){
+      debug_assert(shaders_asm[20].id == VEGA_BLEND_INVERT_KHR_SHADER);
+      shaders[idx] = &shaders_asm[20];
+      ++idx;
+   } else if ((id & VEGA_BLEND_EXCLUSION_KHR_SHADER)){
+      debug_assert(shaders_asm[21].id == VEGA_BLEND_EXCLUSION_KHR_SHADER);
+      shaders[idx] = &shaders_asm[21];
+      ++idx;
+   } else if ((id & VEGA_BLEND_LINEARDODGE_KHR_SHADER)){
+      debug_assert(shaders_asm[22].id == VEGA_BLEND_LINEARDODGE_KHR_SHADER);
+      shaders[idx] = &shaders_asm[22];
+      ++idx;
+   } else if ((id & VEGA_BLEND_LINEARBURN_KHR_SHADER)){
+      debug_assert(shaders_asm[23].id == VEGA_BLEND_LINEARBURN_KHR_SHADER);
+      shaders[idx] = &shaders_asm[23];
+      ++idx;
    }

+
+
    /* fifth stage */
    if ((id & VEGA_PREMULTIPLY_SHADER)) {
-      debug_assert(shaders_asm[12].id == VEGA_PREMULTIPLY_SHADER);
-      shaders[idx] = &shaders_asm[12];
+      debug_assert(shaders_asm[24].id == VEGA_PREMULTIPLY_SHADER);
+      shaders[idx] = &shaders_asm[24];
       ++idx;
    } else if ((id & VEGA_UNPREMULTIPLY_SHADER)) {
-      debug_assert(shaders_asm[13].id == VEGA_UNPREMULTIPLY_SHADER);
-      shaders[idx] = &shaders_asm[13];
+      debug_assert(shaders_asm[25].id == VEGA_UNPREMULTIPLY_SHADER);
+      shaders[idx] = &shaders_asm[25];
       ++idx;
    }

    /* sixth stage */
    if ((id & VEGA_BW_SHADER)) {
-      debug_assert(shaders_asm[14].id == VEGA_BW_SHADER);
-      shaders[idx] = &shaders_asm[14];
+      debug_assert(shaders_asm[26].id == VEGA_BW_SHADER);
+      shaders[idx] = &shaders_asm[26];
       ++idx;
    }

diff --git a/src/gallium/state_trackers/vega/shaders_cache.h
b/src/gallium/state_trackers/vega/shaders_cache.h
index feca58b..5e699fc 100644
--- a/src/gallium/state_trackers/vega/shaders_cache.h
+++ b/src/gallium/state_trackers/vega/shaders_cache.h
@@ -34,25 +34,37 @@ struct tgsi_token;
 struct shaders_cache;

 enum VegaShaderType {
-   VEGA_SOLID_FILL_SHADER         = 1 <<  0,
-   VEGA_LINEAR_GRADIENT_SHADER    = 1 <<  1,
-   VEGA_RADIAL_GRADIENT_SHADER    = 1 <<  2,
-   VEGA_PATTERN_SHADER            = 1 <<  3,
-   VEGA_IMAGE_NORMAL_SHADER       = 1 <<  4,
-   VEGA_IMAGE_MULTIPLY_SHADER     = 1 <<  5,
-   VEGA_IMAGE_STENCIL_SHADER      = 1 <<  6,
+   VEGA_SOLID_FILL_SHADER              = 1 <<  0,
+   VEGA_LINEAR_GRADIENT_SHADER         = 1 <<  1,
+   VEGA_RADIAL_GRADIENT_SHADER         = 1 <<  2,
+   VEGA_PATTERN_SHADER                 = 1 <<  3,
+   VEGA_IMAGE_NORMAL_SHADER            = 1 <<  4,
+   VEGA_IMAGE_MULTIPLY_SHADER          = 1 <<  5,
+   VEGA_IMAGE_STENCIL_SHADER           = 1 <<  6,

-   VEGA_MASK_SHADER               = 1 <<  7,
+   VEGA_MASK_SHADER                    = 1 <<  7,

-   VEGA_BLEND_MULTIPLY_SHADER     = 1 <<  8,
-   VEGA_BLEND_SCREEN_SHADER       = 1 <<  9,
-   VEGA_BLEND_DARKEN_SHADER       = 1 << 10,
-   VEGA_BLEND_LIGHTEN_SHADER      = 1 << 11,
+   VEGA_BLEND_MULTIPLY_SHADER          = 1 <<  8,
+   VEGA_BLEND_SCREEN_SHADER            = 1 <<  9,
+   VEGA_BLEND_DARKEN_SHADER            = 1 << 10,
+   VEGA_BLEND_LIGHTEN_SHADER           = 1 << 11,
+   VEGA_BLEND_OVERLAY_KHR_SHADER       = 1 << 12,
+   VEGA_BLEND_HARDLIGHT_KHR_SHADER     = 1 << 13,
+   VEGA_BLEND_SOFTLIGHT_SVG_KHR_SHADER = 1 << 14,
+   VEGA_BLEND_SOFTLIGHT_KHR_SHADER     = 1 << 15,
+   VEGA_BLEND_COLORDODGE_KHR_SHADER    = 1 << 16,
+   VEGA_BLEND_COLORBURN_KHR_SHADER     = 1 << 17,
+   VEGA_BLEND_DIFFERENCE_KHR_SHADER    = 1 << 18,
+   VEGA_BLEND_SUBTRACT_KHR_SHADER      = 1 << 19,
+   VEGA_BLEND_INVERT_KHR_SHADER        = 1 << 20,
+   VEGA_BLEND_EXCLUSION_KHR_SHADER     = 1 << 21,
+   VEGA_BLEND_LINEARDODGE_KHR_SHADER   = 1 << 22,
+   VEGA_BLEND_LINEARBURN_KHR_SHADER    = 1 << 23,

-   VEGA_PREMULTIPLY_SHADER        = 1 << 12,
-   VEGA_UNPREMULTIPLY_SHADER      = 1 << 13,
+   VEGA_PREMULTIPLY_SHADER             = 1 << 24,
+   VEGA_UNPREMULTIPLY_SHADER           = 1 << 25,

-   VEGA_BW_SHADER                 = 1 << 14
+   VEGA_BW_SHADER                      = 1 << 26
 };

 struct vg_shader {
diff --git a/src/gallium/state_trackers/vega/vg_context.c
b/src/gallium/state_trackers/vega/vg_context.c
index 426bf9b..8c7fa97 100644
--- a/src/gallium/state_trackers/vega/vg_context.c
+++ b/src/gallium/state_trackers/vega/vg_context.c
@@ -339,6 +339,18 @@ void vg_validate_state(struct vg_context *ctx)
       case VG_BLEND_SCREEN:
       case VG_BLEND_DARKEN:
       case VG_BLEND_LIGHTEN:
+      case VG_BLEND_OVERLAY_KHR:
+      case VG_BLEND_HARDLIGHT_KHR:
+      case VG_BLEND_SOFTLIGHT_SVG_KHR:
+      case VG_BLEND_SOFTLIGHT_KHR:
+      case VG_BLEND_COLORDODGE_KHR:
+      case VG_BLEND_COLORBURN_KHR:
+      case VG_BLEND_DIFFERENCE_KHR:
+      case VG_BLEND_SUBTRACT_KHR:
+      case VG_BLEND_INVERT_KHR:
+      case VG_BLEND_EXCLUSION_KHR:
+      case VG_BLEND_LINEARDODGE_KHR:
+      case VG_BLEND_LINEARBURN_KHR:
          blend->rt[0].rgb_src_factor   = PIPE_BLENDFACTOR_ONE;
          blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
          blend->rt[0].rgb_dst_factor   = PIPE_BLENDFACTOR_ZERO;
@@ -351,6 +363,48 @@ void vg_validate_state(struct vg_context *ctx)
          blend->rt[0].rgb_dst_factor   = PIPE_BLENDFACTOR_ONE;
          blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ONE;
          break;
+      case VG_BLEND_CLEAR_KHR:
+         blend->rt[0].rgb_src_factor   = PIPE_BLENDFACTOR_ZERO;
+         blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ZERO;
+         blend->rt[0].rgb_dst_factor   = PIPE_BLENDFACTOR_ZERO;
+         blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+         break;
+      case VG_BLEND_DST_KHR:
+         blend->rt[0].rgb_src_factor   = PIPE_BLENDFACTOR_ZERO;
+         blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ZERO;
+         blend->rt[0].rgb_dst_factor   = PIPE_BLENDFACTOR_ONE;
+         blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ONE;
+         break;
+      case VG_BLEND_SRC_OUT_KHR:
+         blend->rt[0].rgb_src_factor   = PIPE_BLENDFACTOR_INV_DST_ALPHA;
+         blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_INV_DST_ALPHA;
+         blend->rt[0].rgb_dst_factor   = PIPE_BLENDFACTOR_ZERO;
+         blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+         break;
+      case VG_BLEND_DST_OUT_KHR:
+         blend->rt[0].rgb_src_factor   = PIPE_BLENDFACTOR_ZERO;
+         blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ZERO;
+         blend->rt[0].rgb_dst_factor   = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+         blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+         break;
+      case VG_BLEND_SRC_ATOP_KHR:
+         blend->rt[0].rgb_src_factor   = PIPE_BLENDFACTOR_DST_ALPHA;
+         blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_DST_ALPHA;
+         blend->rt[0].rgb_dst_factor   = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+         blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+         break;
+      case VG_BLEND_DST_ATOP_KHR:
+         blend->rt[0].rgb_src_factor   = PIPE_BLENDFACTOR_INV_DST_ALPHA;
+         blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_INV_DST_ALPHA;
+         blend->rt[0].rgb_dst_factor   = PIPE_BLENDFACTOR_SRC_ALPHA;
+         blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_SRC_ALPHA;
+         break;
+      case VG_BLEND_XOR_KHR:
+         blend->rt[0].rgb_src_factor   = PIPE_BLENDFACTOR_INV_DST_ALPHA;
+         blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_INV_DST_ALPHA;
+         blend->rt[0].rgb_dst_factor   = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+         blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+         break;
       default:
          assert(!"not implemented blend mode");
       }

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to