summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp8
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp19
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h10
3 files changed, 13 insertions, 24 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index d7328ff39..0e205ed72 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -75,14 +75,6 @@ void Maxwell3D::WriteReg(u32 method, u32 value, u32 remaining_params) {
75 ProcessMacroUpload(value); 75 ProcessMacroUpload(value);
76 break; 76 break;
77 } 77 }
78 case MAXWELL3D_REG_INDEX(code_address.code_address_high):
79 case MAXWELL3D_REG_INDEX(code_address.code_address_low): {
80 // Note: For some reason games (like Puyo Puyo Tetris) seem to write 0 to the CODE_ADDRESS
81 // register, we do not currently know if that's intended or a bug, so we assert it lest
82 // stuff breaks in other places (like the shader address calculation).
83 ASSERT_MSG(regs.code_address.CodeAddress() == 0, "Unexpected CODE_ADDRESS register value.");
84 break;
85 }
86 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]): 78 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]):
87 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[1]): 79 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[1]):
88 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[2]): 80 case MAXWELL3D_REG_INDEX(const_buffer.cb_data[2]):
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 5d5ad84b7..a1c47bae9 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -5,6 +5,7 @@
5#include <algorithm> 5#include <algorithm>
6#include <memory> 6#include <memory>
7#include <string> 7#include <string>
8#include <string_view>
8#include <tuple> 9#include <tuple>
9#include <utility> 10#include <utility>
10#include <glad/glad.h> 11#include <glad/glad.h>
@@ -37,11 +38,6 @@ MICROPROFILE_DEFINE(OpenGL_Blits, "OpenGL", "Blits", MP_RGB(100, 100, 255));
37MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100)); 38MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100));
38 39
39RasterizerOpenGL::RasterizerOpenGL() { 40RasterizerOpenGL::RasterizerOpenGL() {
40 has_ARB_buffer_storage = false;
41 has_ARB_direct_state_access = false;
42 has_ARB_separate_shader_objects = false;
43 has_ARB_vertex_attrib_binding = false;
44
45 // Create sampler objects 41 // Create sampler objects
46 for (size_t i = 0; i < texture_samplers.size(); ++i) { 42 for (size_t i = 0; i < texture_samplers.size(); ++i) {
47 texture_samplers[i].Create(); 43 texture_samplers[i].Create();
@@ -59,7 +55,8 @@ RasterizerOpenGL::RasterizerOpenGL() {
59 GLint ext_num; 55 GLint ext_num;
60 glGetIntegerv(GL_NUM_EXTENSIONS, &ext_num); 56 glGetIntegerv(GL_NUM_EXTENSIONS, &ext_num);
61 for (GLint i = 0; i < ext_num; i++) { 57 for (GLint i = 0; i < ext_num; i++) {
62 std::string extension{reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, i))}; 58 const std::string_view extension{
59 reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, i))};
63 60
64 if (extension == "GL_ARB_buffer_storage") { 61 if (extension == "GL_ARB_buffer_storage") {
65 has_ARB_buffer_storage = true; 62 has_ARB_buffer_storage = true;
@@ -110,8 +107,6 @@ RasterizerOpenGL::RasterizerOpenGL() {
110 glBindBufferBase(GL_UNIFORM_BUFFER, index, buffer.handle); 107 glBindBufferBase(GL_UNIFORM_BUFFER, index, buffer.handle);
111 } 108 }
112 109
113 accelerate_draw = AccelDraw::Disabled;
114
115 glEnable(GL_BLEND); 110 glEnable(GL_BLEND);
116 111
117 LOG_CRITICAL(Render_OpenGL, "Sync fixed function OpenGL state here!"); 112 LOG_CRITICAL(Render_OpenGL, "Sync fixed function OpenGL state here!");
@@ -694,10 +689,12 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr
694 glBindBuffer(GL_UNIFORM_BUFFER, 0); 689 glBindBuffer(GL_UNIFORM_BUFFER, 0);
695 690
696 // Now configure the bindpoint of the buffer inside the shader 691 // Now configure the bindpoint of the buffer inside the shader
697 std::string buffer_name = used_buffer.GetName(); 692 const std::string buffer_name = used_buffer.GetName();
698 GLuint index = glGetProgramResourceIndex(program, GL_UNIFORM_BLOCK, buffer_name.c_str()); 693 const GLuint index =
699 if (index != -1) 694 glGetProgramResourceIndex(program, GL_UNIFORM_BLOCK, buffer_name.c_str());
695 if (index != GL_INVALID_INDEX) {
700 glUniformBlockBinding(program, index, buffer_draw_state.bindpoint); 696 glUniformBlockBinding(program, index, buffer_draw_state.bindpoint);
697 }
701 } 698 }
702 699
703 state.Apply(); 700 state.Apply();
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index ab06e2d95..e150be58f 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -135,10 +135,10 @@ private:
135 /// Syncs the blend state to match the guest state 135 /// Syncs the blend state to match the guest state
136 void SyncBlendState(); 136 void SyncBlendState();
137 137
138 bool has_ARB_buffer_storage; 138 bool has_ARB_buffer_storage = false;
139 bool has_ARB_direct_state_access; 139 bool has_ARB_direct_state_access = false;
140 bool has_ARB_separate_shader_objects; 140 bool has_ARB_separate_shader_objects = false;
141 bool has_ARB_vertex_attrib_binding; 141 bool has_ARB_vertex_attrib_binding = false;
142 142
143 OpenGLState state; 143 OpenGLState state;
144 144
@@ -167,5 +167,5 @@ private:
167 void SetupShaders(u8* buffer_ptr, GLintptr buffer_offset); 167 void SetupShaders(u8* buffer_ptr, GLintptr buffer_offset);
168 168
169 enum class AccelDraw { Disabled, Arrays, Indexed }; 169 enum class AccelDraw { Disabled, Arrays, Indexed };
170 AccelDraw accelerate_draw; 170 AccelDraw accelerate_draw = AccelDraw::Disabled;
171}; 171};