summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-10-25 04:52:43 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-11-16 22:11:33 +0100
commit9fc1fa1b0dd015db15c6eaafe68206943bf4cbc1 (patch)
treeaabaf59f591abb4b7348b2903df6024ae6022e05
parentTexture Cache: Fix memory usage on ScaleDown. (diff)
downloadyuzu-9fc1fa1b0dd015db15c6eaafe68206943bf4cbc1.tar
yuzu-9fc1fa1b0dd015db15c6eaafe68206943bf4cbc1.tar.gz
yuzu-9fc1fa1b0dd015db15c6eaafe68206943bf4cbc1.tar.bz2
yuzu-9fc1fa1b0dd015db15c6eaafe68206943bf4cbc1.tar.lz
yuzu-9fc1fa1b0dd015db15c6eaafe68206943bf4cbc1.tar.xz
yuzu-9fc1fa1b0dd015db15c6eaafe68206943bf4cbc1.tar.zst
yuzu-9fc1fa1b0dd015db15c6eaafe68206943bf4cbc1.zip
-rw-r--r--src/video_core/renderer_opengl/gl_resource_manager.cpp7
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp14
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() {
return;
MICROPROFILE_SCOPE(OpenGL_ResourceCreation);
- glCreateFramebuffers(1, &handle);
+ // Bind to READ_FRAMEBUFFER to stop Nvidia's driver from creating an EXT_framebuffer instead of
+ // a core framebuffer. EXT framebuffer attachments have to match in size and can be shared
+ // across contexts. yuzu doesn't share framebuffers across contexts and we need attachments with
+ // mismatching size, this is why core framebuffers are preferred.
+ glGenFramebuffers(1, &handle);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, handle);
}
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&
for (size_t i = 0; i < rescale_draw_fbos.size(); ++i) {
rescale_draw_fbos[i].Create();
rescale_read_fbos[i].Create();
-
- // Make sure the framebuffer is created without DSA
- glBindFramebuffer(GL_READ_FRAMEBUFFER, rescale_draw_fbos[i].handle);
- glBindFramebuffer(GL_READ_FRAMEBUFFER, rescale_read_fbos[i].handle);
}
}
}
@@ -1224,13 +1220,8 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const TSCEntry& config) {
Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM_RT> color_buffers,
ImageView* depth_buffer, const VideoCommon::RenderTargets& key) {
- // Bind to READ_FRAMEBUFFER to stop Nvidia's driver from creating an EXT_framebuffer instead of
- // a core framebuffer. EXT framebuffer attachments have to match in size and can be shared
- // across contexts. yuzu doesn't share framebuffers across contexts and we need attachments with
- // mismatching size, this is why core framebuffers are preferred.
- GLuint handle;
- glGenFramebuffers(1, &handle);
- glBindFramebuffer(GL_READ_FRAMEBUFFER, handle);
+ framebuffer.Create();
+ GLuint handle = framebuffer.handle;
GLsizei num_buffers = 0;
std::array<GLenum, NUM_RT> gl_draw_buffers;
@@ -1278,7 +1269,6 @@ Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM
const std::string name = VideoCommon::Name(key);
glObjectLabel(GL_FRAMEBUFFER, handle, static_cast<GLsizei>(name.size()), name.data());
}
- framebuffer.handle = handle;
}
void BGRCopyPass::CopyBGR(Image& dst_image, Image& src_image,