gallium: add support for GLES texture float extensions (v3)
authorMarek Olšák <marek.olsak@amd.com>
Mon, 10 Aug 2015 17:37:01 +0000 (19:37 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 14 Aug 2015 12:56:54 +0000 (14:56 +0200)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74329

v2: add a CAP for half floats
    drivers should not expose the CAPs if they don't support the formats

v3: update relnotes

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
17 files changed:
docs/relnotes/11.0.0.html
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/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index 2d80198d4209ce197c247b76ace0e3e8bff0f180..b5077e7c6a01db2c163f475e8a860d54f296ceea 100644 (file)
@@ -58,6 +58,10 @@ Note: some of the new features are only available with certain drivers.
 <li>GL_ARB_tessellation_shader on nvc0, radeonsi</li>
 <li>GL_ARB_vertex_attrib_64bit on llvmpipe, radeonsi</li>
 <li>GL_ARB_viewport_array on radeonsi</li>
+<li>GL_OES_texture_float on all r300, r600, radeonsi, nv30, nv50, nvc0, softpipe, llvmpipe</li>
+<li>GL_OES_texture_half_float on all r300, r600, radeonsi, nv30, nv50, nvc0, softpipe, llvmpipe</li>
+<li>GL_OES_texture_float_linear on all r300, r600, radeonsi, nv30, nv50, nvc0, softpipe, llvmpipe</li>
+<li>GL_OES_texture_half_float_linear on all r300, r600, radeonsi, nv30, nv50, nvc0, softpipe, llvmpipe</li>
 <li>GLX_ARB_create_context_robustness on r600, radeonsi</li>
 <li>EGL_EXT_create_context_robustness on r600, radeonsi</li>
 <li>EGL_KHR_gl_colorspace on r600, radeonsi, nv50, nvc0</li>
index dbdccc7fcef21b51a1e74578c26e7827032d56a7..c0b5eb31d055ccb1608b55d88f01472d35918de8 100644 (file)
@@ -258,6 +258,12 @@ The integer capabilities:
   How many per-patch outputs and inputs are supported between tessellation
   control and tessellation evaluation shaders, not counting in TESSINNER and
   TESSOUTER. The minimum allowed value for OpenGL is 30.
+* ``PIPE_CAP_TEXTURE_FLOAT_LINEAR``: Whether the linear minification and
+  magnification filters are supported with single-precision floating-point
+  textures.
+* ``PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR``: Whether the linear minification and
+  magnification filters are supported with half-precision floating-point
+  textures.
 
 
 .. _pipe_capf:
index 3aeed57b0432fddbef843d1e2ee319c065ee4176..295ce7e81875f419177e6c237c9db4a12a9d5101 100644 (file)
@@ -230,6 +230,8 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
        case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
+       case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+       case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 6083687962fdc5bb6778caccfd1f7aac5f083adb..7608ca5e1a9b2eaeae1b57a9131990986fe4f41e 100644 (file)
@@ -244,6 +244,8 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
    case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
+   case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+   case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
       return 0;
 
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index 338643e65bba41d95e9b4b241f36585065130e9f..9f150bbd7b2c18ff45e8d19c21ba4eba85e5c27b 100644 (file)
@@ -451,6 +451,8 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TEXTURE_GATHER_SM5:
       return 0;
    case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
+   case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+   case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
       return true;
    case PIPE_CAP_FAKE_SW_MSAA:
    case PIPE_CAP_TEXTURE_QUERY_LOD:
index 1c6c82ea1159d7ed30b5ec45af87b18476fe32ef..539bb448bc6f0bf0ef36649347855e123d27c993 100644 (file)
@@ -288,6 +288,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_VERTEXID_NOBASE:
       return 0;
    case PIPE_CAP_POLYGON_OFFSET_CLAMP:
+   case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+   case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
       return 1;
    case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
index 97cf058ce290e546e01ac29d953c323da24c8dfc..73bcd5b0d3ffc32cf6c426cb423ae940f4548f69 100644 (file)
@@ -164,6 +164,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
    case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
+   case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+   case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index d869544380a0cbd515e6626361c6793d0a3185f8..1e1987745935daffcee1dbf1d0bac78c59e18cd4 100644 (file)
@@ -176,6 +176,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_CLIP_HALFZ:
    case PIPE_CAP_POLYGON_OFFSET_CLAMP:
    case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
+   case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+   case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
       return 1;
    case PIPE_CAP_SEAMLESS_CUBE_MAP:
       return 1; /* class_3d >= NVA0_3D_CLASS; */
index 5c382b8bdaeb8d996748ae1c8ec80f28db859ddc..0c25ec4312016fd19819c54b02f85c15a9716b7e 100644 (file)
@@ -175,6 +175,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_CLIP_HALFZ:
    case PIPE_CAP_POLYGON_OFFSET_CLAMP:
    case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
+   case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+   case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
       return 1;
    case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
       return (class_3d >= NVE4_3D_CLASS) ? 1 : 0;
index f1df79ccb21b84dd7d6601a87a8e359cfac8617b..74aae379c09be43463eba2d016b4ac4f1ded3bfb 100644 (file)
@@ -192,6 +192,8 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
         case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
         case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
+        case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+        case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
             return 0;
 
         /* SWTCL-only features. */
index c4f5c742b9ad9d893d541fdd4db9bc170d82f86a..a0fe1d355c911879c9955f8b79d47a32659c5cc6 100644 (file)
@@ -270,6 +270,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_CLIP_HALFZ:
        case PIPE_CAP_POLYGON_OFFSET_CLAMP:
        case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
+       case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+       case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
                return 1;
 
        case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
index e29b15861070ccd3c7df856bcbad1845dac61d8a..d60c258709d485dc1025863b6da648e24b1d6a8a 100644 (file)
@@ -257,6 +257,8 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_TGSI_TEXCOORD:
        case PIPE_CAP_TGSI_FS_FINE_DERIVATIVE:
        case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
+       case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+       case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
                return 1;
 
        case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
index ed8e5457f27ee5dfb76d5e57fc83670d824ed0f5..49a21d9c06b26ce88b35104297f8491bade48fc4 100644 (file)
@@ -234,6 +234,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
       return 1;
    case PIPE_CAP_CLIP_HALFZ:
+   case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+   case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
       return 1;
    case PIPE_CAP_VERTEXID_NOBASE:
       return 0;
index ac5abe8f89d34899ccc07210b73c3d237ddfed5d..7b70272a82843093fdc3a470828eedf4fa5e7e34 100644 (file)
@@ -310,6 +310,8 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
    case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
+   case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+   case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
       return 0;
    }
 
