Commit Graph

7493 Commits

Author SHA1 Message Date
PatrickvL eca8c82ea8 Fix Direct3D9 build, which broke after "Instead of having to deal with unsupported formats, lets just remove the whole EmuPC2XB_D3DFormat function..." 2024-06-25 21:34:34 +02:00
PatrickvL db1a3b327f Extract all Present calls into helper Cxbx_Present 2024-06-25 21:24:32 +02:00
PatrickvL 015696233c Fixup a few mis-mapped EMUFORMAT's 2024-06-25 21:24:32 +02:00
PatrickvL ca1b56454e Change CXBXFORMAT into EMUFORMAT 2024-06-20 17:58:17 +02:00
PatrickvL 1fec9fa344 Instead of having to deal with unsupported formats, lets just remove the whole EmuPC2XB_D3DFormat function, as there was only 1 place remaining that called it, which selected the input format just a few lines earlier. So instead, just select the Xbox format and skip the whole intermediate format type. We should have done that from the start... 2024-06-20 17:43:30 +02:00
PatrickvL 81b5380206 Declare CXBXFMT_* mappings once, using _9_11 macro
Replace D3DFORMAT by CXBXFORMAT in a few more places (including in disabled code in Direct3D9.cpp.unused-patches, just to conform it to most current X_ prefixed type declarations, similar to other types.
2024-06-19 17:49:14 +02:00
PatrickvL b132ede78b Slightly work towards CxbxSetRenderTarget 2024-06-19 16:53:38 +02:00
PatrickvL 5a3e54fadd Introduced Xbox version of X_D3DCOLOR 2024-06-19 16:02:25 +02:00
PatrickvL 6eb6665a42 Introduced Xbox version of X_D3DTRIPATCH_INFO, and required X_D3DBASISTYPE and X_D3DDEGREETYPE enums 2024-06-19 16:02:25 +02:00
PatrickvL d44d92e783 Introduced Xbox version of X_D3DRECTPATCH_INFO 2024-06-19 16:02:24 +02:00
PatrickvL 1bb692e067 Introduced Xbox version of X_D3DSTATEBLOCKTYPE (unused) 2024-06-19 16:02:24 +02:00
PatrickvL 1444955c39 Apply X_D3DCUBEMAP_FACES in disabled code, just to conform it to most current X_ prefixed type declarations, similar to other types. 2024-06-19 16:02:24 +02:00
PatrickvL 95e166772f Apply X_RECT in disabled code, just to conform it to most current X_ prefixed type declarations, similar to other types. 2024-06-19 16:02:23 +02:00
PatrickvL bf4d2d87f8 Apply X_D3DPOOL in disabled code, just to conform it to most current X_ prefixed type declarations, similar to other types. 2024-06-19 16:02:23 +02:00
PatrickvL 3dd7cb6224 Introduced Xbox version of X_D3DRECT (including its LOGRENDER) 2024-06-19 16:02:23 +02:00
PatrickvL 67a10a3b45 Introduced Xbox version of X_D3DMATRIX
Removed a few needless xbox:: prefixes from arguments of functions in the xbox namespace.
2024-06-19 16:02:22 +02:00
PatrickvL 2a089a9cca Introduced Xbox version of X_D3DBOX (including its LOGRENDER) 2024-06-19 16:02:22 +02:00
PatrickvL b55dc1367e Introduced Xbox version of X_D3DLOCKED_BOX (including its LOGRENDER) 2024-06-19 16:02:21 +02:00
PatrickvL f9f360de75 Introduced Xbox version of X_D3DLOCKED_RECT (including its LOGRENDER)
Aliassed D3DCOLOR under DX11
Aliassed D3DRECT under DX11 (and resolved x1/left etc)
Resolve scope by using namespace DirectX
2024-06-19 16:02:21 +02:00
PatrickvL 61b4472f16 Fixups after rebase (more is probably needed to get this compiling) 2024-06-19 15:58:56 +02:00
PatrickvL b884d16766 Started porting Clear
Ignore BeginScene and EndScene calls under D3D11
For D3D11, move a Present call to SwapChain
Replace a D3D9 SetRenderTarget call by CxbxSetRenderTarget
2024-06-19 15:52:31 +02:00
PatrickvL 377230bcf5 Ported GetBackBuffer 2024-06-19 15:52:31 +02:00
PatrickvL 475eb5deb9 Removed g_UseFixedFunctionVertexShader, as it never changes from true anymore.
Also removed related code that's no longer required either :
host D3DDevice calls to SetTransform and SetLightEnable,
and the EmuXB2PC_D3DTS tooling function.
2024-06-19 15:52:31 +02:00
PatrickvL 53acc42ad9 Avoid ImGui related crashes when render_base is removed 2024-06-19 15:52:31 +02:00
PatrickvL 391741a075 Ported vertex shader creation and activation
For this, introduced and used CxbxCreateVertexShader, and
refactored CxbxUpdateHostVertexShader, to perform local state tracking and switch active host vertex shader only when required
Removed ResetD3DDevice method
2024-06-19 15:52:30 +02:00
PatrickvL aa98efbc1a Introduced and used CxbxSetPixelShader, to perform local state tracking and switch active host pixel shader when required 2024-06-19 15:51:37 +02:00
PatrickvL a704afff26 Ported pixel shader creation and activation 2024-06-19 15:51:37 +02:00
PatrickvL 4a23347d78 Extended the NV2A register defines (completing the kelvin Nv097 set from other sources like recent xemu additions, so all credit to them, although they haven't copied over the defines we've added over the years).
And yeah, this commit doesn't really belong in the D3D11 port, but I figured it might as well be slipped in here, as having a few additional defines won't cause any harm and it's still nice to have this set as complete as we can.
2024-06-19 15:51:37 +02:00
PatrickvL 9c0f4a5991 Introduced Xbox version of D3DPOOL (which seems to be ignored in all XDK API's) 2024-06-19 15:51:37 +02:00
PatrickvL bd83d00b1b Introduced Xbox version of X_D3DBACKBUFFER_TYPE 2024-06-19 15:51:37 +02:00
PatrickvL 8e3651cb70 Introduced Xbox version of X_POINT and X_RECT (for now, aliassed to Windows types) 2024-06-19 15:51:37 +02:00
PatrickvL 824c840102 Introduced Xbox version of X_D3DDEVICE_CREATION_PARAMETERS (although D3DDevice_GetCreationParameters was the only function using this, but it's no longer patched) 2024-06-19 15:51:37 +02:00
PatrickvL 5225e9e609 Introduced Xbox version of HWND 2024-06-19 15:51:37 +02:00
PatrickvL 7a9382a79f Introduced Xbox version of D3DCUBEMAP_FACES 2024-06-19 15:51:37 +02:00
PatrickvL 67c6c4245f Introduced Xbox version of D3DDVTYPE 2024-06-19 15:51:37 +02:00
patrickvl f2529e8cb7 Reviewed texture formats 2024-06-19 15:51:37 +02:00
patrickvl 9baea76494 Ported texture creation and locking/unlocking
Also fixed a (small and probably irrelevant) bug in GetSurfaceFaceAndLevelWithinTexture : it looped over one face too many (7 instead of 6)!
2024-06-19 15:51:36 +02:00
PatrickvL 337755b325 Use feature level 10.0
Port CreateTexture
2024-06-19 15:51:36 +02:00
PatrickvL 11a0834b83 CxbxSetIndices() never returns anything
Copied over example CreateDevice initialization (probably won't compile)
Leave out g_pDirect3D and g_D3DCaps globals (no longer required in D3D11)
Call CheckFormatSupport from g_pD3DDevice (not g_pDirect3D)
Ported CreateQuery (using a D3D11_QUERY_DESC argument)
2024-06-19 15:51:36 +02:00
PatrickvL cd0bf92e50 Ported vertex attribute conversion from D3D9 (which uses DeclCaps) to D3D11 (which seemingly supports all vertex attribute formats we need, in feature level 10 already?)
Moved test-case mentions towards XboxVertexDeclarationConverter::VshConvertToken_STREAMDATA_REG() (as they would otherwide be removed along with the D3D9-only format conversions in CxbxVertexBufferConverter::ConvertStream())
2024-06-19 15:51:36 +02:00
PatrickvL d8e4d27841 Ported vertex attribute conversion from D3D9 (which uses DeclCaps) to D3D11 (which seemingly supports all vertex attribute formats we need, in feature level 10 already?)
Moved test-case mentions towards XboxVertexDeclarationConverter::VshConvertToken_STREAMDATA_REG() (as they would otherwide be removed along with the D3D9-only format conversions in CxbxVertexBufferConverter::ConvertStream())
2024-06-19 15:51:36 +02:00
PatrickvL 10e28379b4 Mapped D3D9 D3DDECLTYPE to D3D11 DXGI_FORMAT
Also a feeble attempt at converting part of the vertex declaration data
2024-06-19 15:51:36 +02:00
PatrickvL 32fae4a0e6 Took a stab at SetSamplerState > CreateSamplerState + PSSetSamplers
Temporary alias CXBXFORMAT, mapped to D3D9 D3DFORMAT or D3D11 DXGI_FORMAT
Mapped D3D9 D3DFORMAT's to D3D11 DXGI_FORMAT's (for as far as possible - needs more work)
Ported D3D9 CheckDeviceFormat to D3D11 CheckFormatSupport
2024-06-19 15:51:36 +02:00
PatrickvL 0531d0dff7 Introduced wrappers for the easy, one-to-one mappable D3D calls 2024-06-19 15:51:36 +02:00
PatrickvL 2cb703c24a Remove FullScreen_PresentationInterval alias
Make sure all code uses aliasses, so nothing but the aliasses refer to D3D 9 types (making it easier to spot all places where we have to convert to 11)
Remove unused symbol dwBytesRead
Fixed hint on missing argument to XB_InitializeObjectAttributes macro
2024-06-19 15:51:36 +02:00
PatrickvL 1413a604ef Removed some unused aliasses
Aliassed some more Dx11 symbols
2024-06-19 15:51:36 +02:00
PatrickvL 1668ed6779 Introduced a few Xbox D3D types that were until now aliassed to D3D9
Adjusted a few assignments that can now no longer rely on the copy operator.
Added D3DDevice_SetBackMaterial implementation (and trampoline)
Trampolined D3DDevice_SetMaterial and unpatched D3DDevice_GetMaterial
No longer call SetLight on host (fixed function won't be possible under DxD11 anyway)
2024-06-19 15:51:36 +02:00
PatrickvL 132fa33b8a Some preliminary interface mapping from DX9 to DX11 (nothing functional, and still using a conditional define, to keep things compiling for now) 2024-06-19 15:51:36 +02:00
Luke Usher 3515449200 Merge branch 'testbed' 2024-06-07 20:05:04 +01:00
Luke Usher 6aba34fe0d Merge branch 'master' of https://github.com/cxbx-reloaded/cxbx-reloaded 2024-06-07 20:04:53 +01:00