yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

OpenGL: Guarantee writes to Buffers.

This commit is contained in:
Fernando Sahmkow 2020-02-20 13:14:03 -04:00
parent 1fb516cd97
commit 131b342130
3 changed files with 2 additions and 4 deletions

View File

@ -52,7 +52,7 @@ Buffer OGLBufferCache::CreateBlock(VAddr cpu_addr, std::size_t size) {
} }
void OGLBufferCache::WriteBarrier() { void OGLBufferCache::WriteBarrier() {
glMemoryBarrier(GL_ALL_BARRIER_BITS); glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT);
} }
GLuint OGLBufferCache::ToHandle(const Buffer& buffer) { GLuint OGLBufferCache::ToHandle(const Buffer& buffer) {
@ -72,6 +72,7 @@ void OGLBufferCache::UploadBlockData(const Buffer& buffer, std::size_t offset, s
void OGLBufferCache::DownloadBlockData(const Buffer& buffer, std::size_t offset, std::size_t size, void OGLBufferCache::DownloadBlockData(const Buffer& buffer, std::size_t offset, std::size_t size,
u8* data) { u8* data) {
MICROPROFILE_SCOPE(OpenGL_Buffer_Download); MICROPROFILE_SCOPE(OpenGL_Buffer_Download);
glMemoryBarrier(GL_BUFFER_UPDATE_BARRIER_BIT);
glGetNamedBufferSubData(buffer->GetHandle(), static_cast<GLintptr>(offset), glGetNamedBufferSubData(buffer->GetHandle(), static_cast<GLintptr>(offset),
static_cast<GLsizeiptr>(size), data); static_cast<GLsizeiptr>(size), data);
} }

View File

@ -630,7 +630,6 @@ void RasterizerOpenGL::DispatchCompute(GPUVAddr code_addr) {
const auto& launch_desc = system.GPU().KeplerCompute().launch_description; const auto& launch_desc = system.GPU().KeplerCompute().launch_description;
glDispatchCompute(launch_desc.grid_dim_x, launch_desc.grid_dim_y, launch_desc.grid_dim_z); glDispatchCompute(launch_desc.grid_dim_x, launch_desc.grid_dim_y, launch_desc.grid_dim_z);
++num_queued_commands; ++num_queued_commands;
system.GPU().TickWork();
} }
void RasterizerOpenGL::ResetCounter(VideoCore::QueryType type) { void RasterizerOpenGL::ResetCounter(VideoCore::QueryType type) {

View File

@ -494,8 +494,6 @@ void RasterizerVulkan::DispatchCompute(GPUVAddr code_addr) {
descriptor_set, {}); descriptor_set, {});
cmdbuf.Dispatch(grid_x, grid_y, grid_z); cmdbuf.Dispatch(grid_x, grid_y, grid_z);
}); });
system.GPU().TickWork();
} }
void RasterizerVulkan::ResetCounter(VideoCore::QueryType type) { void RasterizerVulkan::ResetCounter(VideoCore::QueryType type) {