[Mesa-dev] [PATCH 1/2] mesa: add glRenderbufferStorage support for EXT_texture_norm16 formats

Tapani Pälli tapani.palli at intel.com
Wed Jul 25 05:24:28 UTC 2018



On 07/25/2018 12:45 AM, Nanley Chery wrote:
> On Tue, Jul 24, 2018 at 08:58:20AM +0300, Tapani Pälli wrote:
>> These bits were missing, found when extending the Piglit test.
>>
>> Fixes: 7f467d4f73 "mesa: GL_EXT_texture_norm16 extension plumbing"
>> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
>> ---
>>   src/mesa/main/fbobject.c | 10 +++++++---
>>   1 file changed, 7 insertions(+), 3 deletions(-)
>>
> 
> Shouldn't we also update is_format_color_renderable?

No need since these formats are not rejected by 
is_format_color_renderable. They were added previously to 
_mesa_is_es3_color_renderable.

> Nonetheless, this series is an improvement and is
> Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>

Thanks!

>> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
>> index fa7a9361df..679e206c71 100644
>> --- a/src/mesa/main/fbobject.c
>> +++ b/src/mesa/main/fbobject.c
>> @@ -1927,8 +1927,10 @@ _mesa_base_fbo_format(const struct gl_context *ctx, GLenum internalFormat)
>>      case GL_RGBA:
>>      case GL_RGBA2:
>>      case GL_RGBA12:
>> -   case GL_RGBA16:
>>         return _mesa_is_desktop_gl(ctx) ? GL_RGBA : 0;
>> +   case GL_RGBA16:
>> +      return _mesa_is_desktop_gl(ctx) || _mesa_has_EXT_texture_norm16(ctx)
>> +         ? GL_RGBA : 0;
>>      case GL_RGB10_A2:
>>      case GL_SRGB8_ALPHA8_EXT:
>>         return _mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx) ? GL_RGBA : 0;
>> @@ -1963,15 +1965,17 @@ _mesa_base_fbo_format(const struct gl_context *ctx, GLenum internalFormat)
>>                ctx->Extensions.ARB_depth_buffer_float)
>>            ? GL_DEPTH_STENCIL : 0;
>>      case GL_RED:
>> +      return _mesa_has_ARB_texture_rg(ctx) ? GL_RED : 0;
>>      case GL_R16:
>> -      return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_rg
>> +      return _mesa_has_ARB_texture_rg(ctx) || _mesa_has_EXT_texture_norm16(ctx)
>>            ? GL_RED : 0;
>>      case GL_R8:
>>         return ctx->API != API_OPENGLES && ctx->Extensions.ARB_texture_rg
>>            ? GL_RED : 0;
>>      case GL_RG:
>> +      return _mesa_has_ARB_texture_rg(ctx) ? GL_RG : 0;
>>      case GL_RG16:
>> -      return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_rg
>> +      return _mesa_has_ARB_texture_rg(ctx) || _mesa_has_EXT_texture_norm16(ctx)
>>            ? GL_RG : 0;
>>      case GL_RG8:
>>         return ctx->API != API_OPENGLES && ctx->Extensions.ARB_texture_rg
>> -- 
>> 2.14.4
>>


More information about the mesa-dev mailing list