Add support for NV_blend_square, and print errors if an unsupported blend
authorEric Anholt <anholt@FreeBSD.org>
Fri, 8 Oct 2004 21:37:08 +0000 (21:37 +0000)
committerEric Anholt <anholt@FreeBSD.org>
Fri, 8 Oct 2004 21:37:08 +0000 (21:37 +0000)
function is used.

src/mesa/drivers/dri/sis/sis_context.c
src/mesa/drivers/dri/sis/sis_dd.c
src/mesa/drivers/dri/sis/sis_state.c

index a9b791f..0d15bfa 100644 (file)
@@ -65,6 +65,7 @@ static const char * const card_extensions[] =
 {
    "GL_ARB_multitexture",
    "GL_EXT_texture_lod_bias",
+   "GL_NV_blend_square",
    NULL
 };
 
index 010e1c5..4049a10 100644 (file)
@@ -44,7 +44,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "utils.h"
 
-#define DRIVER_DATE    "20040925"
+#define DRIVER_DATE    "20041008"
 
 /* Return the width and height of the given buffer.
  */
index 422059b..2cca161 100644 (file)
@@ -107,9 +107,7 @@ sisDDBlendFuncSeparate( GLcontext *ctx,
    __GLSiSHardware *prev = &smesa->prev;
    __GLSiSHardware *current = &smesa->current;
 
-   /* TODO: in ICD, if no blend, it will reset these value */
-   /* blending enable */
-   current->hwDstSrcBlend = 0x10000;   /* Default destination alpha */
+   current->hwDstSrcBlend = 0;
 
    switch (dfactorRGB)
    {
@@ -131,12 +129,21 @@ sisDDBlendFuncSeparate( GLcontext *ctx,
    case GL_ONE_MINUS_SRC_ALPHA:
       current->hwDstSrcBlend |= SiS_D_ONE_MINUS_SRC_ALPHA;
       break;
+   case GL_DST_COLOR:
+      current->hwDstSrcBlend |= SiS_D_DST_COLOR;
+      break;
+   case GL_ONE_MINUS_DST_COLOR:
+      current->hwDstSrcBlend |= SiS_D_ONE_MINUS_DST_COLOR;
+      break;
    case GL_DST_ALPHA:
       current->hwDstSrcBlend |= SiS_D_DST_ALPHA;
       break;
    case GL_ONE_MINUS_DST_ALPHA:
       current->hwDstSrcBlend |= SiS_D_ONE_MINUS_DST_ALPHA;
       break;
+   default:
+      fprintf(stderr, "Unknown dst blend function 0x%x\n", dfactorRGB);
+      break;
    }
 
    switch (sfactorRGB)
@@ -147,27 +154,36 @@ sisDDBlendFuncSeparate( GLcontext *ctx,
    case GL_ONE:
       current->hwDstSrcBlend |= SiS_S_ONE;
       break;
+   case GL_SRC_COLOR:
+      current->hwDstSrcBlend |= SiS_S_SRC_COLOR;
+      break;
+   case GL_ONE_MINUS_SRC_COLOR:
+      current->hwDstSrcBlend |= SiS_S_ONE_MINUS_SRC_COLOR;
+      break;
    case GL_SRC_ALPHA:
       current->hwDstSrcBlend |= SiS_S_SRC_ALPHA;
       break;
    case GL_ONE_MINUS_SRC_ALPHA:
       current->hwDstSrcBlend |= SiS_S_ONE_MINUS_SRC_ALPHA;
       break;
-   case GL_DST_ALPHA:
-      current->hwDstSrcBlend |= SiS_S_DST_ALPHA;
-      break;
-   case GL_ONE_MINUS_DST_ALPHA:
-      current->hwDstSrcBlend |= SiS_S_ONE_MINUS_DST_ALPHA;
-      break;
    case GL_DST_COLOR:
       current->hwDstSrcBlend |= SiS_S_DST_COLOR;
       break;
    case GL_ONE_MINUS_DST_COLOR:
       current->hwDstSrcBlend |= SiS_S_ONE_MINUS_DST_COLOR;
       break;
+   case GL_DST_ALPHA:
+      current->hwDstSrcBlend |= SiS_S_DST_ALPHA;
+      break;
+   case GL_ONE_MINUS_DST_ALPHA:
+      current->hwDstSrcBlend |= SiS_S_ONE_MINUS_DST_ALPHA;
+      break;
    case GL_SRC_ALPHA_SATURATE:
       current->hwDstSrcBlend |= SiS_S_SRC_ALPHA_SATURATE;
       break;
+   default:
+      fprintf(stderr, "Unknown src blend function 0x%x\n", sfactorRGB);
+      break;
    }
 
    if (current->hwDstSrcBlend != prev->hwDstSrcBlend) {