mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-05 07:39:17 +00:00
Use main buffers for utility draws
This commit is contained in:
parent
5ca18ff04e
commit
7afd5cc2fb
32 changed files with 533 additions and 681 deletions
|
@ -259,6 +259,21 @@ void ProgramShaderCache::UploadConstants()
|
|||
}
|
||||
}
|
||||
|
||||
void ProgramShaderCache::UploadConstants(const void* data, u32 data_size)
|
||||
{
|
||||
// allocate and copy
|
||||
const u32 alloc_size = Common::AlignUp(data_size, s_ubo_align);
|
||||
auto buffer = s_buffer->Map(alloc_size, s_ubo_align);
|
||||
std::memcpy(buffer.first, data, data_size);
|
||||
s_buffer->Unmap(alloc_size);
|
||||
|
||||
// bind the same sub-buffer to all stages
|
||||
for (u32 index = 1; index <= 3; index++)
|
||||
glBindBufferRange(GL_UNIFORM_BUFFER, index, s_buffer->m_buffer, buffer.second, data_size);
|
||||
|
||||
ADDSTAT(stats.thisFrame.bytesUniformStreamed, data_size);
|
||||
}
|
||||
|
||||
bool ProgramShaderCache::CompileShader(SHADER& shader, const std::string& vcode,
|
||||
const std::string& pcode, const std::string& gcode)
|
||||
{
|
||||
|
@ -539,6 +554,11 @@ void ProgramShaderCache::BindVertexFormat(const GLVertexFormat* vertex_format)
|
|||
s_last_VAO = new_VAO;
|
||||
}
|
||||
|
||||
bool ProgramShaderCache::IsValidVertexFormatBound()
|
||||
{
|
||||
return s_last_VAO != 0 && s_last_VAO != s_attributeless_VAO;
|
||||
}
|
||||
|
||||
void ProgramShaderCache::InvalidateVertexFormat()
|
||||
{
|
||||
s_last_VAO = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue