diff options
author | Lionel Landwerlin <[email protected]> | 2016-11-03 17:18:45 +0000 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2016-11-18 13:27:28 +0000 |
commit | 9a806d2d15d9ec9e11087e4bd7dd390e4263309c (patch) | |
tree | 0874912cd052e0893552ceb959530185765af993 /src/mesa/main | |
parent | 88fe2c308ec0902b8f3980f9ce6ab6241ba74c14 (diff) |
mesa: add NV_image_formats extension support
This extension can be enabled automatically as it is a subset of
ARB_shader_image_load_store.
v2: Replace helper function by qualifier struct field (Ilia)
Enable NV_image_formats using ARB_shader_image_load_store (Ilia)
v3: Drop extension field from gl_extensions (Ilia)
Release notes (Ilia)
Signed-off-by: Lionel Landwerlin <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98480
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/extensions_table.h | 1 | ||||
-rw-r--r-- | src/mesa/main/shaderimage.c | 22 |
2 files changed, 17 insertions, 6 deletions
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 036e62b23e5..d3ec551282c 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -315,6 +315,7 @@ EXT(NV_depth_clamp , ARB_depth_clamp EXT(NV_draw_buffers , dummy_true , x , x , x , ES2, 2011) EXT(NV_fbo_color_attachments , dummy_true , x , x , x , ES2, 2010) EXT(NV_fog_distance , NV_fog_distance , GLL, x , x , x , 2001) +EXT(NV_image_formats , ARB_shader_image_load_store , x , x , x , 31, 2014) EXT(NV_light_max_exponent , dummy_true , GLL, x , x , x , 1999) EXT(NV_packed_depth_stencil , dummy_true , GLL, GLC, x , x , 2000) EXT(NV_point_sprite , NV_point_sprite , GLL, GLC, x , x , 2001) diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c index db36e3bb101..5cce3acd157 100644 --- a/src/mesa/main/shaderimage.c +++ b/src/mesa/main/shaderimage.c @@ -401,7 +401,7 @@ _mesa_is_shader_image_format_supported(const struct gl_context *ctx, /* Formats supported on unextended desktop GL and the original * ARB_shader_image_load_store extension, c.f. table 3.21 of the OpenGL 4.2 - * specification. + * specification or by GLES 3.1 with GL_NV_image_formats extension. */ case GL_RG32F: case GL_RG16F: @@ -418,17 +418,27 @@ _mesa_is_shader_image_format_supported(const struct gl_context *ctx, case GL_RG8I: case GL_R16I: case GL_R8I: - case GL_RGBA16: case GL_RGB10_A2: - case GL_RG16: case GL_RG8: - case GL_R16: case GL_R8: + case GL_RG8_SNORM: + case GL_R8_SNORM: + return true; + + /* Formats supported on unextended desktop GL and the original + * ARB_shader_image_load_store extension, c.f. table 3.21 of the OpenGL 4.2 + * specification. + * + * These can be supported by GLES 3.1 with GL_NV_image_formats & + * GL_EXT_texture_norm16 extensions but we don't have support for the + * latter in Mesa yet. + */ + case GL_RGBA16: case GL_RGBA16_SNORM: + case GL_RG16: case GL_RG16_SNORM: - case GL_RG8_SNORM: + case GL_R16: case GL_R16_SNORM: - case GL_R8_SNORM: return _mesa_is_desktop_gl(ctx); default: |