From 29a1b1539fb2e0e82d02e521954b163c6d9d55d1 Mon Sep 17 00:00:00 2001 From: ns6089 <61738816+ns6089@users.noreply.github.com> Date: Fri, 17 Nov 2023 16:43:12 +0300 Subject: [PATCH] Fix incorrect portrait mode rotation center on Windows (#1851) --- .../windows/assets/shaders/directx/include/base_vs.hlsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 5fc9226b..c04fad39 100644 --- a/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl +++ b/src_assets/windows/assets/shaders/directx/include/base_vs.hlsl @@ -2,7 +2,7 @@ #if defined(LEFT_SUBSAMPLING) vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, float subsample_offset, int rotate_texture_steps) -#elif defined (TOPLEFT_SUBSAMPLING) +#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) @@ -29,7 +29,7 @@ vertex_t generate_fullscreen_triangle_vertex(uint vertex_id, int rotate_texture_ float2x2 rotation_matrix = { cos(rotation_radians), -sin(rotation_radians), sin(rotation_radians), cos(rotation_radians) }; float2 rotation_center = { 0.5, 0.5 }; - tex_coord = round(tex_coord + mul(rotation_matrix, tex_coord - rotation_center)); + tex_coord = round(rotation_center + mul(rotation_matrix, tex_coord - rotation_center)); } #if defined(LEFT_SUBSAMPLING)