diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 26 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/maxwell_to_gl.h | 1 |
3 files changed, 25 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 2f7d98d8b..d46ebd3ea 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -148,6 +148,8 @@ GLenum AttachmentType(PixelFormat format) { | |||
| 148 | switch (const SurfaceType type = VideoCore::Surface::GetFormatType(format); type) { | 148 | switch (const SurfaceType type = VideoCore::Surface::GetFormatType(format); type) { |
| 149 | case SurfaceType::Depth: | 149 | case SurfaceType::Depth: |
| 150 | return GL_DEPTH_ATTACHMENT; | 150 | return GL_DEPTH_ATTACHMENT; |
| 151 | case SurfaceType::Stencil: | ||
| 152 | return GL_STENCIL_ATTACHMENT; | ||
| 151 | case SurfaceType::DepthStencil: | 153 | case SurfaceType::DepthStencil: |
| 152 | return GL_DEPTH_STENCIL_ATTACHMENT; | 154 | return GL_DEPTH_STENCIL_ATTACHMENT; |
| 153 | default: | 155 | default: |
| @@ -897,6 +899,8 @@ void Image::Scale(bool up_scale) { | |||
| 897 | return GL_COLOR_ATTACHMENT0; | 899 | return GL_COLOR_ATTACHMENT0; |
| 898 | case SurfaceType::Depth: | 900 | case SurfaceType::Depth: |
| 899 | return GL_DEPTH_ATTACHMENT; | 901 | return GL_DEPTH_ATTACHMENT; |
| 902 | case SurfaceType::Stencil: | ||
| 903 | return GL_STENCIL_ATTACHMENT; | ||
| 900 | case SurfaceType::DepthStencil: | 904 | case SurfaceType::DepthStencil: |
| 901 | return GL_DEPTH_STENCIL_ATTACHMENT; | 905 | return GL_DEPTH_STENCIL_ATTACHMENT; |
| 902 | default: | 906 | default: |
| @@ -910,8 +914,10 @@ void Image::Scale(bool up_scale) { | |||
| 910 | return GL_COLOR_BUFFER_BIT; | 914 | return GL_COLOR_BUFFER_BIT; |
| 911 | case SurfaceType::Depth: | 915 | case SurfaceType::Depth: |
| 912 | return GL_DEPTH_BUFFER_BIT; | 916 | return GL_DEPTH_BUFFER_BIT; |
| 917 | case SurfaceType::Stencil: | ||
| 918 | return GL_STENCIL_BUFFER_BIT; | ||
| 913 | case SurfaceType::DepthStencil: | 919 | case SurfaceType::DepthStencil: |
| 914 | return GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT; | 920 | return GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; |
| 915 | default: | 921 | default: |
| 916 | UNREACHABLE(); | 922 | UNREACHABLE(); |
| 917 | return GL_COLOR_BUFFER_BIT; | 923 | return GL_COLOR_BUFFER_BIT; |
| @@ -923,8 +929,10 @@ void Image::Scale(bool up_scale) { | |||
| 923 | return 0; | 929 | return 0; |
| 924 | case SurfaceType::Depth: | 930 | case SurfaceType::Depth: |
| 925 | return 1; | 931 | return 1; |
| 926 | case SurfaceType::DepthStencil: | 932 | case SurfaceType::Stencil: |
| 927 | return 2; | 933 | return 2; |
| 934 | case SurfaceType::DepthStencil: | ||
| 935 | return 3; | ||
| 928 | default: | 936 | default: |
| 929 | UNREACHABLE(); | 937 | UNREACHABLE(); |
| 930 | return 0; | 938 | return 0; |
| @@ -1254,10 +1262,20 @@ Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM | |||
| 1254 | } | 1262 | } |
| 1255 | 1263 | ||
| 1256 | if (const ImageView* const image_view = depth_buffer; image_view) { | 1264 | if (const ImageView* const image_view = depth_buffer; image_view) { |
| 1257 | if (GetFormatType(image_view->format) == SurfaceType::DepthStencil) { | 1265 | switch (GetFormatType(image_view->format)) { |
| 1266 | case SurfaceType::Depth: | ||
| 1267 | buffer_bits |= GL_DEPTH_BUFFER_BIT; | ||
| 1268 | break; | ||
| 1269 | case SurfaceType::Stencil: | ||
| 1270 | buffer_bits |= GL_STENCIL_BUFFER_BIT; | ||
| 1271 | break; | ||
| 1272 | case SurfaceType::DepthStencil: | ||
| 1258 | buffer_bits |= GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; | 1273 | buffer_bits |= GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; |
| 1259 | } else { | 1274 | break; |
| 1275 | default: | ||
| 1276 | UNREACHABLE(); | ||
| 1260 | buffer_bits |= GL_DEPTH_BUFFER_BIT; | 1277 | buffer_bits |= GL_DEPTH_BUFFER_BIT; |
| 1278 | break; | ||
| 1261 | } | 1279 | } |
| 1262 | const GLenum attachment = AttachmentType(image_view->format); | 1280 | const GLenum attachment = AttachmentType(image_view->format); |
| 1263 | AttachTexture(handle, attachment, image_view); | 1281 | AttachTexture(handle, attachment, image_view); |
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index 1bb762568..16224e6b3 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h | |||
| @@ -162,8 +162,8 @@ private: | |||
| 162 | 162 | ||
| 163 | std::array<GLuint, Shader::NUM_TEXTURE_TYPES> null_image_views{}; | 163 | std::array<GLuint, Shader::NUM_TEXTURE_TYPES> null_image_views{}; |
| 164 | 164 | ||
| 165 | std::array<OGLFramebuffer, 3> rescale_draw_fbos; | 165 | std::array<OGLFramebuffer, 4> rescale_draw_fbos; |
| 166 | std::array<OGLFramebuffer, 3> rescale_read_fbos; | 166 | std::array<OGLFramebuffer, 4> rescale_read_fbos; |
| 167 | const Settings::ResolutionScalingInfo& resolution; | 167 | const Settings::ResolutionScalingInfo& resolution; |
| 168 | }; | 168 | }; |
| 169 | 169 | ||
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h index 39158aa3e..daba42ed9 100644 --- a/src/video_core/renderer_opengl/maxwell_to_gl.h +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -108,6 +108,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> FORMAT_TAB | |||
| 108 | {GL_RGB9_E5, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV}, // E5B9G9R9_FLOAT | 108 | {GL_RGB9_E5, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV}, // E5B9G9R9_FLOAT |
| 109 | {GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT}, // D32_FLOAT | 109 | {GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT}, // D32_FLOAT |
| 110 | {GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT}, // D16_UNORM | 110 | {GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT}, // D16_UNORM |
| 111 | {GL_STENCIL_INDEX8, GL_STENCIL, GL_UNSIGNED_BYTE}, // S8_UINT | ||
| 111 | {GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8}, // D24_UNORM_S8_UINT | 112 | {GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8}, // D24_UNORM_S8_UINT |
| 112 | {GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8}, // S8_UINT_D24_UNORM | 113 | {GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8}, // S8_UINT_D24_UNORM |
| 113 | {GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, | 114 | {GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, |