summaryrefslogtreecommitdiff
path: root/src/video_core/host_shaders
diff options
context:
space:
mode:
authorGravatar Rodrigo Locatti2021-03-09 02:47:51 -0300
committerGravatar GitHub2021-03-09 02:47:51 -0300
commitdaf5c5060b4b2e4aa985fbfe9724eb99c51bbd71 (patch)
treeaaa1cc96298e6e114cb72dfb517f7a000d2a467d /src/video_core/host_shaders
parentMerge pull request #6021 from ReinUsesLisp/skip-cache-heuristic (diff)
parenttexture_cache: Blacklist BGRA8 copies and views on OpenGL (diff)
downloadyuzu-daf5c5060b4b2e4aa985fbfe9724eb99c51bbd71.tar.gz
yuzu-daf5c5060b4b2e4aa985fbfe9724eb99c51bbd71.tar.xz
yuzu-daf5c5060b4b2e4aa985fbfe9724eb99c51bbd71.zip
Merge pull request #5891 from ameerj/bgra-ogl
renderer_opengl: Use compute shaders to swizzle BGR textures on copy
Diffstat (limited to 'src/video_core/host_shaders')
-rw-r--r--src/video_core/host_shaders/CMakeLists.txt1
-rw-r--r--src/video_core/host_shaders/opengl_copy_bgra.comp15
2 files changed, 16 insertions, 0 deletions
diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt
index 970120acc..3494318ca 100644
--- a/src/video_core/host_shaders/CMakeLists.txt
+++ b/src/video_core/host_shaders/CMakeLists.txt
@@ -5,6 +5,7 @@ set(SHADER_FILES
5 convert_float_to_depth.frag 5 convert_float_to_depth.frag
6 full_screen_triangle.vert 6 full_screen_triangle.vert
7 opengl_copy_bc4.comp 7 opengl_copy_bc4.comp
8 opengl_copy_bgra.comp
8 opengl_present.frag 9 opengl_present.frag
9 opengl_present.vert 10 opengl_present.vert
10 pitch_unswizzle.comp 11 pitch_unswizzle.comp
diff --git a/src/video_core/host_shaders/opengl_copy_bgra.comp b/src/video_core/host_shaders/opengl_copy_bgra.comp
new file mode 100644
index 000000000..2571a4abf
--- /dev/null
+++ b/src/video_core/host_shaders/opengl_copy_bgra.comp
@@ -0,0 +1,15 @@
1// Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#version 430 core
6
7layout (local_size_x = 4, local_size_y = 4) in;
8
9layout(binding = 0, rgba8) readonly uniform image2DArray bgr_input;
10layout(binding = 1, rgba8) writeonly uniform image2DArray bgr_output;
11
12void main() {
13 vec4 color = imageLoad(bgr_input, ivec3(gl_GlobalInvocationID));
14 imageStore(bgr_output, ivec3(gl_GlobalInvocationID), color.bgra);
15}