diff options
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/engines/shader_bytecode.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 8 |
4 files changed, 15 insertions, 5 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 26c6b95ab..4e94048da 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -106,6 +106,8 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata) { | |||
| 106 | is_64bit_process = metadata.Is64BitProgram(); | 106 | is_64bit_process = metadata.Is64BitProgram(); |
| 107 | 107 | ||
| 108 | vm_manager.Reset(metadata.GetAddressSpaceType()); | 108 | vm_manager.Reset(metadata.GetAddressSpaceType()); |
| 109 | // Ensure that the potentially resized page table is seen by CPU backends. | ||
| 110 | Memory::SetCurrentPageTable(&vm_manager.page_table); | ||
| 109 | 111 | ||
| 110 | const auto& caps = metadata.GetKernelCapabilities(); | 112 | const auto& caps = metadata.GetKernelCapabilities(); |
| 111 | const auto capability_init_result = | 113 | const auto capability_init_result = |
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 7f613370b..363e53be1 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -1662,7 +1662,7 @@ private: | |||
| 1662 | INST("0011011-11110---", Id::BFI_IMM_R, Type::Bfi, "BFI_IMM_R"), | 1662 | INST("0011011-11110---", Id::BFI_IMM_R, Type::Bfi, "BFI_IMM_R"), |
| 1663 | INST("0100110001000---", Id::LOP_C, Type::ArithmeticInteger, "LOP_C"), | 1663 | INST("0100110001000---", Id::LOP_C, Type::ArithmeticInteger, "LOP_C"), |
| 1664 | INST("0101110001000---", Id::LOP_R, Type::ArithmeticInteger, "LOP_R"), | 1664 | INST("0101110001000---", Id::LOP_R, Type::ArithmeticInteger, "LOP_R"), |
| 1665 | INST("0011100001000---", Id::LOP_IMM, Type::ArithmeticInteger, "LOP_IMM"), | 1665 | INST("0011100-01000---", Id::LOP_IMM, Type::ArithmeticInteger, "LOP_IMM"), |
| 1666 | INST("000001----------", Id::LOP32I, Type::ArithmeticIntegerImmediate, "LOP32I"), | 1666 | INST("000001----------", Id::LOP32I, Type::ArithmeticIntegerImmediate, "LOP32I"), |
| 1667 | INST("0000001---------", Id::LOP3_C, Type::ArithmeticInteger, "LOP3_C"), | 1667 | INST("0000001---------", Id::LOP3_C, Type::ArithmeticInteger, "LOP3_C"), |
| 1668 | INST("0101101111100---", Id::LOP3_R, Type::ArithmeticInteger, "LOP3_R"), | 1668 | INST("0101101111100---", Id::LOP3_R, Type::ArithmeticInteger, "LOP3_R"), |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 7a3280620..5876145ef 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -661,8 +661,8 @@ void CachedSurface::FlushGLBuffer() { | |||
| 661 | gl_buffer[0].resize(GetSizeInBytes()); | 661 | gl_buffer[0].resize(GetSizeInBytes()); |
| 662 | 662 | ||
| 663 | const FormatTuple& tuple = GetFormatTuple(params.pixel_format, params.component_type); | 663 | const FormatTuple& tuple = GetFormatTuple(params.pixel_format, params.component_type); |
| 664 | // Ensure no bad interactions with GL_UNPACK_ALIGNMENT | 664 | const u32 align = std::clamp(params.RowAlign(0), 1U, 8U); |
| 665 | ASSERT(params.width * GetBytesPerPixel(params.pixel_format) % 4 == 0); | 665 | glPixelStorei(GL_PACK_ALIGNMENT, align); |
| 666 | glPixelStorei(GL_PACK_ROW_LENGTH, static_cast<GLint>(params.width)); | 666 | glPixelStorei(GL_PACK_ROW_LENGTH, static_cast<GLint>(params.width)); |
| 667 | ASSERT(!tuple.compressed); | 667 | ASSERT(!tuple.compressed); |
| 668 | glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); | 668 | glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); |
| @@ -707,8 +707,8 @@ void CachedSurface::UploadGLMipmapTexture(u32 mip_map, GLuint read_fb_handle, | |||
| 707 | 707 | ||
| 708 | const FormatTuple& tuple = GetFormatTuple(params.pixel_format, params.component_type); | 708 | const FormatTuple& tuple = GetFormatTuple(params.pixel_format, params.component_type); |
| 709 | 709 | ||
| 710 | // Ensure no bad interactions with GL_UNPACK_ALIGNMENT | 710 | const u32 align = std::clamp(params.RowAlign(mip_map), 1U, 8U); |
| 711 | ASSERT(params.MipWidth(mip_map) * GetBytesPerPixel(params.pixel_format) % 4 == 0); | 711 | glPixelStorei(GL_UNPACK_ALIGNMENT, align); |
| 712 | glPixelStorei(GL_UNPACK_ROW_LENGTH, static_cast<GLint>(params.MipWidth(mip_map))); | 712 | glPixelStorei(GL_UNPACK_ROW_LENGTH, static_cast<GLint>(params.MipWidth(mip_map))); |
| 713 | 713 | ||
| 714 | const auto image_size = static_cast<GLsizei>(params.GetMipmapSizeGL(mip_map, false)); | 714 | const auto image_size = static_cast<GLsizei>(params.GetMipmapSizeGL(mip_map, false)); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index ad4fd3ad2..db280dbb3 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <vector> | 11 | #include <vector> |
| 12 | 12 | ||
| 13 | #include "common/alignment.h" | 13 | #include "common/alignment.h" |
| 14 | #include "common/bit_util.h" | ||
| 14 | #include "common/common_types.h" | 15 | #include "common/common_types.h" |
| 15 | #include "common/hash.h" | 16 | #include "common/hash.h" |
| 16 | #include "common/math_util.h" | 17 | #include "common/math_util.h" |
| @@ -205,6 +206,13 @@ struct SurfaceParams { | |||
| 205 | return bd; | 206 | return bd; |
| 206 | } | 207 | } |
| 207 | 208 | ||
| 209 | u32 RowAlign(u32 mip_level) const { | ||
| 210 | const u32 m_width = MipWidth(mip_level); | ||
| 211 | const u32 bytes_per_pixel = GetBytesPerPixel(pixel_format); | ||
| 212 | const u32 l2 = Common::CountTrailingZeroes32(m_width * bytes_per_pixel); | ||
| 213 | return (1U << l2); | ||
| 214 | } | ||
| 215 | |||
| 208 | /// Creates SurfaceParams from a texture configuration | 216 | /// Creates SurfaceParams from a texture configuration |
| 209 | static SurfaceParams CreateForTexture(const Tegra::Texture::FullTextureInfo& config, | 217 | static SurfaceParams CreateForTexture(const Tegra::Texture::FullTextureInfo& config, |
| 210 | const GLShader::SamplerEntry& entry); | 218 | const GLShader::SamplerEntry& entry); |