mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
D3DState: Always update the m_pending members in the setters.
Fixes unintentional behaviour when a setter is called twice before the state is applied.
This commit is contained in:
parent
68a4cc6b72
commit
a2b43b21fe
@ -113,52 +113,42 @@ public:
|
||||
void SetTexture(u32 index, ID3D11ShaderResourceView* texture)
|
||||
{
|
||||
if (m_current.textures[index] != texture)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_Texture0 << index;
|
||||
m_pending.textures[index] = texture;
|
||||
}
|
||||
|
||||
m_pending.textures[index] = texture;
|
||||
}
|
||||
|
||||
void SetSampler(u32 index, ID3D11SamplerState* sampler)
|
||||
{
|
||||
if (m_current.samplers[index] != sampler)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_Sampler0 << index;
|
||||
m_pending.samplers[index] = sampler;
|
||||
}
|
||||
|
||||
m_pending.samplers[index] = sampler;
|
||||
}
|
||||
|
||||
void SetPixelConstants(ID3D11Buffer* buffer0, ID3D11Buffer* buffer1 = nullptr)
|
||||
{
|
||||
if (m_current.pixelConstants[0] != buffer0)
|
||||
{
|
||||
if (m_current.pixelConstants[0] != buffer0 || m_current.pixelConstants[1] != buffer1)
|
||||
m_dirtyFlags |= DirtyFlag_PixelConstants;
|
||||
m_pending.pixelConstants[0] = buffer0;
|
||||
}
|
||||
|
||||
if (m_current.pixelConstants[1] != buffer1)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_PixelConstants;
|
||||
m_pending.pixelConstants[1] = buffer1;
|
||||
}
|
||||
m_pending.pixelConstants[0] = buffer0;
|
||||
m_pending.pixelConstants[1] = buffer1;
|
||||
}
|
||||
|
||||
void SetVertexConstants(ID3D11Buffer* buffer)
|
||||
{
|
||||
if (m_current.vertexConstants != buffer)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_VertexConstants;
|
||||
m_pending.vertexConstants = buffer;
|
||||
}
|
||||
|
||||
m_pending.vertexConstants = buffer;
|
||||
}
|
||||
|
||||
void SetGeometryConstants(ID3D11Buffer* buffer)
|
||||
{
|
||||
if (m_current.geometryConstants != buffer)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_GeometryConstants;
|
||||
m_pending.geometryConstants = buffer;
|
||||
}
|
||||
|
||||
m_pending.geometryConstants = buffer;
|
||||
}
|
||||
|
||||
void SetVertexBuffer(ID3D11Buffer* buffer, u32 stride, u32 offset)
|
||||
@ -166,48 +156,43 @@ public:
|
||||
if (m_current.vertexBuffer != buffer ||
|
||||
m_current.vertexBufferStride != stride ||
|
||||
m_current.vertexBufferOffset != offset)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_VertexBuffer;
|
||||
m_pending.vertexBuffer = buffer;
|
||||
m_pending.vertexBufferStride = stride;
|
||||
m_pending.vertexBufferOffset = offset;
|
||||
}
|
||||
|
||||
m_pending.vertexBuffer = buffer;
|
||||
m_pending.vertexBufferStride = stride;
|
||||
m_pending.vertexBufferOffset = offset;
|
||||
}
|
||||
|
||||
void SetIndexBuffer(ID3D11Buffer* buffer)
|
||||
{
|
||||
if (m_current.indexBuffer != buffer)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_IndexBuffer;
|
||||
m_pending.indexBuffer = buffer;
|
||||
}
|
||||
|
||||
m_pending.indexBuffer = buffer;
|
||||
}
|
||||
|
||||
void SetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY topology)
|
||||
{
|
||||
if (m_current.topology != topology)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_InputAssembler;
|
||||
m_pending.topology = topology;
|
||||
}
|
||||
|
||||
m_pending.topology = topology;
|
||||
}
|
||||
|
||||
void SetInputLayout(ID3D11InputLayout* layout)
|
||||
{
|
||||
if (m_current.inputLayout != layout)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_InputAssembler;
|
||||
m_pending.inputLayout = layout;
|
||||
}
|
||||
|
||||
m_pending.inputLayout = layout;
|
||||
}
|
||||
|
||||
void SetPixelShader(ID3D11PixelShader* shader)
|
||||
{
|
||||
if (m_current.pixelShader != shader)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_PixelShader;
|
||||
m_pending.pixelShader = shader;
|
||||
}
|
||||
|
||||
m_pending.pixelShader = shader;
|
||||
}
|
||||
|
||||
void SetPixelShaderDynamic(ID3D11PixelShader* shader, ID3D11ClassInstance * const * classInstances, u32 classInstancesCount)
|
||||
@ -219,19 +204,17 @@ public:
|
||||
void SetVertexShader(ID3D11VertexShader* shader)
|
||||
{
|
||||
if (m_current.vertexShader != shader)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_VertexShader;
|
||||
m_pending.vertexShader = shader;
|
||||
}
|
||||
|
||||
m_pending.vertexShader = shader;
|
||||
}
|
||||
|
||||
void SetGeometryShader(ID3D11GeometryShader* shader)
|
||||
{
|
||||
if (m_current.geometryShader != shader)
|
||||
{
|
||||
m_dirtyFlags |= DirtyFlag_GeometryShader;
|
||||
m_pending.geometryShader = shader;
|
||||
}
|
||||
|
||||
m_pending.geometryShader = shader;
|
||||
}
|
||||
|
||||
// call this immediately before any drawing operation or to explicitly apply pending resource state changes
|
||||
|
Loading…
Reference in New Issue
Block a user