diff options
author | Ameer J <52414509+ameerj@users.noreply.github.com> | 2023-12-19 21:53:36 +0100 |
---|---|---|
committer | Ameer J <52414509+ameerj@users.noreply.github.com> | 2023-12-19 23:13:23 +0100 |
commit | 372bca5945bc455e12bb9d309679e0bb8c00283d (patch) | |
tree | 6d8d5623c8d00bff1946534f3dd9bb9b0d369880 /src/video_core/renderer_opengl/renderer_opengl.cpp | |
parent | Merge pull request #12382 from liamwhite/image-limit (diff) | |
download | yuzu-372bca5945bc455e12bb9d309679e0bb8c00283d.tar yuzu-372bca5945bc455e12bb9d309679e0bb8c00283d.tar.gz yuzu-372bca5945bc455e12bb9d309679e0bb8c00283d.tar.bz2 yuzu-372bca5945bc455e12bb9d309679e0bb8c00283d.tar.lz yuzu-372bca5945bc455e12bb9d309679e0bb8c00283d.tar.xz yuzu-372bca5945bc455e12bb9d309679e0bb8c00283d.tar.zst yuzu-372bca5945bc455e12bb9d309679e0bb8c00283d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 7a4f0c5c1..2933718b6 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -168,6 +168,14 @@ RendererOpenGL::RendererOpenGL(Core::TelemetrySession& telemetry_session_, if (!GLAD_GL_ARB_seamless_cubemap_per_texture && !GLAD_GL_AMD_seamless_cubemap_per_texture) { glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); } + // Enable unified vertex attributes and query vertex buffer address when the driver supports it + if (device.HasVertexBufferUnifiedMemory()) { + glEnableClientState(GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV); + glEnableClientState(GL_ELEMENT_ARRAY_UNIFIED_NV); + glMakeNamedBufferResidentNV(vertex_buffer.handle, GL_READ_ONLY); + glGetNamedBufferParameterui64vNV(vertex_buffer.handle, GL_BUFFER_GPU_ADDRESS_NV, + &vertex_buffer_address); + } } RendererOpenGL::~RendererOpenGL() = default; @@ -667,7 +675,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)); + } if (Settings::values.scaling_filter.GetValue() != Settings::ScalingFilter::NearestNeighbor) { glBindSampler(0, present_sampler.handle); |