-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vkd3d: Implement negative viewport height feature. #1611
vkd3d: Implement negative viewport height feature. #1611
Conversation
tests/d3d12_command.c
Outdated
vbv.SizeInBytes = sizeof(quad); | ||
|
||
set_viewport(&viewport, 0, context.render_target_desc.Height, | ||
context.render_target_desc.Width, -(float)context.render_target_desc.Height, 0.0f, 1.0f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a viewport test like this should test 4 draw calls targeting 4 quadrants to make sure the intended X / Y offsets end up where we expect.
Might as well throw InvertedViewportDepthFlipsZSupported in there and render different depths per quadrant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, done. PTAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smol nits.
800f469
to
3200a4c
Compare
3200a4c
to
1f3ef19
Compare
tests/d3d12_command.c
Outdated
quads[4][4] = | ||
{ | ||
{ | ||
{{0.0f, 1.0f, 1.0f, 1.0f}, {0.1f, 0.1f}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is flat TEXCOORD input here to PS, so it does not verify that Y-flip actually happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to a variable TEXCOORD Y.
tests/d3d12_command.c
Outdated
float4 main(float4 position : SV_Position, | ||
float2 texcoord : TEXCOORD) : SV_Target | ||
{ | ||
return float4(position.xyz, texcoord.x); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be texcoord.y here I think, since that will be "flipped" when viewport is flipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, changed to output y.
tests/d3d12_command.c
Outdated
|
||
for (i = 0; i < 4; i++) | ||
{ | ||
ID3D12GraphicsCommandList_IASetVertexBuffers(command_list, 0, 1, &vbvs[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that we need 4 different RSSetViewports here rather than using the VBO to do the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, PTAL.
These features correspond to Vulkan-native functionality.
1f3ef19
to
f478f64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passes on both AMD and NV. LGTM.
This mirrors a Vulkan feature and doesn't require any emulation.
@HansKristian-Work LMK if you'd prefer I de-duplicate the test code.