diff mbox

[Bug,97305] Wrong values returned by GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT & GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT randomly breaks stuff

Message ID bug-97305-502-1owMP5Gc41@http.bugs.freedesktop.org/ (mailing list archive)
State New, archived
Headers show

Commit Message

bugzilla-daemon@freedesktop.org Aug. 11, 2016, 8:30 p.m. UTC
https://bugs.freedesktop.org/show_bug.cgi?id=97305

--- Comment #3 from Matias N. Goldberg <dark_sylinc@yahoo.com.ar> ---
>> BEGIN PATCH

                if (pscreen->get_shader_param(pscreen, PIPE_SHADER_COMPUTE,

<< END PATCH


I'm playing safe by going with 256 bytes with everyone, based on the
overwhelming amount of reports (on the left top there's a dropdown, select
"All"); unless someone wants to go through the trouble of identifying each
card. Even in DX12 256 alignment is by spec:
http://delphigl.de/glcapsviewer/gl_stats_caps_single.php?listreportsbycap=GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT
http://delphigl.de/glcapsviewer/gl_stats_caps_single.php?listreportsbycap=GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT
http://delphigl.de/glcapsviewer/gl_stats_caps_single.php?listreportsbycap=GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT

I believe this patch could potentially increase radeonsi's compatibility
greatly and should be tested against popular game titles.
diff mbox

Patch

diff --git a/src/gallium/drivers/radeonsi/si_pipe.c
b/src/gallium/drivers/radeonsi/si_pipe.c
index 88f4f20..6a2d5bc 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -363,10 +363,11 @@  static int si_get_param(struct pipe_screen* pscreen, enum
pipe_cap param)

        case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
        case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
+               return 256;
        case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS:
                return 4;
        case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
-               return HAVE_LLVM >= 0x0309 ? 4 : 0;
+               return HAVE_LLVM >= 0x0309 ? 256 : 0;

        case PIPE_CAP_GLSL_FEATURE_LEVEL: