diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 19 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 7 |
5 files changed, 21 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/gpu.h b/src/video_core/gpu.h index a0e5e3365..e9d87efb4 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -24,6 +24,7 @@ enum class RenderTargetFormat : u32 { | |||
| 24 | RGBA8_UNORM = 0xD5, | 24 | RGBA8_UNORM = 0xD5, |
| 25 | RGBA8_SRGB = 0xD6, | 25 | RGBA8_SRGB = 0xD6, |
| 26 | R11G11B10_FLOAT = 0xE0, | 26 | R11G11B10_FLOAT = 0xE0, |
| 27 | R8_UNORM = 0xF3, | ||
| 27 | }; | 28 | }; |
| 28 | 29 | ||
| 29 | enum class DepthFormat : u32 { | 30 | enum class DepthFormat : u32 { |
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)); | |||
| 37 | MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100)); | 38 | MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100)); |
| 38 | 39 | ||
| 39 | RasterizerOpenGL::RasterizerOpenGL() { | 40 | RasterizerOpenGL::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 | }; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 7785b7df4..0267dbac6 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -199,6 +199,8 @@ struct SurfaceParams { | |||
| 199 | return PixelFormat::R11FG11FB10F; | 199 | return PixelFormat::R11FG11FB10F; |
| 200 | case Tegra::RenderTargetFormat::RGBA32_UINT: | 200 | case Tegra::RenderTargetFormat::RGBA32_UINT: |
| 201 | return PixelFormat::RGBA32UI; | 201 | return PixelFormat::RGBA32UI; |
| 202 | case Tegra::RenderTargetFormat::R8_UNORM: | ||
| 203 | return PixelFormat::R8; | ||
| 202 | default: | 204 | default: |
| 203 | LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); | 205 | LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); |
| 204 | UNREACHABLE(); | 206 | UNREACHABLE(); |
| @@ -249,6 +251,8 @@ struct SurfaceParams { | |||
| 249 | UNREACHABLE(); | 251 | UNREACHABLE(); |
| 250 | case Tegra::Texture::TextureFormat::R32: | 252 | case Tegra::Texture::TextureFormat::R32: |
| 251 | return PixelFormat::R32F; | 253 | return PixelFormat::R32F; |
| 254 | case Tegra::Texture::TextureFormat::ZF32: | ||
| 255 | return PixelFormat::Z32F; | ||
| 252 | case Tegra::Texture::TextureFormat::DXT1: | 256 | case Tegra::Texture::TextureFormat::DXT1: |
| 253 | return PixelFormat::DXT1; | 257 | return PixelFormat::DXT1; |
| 254 | case Tegra::Texture::TextureFormat::DXT23: | 258 | case Tegra::Texture::TextureFormat::DXT23: |
| @@ -314,6 +318,8 @@ struct SurfaceParams { | |||
| 314 | case PixelFormat::R16F: | 318 | case PixelFormat::R16F: |
| 315 | case PixelFormat::R16UNORM: | 319 | case PixelFormat::R16UNORM: |
| 316 | return Tegra::Texture::TextureFormat::R16; | 320 | return Tegra::Texture::TextureFormat::R16; |
| 321 | case PixelFormat::Z32F: | ||
| 322 | return Tegra::Texture::TextureFormat::ZF32; | ||
| 317 | default: | 323 | default: |
| 318 | LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); | 324 | LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); |
| 319 | UNREACHABLE(); | 325 | UNREACHABLE(); |
| @@ -358,6 +364,7 @@ struct SurfaceParams { | |||
| 358 | case Tegra::RenderTargetFormat::RGBA8_SRGB: | 364 | case Tegra::RenderTargetFormat::RGBA8_SRGB: |
| 359 | case Tegra::RenderTargetFormat::BGRA8_UNORM: | 365 | case Tegra::RenderTargetFormat::BGRA8_UNORM: |
| 360 | case Tegra::RenderTargetFormat::RGB10_A2_UNORM: | 366 | case Tegra::RenderTargetFormat::RGB10_A2_UNORM: |
| 367 | case Tegra::RenderTargetFormat::R8_UNORM: | ||
| 361 | return ComponentType::UNorm; | 368 | return ComponentType::UNorm; |
| 362 | case Tegra::RenderTargetFormat::RGBA16_FLOAT: | 369 | case Tegra::RenderTargetFormat::RGBA16_FLOAT: |
| 363 | case Tegra::RenderTargetFormat::R11G11B10_FLOAT: | 370 | case Tegra::RenderTargetFormat::R11G11B10_FLOAT: |