VideoBackends / VideoCommon: add new uniform buffer object for custom shader materials (slot 3, geometry shader buffer moves to slot 4 if available)

This commit is contained in:
iwubcode
2023-09-19 19:29:38 -05:00
parent 92accc3ef7
commit b6d321bfb1
16 changed files with 214 additions and 83 deletions

View File

@ -91,13 +91,16 @@ public:
m_pending.samplers[index] = sampler;
}
void SetPixelConstants(ID3D11Buffer* buffer0, ID3D11Buffer* buffer1 = nullptr)
void SetPixelConstants(ID3D11Buffer* buffer0, ID3D11Buffer* buffer1 = nullptr,
ID3D11Buffer* buffer2 = nullptr)
{
if (m_current.pixelConstants[0] != buffer0 || m_current.pixelConstants[1] != buffer1)
if (m_current.pixelConstants[0] != buffer0 || m_current.pixelConstants[1] != buffer1 ||
m_current.pixelConstants[2] != buffer2)
m_dirtyFlags.set(DirtyFlag_PixelConstants);
m_pending.pixelConstants[0] = buffer0;
m_pending.pixelConstants[1] = buffer1;
m_pending.pixelConstants[2] = buffer2;
}
void SetVertexConstants(ID3D11Buffer* buffer)
@ -252,7 +255,7 @@ private:
{
std::array<ID3D11ShaderResourceView*, VideoCommon::MAX_PIXEL_SHADER_SAMPLERS> textures;
std::array<ID3D11SamplerState*, VideoCommon::MAX_PIXEL_SHADER_SAMPLERS> samplers;
std::array<ID3D11Buffer*, 2> pixelConstants;
std::array<ID3D11Buffer*, 3> pixelConstants;
ID3D11Buffer* vertexConstants;
ID3D11Buffer* geometryConstants;
ID3D11Buffer* vertexBuffer;