Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- v2: Added a reference to the spec that mandates this. --- dlls/wined3d/context_vk.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index fbc1e294fcd..83b1d081514 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -2204,6 +2204,11 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte key->scissor.extent.width = key->viewport.width; key->scissor.extent.height = key->viewport.height; } + /* Scissor offsets need to be non-negative (VUID-VkPipelineViewportStateCreateInfo-x-02821) */ + if (key->scissor.offset.x < 0) + key->scissor.offset.x = 0; + if (key->scissor.offset.y < 0) + key->scissor.offset.y = 0; key->viewport.y += key->viewport.height; key->viewport.height = -key->viewport.height;
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 191df67a41d..95d7c847720 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -11550,6 +11550,23 @@ static void test_scissor(void) color = get_texture_color(test_context.backbuffer, 320, 420); ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color);
+ set_viewport(immediate_context, -1.0f, 0.0f, 641, 480, 0.0f, 1.0f); + SetRect(&scissor_rect, -1, 0, 640, 480); + ID3D11DeviceContext_RSSetScissorRects(immediate_context, 1, &scissor_rect); + ID3D11DeviceContext_ClearRenderTargetView(immediate_context, test_context.backbuffer_rtv, red); + check_texture_color(test_context.backbuffer, 0xff0000ff, 1); + draw_color_quad(&test_context, &green); + color = get_texture_color(test_context.backbuffer, 320, 60); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(test_context.backbuffer, 80, 240); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(test_context.backbuffer, 320, 240); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(test_context.backbuffer, 560, 240); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(test_context.backbuffer, 320, 420); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + ID3D11RasterizerState_Release(rs); release_test_context(&test_context); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=89893
Your paranoid android.
=== w1064v1809 (32 bit report) ===
d3d11: d3d11.c:5811: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5812: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5813: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5816: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5817: Test failed: Got unexpected CPrimitives count: 0.
=== w1064 (32 bit report) ===
d3d11: d3d11.c:5658: Test failed: Got unexpected query result 0x0000000000000000. d3d11.c:5811: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5812: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5813: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5816: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5817: Test failed: Got unexpected CPrimitives count: 0.
=== w10pro64 (32 bit report) ===
d3d11: d3d11.c:5811: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5812: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5813: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5816: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5817: Test failed: Got unexpected CPrimitives count: 0.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d10core/tests/d3d10core.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index ccddb401aed..d23857a14bf 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -5067,6 +5067,23 @@ static void test_scissor(void) color = get_texture_color(test_context.backbuffer, 320, 420); ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color);
+ set_viewport(device, -1.0f, 0.0f, 641, 480, 0.0f, 1.0f); + SetRect(&scissor_rect, -1, 0, 640, 480); + ID3D10Device_RSSetScissorRects(device, 1, &scissor_rect); + ID3D10Device_ClearRenderTargetView(device, test_context.backbuffer_rtv, red); + check_texture_color(test_context.backbuffer, 0xff0000ff, 1); + draw_color_quad(&test_context, &green); + color = get_texture_color(test_context.backbuffer, 320, 60); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(test_context.backbuffer, 80, 240); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(test_context.backbuffer, 320, 240); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(test_context.backbuffer, 560, 240); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(test_context.backbuffer, 320, 420); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + ID3D10RasterizerState_Release(rs); release_test_context(&test_context); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=89894
Your paranoid android.
=== w10pro64_ja (64 bit report) ===
d3d10core: d3d10core.c:4651: Test failed: Got unexpected query result 0x0000000000000000.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com