gallium: add a way to query min/max texture gather offsets
authorIlia Mirkin <imirkin@alum.mit.edu>
Wed, 9 Apr 2014 18:58:53 +0000 (14:58 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 11 Apr 2014 00:42:36 +0000 (20:42 -0400)
Defaults to providing the same offsets as MIN/MAX_TEXEL_OFFSET. For
nvc0, the offset can be -32/31.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
13 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/svga/svga_screen.c
src/gallium/include/pipe/p_defines.h

index 943d880782612bb53263b1b1648519307774c747..5c255d05cc58a25bf044f79fb8ffcc3706b94239 100644 (file)
@@ -193,6 +193,10 @@ The integer capabilities:
   for buffers.
 * ``PIPE_CAP_TEXTURE_QUERY_LOD``: Whether the ``LODQ`` instruction is
   supported.
+* ``PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET``: The minimum offset that can be used
+  in conjunction with a texture gather opcode.
+* ``PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET``: The maximum offset that can be used
+  in conjunction with a texture gather opcode.
 
 
 .. _pipe_capf:
index 96c769ed41ce1369f12aa4cb0c7f8a9713461c6f..08556a4963b6758c80b479eccbcae44214cb8fa5 100644 (file)
@@ -240,9 +240,11 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_QUERY_TIMESTAMP:
                return 0;
 
+       case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
        case PIPE_CAP_MIN_TEXEL_OFFSET:
                return -8;
 
+       case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
        case PIPE_CAP_MAX_TEXEL_OFFSET:
                return 7;
 
index 892c3ead37b67dbfec4898d624463e50a3a119a2..b484d36d3d37cc8a5a6bcd26738458b1f3bd3554 100644 (file)
@@ -253,6 +253,8 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
       return I915_MAX_TEXTURE_2D_LEVELS;
    case PIPE_CAP_MIN_TEXEL_OFFSET:
    case PIPE_CAP_MAX_TEXEL_OFFSET:
+   case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
+   case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
    case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
    case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
    case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
index 7f2e01fffeb1c602e78f9cc35717555ffcb5d567..4bea564e6a0fe4f62f9b2ba8fcec35cf86ce06e6 100644 (file)
@@ -361,8 +361,10 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SEAMLESS_CUBE_MAP:
    case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
       return true;
+   case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
    case PIPE_CAP_MIN_TEXEL_OFFSET:
       return -8;
+   case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
    case PIPE_CAP_MAX_TEXEL_OFFSET:
       return 7;
    case PIPE_CAP_CONDITIONAL_RENDER:
index 6eb7d64b233379433eea324279f2b696c0544b18..8fbc58f042ecea306df91b8da94157d07c3f7cbd 100644 (file)
@@ -176,8 +176,10 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
       return 1;
    /* this is a lie could support arbitrary large offsets */
+   case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
    case PIPE_CAP_MIN_TEXEL_OFFSET:
       return -8;
+   case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
    case PIPE_CAP_MAX_TEXEL_OFFSET:
       return 7;
    case PIPE_CAP_CONDITIONAL_RENDER:
index ce1397d413b0dc430a4e0d5aada87b37aa9da7cb..0e10679e659275ab4c82ef3798e468741b9addba 100644 (file)
@@ -106,6 +106,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
    case PIPE_CAP_MIN_TEXEL_OFFSET:
    case PIPE_CAP_MAX_TEXEL_OFFSET:
+   case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
+   case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
    case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
    case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
    case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
index d02806ade19e21c511d9f0c3b111ab0c400131ea..4a8423f39447be82a509d6859ed226d4f42b034e 100644 (file)
@@ -93,8 +93,10 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return 14;
    case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
       return 512;
+   case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
    case PIPE_CAP_MIN_TEXEL_OFFSET:
       return -8;
+   case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
    case PIPE_CAP_MAX_TEXEL_OFFSET:
       return 7;
    case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
index 1ee6f727a4675a4c3f9910f3af140ddcfec08cc8..64674f71034c835257f2fb4d81c4c4ad9b0ceed4 100644 (file)
@@ -82,6 +82,10 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return -8;
    case PIPE_CAP_MAX_TEXEL_OFFSET:
       return 7;
+   case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
+      return -32;
+   case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
+      return 31;
    case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
    case PIPE_CAP_TEXTURE_SWIZZLE:
    case PIPE_CAP_TEXTURE_SHADOW_MAP:
index 8e601e3d37f60703e8b856999b6a5ff1d8556ebf..a60cdca765919528a38a8cb62ee5355b3778bf9b 100644 (file)
@@ -149,6 +149,8 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
         case PIPE_CAP_MIN_TEXEL_OFFSET:
         case PIPE_CAP_MAX_TEXEL_OFFSET:
+        case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
+        case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
         case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
         case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
         case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
index 18fde7453bade2ea7587cca03e981fe7b81239f7..c0376621334844c700dabf411ecc3a76d62adbe8 100644 (file)
@@ -424,9 +424,11 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
                return rscreen->b.info.drm_minor >= 20 &&
                       rscreen->b.info.r600_clock_crystal_freq != 0;
 
+       case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
        case PIPE_CAP_MIN_TEXEL_OFFSET:
                return -8;
 
+       case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
        case PIPE_CAP_MAX_TEXEL_OFFSET:
                return 7;
 
index 7dac287266451a548ff994447c639e298f87da13..03f73acac83fdcb1ddc037b4ece313b5f984e548 100644 (file)
@@ -335,9 +335,11 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_QUERY_TIME_ELAPSED:
                return sscreen->b.info.r600_clock_crystal_freq != 0;
 
+       case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
        case PIPE_CAP_MIN_TEXEL_OFFSET:
                return -8;
 
+       case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
        case PIPE_CAP_MAX_TEXEL_OFFSET:
                return 7;
        case PIPE_CAP_ENDIANNESS:
index 785b03636e2ec2ebfabb1365b76a7e217f1f0414..5a0436a3888a5409e3d2e08ef1216881fa80b3a9 100644 (file)
@@ -246,6 +246,8 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
    case PIPE_CAP_MIN_TEXEL_OFFSET:
    case PIPE_CAP_MAX_TEXEL_OFFSET:
+   case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
+   case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
    case PIPE_CAP_CONDITIONAL_RENDER:
    case PIPE_CAP_TEXTURE_BARRIER:
    case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
index 30a65ee5136a1afccfd3b9eaa8029bd7ae293f03..a3a1ae1c888345a363245c727afdad704d1f3da9 100644 (file)
@@ -554,6 +554,8 @@ enum pipe_cap {
    PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT = 92,
    PIPE_CAP_FAKE_SW_MSAA = 93,
    PIPE_CAP_TEXTURE_QUERY_LOD = 94,
+   PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET = 95,
+   PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET = 96,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)