feat(gx): set d3d shader targets

This commit is contained in:
fallenoak 2023-03-09 21:45:15 -06:00 committed by GitHub
parent f818d5f397
commit 5d49ab72c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}