gallium: Add PIPE_CAP_SURFACE_REINTERPRET_BLOCKS
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 26 Jan 2016 15:27:58 +0000 (10:27 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 3 Feb 2016 13:10:34 +0000 (14:10 +0100)
This cap indicates whether pipe->create_surface can reinterpret a texture
as a surface with a format of different block width/height (but equal
block size).

v2: fix whitespace

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
16 files changed:
src/gallium/docs/source/screen.rst
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/ilo/ilo_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/vc4/vc4_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_defines.h

index 06e638cf57bdb7747495d3a05f3141f315d32634..1fcd882ccbecf727bcca427acc2876f3bfebf700 100644 (file)
@@ -310,6 +310,13 @@ The integer capabilities:
 * ``PIPE_CAP_GENERATE_MIPMAP``: Indicates whether pipe_context::generate_mipmap
   is supported.
 * ``PIPE_CAP_STRING_MARKER``: Whether pipe->emit_string_marker() is supported.
+* ``PIPE_CAP_SURFACE_REINTERPRET_BLOCKS``: Indicates whether
+  pipe_context::create_surface supports reinterpreting a texture as a surface
+  of a format with different block width/height (but same block size in bits).
+  For example, a compressed texture image can be interpreted as a
+  non-compressed surface whose texels are the same number of bits as the
+  compressed blocks, and vice versa. The width and height of the surface is
+  adjusted appropriately.
 
 
 .. _pipe_capf:
index abfebc0aa800617428126854bf6617670fcbccc8..e4352b1a9a5c0116262ae658eab95ea276ff5a45 100644 (file)
@@ -250,6 +250,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
        case PIPE_CAP_INVALIDATE_BUFFER:
        case PIPE_CAP_GENERATE_MIPMAP:
+       case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 383024ba0cac5f5ef66b7fb5afa8eb662d2b5864..31856ad91139fd1afd4cc91504c32f9040918b97 100644 (file)
@@ -263,6 +263,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_GENERATE_MIPMAP:
    case PIPE_CAP_STRING_MARKER:
    case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
+   case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
       return 0;
 
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index 17ab6901737de97b48edf786fa52f94c2f3dfafc..b81057bf82d30e3a9b7bcfd49e0fb537ff71baea 100644 (file)
@@ -488,6 +488,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_INVALIDATE_BUFFER:
    case PIPE_CAP_GENERATE_MIPMAP:
    case PIPE_CAP_STRING_MARKER:
+   case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 9f56ce180f862695a7ddb9278fe7b2d864508b36..1d08abd26a7f95e3f2e97c287775d8aa0a4975dc 100644 (file)
@@ -312,6 +312,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_GENERATE_MIPMAP:
    case PIPE_CAP_STRING_MARKER:
    case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
+   case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
       return 0;
    }
    /* should only get here on unhandled cases */
index 9e1dda28d56560ca19b342bdcda62af38e53f6bf..851b7b915b826c51c691a0dd25c1fa98dbc92fab 100644 (file)
@@ -185,6 +185,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_GENERATE_MIPMAP:
    case PIPE_CAP_STRING_MARKER:
    case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
+   case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 61bad160190198cd4c23c5a3fd64403ece054b6c..c74df23f6e20f94a7dc2edb837f05ff40d9ff769 100644 (file)
@@ -228,6 +228,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_GENERATE_MIPMAP:
    case PIPE_CAP_STRING_MARKER:
    case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
+   case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index f50e5cce918c70c3d56a339bbd0f9dffa91e6659..a9bde273ac668754029164d6ce59e9a658305524 100644 (file)
@@ -218,6 +218,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_GENERATE_MIPMAP:
    case PIPE_CAP_STRING_MARKER:
    case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
+   case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 43f95b9491b9d351157825346958a0cb5e1a17ec..acc32b9af4dfdbca27882d789ef275866d643aea 100644 (file)
@@ -211,6 +211,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_GENERATE_MIPMAP:
         case PIPE_CAP_STRING_MARKER:
         case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
+        case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
             return 0;
 
         /* SWTCL-only features. */
index cb505a41bfbc22b4b70f8be2c1b766a8f6c504e2..27313c53f6619f75334e03243423bbce84469544 100644 (file)
@@ -367,6 +367,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
        case PIPE_CAP_GENERATE_MIPMAP:
        case PIPE_CAP_STRING_MARKER:
+       case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
                return 0;
 
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
index 6906445556ffd24a834fd7ac57c8ac912fff5106..5145983933ea0cd8d4088017279469ea08e16403 100644 (file)
@@ -357,6 +357,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
        case PIPE_CAP_GENERATE_MIPMAP:
        case PIPE_CAP_STRING_MARKER:
+       case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
                return 0;
 
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
index 530b9bbb7b78df0b10e12b7ba9c3993e8c3387f6..5bb623f9258dd914bc37d5c77c3f8029c8062e01 100644 (file)
@@ -263,6 +263,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_INVALIDATE_BUFFER:
    case PIPE_CAP_GENERATE_MIPMAP:
    case PIPE_CAP_STRING_MARKER:
+   case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
       return 0;
    }
    /* should only get here on unhandled cases */
index 5a07c448eeecfd69ea9112a1a9887b79ac2e4ec3..73d90d180fdad1a895cb5e41674e873a93778933 100644 (file)
@@ -358,6 +358,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
    case PIPE_CAP_INVALIDATE_BUFFER:
    case PIPE_CAP_STRING_MARKER:
+   case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
       return 0;
    case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
       return 64;
index bdfcb7856eb7399bf1355f9e5811a16058b3031f..641433a76fed768b30441d0ba7aaa7fd78b61ad0 100644 (file)
@@ -200,6 +200,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_INVALIDATE_BUFFER:
         case PIPE_CAP_GENERATE_MIPMAP:
         case PIPE_CAP_STRING_MARKER:
+        case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
                 return 0;
 
                 /* Stream output. */
index f530c7985cf5a9959432845ed85c2efed99b3d40..5036e1dedb5c5a4bb5b639a8aa62cb1e2dbdee23 100644 (file)
@@ -230,6 +230,7 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
    case PIPE_CAP_INVALIDATE_BUFFER:
    case PIPE_CAP_GENERATE_MIPMAP:
+   case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
       return 0;
    case PIPE_CAP_VENDOR_ID:
       return 0x1af4;
index 6f76b8ed5b11e1f5e27195d7844491cc2ac203d7..a96c06f9d8c0a1af2e329389c88326dddfda363c 100644 (file)
@@ -647,6 +647,7 @@ enum pipe_cap
    PIPE_CAP_INVALIDATE_BUFFER,
    PIPE_CAP_GENERATE_MIPMAP,
    PIPE_CAP_STRING_MARKER,
+   PIPE_CAP_SURFACE_REINTERPRET_BLOCKS,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)