mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 05:00:09 +01:00
gallium: fix draw info setup in draw and utilities
index_bias is undefined if index_size == 0. index bounds are undefined if index_bounds_valid == false. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>
This commit is contained in:
parent
05f35a50e3
commit
26dcbdb8e2
3 changed files with 5 additions and 4 deletions
|
|
@ -502,9 +502,9 @@ draw_vbo(struct draw_context *draw,
|
|||
|
||||
count = draws[0].count;
|
||||
|
||||
draw->pt.user.eltBias = info->index_bias;
|
||||
draw->pt.user.min_index = info->min_index;
|
||||
draw->pt.user.max_index = info->max_index;
|
||||
draw->pt.user.eltBias = info->index_size ? info->index_bias : 0;
|
||||
draw->pt.user.min_index = info->index_bounds_valid ? info->min_index : 0;
|
||||
draw->pt.user.max_index = info->index_bounds_valid ? info->max_index : ~0;
|
||||
draw->pt.user.eltSize = info->index_size ? draw->pt.user.eltSizeIB : 0;
|
||||
draw->pt.user.drawid = info->drawid;
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ util_primconvert_draw_vbo(struct primconvert_context *pc,
|
|||
new_info.index_bounds_valid = info->index_bounds_valid;
|
||||
new_info.min_index = info->min_index;
|
||||
new_info.max_index = info->max_index;
|
||||
new_info.index_bias = info->index_bias;
|
||||
new_info.index_bias = info->index_size ? info->index_bias : 0;
|
||||
new_info.start_instance = info->start_instance;
|
||||
new_info.instance_count = info->instance_count;
|
||||
new_info.primitive_restart = info->primitive_restart;
|
||||
|
|
|
|||
|
|
@ -1534,6 +1534,7 @@ void u_vbuf_draw_vbo(struct u_vbuf *mgr, const struct pipe_draw_info *info,
|
|||
if (unroll_indices) {
|
||||
new_info.index_size = 0;
|
||||
new_info.index_bias = 0;
|
||||
new_info.index_bounds_valid = true;
|
||||
new_info.min_index = 0;
|
||||
new_info.max_index = new_draw.count - 1;
|
||||
new_draw.start = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue