diff options
| author | 2023-01-19 14:58:53 -0500 | |
|---|---|---|
| committer | 2023-01-19 14:58:53 -0500 | |
| commit | 475370c8f89002e3b508eb152b981a5b89049d68 (patch) | |
| tree | 79a145e24f2bf5ab5baca6824cae6cd525a8d170 /src/video_core/host_shaders | |
| parent | Merge pull request #9623 from liamwhite/wp-oops (diff) | |
| parent | Address feedback (diff) | |
| download | yuzu-475370c8f89002e3b508eb152b981a5b89049d68.tar.gz yuzu-475370c8f89002e3b508eb152b981a5b89049d68.tar.xz yuzu-475370c8f89002e3b508eb152b981a5b89049d68.zip | |
Merge pull request #9556 from vonchenplus/draw_texture
video_core: Implement maxwell3d draw texture method
Diffstat (limited to 'src/video_core/host_shaders')
| -rw-r--r-- | src/video_core/host_shaders/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/video_core/host_shaders/blit_color_float.frag (renamed from src/video_core/host_shaders/vulkan_blit_color_float.frag) | 0 | ||||
| -rw-r--r-- | src/video_core/host_shaders/full_screen_triangle.vert | 13 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt index f275b2aa9..e968ae220 100644 --- a/src/video_core/host_shaders/CMakeLists.txt +++ b/src/video_core/host_shaders/CMakeLists.txt | |||
| @@ -11,6 +11,7 @@ set(GLSL_INCLUDES | |||
| 11 | 11 | ||
| 12 | set(SHADER_FILES | 12 | set(SHADER_FILES |
| 13 | astc_decoder.comp | 13 | astc_decoder.comp |
| 14 | blit_color_float.frag | ||
| 14 | block_linear_unswizzle_2d.comp | 15 | block_linear_unswizzle_2d.comp |
| 15 | block_linear_unswizzle_3d.comp | 16 | block_linear_unswizzle_3d.comp |
| 16 | convert_abgr8_to_d24s8.frag | 17 | convert_abgr8_to_d24s8.frag |
| @@ -36,7 +37,6 @@ set(SHADER_FILES | |||
| 36 | smaa_blending_weight_calculation.frag | 37 | smaa_blending_weight_calculation.frag |
| 37 | smaa_neighborhood_blending.vert | 38 | smaa_neighborhood_blending.vert |
| 38 | smaa_neighborhood_blending.frag | 39 | smaa_neighborhood_blending.frag |
| 39 | vulkan_blit_color_float.frag | ||
| 40 | vulkan_blit_depth_stencil.frag | 40 | vulkan_blit_depth_stencil.frag |
| 41 | vulkan_fidelityfx_fsr_easu_fp16.comp | 41 | vulkan_fidelityfx_fsr_easu_fp16.comp |
| 42 | vulkan_fidelityfx_fsr_easu_fp32.comp | 42 | vulkan_fidelityfx_fsr_easu_fp32.comp |
diff --git a/src/video_core/host_shaders/vulkan_blit_color_float.frag b/src/video_core/host_shaders/blit_color_float.frag index c0c832296..c0c832296 100644 --- a/src/video_core/host_shaders/vulkan_blit_color_float.frag +++ b/src/video_core/host_shaders/blit_color_float.frag | |||
diff --git a/src/video_core/host_shaders/full_screen_triangle.vert b/src/video_core/host_shaders/full_screen_triangle.vert index 2c976b19f..d16d98995 100644 --- a/src/video_core/host_shaders/full_screen_triangle.vert +++ b/src/video_core/host_shaders/full_screen_triangle.vert | |||
| @@ -4,13 +4,20 @@ | |||
| 4 | #version 450 | 4 | #version 450 |
| 5 | 5 | ||
| 6 | #ifdef VULKAN | 6 | #ifdef VULKAN |
| 7 | #define VERTEX_ID gl_VertexIndex | ||
| 7 | #define BEGIN_PUSH_CONSTANTS layout(push_constant) uniform PushConstants { | 8 | #define BEGIN_PUSH_CONSTANTS layout(push_constant) uniform PushConstants { |
| 8 | #define END_PUSH_CONSTANTS }; | 9 | #define END_PUSH_CONSTANTS }; |
| 9 | #define UNIFORM(n) | 10 | #define UNIFORM(n) |
| 11 | #define FLIPY 1 | ||
| 10 | #else // ^^^ Vulkan ^^^ // vvv OpenGL vvv | 12 | #else // ^^^ Vulkan ^^^ // vvv OpenGL vvv |
| 13 | #define VERTEX_ID gl_VertexID | ||
| 11 | #define BEGIN_PUSH_CONSTANTS | 14 | #define BEGIN_PUSH_CONSTANTS |
| 12 | #define END_PUSH_CONSTANTS | 15 | #define END_PUSH_CONSTANTS |
| 16 | #define FLIPY -1 | ||
| 13 | #define UNIFORM(n) layout (location = n) uniform | 17 | #define UNIFORM(n) layout (location = n) uniform |
| 18 | out gl_PerVertex { | ||
| 19 | vec4 gl_Position; | ||
| 20 | }; | ||
| 14 | #endif | 21 | #endif |
| 15 | 22 | ||
| 16 | BEGIN_PUSH_CONSTANTS | 23 | BEGIN_PUSH_CONSTANTS |
| @@ -21,8 +28,8 @@ END_PUSH_CONSTANTS | |||
| 21 | layout(location = 0) out vec2 texcoord; | 28 | layout(location = 0) out vec2 texcoord; |
| 22 | 29 | ||
| 23 | void main() { | 30 | void main() { |
| 24 | float x = float((gl_VertexIndex & 1) << 2); | 31 | float x = float((VERTEX_ID & 1) << 2); |
| 25 | float y = float((gl_VertexIndex & 2) << 1); | 32 | float y = float((VERTEX_ID & 2) << 1); |
| 26 | gl_Position = vec4(x - 1.0, y - 1.0, 0.0, 1.0); | 33 | gl_Position = vec4(x - 1.0, FLIPY * (y - 1.0), 0.0, 1.0); |
| 27 | texcoord = fma(vec2(x, y) / 2.0, tex_scale, tex_offset); | 34 | texcoord = fma(vec2(x, y) / 2.0, tex_scale, tex_offset); |
| 28 | } | 35 | } |