From 5d49ab72c44a4782de3f29b7304da79644374ece Mon Sep 17 00:00:00 2001 From: fallenoak Date: Thu, 9 Mar 2023 21:45:15 -0600 Subject: [PATCH] feat(gx): set d3d shader targets --- src/gx/d3d/CGxDeviceD3d.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/gx/d3d/CGxDeviceD3d.cpp b/src/gx/d3d/CGxDeviceD3d.cpp index 6e4f0ca..d930d71 100644 --- a/src/gx/d3d/CGxDeviceD3d.cpp +++ b/src/gx/d3d/CGxDeviceD3d.cpp @@ -674,7 +674,33 @@ void CGxDeviceD3d::ISetCaps(const CGxFormat& format) { // Shader targets - // TODO + auto pixelShaderVersion = this->m_d3dCaps.PixelShaderVersion; + + if (pixelShaderVersion >= D3DPS_VERSION(3, 0)) { + this->m_caps.m_pixelShaderTarget = GxShPS_ps_3_0; + } else if (pixelShaderVersion >= D3DPS_VERSION(2, 0)) { + this->m_caps.m_pixelShaderTarget = GxShPS_ps_2_0; + } else if (pixelShaderVersion >= D3DPS_VERSION(1, 4)) { + this->m_caps.m_pixelShaderTarget = GxShPS_ps_1_4; + } else if (pixelShaderVersion >= D3DPS_VERSION(1, 1)) { + this->m_caps.m_pixelShaderTarget = GxShPS_ps_1_1; + } + + if (this->m_caps.m_pixelShaderTarget != GxShPS_none) { + auto vertexShaderVersion = this->m_d3dCaps.VertexShaderVersion; + + if (vertexShaderVersion >= D3DVS_VERSION(3, 0)) { + this->m_caps.m_vertexShaderTarget = GxShVS_vs_3_0; + } else if (vertexShaderVersion >= D3DVS_VERSION(2, 0)) { + this->m_caps.m_vertexShaderTarget = GxShVS_vs_2_0; + } else if (vertexShaderVersion == D3DVS_VERSION(1, 1)) { + this->m_caps.m_vertexShaderTarget = GxShVS_vs_1_1; + } + + // TODO maxVertexShaderConst + } + + // TODO modify shader targets based on format // TODO }