mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-17 12:58:55 +02:00
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:
@ -288,9 +288,25 @@ void VertexManager::UploadUniforms()
|
||||
pixel_shader_manager.dirty = false;
|
||||
}
|
||||
|
||||
if (pixel_shader_manager.custom_constants_dirty)
|
||||
{
|
||||
if (m_last_custom_pixel_buffer_size < pixel_shader_manager.custom_constants.size())
|
||||
{
|
||||
m_custom_pixel_constant_buffer =
|
||||
AllocateConstantBuffer(static_cast<u32>(pixel_shader_manager.custom_constants.size()));
|
||||
}
|
||||
UpdateConstantBuffer(m_custom_pixel_constant_buffer.Get(),
|
||||
pixel_shader_manager.custom_constants.data(),
|
||||
static_cast<u32>(pixel_shader_manager.custom_constants.size()));
|
||||
m_last_custom_pixel_buffer_size = pixel_shader_manager.custom_constants.size();
|
||||
pixel_shader_manager.custom_constants_dirty = false;
|
||||
}
|
||||
|
||||
D3D::stateman->SetPixelConstants(
|
||||
m_pixel_constant_buffer.Get(),
|
||||
g_ActiveConfig.bEnablePixelLighting ? m_vertex_constant_buffer.Get() : nullptr);
|
||||
g_ActiveConfig.bEnablePixelLighting ? m_vertex_constant_buffer.Get() : nullptr,
|
||||
pixel_shader_manager.custom_constants.empty() ? nullptr :
|
||||
m_custom_pixel_constant_buffer.Get());
|
||||
D3D::stateman->SetVertexConstants(m_vertex_constant_buffer.Get());
|
||||
D3D::stateman->SetGeometryConstants(m_geometry_constant_buffer.Get());
|
||||
}
|
||||
|
Reference in New Issue
Block a user