OSDN Git Service

i965: do not emit empty surface state
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 7 Aug 2018 19:31:20 +0000 (21:31 +0200)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 15 Aug 2018 22:23:16 +0000 (23:23 +0100)
If called with an empty size, brw_emit_buffer_surface_state asserts.
We already have a dedicated helper for uploading nothing, so let's use
that instead.

Avoids an assert in
dEQP-GLES31.functional.shaders.opaque_type_indexing.ssbo.const_literal_vertex
when running a debug build of i965.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index 9397b63..2aef0ef 100644 (file)
@@ -1322,6 +1322,11 @@ upload_buffer_surface(struct brw_context *brw,
       if (!binding->AutomaticSize)
          size = MIN2(size, binding->Size);
 
+      if (size == 0) {
+         emit_null_surface_state(brw, NULL, out_offset);
+         return;
+      }
+
       struct intel_buffer_object *iobj =
          intel_buffer_object(binding->BufferObject);
       struct brw_bo *bo =