diff options
| -rw-r--r-- | src/video_core/renderer_opengl/gl_resource_manager.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 14 |
2 files changed, 8 insertions, 13 deletions
diff --git a/src/video_core/renderer_opengl/gl_resource_manager.cpp b/src/video_core/renderer_opengl/gl_resource_manager.cpp index 70947838c..5e7101d28 100644 --- a/src/video_core/renderer_opengl/gl_resource_manager.cpp +++ b/src/video_core/renderer_opengl/gl_resource_manager.cpp | |||
| @@ -166,7 +166,12 @@ void OGLFramebuffer::Create() { | |||
| 166 | return; | 166 | return; |
| 167 | 167 | ||
| 168 | MICROPROFILE_SCOPE(OpenGL_ResourceCreation); | 168 | MICROPROFILE_SCOPE(OpenGL_ResourceCreation); |
| 169 | glCreateFramebuffers(1, &handle); | 169 | // Bind to READ_FRAMEBUFFER to stop Nvidia's driver from creating an EXT_framebuffer instead of |
| 170 | // a core framebuffer. EXT framebuffer attachments have to match in size and can be shared | ||
| 171 | // across contexts. yuzu doesn't share framebuffers across contexts and we need attachments with | ||
| 172 | // mismatching size, this is why core framebuffers are preferred. | ||
| 173 | glGenFramebuffers(1, &handle); | ||
| 174 | glBindFramebuffer(GL_READ_FRAMEBUFFER, handle); | ||
| 170 | } | 175 | } |
| 171 | 176 | ||
| 172 | void OGLFramebuffer::Release() { | 177 | void OGLFramebuffer::Release() { |
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 6841b5450..00610ea2c 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -478,10 +478,6 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, ProgramManager& | |||
| 478 | for (size_t i = 0; i < rescale_draw_fbos.size(); ++i) { | 478 | for (size_t i = 0; i < rescale_draw_fbos.size(); ++i) { |
| 479 | rescale_draw_fbos[i].Create(); | 479 | rescale_draw_fbos[i].Create(); |
| 480 | rescale_read_fbos[i].Create(); | 480 | rescale_read_fbos[i].Create(); |
| 481 | |||
| 482 | // Make sure the framebuffer is created without DSA | ||
| 483 | glBindFramebuffer(GL_READ_FRAMEBUFFER, rescale_draw_fbos[i].handle); | ||
| 484 | glBindFramebuffer(GL_READ_FRAMEBUFFER, rescale_read_fbos[i].handle); | ||
| 485 | } | 481 | } |
| 486 | } | 482 | } |
| 487 | } | 483 | } |
| @@ -1224,13 +1220,8 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const TSCEntry& config) { | |||
| 1224 | 1220 | ||
| 1225 | Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM_RT> color_buffers, | 1221 | Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM_RT> color_buffers, |
| 1226 | ImageView* depth_buffer, const VideoCommon::RenderTargets& key) { | 1222 | ImageView* depth_buffer, const VideoCommon::RenderTargets& key) { |
| 1227 | // Bind to READ_FRAMEBUFFER to stop Nvidia's driver from creating an EXT_framebuffer instead of | 1223 | framebuffer.Create(); |
| 1228 | // a core framebuffer. EXT framebuffer attachments have to match in size and can be shared | 1224 | GLuint handle = framebuffer.handle; |
| 1229 | // across contexts. yuzu doesn't share framebuffers across contexts and we need attachments with | ||
| 1230 | // mismatching size, this is why core framebuffers are preferred. | ||
| 1231 | GLuint handle; | ||
| 1232 | glGenFramebuffers(1, &handle); | ||
| 1233 | glBindFramebuffer(GL_READ_FRAMEBUFFER, handle); | ||
| 1234 | 1225 | ||
| 1235 | GLsizei num_buffers = 0; | 1226 | GLsizei num_buffers = 0; |
| 1236 | std::array<GLenum, NUM_RT> gl_draw_buffers; | 1227 | std::array<GLenum, NUM_RT> gl_draw_buffers; |
| @@ -1278,7 +1269,6 @@ Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM | |||
| 1278 | const std::string name = VideoCommon::Name(key); | 1269 | const std::string name = VideoCommon::Name(key); |
| 1279 | glObjectLabel(GL_FRAMEBUFFER, handle, static_cast<GLsizei>(name.size()), name.data()); | 1270 | glObjectLabel(GL_FRAMEBUFFER, handle, static_cast<GLsizei>(name.size()), name.data()); |
| 1280 | } | 1271 | } |
| 1281 | framebuffer.handle = handle; | ||
| 1282 | } | 1272 | } |
| 1283 | 1273 | ||
| 1284 | void BGRCopyPass::CopyBGR(Image& dst_image, Image& src_image, | 1274 | void BGRCopyPass::CopyBGR(Image& dst_image, Image& src_image, |