Skip to content

Commit

Permalink
[d3d8] Adjust d3d8 device capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterSnowfall committed Jul 3, 2023
1 parent 8dd7d2f commit 4f8a597
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions src/d3d8/d3d8_d3d9_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,40 @@ namespace dxvk {
// should be aligned
std::memcpy(pCaps8, &caps9, sizeof(D3DCAPS8));

// Max supported shader model is 1.4
pCaps8->VertexShaderVersion = D3DVS_VERSION(1, 4);
// Max supported shader model is 1.4 (1.1 for VS)
pCaps8->VertexShaderVersion = D3DVS_VERSION(1, 1);
pCaps8->PixelShaderVersion = D3DPS_VERSION(1, 4);

pCaps8->Caps2 &= ~D3DCAPS2_CANAUTOGENMIPMAP;
// This was removed by D3D9. We can probably render windowed.
pCaps8->Caps2 |= D3DCAPS2_CANRENDERWINDOWED;

pCaps8->Caps3 &= ~D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION
& ~D3DCAPS3_COPY_TO_VIDMEM
& ~D3DCAPS3_COPY_TO_SYSTEMMEM;

pCaps8->PrimitiveMiscCaps &= ~D3DPMISCCAPS_INDEPENDENTWRITEMASKS
& ~D3DPMISCCAPS_PERSTAGECONSTANT
& ~D3DPMISCCAPS_FOGANDSPECULARALPHA
& ~D3DPMISCCAPS_SEPARATEALPHABLEND
& ~D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS
& ~D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING
& ~D3DPMISCCAPS_FOGVERTEXCLAMPED
& ~D3DPMISCCAPS_POSTBLENDSRGBCONVERT;

pCaps8->RasterCaps &= ~D3DPRASTERCAPS_SCISSORTEST
& ~D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS
& ~D3DPRASTERCAPS_DEPTHBIAS
& ~D3DPRASTERCAPS_MULTISAMPLE_TOGGLE;
// Replaced by D3DPRASTERCAPS_DEPTHBIAS in D3D9
pCaps8->RasterCaps |= D3DPRASTERCAPS_ZBIAS;

pCaps8->SrcBlendCaps &= ~D3DPBLENDCAPS_INVSRCCOLOR2
& ~D3DPBLENDCAPS_SRCCOLOR2;

pCaps8->LineCaps &= ~D3DLINECAPS_ANTIALIAS;

pCaps8->StencilCaps &= ~D3DSTENCILCAPS_TWOSIDED;
}

// (9<-8) D3DD3DPRESENT_PARAMETERS: Returns D3D9's params given an input for D3D8
Expand Down

0 comments on commit 4f8a597

Please sign in to comment.