Module: Mesa
Branch: main
Commit: 782fb8966bd59a40b905b17804c493a76fdea7a0
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=782fb8966bd59a40b905b17804c493a76fdea7a0

Author: Erik Faye-Lund <erik.faye-l...@collabora.com>
Date:   Wed Jan  3 11:20:25 2024 +0100

mesa: actually check for EXT_color_buffer_float support

EXT_color_buffer_float makes both 16 and 32 bit floating-point texture
formats color-renderable. We can't just unconditionally report that, we
need to check for support.

The RGB formats are a bit special under this extension, because it's not
specified as color-renderable. However, because the RGBA formats *are*
specified as color-renderable, and the state-tracker can emulate the RGB
formats with the RGBA ones, we don't need to test for that here.

While we're at it, move EXT_color_buffer_half_float to its correct
sorted position.

Reviewed-by: Tapani Pälli <tapani.pa...@intel.com>
Reviewed-by: Marek Olšák <marek.ol...@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26870>

---

 src/mesa/main/consts_exts.h            | 3 ++-
 src/mesa/main/extensions_table.h       | 2 +-
 src/mesa/state_tracker/st_extensions.c | 8 ++++++++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/consts_exts.h b/src/mesa/main/consts_exts.h
index 5f68df7bc29..657df071324 100644
--- a/src/mesa/main/consts_exts.h
+++ b/src/mesa/main/consts_exts.h
@@ -64,7 +64,6 @@ struct gl_extensions
    GLboolean ARB_conservative_depth;
    GLboolean ARB_copy_image;
    GLboolean ARB_cull_distance;
-   GLboolean EXT_color_buffer_half_float;
    GLboolean ARB_depth_buffer_float;
    GLboolean ARB_depth_clamp;
    GLboolean ARB_derivative_control;
@@ -161,6 +160,8 @@ struct gl_extensions
    GLboolean ARB_vertex_type_2_10_10_10_rev;
    GLboolean ARB_viewport_array;
    GLboolean EXT_blend_equation_separate;
+   GLboolean EXT_color_buffer_float;
+   GLboolean EXT_color_buffer_half_float;
    GLboolean EXT_demote_to_helper_invocation;
    GLboolean EXT_depth_bounds_test;
    GLboolean EXT_disjoint_timer_query;
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index c4ed8c64415..417ffe2a905 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -227,7 +227,7 @@ EXT(EXT_buffer_storage                      , 
ARB_buffer_storage
 EXT(EXT_clear_texture                       , dummy_true                       
      ,  x ,  x ,  x ,  31, 2016)
 EXT(EXT_clip_control                        , ARB_clip_control                 
      ,  x ,  x ,  x , ES2, 2017)
 EXT(EXT_clip_cull_distance                  , ARB_cull_distance                
      ,  x ,  x ,  x ,  30, 2016)
-EXT(EXT_color_buffer_float                  , dummy_true                       
      ,  x ,  x ,  x ,  30, 2013)
+EXT(EXT_color_buffer_float                  , EXT_color_buffer_float           
      ,  x ,  x ,  x ,  30, 2013)
 EXT(EXT_color_buffer_half_float             , EXT_color_buffer_half_float      
      ,  x ,  x ,  x ,  20, 2017)
 EXT(EXT_compiled_vertex_array               , dummy_true                       
      , GLL,  x ,  x ,  x , 1996)
 EXT(EXT_compressed_ETC1_RGB8_sub_texture    , OES_compressed_ETC1_RGB8_texture 
      ,  x ,  x , ES1, ES2, 2014)
diff --git a/src/mesa/state_tracker/st_extensions.c 
b/src/mesa/state_tracker/st_extensions.c
index bdcb48e39e2..1b36fcf68dc 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -916,6 +916,14 @@ void st_init_extensions(struct pipe_screen *screen,
         { PIPE_FORMAT_R16_FLOAT,
           PIPE_FORMAT_R16G16_FLOAT,
           PIPE_FORMAT_R16G16B16A16_FLOAT } },
+
+      { { o(EXT_color_buffer_float) },
+        { PIPE_FORMAT_R16_FLOAT,
+          PIPE_FORMAT_R16G16_FLOAT,
+          PIPE_FORMAT_R16G16B16A16_FLOAT,
+          PIPE_FORMAT_R32_FLOAT,
+          PIPE_FORMAT_R32G32_FLOAT,
+          PIPE_FORMAT_R32G32B32A32_FLOAT } },
    };
 
    /* Required: render target, sampler, and blending */

Reply via email to