Re: [Mesa-dev] [RFC 15/21] mesa: Fix EXT_texture_sRGB functionality leaks
On Fri, Oct 23, 2015 at 3:01 PM, Nanley Cherywrote: > > > On Thu, Oct 22, 2015 at 12:15 PM, Chad Versace > wrote: > >> On Mon 19 Oct 2015, Nanley Chery wrote: >> > From: Nanley Chery >> > >> > Stop leaks into the following contexts: >> >* GLES in _mesa_base_tex_format() and lookup_view_class(). >> >* Pre-1.1 GL legacy contexts in all uses. >> > >> > Stop allowing compressed sRGB formats as valid formats in GLES3 >> > contexts. I realized this was happening when CTS failures occured after >> > fixing the extension functionality leak with the helper function. >> >> Do you mean that this patch *fixes* CTS failures? If so, which CTS for >> which GLES version? There are so many CTS's in the world :( >> > > I meant that when I first modified _mesa_base_tex_format() to use the > helper > function, I had failures in piglit, dEQP, and the Khronos CTS. "failures > in every > test-suite" probably would've been better than "CTS failures" here. It was > because of those failures, that I realized that we were incorrectly > allowing > formats like GL_COMPRESSED_SRGB_EXT in GLES contexts. This motivated > the split of the switch statement you see in the diff of > _mesa_base_tex_format(). > It seems that the note about what inspired this change is confusing (and likely unnecessary). I'll leave it out in the v2. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [RFC 15/21] mesa: Fix EXT_texture_sRGB functionality leaks
On Thu, Oct 22, 2015 at 12:15 PM, Chad Versacewrote: > On Mon 19 Oct 2015, Nanley Chery wrote: > > From: Nanley Chery > > > > Stop leaks into the following contexts: > >* GLES in _mesa_base_tex_format() and lookup_view_class(). > >* Pre-1.1 GL legacy contexts in all uses. > > > > Stop allowing compressed sRGB formats as valid formats in GLES3 > > contexts. I realized this was happening when CTS failures occured after > > fixing the extension functionality leak with the helper function. > > Do you mean that this patch *fixes* CTS failures? If so, which CTS for > which GLES version? There are so many CTS's in the world :( > I meant that when I first modified _mesa_base_tex_format() to use the helper function, I had failures in piglit, dEQP, and the Khronos CTS. "failures in every test-suite" probably would've been better than "CTS failures" here. It was because of those failures, that I realized that we were incorrectly allowing formats like GL_COMPRESSED_SRGB_EXT in GLES contexts. This motivated the split of the switch statement you see in the diff of _mesa_base_tex_format(). ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [RFC 15/21] mesa: Fix EXT_texture_sRGB functionality leaks
On Mon 19 Oct 2015, Nanley Chery wrote: > From: Nanley Chery> > Stop leaks into the following contexts: >* GLES in _mesa_base_tex_format() and lookup_view_class(). >* Pre-1.1 GL legacy contexts in all uses. > > Stop allowing compressed sRGB formats as valid formats in GLES3 > contexts. I realized this was happening when CTS failures occured after > fixing the extension functionality leak with the helper function. Do you mean that this patch *fixes* CTS failures? If so, which CTS for which GLES version? There are so many CTS's in the world :( ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [RFC 15/21] mesa: Fix EXT_texture_sRGB functionality leaks
On Tue, Oct 20, 2015 at 12:44 AM, Nanley Cherywrote: > From: Nanley Chery > > Stop leaks into the following contexts: >* GLES in _mesa_base_tex_format() and lookup_view_class(). >* Pre-1.1 GL legacy contexts in all uses. Fixing OpenGL 1.0? Seriously? Come on. :) Marek ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [RFC 15/21] mesa: Fix EXT_texture_sRGB functionality leaks
On Tue, Oct 20, 2015 at 8:32 AM, Marek Olšákwrote: > On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery > wrote: > > From: Nanley Chery > > > > Stop leaks into the following contexts: > >* GLES in _mesa_base_tex_format() and lookup_view_class(). > >* Pre-1.1 GL legacy contexts in all uses. > > Fixing OpenGL 1.0? Seriously? Come on. :) > > :) I was just notified (in the first patch's thread) that 1.2 is the minimum version advertised in Mesa. I'll have to update the comments in other such patches which mention pre 1.2 versions of GL. > Marek > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [RFC 15/21] mesa: Fix EXT_texture_sRGB functionality leaks
From: Nanley CheryStop leaks into the following contexts: * GLES in _mesa_base_tex_format() and lookup_view_class(). * Pre-1.1 GL legacy contexts in all uses. Stop allowing compressed sRGB formats as valid formats in GLES3 contexts. I realized this was happening when CTS failures occured after fixing the extension functionality leak with the helper function. The extension spec lists 1.1 as required for OpenGL, so update the extension table accordingly. Signed-off-by: Nanley Chery --- src/mesa/main/extensions_table.h | 2 +- src/mesa/main/glformats.c| 16 src/mesa/main/textureview.c | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 3729d22..cf6eed7 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -202,7 +202,7 @@ EXT(EXT_texture , dummy_true EXT(EXT_texture_rectangle , NV_texture_rectangle , GLL, x , x , x , 2004) EXT(EXT_texture_shared_exponent , EXT_texture_shared_exponent , GLL, GLC, x , x , 2004) EXT(EXT_texture_snorm , EXT_texture_snorm , GLL, GLC, x , x , 2009) -EXT(EXT_texture_sRGB, EXT_texture_sRGB , GLL, GLC, x , x , 2004) +EXT(EXT_texture_sRGB, EXT_texture_sRGB , 11, GLC, x , x , 2004) EXT(EXT_texture_sRGB_decode , EXT_texture_sRGB_decode , GLL, GLC, x , x , 2006) EXT(EXT_texture_swizzle , EXT_texture_swizzle , GLL, GLC, x , x , 2008) EXT(EXT_texture_type_2_10_10_10_REV , dummy_true , x , x , x , ES2, 2008) diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index f37b5da..9134d7d 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -1310,8 +1310,7 @@ _mesa_is_compressed_format(const struct gl_context *ctx, GLenum format) */ return ctx->Extensions.ANGLE_texture_compression_dxt; } else { - return _mesa_is_desktop_gl(ctx) -&& ctx->Extensions.EXT_texture_sRGB + return _mesa_has_EXT_texture_sRGB(ctx) && _mesa_has_EXT_texture_compression_s3tc(ctx); } case MESA_FORMAT_LAYOUT_FXT1: @@ -2354,14 +2353,23 @@ _mesa_base_tex_format(const struct gl_context *ctx, GLint internalFormat) } } - if (ctx->Extensions.EXT_texture_sRGB) { + if (_mesa_has_EXT_texture_sRGB(ctx) || + _mesa_is_gles3(ctx)) { switch (internalFormat) { case GL_SRGB_EXT: case GL_SRGB8_EXT: - case GL_COMPRESSED_SRGB_EXT: return GL_RGB; case GL_SRGB_ALPHA_EXT: case GL_SRGB8_ALPHA8_EXT: + return GL_RGBA; + default: + ; /* fallthrough */ + } + } + if (_mesa_has_EXT_texture_sRGB(ctx)) { + switch (internalFormat) { + case GL_COMPRESSED_SRGB_EXT: + return GL_RGB; case GL_COMPRESSED_SRGB_ALPHA_EXT: return GL_RGBA; case GL_SLUMINANCE_ALPHA_EXT: diff --git a/src/mesa/main/textureview.c b/src/mesa/main/textureview.c index 1ac46d6..c5b0175 100644 --- a/src/mesa/main/textureview.c +++ b/src/mesa/main/textureview.c @@ -177,7 +177,7 @@ lookup_view_class(const struct gl_context *ctx, GLenum internalformat) } if (_mesa_has_EXT_texture_compression_s3tc(ctx) && - ctx->Extensions.EXT_texture_sRGB) { + _mesa_has_EXT_texture_sRGB(ctx)) { for (i = 0; i < ARRAY_SIZE(s3tc_compatible_internal_formats); i++) { if (s3tc_compatible_internal_formats[i].internal_format == internalformat) -- 2.6.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev