diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-06-18 08:56:31 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-06-24 07:36:14 +0200 |
commit | 41a4090320ee52e914e8b4c789dfe14210794fed (patch) | |
tree | d6f21844e35ad9cda503b7b27d8a81f75dd0f97e /src/video_core/renderer_opengl/renderer_opengl.cpp | |
parent | gl_buffer_cache: Mark buffers as resident (diff) | |
download | yuzu-41a4090320ee52e914e8b4c789dfe14210794fed.tar yuzu-41a4090320ee52e914e8b4c789dfe14210794fed.tar.gz yuzu-41a4090320ee52e914e8b4c789dfe14210794fed.tar.bz2 yuzu-41a4090320ee52e914e8b4c789dfe14210794fed.tar.lz yuzu-41a4090320ee52e914e8b4c789dfe14210794fed.tar.xz yuzu-41a4090320ee52e914e8b4c789dfe14210794fed.tar.zst yuzu-41a4090320ee52e914e8b4c789dfe14210794fed.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/renderer_opengl.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 6214fcbc3..c40adb6e7 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -488,6 +488,15 @@ void RendererOpenGL::InitOpenGLObjects() { // Clear screen to black LoadColorToActiveGLTexture(0, 0, 0, 0, screen_info.texture); + + // Enable unified vertex attributes and query vertex buffer address when the driver supports it + if (device.HasVertexBufferUnifiedMemory()) { + glEnableClientState(GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV); + + glMakeNamedBufferResidentNV(vertex_buffer.handle, GL_READ_ONLY); + glGetNamedBufferParameterui64vNV(vertex_buffer.handle, GL_BUFFER_GPU_ADDRESS_NV, + &vertex_buffer_address); + } } void RendererOpenGL::AddTelemetryFields() { @@ -656,7 +665,13 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) { offsetof(ScreenRectVertex, tex_coord)); glVertexAttribBinding(PositionLocation, 0); glVertexAttribBinding(TexCoordLocation, 0); - glBindVertexBuffer(0, vertex_buffer.handle, 0, sizeof(ScreenRectVertex)); + if (device.HasVertexBufferUnifiedMemory()) { + glBindVertexBuffer(0, 0, 0, sizeof(ScreenRectVertex)); + glBufferAddressRangeNV(GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV, 0, vertex_buffer_address, + sizeof(vertices)); + } else { + glBindVertexBuffer(0, vertex_buffer.handle, 0, sizeof(ScreenRectVertex)); + } glBindTextureUnit(0, screen_info.display_texture); glBindSampler(0, 0); |