gallium: add PIPE_CAP_USER_INDEX_BUFFERS and PIPE_CAP_USER_CONSTANT_BUFFERS
authorMarek Olšák <maraeo@gmail.com>
Tue, 24 Apr 2012 13:19:31 +0000 (15:19 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sun, 29 Apr 2012 23:09:57 +0000 (01:09 +0200)
12 files changed:
src/gallium/docs/source/screen.rst
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/nv30/nv30_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/radeonsi/radeonsi_pipe.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/include/pipe/p_defines.h

index 05f7e8fc5397a4eb9bbf14bc7882b98f8aee201b..b73c4d25c1d14e366411bad94209f509fff57db3 100644 (file)
@@ -110,6 +110,12 @@ The integer capabilities:
 * ``PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY``: This CAP describes
   a hw limitation.  If true, pipe_vertex_element::src_offset must always be
   aligned to 4.  If false, there are no restrictions on src_offset.
+* ``PIPE_CAP_USER_INDEX_BUFFERS``: Whether user index buffers are supported.
+  If not, the state tracker must upload all indices which are not in hw
+  resources.
+* ``PIPE_CAP_USER_CONSTANT_BUFFERS``: Whether user constant buffers are
+  supported. If not, the state tracker must upload constants which are not in hw
+  resources.
 
 
 
index 1546ee80230394c86cb8af2aa52dde21ae36c427..1b3c4be12c745876e724784b02391b68f6845d4c 100644 (file)
@@ -181,6 +181,8 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_TGSI_INSTANCEID:
    case PIPE_CAP_VERTEX_COLOR_CLAMPED:
    case PIPE_CAP_USER_VERTEX_BUFFERS:
+   case PIPE_CAP_USER_INDEX_BUFFERS:
+   case PIPE_CAP_USER_CONSTANT_BUFFERS:
       return 1;
 
    /* Unsupported features (boolean caps). */
index 3e0808d61da5723ea20e066fb711c45fd87e9381..1a3e2bdac5a2f09fa36484868a5bb37b9e368efc 100644 (file)
@@ -160,6 +160,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
       return 0;
    case PIPE_CAP_USER_VERTEX_BUFFERS:
+   case PIPE_CAP_USER_INDEX_BUFFERS:
+   case PIPE_CAP_USER_CONSTANT_BUFFERS:
       return 1;
    default:
       return 0;
index d355f749a09aba142d744269e6cc3c82fd6fdbf6..2078c1995b0168c001e6358968858428eff2c3c1 100644 (file)
@@ -79,6 +79,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
    case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
    case PIPE_CAP_USER_VERTEX_BUFFERS:
+   case PIPE_CAP_USER_INDEX_BUFFERS:
+   case PIPE_CAP_USER_CONSTANT_BUFFERS:
       return 1;
    /* nv4x capabilities */
    case PIPE_CAP_BLEND_EQUATION_SEPARATE:
index b3489198d2b1858aa19da48b66b0ef22fd0ecad1..ad40cb49eb8e6f2b663f0d2f5d1d435c5716dd39 100644 (file)
@@ -151,6 +151,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
       return 0; /* state trackers will know better */
    case PIPE_CAP_USER_VERTEX_BUFFERS:
+   case PIPE_CAP_USER_INDEX_BUFFERS:
+   case PIPE_CAP_USER_CONSTANT_BUFFERS:
       return 1;
    case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
    case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
index 457d56e7d9e5edf598c8bdc401c00d65c07ef40f..7e6c1d409139b2f0ab1ab4fb56c89b4cd637a9b7 100644 (file)
@@ -141,6 +141,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
       return 0; /* state trackers will know better */
    case PIPE_CAP_USER_VERTEX_BUFFERS:
+   case PIPE_CAP_USER_INDEX_BUFFERS:
+   case PIPE_CAP_USER_CONSTANT_BUFFERS:
       return 1;
    case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
    case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
index 0803a0808b5b4d7a3bca0caf0687dea8ef574543..ff9d3952e7eed2909715f310d6a914d971c32cf6 100644 (file)
@@ -106,6 +106,8 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
         case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
         case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
+        case PIPE_CAP_USER_INDEX_BUFFERS:
+        case PIPE_CAP_USER_CONSTANT_BUFFERS:
             return 1;
 
         case PIPE_CAP_GLSL_FEATURE_LEVEL:
index 0b67a0143a03a1359d6bace14ce393c923a624b0..1a8dbdb3de1d873fcfd55944196a825b6247f178 100644 (file)
@@ -403,6 +403,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
        case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
        case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
+       case PIPE_CAP_USER_INDEX_BUFFERS:
+       case PIPE_CAP_USER_CONSTANT_BUFFERS:
                return 1;
 
        case PIPE_CAP_GLSL_FEATURE_LEVEL:
index f97db3ac39a0d8bc501fd18cc5a5e39b4460744c..e2f438be1420e282a45ccc193fbb93fb91b56f70 100644 (file)
@@ -345,6 +345,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
        case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
        case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
+       case PIPE_CAP_USER_INDEX_BUFFERS:
+       case PIPE_CAP_USER_CONSTANT_BUFFERS:
                return 1;
 
        case PIPE_CAP_GLSL_FEATURE_LEVEL:
index 28fda94060d7ecd6d5abe72c00ac5fc2ef9431bf..ec8acebf91334fbfaf8ada19b3b050ab84723bf1 100644 (file)
@@ -139,6 +139,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
       return 0;
    case PIPE_CAP_USER_VERTEX_BUFFERS:
+   case PIPE_CAP_USER_INDEX_BUFFERS:
+   case PIPE_CAP_USER_CONSTANT_BUFFERS:
       return 1;
    default:
       return 0;
index 0db2dd37fe56216ccd886afa700598000c07fd79..e6933a90b8627259c732e26f643d5a087952918d 100644 (file)
@@ -161,6 +161,8 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TEXTURE_SWIZZLE:
       return 1;
    case PIPE_CAP_USER_VERTEX_BUFFERS:
+   case PIPE_CAP_USER_INDEX_BUFFERS:
+   case PIPE_CAP_USER_CONSTANT_BUFFERS:
       return 1;
 
    case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
index 8b6d00d4318ed12b7a5cb3b9c6deb44e3dc2cbd0..4d75dec3c25a96473bc852e277c9e3e52c04de8b 100644 (file)
@@ -477,6 +477,8 @@ enum pipe_cap {
    PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY = 65,
    PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY = 66,
    PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY = 67,
+   PIPE_CAP_USER_INDEX_BUFFERS = 68,
+   PIPE_CAP_USER_CONSTANT_BUFFERS = 69
 };
 
 /**