vrend: query for GL_SHADER_BUFFER_OFFSET_ALIGNMENT

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

Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
gurchetansingh@chromium.org 7 years ago committed by Jakob Bornecrantz
parent 9ed16488b2
commit 8299313e14
  1. 1
      src/virgl_hw.h
  2. 7
      src/vrend_renderer.c

@ -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 {

@ -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;
}

Loading…
Cancel
Save