diff options
author | Krzysztof Raszkowski <[email protected]> | 2020-02-21 14:05:33 +0100 |
---|---|---|
committer | Krzysztof Raszkowski <[email protected]> | 2020-02-24 10:27:23 +0000 |
commit | 5e9a2c603f38308f7027d6a5e4575e5fc24c1bd5 (patch) | |
tree | 34b1786ccb15c335d5a23d4973c7505bd78733ce /src/gallium/drivers/swr | |
parent | 4d57a2750485e51b34e0bc413100e4e2787a4e84 (diff) |
gallium/swr: Fix min/max range index draw
Reviewed-by: Jan Zielinski <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3905>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3905>
Diffstat (limited to 'src/gallium/drivers/swr')
-rw-r--r-- | src/gallium/drivers/swr/swr_state.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp index 625f0050ad5..2967dd233cd 100644 --- a/src/gallium/drivers/swr/swr_state.cpp +++ b/src/gallium/drivers/swr/swr_state.cpp @@ -51,6 +51,7 @@ #include "util/u_framebuffer.h" #include "util/u_viewport.h" #include "util/u_prim.h" +#include "util/u_vbuf.h" #include "swr_state.h" #include "swr_context.h" @@ -1399,8 +1400,12 @@ swr_update_derived(struct pipe_context *pipe, /* Set vertex & index buffers */ if (ctx->dirty & SWR_NEW_VERTEX) { - const struct pipe_draw_info &info = *p_draw_info; - + struct pipe_draw_info info = *p_draw_info; + /* SWR always need min/max index info for index draw, + * compute it if upper layer does not do for us */ + if (info.index_size > 0 && info.max_index == ~0u) { + u_vbuf_get_minmax_index(pipe, &info, &(info.min_index), &(info.max_index)); + } /* vertex buffers */ SWR_VERTEX_BUFFER_STATE swrVertexBuffers[PIPE_MAX_ATTRIBS]; for (UINT i = 0; i < ctx->num_vertex_buffers; i++) { |