mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-14 09:08:59 +02:00
fixup sgsr for realsies
This commit is contained in:
parent
b54cc42afd
commit
f0cb194a57
5 changed files with 92 additions and 105 deletions
|
|
@ -79,8 +79,8 @@ set(SHADER_FILES
|
|||
|
||||
# Snapdragon Game Super Resolution
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sgsr1_shader.vert
|
||||
${snapdragon_gsr_SOURCE_DIR}/sgsr/v1/include/glsl/sgsr1_shader_mobile.frag
|
||||
${snapdragon_gsr_SOURCE_DIR}/sgsr/v1/include/glsl/sgsr1_shader_mobile_edge_direction.frag
|
||||
${sgsr_SOURCE_DIR}/sgsr/v1/include/glsl/sgsr1_shader_mobile.frag
|
||||
${sgsr_SOURCE_DIR}/sgsr/v1/include/glsl/sgsr1_shader_mobile_edge_direction.frag
|
||||
)
|
||||
|
||||
if (PLATFORM_HAIKU)
|
||||
|
|
@ -217,4 +217,4 @@ add_custom_target(host_shaders
|
|||
SOURCES
|
||||
${SHADER_SOURCES}
|
||||
)
|
||||
#add_dependencies(host_shaders snapdragon_gsr::snapdragon_gsr)
|
||||
#add_dependencies(host_shaders sgsr::sgsr)
|
||||
|
|
|
|||
|
|
@ -116,11 +116,13 @@ VkImageView SGSR::Draw(Scheduler& scheduler, size_t image_index, VkImage source_
|
|||
const f32 viewport_width = (crop_rect.right - crop_rect.left) * input_image_width;
|
||||
const f32 viewport_height = (crop_rect.bottom - crop_rect.top) * input_image_height;
|
||||
|
||||
// p = (tex * viewport) / input = [0,n] (normalized texcoords)
|
||||
// p * input = [0,1024], [0,768]
|
||||
PushConstants viewport_con{};
|
||||
viewport_con[0] = std::bit_cast<u32>(1.f / output_image_width);
|
||||
viewport_con[1] = std::bit_cast<u32>(1.f / output_image_height);
|
||||
viewport_con[2] = std::bit_cast<u32>(output_image_width);
|
||||
viewport_con[3] = std::bit_cast<u32>(output_image_height);
|
||||
viewport_con[0] = std::bit_cast<u32>(1.f / viewport_width);
|
||||
viewport_con[1] = std::bit_cast<u32>(1.f / viewport_height);
|
||||
viewport_con[2] = std::bit_cast<u32>(viewport_width);
|
||||
viewport_con[3] = std::bit_cast<u32>(viewport_height);
|
||||
|
||||
UploadImages(scheduler);
|
||||
UpdateDescriptorSets(source_image_view, image_index);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue