gallium: add PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX
authorMarek Olšák <marek.olsak@amd.com>
Sat, 29 Apr 2017 23:18:43 +0000 (01:18 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 10 May 2017 17:29:08 +0000 (19:29 +0200)
The next patch will use it. This is really for svga and GL2-level drivers.

Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
17 files changed:
src/gallium/docs/source/screen.rst
src/gallium/drivers/etnaviv/etnaviv_screen.c
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/nouveau/nv30/nv30_screen.c
src/gallium/drivers/nouveau/nv50/nv50_screen.c
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/drivers/swr/swr_screen.cpp
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_defines.h

index 03a37f0bd29fee79f763fb0d16510366fb31276c..971dc1feb5096ef1619a3e2c688aa0635c4b25f6 100644 (file)
@@ -389,6 +389,8 @@ The integer capabilities:
 * ``PIPE_CAP_TGSI_TES_LAYER_VIEWPORT``: Whether ``TGSI_SEMANTIC_LAYER`` and
   ``TGSI_SEMANTIC_VIEWPORT_INDEX`` are supported as tessellation evaluation
   shader outputs.
+* ``PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX``: Whether a buffer with just
+  PIPE_BIND_CONSTANT_BUFFER can be legally passed to set_vertex_buffers.
 
 
 .. _pipe_capf:
index 13e20e07dabe54332e2b982ae5c3b0fb7809493d..d8a970b9105c37a78d898f689b3d3af405f5c648 100644 (file)
@@ -254,6 +254,7 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
    case PIPE_CAP_TGSI_BALLOT:
    case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+   case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
       return 0;
 
    /* Stream output. */
index 57010d64587f76b072420053e431cd7e4ff9b311..e1e02005ae376741d922336f6517255a5a86db98 100644 (file)
@@ -313,6 +313,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
        case PIPE_CAP_TGSI_BALLOT:
        case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+       case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 139b5d89635fd4ea1a3c35d52a93fb283799e078..ae0a495e9d8080b58b783ecec35b14cf11159d7e 100644 (file)
@@ -306,6 +306,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
    case PIPE_CAP_TGSI_BALLOT:
    case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+   case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
       return 0;
 
    case PIPE_CAP_MAX_VIEWPORTS:
index 85449ab490a69477938f6837daddd11ca154a8d4..c43f85e86044aa19888cb4e5e730cb0cf3dd50fc 100644 (file)
@@ -352,6 +352,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
    case PIPE_CAP_TGSI_BALLOT:
    case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+   case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
       return 0;
    }
    /* should only get here on unhandled cases */
index 363ac312a9410e6cf48057f53fdc4d675a2c947e..b3cd2b69a0ffa1dd2e62a55439e3da1f43d99f63 100644 (file)
@@ -216,6 +216,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
    case PIPE_CAP_TGSI_BALLOT:
    case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+   case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 82e666a39e475fe2ab84af71c9037901ba373da2..c425b1182b71a6917085bbf4ee53ca0af5224817 100644 (file)
@@ -200,6 +200,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_MUL_ZERO_WINS:
    case PIPE_CAP_TGSI_TEX_TXF_LZ:
    case PIPE_CAP_TGSI_CLOCK:
+   case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
       return 1;
    case PIPE_CAP_SEAMLESS_CUBE_MAP:
       return 1; /* class_3d >= NVA0_3D_CLASS; */
index 20d2fa0253a0684650687d1f6dbdfaf74e5010e4..d2a1292ec5925c324fd5cdaf91ddfbc58be15ac5 100644 (file)
@@ -249,6 +249,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TGSI_TEX_TXF_LZ:
    case PIPE_CAP_TGSI_CLOCK:
    case PIPE_CAP_COMPUTE:
+   case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
       return 1;
    case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
       return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
index 989912c03d55fc1c0225df073d0a6aecf9a05705..9fa6bcd3924faa82df159e5d9e56d1566bc39b29 100644 (file)
@@ -238,6 +238,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
         case PIPE_CAP_TGSI_BALLOT:
         case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+        case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
             return 0;
 
         /* SWTCL-only features. */
index ca18db05979c4b48e1dd6ec96dd4d52541400868..e4aa8868b93dd6bb75072d98c6e73227c7a09698 100644 (file)
@@ -286,6 +286,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
        case PIPE_CAP_CLEAR_TEXTURE:
        case PIPE_CAP_TGSI_MUL_ZERO_WINS:
+       case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
                return 1;
 
        case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
index 0d1721f677f91d9eb33c7e95f1ac6a9ca11a7b57..78e01360b8a59cf3b74af99e3f1ec1d96cbb005c 100644 (file)
@@ -424,6 +424,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_INT64:
        case PIPE_CAP_INT64_DIVMOD:
        case PIPE_CAP_TGSI_CLOCK:
+       case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
                return 1;
 
        case PIPE_CAP_TGSI_VOTE:
index f4c44efe7ac402af7bba495126f49f679bab712f..1719972fac92453d37921c5963d19ea5ee158974 100644 (file)
@@ -302,6 +302,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
    case PIPE_CAP_TGSI_BALLOT:
    case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+   case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
       return 0;
    case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
       return 4;
index 08e09ec33610474933b9a4e4246bdf3783c7ad0d..7ccb66e478ba66a1aaa5a35404a40d89cb48dc5a 100644 (file)
@@ -433,6 +433,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
    case PIPE_CAP_TGSI_BALLOT:
    case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+   case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
       return 0;
    }
 
index 9254e735085b2452cbaae7f75c89c91e22840b4d..a584a0ab56c032c2c8506a7243fdb70d3f32b222 100644 (file)
@@ -337,6 +337,7 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
    case PIPE_CAP_TGSI_BALLOT:
    case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+   case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index d116748324a23d2c1af140148fc3d94b4ba37ef2..0660a647de9691104df2d586503180b142ebe1db 100644 (file)
@@ -253,6 +253,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
         case PIPE_CAP_TGSI_BALLOT:
         case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+       case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
                 return 0;
 
                 /* Stream output. */
index c8bad5381dba45d034908db584b2f784eaa259df..d354585baf463e22026bc2928fa8c7a8d2334fde 100644 (file)
@@ -262,6 +262,7 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TGSI_BALLOT:
    case PIPE_CAP_DOUBLES:
    case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
+   case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
       return 0;
    case PIPE_CAP_VENDOR_ID:
       return 0x1af4;
index ce2cfd1d88f9f0ce680e5180dcd5ecf6b4ead716..82b9d9c08a4d1fc33e68d27e181fda942f13dfc6 100644 (file)
@@ -762,6 +762,7 @@ enum pipe_cap
    PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE,
    PIPE_CAP_TGSI_BALLOT,
    PIPE_CAP_TGSI_TES_LAYER_VIEWPORT,
+   PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)