index a20818da4d2ebf6c77b65746f248e1e206f232ca..72f08262b662aae12f8bb8bf4e42506530cf8167 100644 (file)
@@ -177,6 +177,8 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
         case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
+       case PIPE_CAP_TEXTURE_FLOAT_LINEAR:
+       case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
                 return 0;
 
                 /* Stream output. */
index 85328264cc352b60eb2f3b4b380794a3ff260eb4..83a3e2bb3775e9efd7748b7e5e2e46f2dfa7e6e9 100644 (file)
@@ -607,6 +607,8 @@ enum pipe_cap
    PIPE_CAP_RESOURCE_FROM_USER_MEMORY,
    PIPE_CAP_DEVICE_RESET_STATUS_QUERY,
    PIPE_CAP_MAX_SHADER_PATCH_VARYINGS,
+   PIPE_CAP_TEXTURE_FLOAT_LINEAR,
+   PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
index 13d636fede07f53f1534ae92affb5eca24db6195..ee14019c526ed2d5fc5f63f79fcc7a3475f0fa71 100644 (file)
@@ -474,6 +474,8 @@ void st_init_extensions(struct pipe_screen *screen,
        * support the GL_POINT_SPRITE_R_MODE_NV option. */
 
       { o(OES_standard_derivatives),         PIPE_CAP_SM3                              },
+      { o(OES_texture_float_linear),         PIPE_CAP_TEXTURE_FLOAT_LINEAR             },
+      { o(OES_texture_half_float_linear),    PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR        },
       { o(ARB_texture_cube_map_array),       PIPE_CAP_CUBE_MAP_ARRAY                   },
       { o(ARB_texture_multisample),          PIPE_CAP_TEXTURE_MULTISAMPLE              },
       { o(ARB_texture_query_lod),            PIPE_CAP_TEXTURE_QUERY_LOD                },
@@ -492,6 +494,12 @@ void st_init_extensions(struct pipe_screen *screen,
         { PIPE_FORMAT_R32G32B32A32_FLOAT,
           PIPE_FORMAT_R16G16B16A16_FLOAT } },
 
+      { { o(OES_texture_float) },
+        { PIPE_FORMAT_R32G32B32A32_FLOAT } },
+
+      { { o(OES_texture_half_float) },
+        { PIPE_FORMAT_R16G16B16A16_FLOAT } },
+
       { { o(ARB_texture_rgb10_a2ui) },
         { PIPE_FORMAT_R10G10B10A2_UINT,
           PIPE_FORMAT_B10G10R10A2_UINT },