summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-06-26 06:14:06 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:39 +0200
commit5643a909bc3fa9f497d2f2e68650f823ed2944ac (patch)
tree9fd367abf424ed751d0053e22b7bc53ed6b4e61c /src/video_core
parentglsl: Fix shared and local memory declarations (diff)
downloadyuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar.gz
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar.bz2
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar.lz
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar.xz
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.tar.zst
yuzu-5643a909bc3fa9f497d2f2e68650f823ed2944ac.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index b8777643b..dab0afe6d 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -140,6 +140,26 @@ RendererOpenGL::RendererOpenGL(Core::TelemetrySession& telemetry_session_,
}
AddTelemetryFields();
InitOpenGLObjects();
+
+ // Initialize default attributes to match hardware's disabled attributes
+ GLint max_attribs{};
+ glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &max_attribs);
+ for (GLint attrib = 0; attrib < max_attribs; ++attrib) {
+ glVertexAttrib4f(attrib, 0.0f, 0.0f, 0.0f, 0.0f);
+ }
+ // Enable seamless cubemaps when per texture parameters are not available
+ 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;
@@ -256,21 +276,6 @@ void RendererOpenGL::InitOpenGLObjects() {
// Clear screen to black
LoadColorToActiveGLTexture(0, 0, 0, 0, screen_info.texture);
-
- // Enable seamless cubemaps when per texture parameters are not available
- 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);
- }
}
void RendererOpenGL::AddTelemetryFields() {