summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-01-04 01:56:44 -0300
committerGravatar ReinUsesLisp2021-01-04 02:06:40 -0300
commit7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5 (patch)
tree5bdc2bdcf8b5aeb594a3a2b16c183b13d6fe2771 /src/video_core/renderer_opengl
parentgl_texture_cache: Create base images with sRGB (diff)
downloadyuzu-7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5.tar.gz
yuzu-7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5.tar.xz
yuzu-7d904fef2e6ac9ce8a3df71e758a36d39b8f69e5.zip
gl_texture_cache: Avoid format views on Intel and AMD
Intel and AMD proprietary drivers are incapable of rendering to texture views of different formats than the original texture. Avoid creating these at a cache level. This will consume more memory, emulating them with copies.
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_device.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_device.h5
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp2
3 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp
index b24179d59..81b71edfb 100644
--- a/src/video_core/renderer_opengl/gl_device.cpp
+++ b/src/video_core/renderer_opengl/gl_device.cpp
@@ -208,6 +208,7 @@ Device::Device()
208 208
209 const bool is_nvidia = vendor == "NVIDIA Corporation"; 209 const bool is_nvidia = vendor == "NVIDIA Corporation";
210 const bool is_amd = vendor == "ATI Technologies Inc."; 210 const bool is_amd = vendor == "ATI Technologies Inc.";
211 const bool is_intel = vendor == "Intel";
211 212
212 bool disable_fast_buffer_sub_data = false; 213 bool disable_fast_buffer_sub_data = false;
213 if (is_nvidia && version == "4.6.0 NVIDIA 443.24") { 214 if (is_nvidia && version == "4.6.0 NVIDIA 443.24") {
@@ -231,6 +232,7 @@ Device::Device()
231 has_variable_aoffi = TestVariableAoffi(); 232 has_variable_aoffi = TestVariableAoffi();
232 has_component_indexing_bug = is_amd; 233 has_component_indexing_bug = is_amd;
233 has_precise_bug = TestPreciseBug(); 234 has_precise_bug = TestPreciseBug();
235 has_broken_texture_view_formats = is_amd || is_intel;
234 has_nv_viewport_array2 = GLAD_GL_NV_viewport_array2; 236 has_nv_viewport_array2 = GLAD_GL_NV_viewport_array2;
235 has_vertex_buffer_unified_memory = GLAD_GL_NV_vertex_buffer_unified_memory; 237 has_vertex_buffer_unified_memory = GLAD_GL_NV_vertex_buffer_unified_memory;
236 has_debugging_tool_attached = IsDebugToolAttached(extensions); 238 has_debugging_tool_attached = IsDebugToolAttached(extensions);
@@ -248,6 +250,8 @@ Device::Device()
248 LOG_INFO(Render_OpenGL, "Renderer_VariableAOFFI: {}", has_variable_aoffi); 250 LOG_INFO(Render_OpenGL, "Renderer_VariableAOFFI: {}", has_variable_aoffi);
249 LOG_INFO(Render_OpenGL, "Renderer_ComponentIndexingBug: {}", has_component_indexing_bug); 251 LOG_INFO(Render_OpenGL, "Renderer_ComponentIndexingBug: {}", has_component_indexing_bug);
250 LOG_INFO(Render_OpenGL, "Renderer_PreciseBug: {}", has_precise_bug); 252 LOG_INFO(Render_OpenGL, "Renderer_PreciseBug: {}", has_precise_bug);
253 LOG_INFO(Render_OpenGL, "Renderer_BrokenTextureViewFormats: {}",
254 has_broken_texture_view_formats);
251 255
252 if (Settings::values.use_assembly_shaders.GetValue() && !use_assembly_shaders) { 256 if (Settings::values.use_assembly_shaders.GetValue() && !use_assembly_shaders) {
253 LOG_ERROR(Render_OpenGL, "Assembly shaders enabled but not supported"); 257 LOG_ERROR(Render_OpenGL, "Assembly shaders enabled but not supported");
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h
index 13e66846c..3e79d1e37 100644
--- a/src/video_core/renderer_opengl/gl_device.h
+++ b/src/video_core/renderer_opengl/gl_device.h
@@ -96,6 +96,10 @@ public:
96 return has_precise_bug; 96 return has_precise_bug;
97 } 97 }
98 98
99 bool HasBrokenTextureViewFormats() const {
100 return has_broken_texture_view_formats;
101 }
102
99 bool HasFastBufferSubData() const { 103 bool HasFastBufferSubData() const {
100 return has_fast_buffer_sub_data; 104 return has_fast_buffer_sub_data;
101 } 105 }
@@ -137,6 +141,7 @@ private:
137 bool has_variable_aoffi{}; 141 bool has_variable_aoffi{};
138 bool has_component_indexing_bug{}; 142 bool has_component_indexing_bug{};
139 bool has_precise_bug{}; 143 bool has_precise_bug{};
144 bool has_broken_texture_view_formats{};
140 bool has_fast_buffer_sub_data{}; 145 bool has_fast_buffer_sub_data{};
141 bool has_nv_viewport_array2{}; 146 bool has_nv_viewport_array2{};
142 bool has_debugging_tool_attached{}; 147 bool has_debugging_tool_attached{};
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index 710874311..546cb6d00 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -430,6 +430,8 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, ProgramManager&
430 format_properties[i].emplace(format, properties); 430 format_properties[i].emplace(format, properties);
431 } 431 }
432 } 432 }
433 has_broken_texture_view_formats = device.HasBrokenTextureViewFormats();
434
433 null_image_1d_array.Create(GL_TEXTURE_1D_ARRAY); 435 null_image_1d_array.Create(GL_TEXTURE_1D_ARRAY);
434 null_image_cube_array.Create(GL_TEXTURE_CUBE_MAP_ARRAY); 436 null_image_cube_array.Create(GL_TEXTURE_CUBE_MAP_ARRAY);
435 null_image_3d.Create(GL_TEXTURE_3D); 437 null_image_3d.Create(GL_TEXTURE_3D);