Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-06-08 13:03:11 +0300
committerJeroen Bakker <jeroen@blender.org>2020-06-11 09:34:34 +0300
commit7b754c8c99526201ad4ed28ce6b216c9b8736c27 (patch)
tree9795ecf38e06bdfb8844306fe0c600b01d474db7 /source
parent1510c04d4173987c207ae246c164ef0f1bdc2de8 (diff)
Fix T76273 Glitches caused by glCopyImageSubData on windows + intel gpu
We limit this fix to Windows Intel GPU whose driver reports at most GL 4.4 support. This limits the fix to the range of reported GPU.
Diffstat (limited to 'source')
-rw-r--r--source/blender/gpu/GPU_extensions.h1
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c18
-rw-r--r--source/blender/gpu/intern/gpu_texture.c2
3 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index 4ffe4a53a52..ab54148a2ff 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -49,6 +49,7 @@ bool GPU_mip_render_workaround(void);
bool GPU_depth_blitting_workaround(void);
bool GPU_unused_fb_slot_workaround(void);
bool GPU_context_local_shaders_workaround(void);
+bool GPU_texture_copy_workaround(void);
bool GPU_crappy_amd_driver(void);
bool GPU_mem_stats_supported(void);
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index ff745787630..447a15f267b 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -96,6 +96,9 @@ static struct GPUGlobal {
/* Some crappy Intel drivers don't work well with shaders created in different
* rendering contexts. */
bool context_local_shaders_workaround;
+ /* Intel drivers exhibit artifacts when using glCopyImageSubData & workbench antialiasing.
+ * (see T76273) */
+ bool texture_copy_workaround;
} GG = {1, 0};
static void gpu_detect_mip_render_workaround(void)
@@ -224,6 +227,11 @@ bool GPU_context_local_shaders_workaround(void)
return GG.context_local_shaders_workaround;
}
+bool GPU_texture_copy_workaround(void)
+{
+ return GG.texture_copy_workaround;
+}
+
bool GPU_crappy_amd_driver(void)
{
/* Currently are the same drivers with the `unused_fb_slot` problem. */
@@ -287,6 +295,15 @@ void gpu_extensions_init(void)
}
}
+ if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_WIN, GPU_DRIVER_OFFICIAL)) {
+ /* Limit this fix to older hardware with GL < 4.5. This means Broadwell GPUs are
+ * covered since they only support GL 4.4 on windows.
+ * This fixes some issues with workbench antialiasing on Win + Intel GPU. (see T76273) */
+ if (!GLEW_VERSION_4_5) {
+ GG.texture_copy_workaround = true;
+ }
+ }
+
GG.glew_arb_base_instance_is_supported = GLEW_ARB_base_instance;
GG.glew_arb_texture_cube_map_array_is_supported = GLEW_ARB_texture_cube_map_array;
gpu_detect_mip_render_workaround();
@@ -301,6 +318,7 @@ void gpu_extensions_init(void)
GG.mip_render_workaround = true;
GG.depth_blitting_workaround = true;
GG.unused_fb_slot_workaround = true;
+ GG.texture_copy_workaround = true;
GG.context_local_shaders_workaround = GLEW_ARB_get_program_binary;
}
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index fd01ddf8597..5f8eb383064 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -1759,7 +1759,7 @@ void GPU_texture_copy(GPUTexture *dst, GPUTexture *src)
BLI_assert(dst->d == 0);
BLI_assert(dst->format == src->format);
- if (GLEW_ARB_copy_image) {
+ if (GLEW_ARB_copy_image && !GPU_texture_copy_workaround()) {
/* Opengl 4.3 */
glCopyImageSubData(src->bindcode,
src->target,