vrend: query for GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT / GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT

glBindBufferRange(..) in vrend_draw_bind_ubo is failing with
more than one uniform block. This is due to improper alignment
of the start of the second block. Let's query the proper
alignment from the driver and pass it back to Mesa.

Let's also query for GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT just in
case, even though don't use glTexBufferRange yet.

Fixes:
	dEQP-GLES3.functional.ubo.* on Nvidia

Example test:
       dEQP-GLES3.functional.ubo.multi_basic_types.single_buffer.shared_vertex

Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Gurchetan Singh 7 years ago committed by Dave Airlie
parent 7b1ab9831a
commit 88444a8ee8
  1. 2
      src/virgl_hw.h
  2. 5
      src/vrend_renderer.c

@ -284,6 +284,8 @@ struct virgl_caps_v2 {
int32_t max_texel_offset;
int32_t min_texture_gather_offset;
int32_t max_texture_gather_offset;
uint32_t texture_buffer_offset_alignment;
uint32_t uniform_buffer_offset_alignment;
};
union virgl_caps {

@ -6542,6 +6542,11 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
}
glGetIntegerv(GL_MIN_PROGRAM_TEXEL_OFFSET, &caps->v2.min_texel_offset);
glGetIntegerv(GL_MAX_PROGRAM_TEXEL_OFFSET, &caps->v2.max_texel_offset);
glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &caps->v2.uniform_buffer_offset_alignment);
if (gl_ver >= 43)
glGetIntegerv(GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT, &caps->v2.texture_buffer_offset_alignment);
}
GLint64 vrend_renderer_get_timestamp(void)

Loading…
Cancel
Save