vrend_renderer: use GL_RGBA8UI instead of GL_RGBA8_SNORM

glTexBuffer doesn't accept GL_RGBA8_SNORM, so use GL_RGBA8UI
instead. Unfortunately, we can't use our texture table since
Gallium requests PIPE_FORMAT_R8_UNORM for texture buffers. For
normal sampler views, the correct semantics are passed down later,
but for images (where texture and image formats can differ) this
is not case.

Fixes:
   dEQP-GLES31.functional.image_load_store.buffer.format_reinterpret.rgba8ui_rgba8_snorm
   dEQP-GLES31.functional.image_load_store.buffer.format_reinterpret.r32ui_rgba8_snorm
   dEQP-GLES31.functional.image_load_store.buffer.format_reinterpret.rgba8i_rgba8_snorm
   dEQP-GLES31.functional.image_load_store.buffer.format_reinterpret.rgba8_rgba8_snorm

Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Gurchetan Singh 6 years ago committed by Jakob Bornecrantz
parent fd10f0a017
commit fe745cea60
  1. 5
      src/vrend_renderer.c

@ -3655,9 +3655,12 @@ static void vrend_draw_bind_images_shader(struct vrend_context *ctx, int shader_
if (!iview->texture->tbo_tex_id)
glGenTextures(1, &iview->texture->tbo_tex_id);
/* glTexBuffer doesn't accept GL_RGBA8_SNORM, find an appropriate replacement. */
uint32_t format = (iview->format == GL_RGBA8_SNORM) ? GL_RGBA8UI : iview->format;
glBindBufferARB(GL_TEXTURE_BUFFER, iview->texture->id);
glBindTexture(GL_TEXTURE_BUFFER, iview->texture->tbo_tex_id);
glTexBuffer(GL_TEXTURE_BUFFER, iview->format, iview->texture->id);
glTexBuffer(GL_TEXTURE_BUFFER, format, iview->texture->id);
tex_id = iview->texture->tbo_tex_id;
level = first_layer = 0;
layered = GL_TRUE;

Loading…
Cancel
Save