diff options
author | Rob Clark <[email protected]> | 2016-07-30 11:22:52 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-08-01 13:42:11 -0400 |
commit | 53b2b8bf6f12547a0dde25cfb8e6926ac144f5d8 (patch) | |
tree | 5698253ee4293671dcb38ba637c324d33e122ab3 /src/gallium/auxiliary/util | |
parent | e7c8c85785b3a8f29e3fc202988ac2414453586f (diff) |
u_vbuf: fix potentially bogus assert
There are cases where we hit u_vbuf path due to alignment or pitch-
alignment restrictions, but for an output-format that u_vbuf does not
support translating (yet the driver does support natively). In which
case we hit the memcpy() path and don't care that u_vbuf doesn't
understand it.
Fixes crash with debug build of mesa in:
dEQP-GLES3.functional.vertex_arrays.single_attribute.strides.fixed.user_ptr_stride17_components2_quads1
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95000
Signed-off-by: Rob Clark <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_vbuf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c index 5b4e527f030..532e7c004bf 100644 --- a/src/gallium/auxiliary/util/u_vbuf.c +++ b/src/gallium/auxiliary/util/u_vbuf.c @@ -627,6 +627,7 @@ u_vbuf_translate_begin(struct u_vbuf *mgr, for (i = 0; i < mgr->ve->count; i++) { struct translate_key *k; struct translate_element *te; + enum pipe_format output_format = mgr->ve->native_format[i]; unsigned bit, vb_index = mgr->ve->ve[i].vertex_buffer_index; bit = 1 << vb_index; @@ -644,7 +645,8 @@ u_vbuf_translate_begin(struct u_vbuf *mgr, } } assert(type < VB_NUM); - assert(translate_is_output_format_supported(mgr->ve->native_format[i])); + if (mgr->ve->ve[i].src_format != output_format) + assert(translate_is_output_format_supported(output_format)); /*printf("velem=%i type=%i\n", i, type);*/ /* Add the vertex element. */ @@ -657,7 +659,7 @@ u_vbuf_translate_begin(struct u_vbuf *mgr, te->input_buffer = vb_index; te->input_format = mgr->ve->ve[i].src_format; te->input_offset = mgr->ve->ve[i].src_offset; - te->output_format = mgr->ve->native_format[i]; + te->output_format = output_format; te->output_offset = k->output_stride; k->output_stride += mgr->ve->native_format_size[i]; |