mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 22:05:38 +00:00
GPU/D3D11: Fix uniform buffer creation on Win7
This commit is contained in:
parent
eb6dbbfb13
commit
6fa8031569
|
@ -212,7 +212,7 @@ bool GPU_HW_D3D11::CreateVertexBuffer()
|
|||
|
||||
bool GPU_HW_D3D11::CreateUniformBuffer()
|
||||
{
|
||||
return m_uniform_stream_buffer.Create(m_device.Get(), D3D11_BIND_CONSTANT_BUFFER, UNIFORM_BUFFER_SIZE);
|
||||
return m_uniform_stream_buffer.Create(m_device.Get(), D3D11_BIND_CONSTANT_BUFFER, MAX_UNIFORM_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
bool GPU_HW_D3D11::CreateTextureBuffer()
|
||||
|
@ -403,7 +403,9 @@ bool GPU_HW_D3D11::CompileShaders()
|
|||
|
||||
void GPU_HW_D3D11::UploadUniformBlock(const void* data, u32 data_size)
|
||||
{
|
||||
const auto res = m_uniform_stream_buffer.Map(m_context.Get(), m_uniform_stream_buffer.GetSize(), data_size);
|
||||
Assert(data_size <= MAX_UNIFORM_BUFFER_SIZE);
|
||||
|
||||
const auto res = m_uniform_stream_buffer.Map(m_context.Get(), MAX_UNIFORM_BUFFER_SIZE, data_size);
|
||||
std::memcpy(res.pointer, data, data_size);
|
||||
m_uniform_stream_buffer.Unmap(m_context.Get(), data_size);
|
||||
|
||||
|
|
|
@ -38,6 +38,12 @@ protected:
|
|||
void UpdateVRAMReadTexture() override;
|
||||
|
||||
private:
|
||||
enum : u32
|
||||
{
|
||||
// Currently we don't stream uniforms, instead just re-map the buffer every time and let the driver take care of it.
|
||||
MAX_UNIFORM_BUFFER_SIZE = 64
|
||||
};
|
||||
|
||||
void SetCapabilities();
|
||||
bool CreateFramebuffer();
|
||||
void ClearFramebuffer();
|
||||
|
|
Loading…
Reference in a new issue