i915: Remove most of the code under gen >= 4 checks.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_util.c
index ce21aa48695c47f428a99af2d333bd57cfa1fd93..5441c5e5bc5c69674ec6bc18aee85acfaa6633da 100644 (file)
   */
          
 
+#include <assert.h>
+
 #include "main/mtypes.h"
-#include "shader/prog_parameter.h"
+#include "program/prog_parameter.h"
 #include "brw_util.h"
 #include "brw_defines.h"
 
-GLuint brw_count_bits( GLuint val )
-{
-   GLuint i;
-   for (i = 0; val ; val >>= 1)
-      if (val & 1)
-        i++;
-   return i;
-}
-
-
 GLuint brw_translate_blend_equation( GLenum mode )
 {
    switch (mode) {
@@ -97,6 +89,16 @@ GLuint brw_translate_blend_factor( GLenum factor )
       return BRW_BLENDFACTOR_CONST_ALPHA; 
    case GL_ONE_MINUS_CONSTANT_ALPHA:
       return BRW_BLENDFACTOR_INV_CONST_ALPHA;
+
+   case GL_SRC1_COLOR:
+      return BRW_BLENDFACTOR_SRC1_COLOR;
+   case GL_SRC1_ALPHA:
+      return BRW_BLENDFACTOR_SRC1_ALPHA;
+   case GL_ONE_MINUS_SRC1_COLOR:
+      return BRW_BLENDFACTOR_INV_SRC1_COLOR;
+   case GL_ONE_MINUS_SRC1_ALPHA:
+      return BRW_BLENDFACTOR_INV_SRC1_ALPHA;
+
    default:
       assert(0);
       return BRW_BLENDFACTOR_ZERO;