gallium: split CAP_INSTANCE_DRAWING into INSTANCEID and INSTANCE_DIVISOR
authorMarek Olšák <maraeo@gmail.com>
Sat, 5 Mar 2011 15:06:10 +0000 (16:06 +0100)
committerMarek Olšák <maraeo@gmail.com>
Sat, 5 Mar 2011 16:40:19 +0000 (17:40 +0100)
ARB_instanced_arrays is a subset of D3D9.
ARB_draw_instanced is a subset of D3D10.

The point of this change is to allow D3D9-level drivers to enable
ARB_instanced_arrays without ARB_draw_instanced.

src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nvc0/nvc0_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index 77febbf5012aa8e0754e33882f9b63de9b0b279e..64c4bbab399c8ac749b5ad64e53e30f10be5447c 100644 (file)
@@ -124,7 +124,8 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_GLSL:
    case PIPE_CAP_INDEP_BLEND_ENABLE:
    case PIPE_CAP_INDEP_BLEND_FUNC:
-   case PIPE_CAP_INSTANCED_DRAWING: /* draw module? */
+   case PIPE_CAP_TGSI_INSTANCEID:
+   case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
    case PIPE_CAP_POINT_SPRITE:
    case PIPE_CAP_SHADER_STENCIL_EXPORT:
    case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
index 2c32aa93cdf3bca8f75ace2b89449042935de23a..edcfbfcfac19a8c8859a59521caeb515a1a3c6cd 100644 (file)
@@ -164,7 +164,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 1;
    case PIPE_CAP_DEPTH_CLAMP:
       return 0;
-   case PIPE_CAP_INSTANCED_DRAWING:
+   case PIPE_CAP_TGSI_INSTANCEID:
+   case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
       return 1;
    default:
       return 0;
index ae0365eb5c53a52ae6c1a1fb7757b82a7de3ceb9..d1744a388370c9663e7939e9ec924f6cc1fa777c 100644 (file)
@@ -127,7 +127,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_SHADER_STENCIL_EXPORT:
       return 0;
    case PIPE_CAP_PRIMITIVE_RESTART:
-   case PIPE_CAP_INSTANCED_DRAWING:
+   case PIPE_CAP_TGSI_INSTANCEID:
+   case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
       return 1;
    default:
       NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
index d430be92c51609a07bf0e4380e078485ba7b81e0..4ce827d33f814ae4b46a52d0604a9ada0d55ca17 100644 (file)
@@ -111,7 +111,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_SHADER_STENCIL_EXPORT:
       return 0;
    case PIPE_CAP_PRIMITIVE_RESTART:
-   case PIPE_CAP_INSTANCED_DRAWING:
+   case PIPE_CAP_TGSI_INSTANCEID:
+   case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
       return 1;
    default:
       NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
index 52d0247fbfdf66683a8f3ba3f48d5e128653b3ce..2f82f78125d17cb0e366b8ae2b36a8afea9a6603 100644 (file)
@@ -126,7 +126,8 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_SHADER_STENCIL_EXPORT:
         case PIPE_CAP_STREAM_OUTPUT:
         case PIPE_CAP_PRIMITIVE_RESTART:
-        case PIPE_CAP_INSTANCED_DRAWING:
+        case PIPE_CAP_TGSI_INSTANCEID:
+        case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
         case PIPE_CAP_ARRAY_TEXTURES:
             return 0;
 
index fcca7f705d4693cc3b1de29076f529ac6cf2324b..60838578f2989f698b432d505687b982eb32ef06 100644 (file)
@@ -284,7 +284,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE:
        case PIPE_CAP_DEPTH_CLAMP:
        case PIPE_CAP_SHADER_STENCIL_EXPORT:
-       case PIPE_CAP_INSTANCED_DRAWING:
+       case PIPE_CAP_TGSI_INSTANCEID:
+       case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
                return 1;
 
        /* Unsupported features (boolean caps). */
index 6d47fb9628032431a1b89f67974444ba8b42d9db..8b693ba9198a35b369b602563ee201dfec389943 100644 (file)
@@ -123,7 +123,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 0;
    case PIPE_CAP_SHADER_STENCIL_EXPORT:
       return 1;
-   case PIPE_CAP_INSTANCED_DRAWING:
+   case PIPE_CAP_TGSI_INSTANCEID:
+   case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
       return 1;
    case PIPE_CAP_ARRAY_TEXTURES:
       return 1;
index 81da4b864487713577ea7a275cdd393cf15717c9..edbaaae334a06066e7f68e3da811b334ddb6b045 100644 (file)
@@ -478,7 +478,8 @@ enum pipe_cap {
    PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER,
    PIPE_CAP_DEPTH_CLAMP,
    PIPE_CAP_SHADER_STENCIL_EXPORT,
-   PIPE_CAP_INSTANCED_DRAWING,
+   PIPE_CAP_TGSI_INSTANCEID,
+   PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR,
 };
 
 /* Shader caps not specific to any single stage */
index d2098987d1d738c12cd004a66d07a5bdce825cf4..6bbf68accdd31c40a463c8faf598e20d8e5c1092 100644 (file)
@@ -491,8 +491,10 @@ void st_init_extensions(struct st_context *st)
       ctx->Extensions.ARB_shader_stencil_export = GL_TRUE;
    }
 
-   if (screen->get_param(screen, PIPE_CAP_INSTANCED_DRAWING)) {
+   if (screen->get_param(screen, PIPE_CAP_TGSI_INSTANCEID)) {
       ctx->Extensions.ARB_draw_instanced = GL_TRUE;
+   }
+   if (screen->get_param(screen, PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR)) {
       ctx->Extensions.ARB_instanced_arrays = GL_TRUE;
    }
 }