radv: fix pre-computing viewport xform when setting new viewports
viewportCount is the number of viewports in pViewports while
firstViewport is the index.
Fixes new CTS dEQP-VK.draw.depth_clamp.*_clamp_four_viewports
Fixes: a2ef92d7a5 ("radv: pre-calculate viewport transforms")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12353>
This commit is contained in:
@@ -4412,8 +4412,11 @@ radv_CmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint3
|
||||
|
||||
memcpy(state->dynamic.viewport.viewports + firstViewport, pViewports,
|
||||
viewportCount * sizeof(*pViewports));
|
||||
for (unsigned i = firstViewport; i < firstViewport + viewportCount; i++)
|
||||
radv_get_viewport_xform(&pViewports[i], state->dynamic.viewport.xform[i].scale, state->dynamic.viewport.xform[i].translate);
|
||||
for (unsigned i = 0; i < viewportCount; i++) {
|
||||
radv_get_viewport_xform(&pViewports[i],
|
||||
state->dynamic.viewport.xform[i + firstViewport].scale,
|
||||
state->dynamic.viewport.xform[i + firstViewport].translate);
|
||||
}
|
||||
|
||||
state->dirty |= RADV_CMD_DIRTY_DYNAMIC_VIEWPORT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user