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

Author: Juan A. Suarez Romero <[email protected]>
Date:   Wed Sep  8 13:29:04 2021 +0200

mesa: fix default texture buffer format

According to ARB_tbo spec, default format is LUMINANCE8, but according
to core spec, it is R8.

This fixes piglit's spec@arb_texture_buffer_object@get test with drivers
supporting ARB_tbo spec but OpenGL/ES < 3.1.

v2:
 - Compare against compat profile (Ilia)

Reviewed-by: Ilia Mirkin <[email protected]>
Signed-off-by: Juan A. Suarez Romero <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12774>

---

 .gitlab-ci/windows/quick_gl.txt | 5 ++---
 src/mesa/main/texobj.c          | 5 +++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci/windows/quick_gl.txt b/.gitlab-ci/windows/quick_gl.txt
index 45365fdc52b..052823d94b5 100644
--- a/.gitlab-ci/windows/quick_gl.txt
+++ b/.gitlab-ci/windows/quick_gl.txt
@@ -2389,7 +2389,6 @@ 
spec/arb_texture_barrier/arb_texture_barrier-blending-in-shader 512 42 8 8 7: sk
 spec/arb_texture_barrier/arb_texture_barrier-blending-in-shader 512 42 8 8 8: 
skip
 spec/arb_texture_buffer_object/bufferstorage: skip
 spec/arb_texture_buffer_object/data-sync: fail
-spec/arb_texture_buffer_object/get: fail
 spec/arb_texture_buffer_object/indexed: skip
 spec/arb_texture_buffer_object/negative-unsupported: skip
 spec/arb_texture_buffer_object/subdata-sync: fail
@@ -4750,8 +4749,8 @@ wgl/wgl-sanity: skip
 summary:
        name:  results
        ----  --------
-       pass:    13302
-       fail:      536
+       pass:    13303
+       fail:      535
       crash:       67
        skip:     4126
     timeout:        0
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index b61fee5b9cf..ff594b04790 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -380,8 +380,9 @@ _mesa_initialize_texture_object( struct gl_context *ctx,
    obj->Sampler.Attrib.sRGBDecode = GL_DECODE_EXT;
    obj->Sampler.Attrib.ReductionMode = GL_WEIGHTED_AVERAGE_EXT;
    obj->Sampler.Attrib.state.reduction_mode = 
PIPE_TEX_REDUCTION_WEIGHTED_AVERAGE;
-   obj->BufferObjectFormat = GL_R8;
-   obj->_BufferObjectFormat = MESA_FORMAT_R_UNORM8;
+   obj->BufferObjectFormat = ctx->API == API_OPENGL_COMPAT ? GL_LUMINANCE8 : 
GL_R8;
+   obj->_BufferObjectFormat = ctx->API == API_OPENGL_COMPAT
+      ? MESA_FORMAT_L_UNORM8 : MESA_FORMAT_R_UNORM8;
    obj->Attrib.ImageFormatCompatibilityType = 
GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE;
 
    /* GL_ARB_bindless_texture */

Reply via email to