summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 56d9c575b..a1c47bae9 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -5,6 +5,7 @@
#include <algorithm>
#include <memory>
#include <string>
+#include <string_view>
#include <tuple>
#include <utility>
#include <glad/glad.h>
@@ -37,11 +38,6 @@ MICROPROFILE_DEFINE(OpenGL_Blits, "OpenGL", "Blits", MP_RGB(100, 100, 255));
MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100));
RasterizerOpenGL::RasterizerOpenGL() {
- has_ARB_buffer_storage = false;
- has_ARB_direct_state_access = false;
- has_ARB_separate_shader_objects = false;
- has_ARB_vertex_attrib_binding = false;
-
// Create sampler objects
for (size_t i = 0; i < texture_samplers.size(); ++i) {
texture_samplers[i].Create();
@@ -59,7 +55,8 @@ RasterizerOpenGL::RasterizerOpenGL() {
GLint ext_num;
glGetIntegerv(GL_NUM_EXTENSIONS, &ext_num);
for (GLint i = 0; i < ext_num; i++) {
- std::string extension{reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, i))};
+ const std::string_view extension{
+ reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, i))};
if (extension == "GL_ARB_buffer_storage") {
has_ARB_buffer_storage = true;
@@ -110,8 +107,6 @@ RasterizerOpenGL::RasterizerOpenGL() {
glBindBufferBase(GL_UNIFORM_BUFFER, index, buffer.handle);
}
- accelerate_draw = AccelDraw::Disabled;
-
glEnable(GL_BLEND);
LOG_CRITICAL(Render_OpenGL, "Sync fixed function OpenGL state here!");
@@ -601,7 +596,6 @@ void RasterizerOpenGL::SamplerInfo::Create() {
sampler.Create();
mag_filter = min_filter = Tegra::Texture::TextureFilter::Linear;
wrap_u = wrap_v = Tegra::Texture::WrapMode::Wrap;
- border_color_r = border_color_g = border_color_b = border_color_a = 0;
// default is GL_LINEAR_MIPMAP_LINEAR
glSamplerParameteri(sampler.handle, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -630,8 +624,12 @@ void RasterizerOpenGL::SamplerInfo::SyncWithConfig(const Tegra::Texture::TSCEntr
}
if (wrap_u == Tegra::Texture::WrapMode::Border || wrap_v == Tegra::Texture::WrapMode::Border) {
- // TODO(Subv): Implement border color
- ASSERT(false);
+ const GLvec4 new_border_color = {{config.border_color_r, config.border_color_g,
+ config.border_color_b, config.border_color_a}};
+ if (border_color != new_border_color) {
+ border_color = new_border_color;
+ glSamplerParameterfv(s, GL_TEXTURE_BORDER_COLOR, border_color.data());
+ }
}
}
@@ -691,10 +689,12 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr
glBindBuffer(GL_UNIFORM_BUFFER, 0);
// Now configure the bindpoint of the buffer inside the shader
- std::string buffer_name = used_buffer.GetName();
- GLuint index = glGetProgramResourceIndex(program, GL_UNIFORM_BLOCK, buffer_name.c_str());
- if (index != -1)
+ const std::string buffer_name = used_buffer.GetName();
+ const GLuint index =
+ glGetProgramResourceIndex(program, GL_UNIFORM_BLOCK, buffer_name.c_str());
+ if (index != GL_INVALID_INDEX) {
glUniformBlockBinding(program, index, buffer_draw_state.bindpoint);
+ }
}
state.Apply();