[virglrenderer-devel] [PATCH] vrend: query for GL_SHADER_BUFFER_OFFSET_ALIGNMENT
Gurchetan Singh
gurchetansingh at chromium.org
Fri Apr 13 01:01:11 UTC 2018
This is the SSBO analogue to 88444a. SSBOs are core in GL4.3 and
GLES31, so let's query for it.
This fixes 44 GLES31 tests on airlied@'s GLES31 sketch branches with
Nvidia hardware, but this patch standalone can be applied to master.
Example tests:
dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.0
dEQP-GLES31.functional.ssbo.layout.multi_basic_types.single_buffer.std430
---
src/virgl_hw.h | 1 +
src/vrend_renderer.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/virgl_hw.h b/src/virgl_hw.h
index b27b698..05a088c 100644
--- a/src/virgl_hw.h
+++ b/src/virgl_hw.h
@@ -291,6 +291,7 @@ struct virgl_caps_v2 {
uint32_t texture_buffer_offset_alignment;
uint32_t uniform_buffer_offset_alignment;
uint32_t tgsi_invariant;
+ uint32_t shader_buffer_offset_alignment;
};
union virgl_caps {
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index ef19fce..2fa0f2a 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -6678,6 +6678,9 @@ void vrend_renderer_fill_caps_gles(uint32_t set, uint32_t version,
glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &caps->v2.uniform_buffer_offset_alignment);
+ if (gles_ver >= 31)
+ glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &caps->v2.shader_buffer_offset_alignment);
+
/* Not available on GLES */
caps->v2.texture_buffer_offset_alignment = 0;
}
@@ -6872,8 +6875,10 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &caps->v2.uniform_buffer_offset_alignment);
- if (gl_ver >= 43)
+ if (gl_ver >= 43) {
glGetIntegerv(GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT, &caps->v2.texture_buffer_offset_alignment);
+ glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &caps->v2.shader_buffer_offset_alignment);
+ }
caps->v2.tgsi_invariant = 1;
}
--
2.17.0.484.g0c8726318c-goog
More information about the virglrenderer-devel
mailing list