summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorFeng Chen <VonChenPlus@gmail.com>2022-11-04 07:39:42 +0100
committerGitHub <noreply@github.com>2022-11-04 07:39:42 +0100
commit75596c07e0fc1462c2a19484e168f4944c33d3d3 (patch)
tree1aa919ea76f467c51b3fc591a72c57f5ade92560 /src/video_core/renderer_opengl
parentUI: Add options to hide extra columns (#9093) (diff)
downloadyuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar.gz
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar.bz2
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar.lz
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar.xz
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.tar.zst
yuzu-75596c07e0fc1462c2a19484e168f4944c33d3d3.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_buffer_cache.cpp15
-rw-r--r--src/video_core/renderer_opengl/gl_graphics_pipeline.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp10
3 files changed, 13 insertions, 16 deletions
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.cpp b/src/video_core/renderer_opengl/gl_buffer_cache.cpp
index 08f4d69ab..6af4ae793 100644
--- a/src/video_core/renderer_opengl/gl_buffer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_buffer_cache.cpp
@@ -29,17 +29,17 @@ constexpr std::array PROGRAM_LUT{
[[nodiscard]] GLenum GetTextureBufferFormat(GLenum gl_format) {
switch (gl_format) {
case GL_RGBA8_SNORM:
- return GL_RGBA8;
+ return GL_RGBA8I;
case GL_R8_SNORM:
- return GL_R8;
+ return GL_R8I;
case GL_RGBA16_SNORM:
- return GL_RGBA16;
+ return GL_RGBA16I;
case GL_R16_SNORM:
- return GL_R16;
+ return GL_R16I;
case GL_RG16_SNORM:
- return GL_RG16;
+ return GL_RG16I;
case GL_RG8_SNORM:
- return GL_RG8;
+ return GL_RG8I;
default:
return gl_format;
}
@@ -96,9 +96,6 @@ GLuint Buffer::View(u32 offset, u32 size, PixelFormat format) {
texture.Create(GL_TEXTURE_BUFFER);
const GLenum gl_format{MaxwellToGL::GetFormatTuple(format).internal_format};
const GLenum texture_format{GetTextureBufferFormat(gl_format)};
- if (texture_format != gl_format) {
- LOG_WARNING(Render_OpenGL, "Emulating SNORM texture buffer with UNORM.");
- }
glTextureBufferRange(texture.handle, texture_format, buffer.handle, offset, size);
views.push_back({
.offset = offset,
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
index daceb05f4..c115dabe1 100644
--- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
+++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
@@ -504,8 +504,8 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
}
}
if (info.uses_render_area) {
- const auto render_area_width(static_cast<GLfloat>(regs.render_area.width));
- const auto render_area_height(static_cast<GLfloat>(regs.render_area.height));
+ const auto render_area_width(static_cast<GLfloat>(regs.surface_clip.width));
+ const auto render_area_height(static_cast<GLfloat>(regs.surface_clip.height));
if (use_assembly) {
glProgramLocalParameter4fARB(AssemblyStage(stage), 1, render_area_width,
render_area_height, 0.0f, 0.0f);
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 79d7908d4..72e314d39 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -618,11 +618,11 @@ void RasterizerOpenGL::SyncViewport() {
}
flags[Dirty::Viewport0 + index] = false;
- if (!regs.viewport_transform_enabled) {
- const auto x = static_cast<GLfloat>(regs.render_area.x);
- const auto y = static_cast<GLfloat>(regs.render_area.y);
- const auto width = static_cast<GLfloat>(regs.render_area.width);
- const auto height = static_cast<GLfloat>(regs.render_area.height);
+ if (!regs.viewport_scale_offset_enbled) {
+ const auto x = static_cast<GLfloat>(regs.surface_clip.x);
+ const auto y = static_cast<GLfloat>(regs.surface_clip.y);
+ const auto width = static_cast<GLfloat>(regs.surface_clip.width);
+ const auto height = static_cast<GLfloat>(regs.surface_clip.height);
glViewportIndexedf(static_cast<GLuint>(index), x, y, width != 0.0f ? width : 1.0f,
height != 0.0f ? height : 1.0f);
continue;