Commit 5e134b6b authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Implement scissor rectangle support for the Vulkan adapter.

No multi-viewport support yet. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 299eb1f5
...@@ -1462,7 +1462,9 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte ...@@ -1462,7 +1462,9 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
update = true; update = true;
} }
if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_VIEWPORT)) if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_VIEWPORT)
|| wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_SCISSORRECT)
|| wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_RASTERIZER))
{ {
key->viewport.x = state->viewports[0].x; key->viewport.x = state->viewports[0].x;
key->viewport.y = state->viewports[0].y; key->viewport.y = state->viewports[0].y;
...@@ -1471,10 +1473,22 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte ...@@ -1471,10 +1473,22 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
key->viewport.minDepth = state->viewports[0].min_z; key->viewport.minDepth = state->viewports[0].min_z;
key->viewport.maxDepth = state->viewports[0].max_z; key->viewport.maxDepth = state->viewports[0].max_z;
key->scissor.offset.x = key->viewport.x; if (state->rasterizer_state && state->rasterizer_state->desc.scissor)
key->scissor.offset.y = key->viewport.y; {
key->scissor.extent.width = key->viewport.width; const RECT *r = &state->scissor_rects[0];
key->scissor.extent.height = key->viewport.height;
key->scissor.offset.x = r->left;
key->scissor.offset.y = r->top;
key->scissor.extent.width = r->right - r->left;
key->scissor.extent.height = r->bottom - r->top;
}
else
{
key->scissor.offset.x = key->viewport.x;
key->scissor.offset.y = key->viewport.y;
key->scissor.extent.width = key->viewport.width;
key->scissor.extent.height = key->viewport.height;
}
key->viewport.y += key->viewport.height; key->viewport.y += key->viewport.height;
key->viewport.height = -key->viewport.height; key->viewport.height = -key->viewport.height;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment