diff --git a/rpcs3/Emu/RSX/GL/glutils/buffer_object.cpp b/rpcs3/Emu/RSX/GL/glutils/buffer_object.cpp index 5c1f0d0447..f3849718d0 100644 --- a/rpcs3/Emu/RSX/GL/glutils/buffer_object.cpp +++ b/rpcs3/Emu/RSX/GL/glutils/buffer_object.cpp @@ -131,6 +131,11 @@ namespace gl DSA_CALL2(NamedBufferSubData, m_id, offset, length, data); } + void buffer::fill(GLsizeiptr offset, GLsizeiptr length, GLuint pattern) + { + DSA_CALL2(ClearNamedBufferSubData, m_id, GL_R32UI, offset, length, GL_RED, GL_UNSIGNED_INT, &pattern); + } + GLubyte* buffer::map(GLsizeiptr offset, GLsizeiptr length, access access_) { ensure(m_memory_type == memory_type::host_visible); diff --git a/rpcs3/Emu/RSX/GL/glutils/buffer_object.h b/rpcs3/Emu/RSX/GL/glutils/buffer_object.h index dccb2a314e..28730bdd0d 100644 --- a/rpcs3/Emu/RSX/GL/glutils/buffer_object.h +++ b/rpcs3/Emu/RSX/GL/glutils/buffer_object.h @@ -15,7 +15,9 @@ namespace gl element_array = GL_ELEMENT_ARRAY_BUFFER, uniform = GL_UNIFORM_BUFFER, texture = GL_TEXTURE_BUFFER, - ssbo = GL_SHADER_STORAGE_BUFFER + ssbo = GL_SHADER_STORAGE_BUFFER, + copy_src = GL_COPY_READ_BUFFER, + copy_dst = GL_COPY_WRITE_BUFFER }; enum class access @@ -65,6 +67,8 @@ namespace gl case target::uniform: pname = GL_UNIFORM_BUFFER_BINDING; break; case target::texture: pname = GL_TEXTURE_BUFFER_BINDING; break; case target::ssbo: pname = GL_SHADER_STORAGE_BUFFER_BINDING; break; + case target::copy_src: pname = GL_COPY_READ_BUFFER_BINDING; break; + case target::copy_dst: pname = GL_COPY_WRITE_BUFFER_BINDING; break; default: fmt::throw_exception("Invalid binding state target (0x%x)", static_cast(target_)); } @@ -113,6 +117,7 @@ namespace gl void data(GLsizeiptr size, const void* data_ = nullptr, GLenum usage = GL_STREAM_DRAW); void sub_data(GLsizeiptr offset, GLsizeiptr length, const GLvoid* data); + void fill(GLsizeiptr offset, GLsizeiptr length, GLuint pattern); GLubyte* map(GLsizeiptr offset, GLsizeiptr length, access access_); void unmap();