mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
svga: fix handling draw info
index_bias is undefined if index_size == 0. index bounds are undefined if index_bounds_valid == false. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>
This commit is contained in:
parent
609d25c161
commit
40c3a743ef
3 changed files with 8 additions and 6 deletions
|
|
@ -279,8 +279,8 @@ svga_hwtnl_draw_range_elements(struct svga_hwtnl *hwtnl,
|
|||
ret = svga_hwtnl_simple_draw_range_elements(hwtnl, index_buffer,
|
||||
info->index_size,
|
||||
info->index_bias,
|
||||
info->min_index,
|
||||
info->max_index,
|
||||
info->index_bounds_valid ? info->min_index : 0,
|
||||
info->index_bounds_valid ? info->max_index : ~0,
|
||||
gen_prim, index_offset, count,
|
||||
info->start_instance,
|
||||
info->instance_count,
|
||||
|
|
@ -307,8 +307,8 @@ svga_hwtnl_draw_range_elements(struct svga_hwtnl *hwtnl,
|
|||
gen_buf,
|
||||
gen_size,
|
||||
info->index_bias,
|
||||
info->min_index,
|
||||
info->max_index,
|
||||
info->index_bounds_valid ? info->min_index : 0,
|
||||
info->index_bounds_valid ? info->max_index : ~0,
|
||||
gen_prim, gen_offset,
|
||||
gen_nr,
|
||||
info->start_instance,
|
||||
|
|
|
|||
|
|
@ -265,8 +265,9 @@ svga_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info,
|
|||
* always start from 0 for DrawArrays and does not include baseVertex for
|
||||
* DrawIndexed.
|
||||
*/
|
||||
if (svga->curr.vertex_id_bias != (draws[0].start + info->index_bias)) {
|
||||
svga->curr.vertex_id_bias = draws[0].start + info->index_bias;
|
||||
unsigned index_bias = info->index_size ? info->index_bias : 0;
|
||||
if (svga->curr.vertex_id_bias != (draws[0].start + index_bias)) {
|
||||
svga->curr.vertex_id_bias = draws[0].start + index_bias;
|
||||
svga->dirty |= SVGA_NEW_VS_CONSTS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -330,6 +330,7 @@ svga_vbuf_render_draw_elements(struct vbuf_render *render,
|
|||
.start_instance = 0,
|
||||
.instance_count = 1,
|
||||
.index_bias = bias,
|
||||
.index_bounds_valid = true,
|
||||
.min_index = svga_render->min_index,
|
||||
.max_index = svga_render->max_index,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue