mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 01:24:11 +01:00
[d3d9] Respect specific mip size for implicit viewport in SetRenderTarget
Closes #1295
This commit is contained in:
parent
3cfc16ea34
commit
ebcab68822
@ -1134,19 +1134,22 @@ namespace dxvk {
|
|||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
|
|
||||||
if (RenderTargetIndex == 0) {
|
if (RenderTargetIndex == 0) {
|
||||||
|
uint32_t width = std::max(1u, desc->Width >> rt->GetMipLevel());
|
||||||
|
uint32_t height = std::max(1u, desc->Height >> rt->GetMipLevel());
|
||||||
|
|
||||||
D3DVIEWPORT9 viewport;
|
D3DVIEWPORT9 viewport;
|
||||||
viewport.X = 0;
|
viewport.X = 0;
|
||||||
viewport.Y = 0;
|
viewport.Y = 0;
|
||||||
viewport.Width = desc->Width;
|
viewport.Width = width;
|
||||||
viewport.Height = desc->Height;
|
viewport.Height = height;
|
||||||
viewport.MinZ = 0.0f;
|
viewport.MinZ = 0.0f;
|
||||||
viewport.MaxZ = 1.0f;
|
viewport.MaxZ = 1.0f;
|
||||||
|
|
||||||
RECT scissorRect;
|
RECT scissorRect;
|
||||||
scissorRect.left = 0;
|
scissorRect.left = 0;
|
||||||
scissorRect.top = 0;
|
scissorRect.top = 0;
|
||||||
scissorRect.right = desc->Width;
|
scissorRect.right = width;
|
||||||
scissorRect.bottom = desc->Height;
|
scissorRect.bottom = height;
|
||||||
|
|
||||||
if (m_state.viewport != viewport) {
|
if (m_state.viewport != viewport) {
|
||||||
m_flags.set(D3D9DeviceFlag::DirtyFFViewport);
|
m_flags.set(D3D9DeviceFlag::DirtyFFViewport);
|
||||||
|
Loading…
Reference in New Issue
Block a user