diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_vs.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_vs.hlsl index eb9068b4187..fcbe2774475 100644 --- a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0_vs.hlsl @@ -11,5 +11,5 @@ cbuffer rotate_texture_steps_cbuffer : register(b1) { vertex_t main_vs(uint vertex_id : SV_VertexID) { - return generate_fullscreen_triangle_vertex(vertex_id, subsample_offset.x, rotate_texture_steps); + return generate_fullscreen_triangle_vertex(vertex_id, subsample_offset, rotate_texture_steps); } diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_vs.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_vs.hlsl index c6df6b49bad..fec99ca34aa 100644 --- a/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_packed_uv_type0s_vs.hlsl @@ -11,5 +11,5 @@ cbuffer rotate_texture_steps_cbuffer : register(b1) { vertex_t main_vs(uint vertex_id : SV_VertexID) { - return generate_fullscreen_triangle_vertex(vertex_id, subsample_offset / 2, rotate_texture_steps); + return generate_fullscreen_triangle_vertex(vertex_id, subsample_offset, rotate_texture_steps); } diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_vs.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_vs.hlsl index 33e481453ed..f9c774eb5cf 100644 --- a/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/convert_yuv420_planar_y_vs.hlsl @@ -6,5 +6,5 @@ cbuffer rotate_texture_steps_cbuffer : register(b1) { vertex_t main_vs(uint vertex_id : SV_VertexID) { - return generate_fullscreen_triangle_vertex(vertex_id, rotate_texture_steps); + return generate_fullscreen_triangle_vertex(vertex_id, float2(0, 0), rotate_texture_steps); } diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv444_packed_vs.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv444_packed_vs.hlsl index 33e481453ed..f9c774eb5cf 100644 --- a/src_assets/windows/assets/shaders/directx/convert_yuv444_packed_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/convert_yuv444_packed_vs.hlsl @@ -6,5 +6,5 @@ cbuffer rotate_texture_steps_cbuffer : register(b1) { vertex_t main_vs(uint vertex_id : SV_VertexID) { - return generate_fullscreen_triangle_vertex(vertex_id, rotate_texture_steps); + return generate_fullscreen_triangle_vertex(vertex_id, float2(0, 0), rotate_texture_steps); } diff --git a/src_assets/windows/assets/shaders/directx/convert_yuv444_planar_vs.hlsl b/src_assets/windows/assets/shaders/directx/convert_yuv444_planar_vs.hlsl index 566da5d8cf8..e8fa1370167 100644 --- a/src_assets/windows/assets/shaders/directx/convert_yuv444_planar_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/convert_yuv444_planar_vs.hlsl @@ -15,7 +15,7 @@ cbuffer color_matrix_cbuffer : register(b3) { vertex_t main_vs(uint vertex_id : SV_VertexID) { - vertex_t output = generate_fullscreen_triangle_vertex(vertex_id % 3, rotate_texture_steps); + vertex_t output = generate_fullscreen_triangle_vertex(vertex_id % 3, float2(0, 0), rotate_texture_steps); output.viewport = vertex_id / 3; diff --git a/src_assets/windows/assets/shaders/directx/cursor_vs.hlsl b/src_assets/windows/assets/shaders/directx/cursor_vs.hlsl index cf737ede7e4..2d62120ccf8 100644 --- a/src_assets/windows/assets/shaders/directx/cursor_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/cursor_vs.hlsl @@ -6,5 +6,5 @@ cbuffer rotate_texture_steps_cbuffer : register(b2) { vertex_t main_vs(uint vertex_id : SV_VertexID) { - return generate_fullscreen_triangle_vertex(vertex_id, rotate_texture_steps); + return generate_fullscreen_triangle_vertex(vertex_id, float2(0, 0), rotate_texture_steps); } diff --git a/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl b/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl index 287d252be83..8e6f2d92431 100644 --- a/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl @@ -1,14 +1,6 @@ #include "include/base_vs_types.hlsl" -#if defined(LEFT_SUBSAMPLING) -vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, float subsample_offset, int rotate_texture_steps) -#elif defined(LEFT_SUBSAMPLING_SCALE) -vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, float2 halfsample_offset, int rotate_texture_steps) -#elif defined(TOPLEFT_SUBSAMPLING) vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, float2 subsample_offset, int rotate_texture_steps) -#else -vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, int rotate_texture_steps) -#endif { vertex_t output; float2 tex_coord; @@ -32,11 +24,16 @@ vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, int rotate_texture_ sin(rotation_radians), cos(rotation_radians) }; float2 rotation_center = { 0.5, 0.5 }; tex_coord = round(rotation_center + mul(rotation_matrix, tex_coord - rotation_center)); + + if (rotate_texture_steps % 2) { + subsample_offset.xy = subsample_offset.yx; + } } #if defined(LEFT_SUBSAMPLING) - output.tex_right_left_center = float3(tex_coord.x, tex_coord.x - subsample_offset, tex_coord.y); + output.tex_right_left_center = float3(tex_coord.x, tex_coord.x - subsample_offset.x, tex_coord.y); #elif defined(LEFT_SUBSAMPLING_SCALE) + float2 halfsample_offset = subsample_offset / 2; float3 right_center_left = float3(tex_coord.x + halfsample_offset.x, tex_coord.x - halfsample_offset.x, tex_coord.x - 3 * halfsample_offset.x);