mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-11 00:58:57 +02:00
dont multiply shit randomly, just premult the texcoord to scale :)
This commit is contained in:
parent
f5da8df578
commit
dee9634db9
3 changed files with 27 additions and 41 deletions
|
|
@ -3,11 +3,15 @@
|
|||
|
||||
#version 450
|
||||
|
||||
layout( push_constant ) uniform constants {
|
||||
highp vec4 ViewportInfo[1];
|
||||
highp vec2 ResizeFactor;
|
||||
};
|
||||
layout(location = 0) out highp vec2 texcoord;
|
||||
|
||||
void main() {
|
||||
float x = float((gl_VertexIndex & 1) << 2);
|
||||
float y = float((gl_VertexIndex & 2) << 1);
|
||||
gl_Position = vec4(x - 1.0f, y - 1.0f, 0.0, 1.0f);
|
||||
texcoord = vec2(x, y) / 2.0;
|
||||
texcoord = vec2(x, y) * ResizeFactor * 0.5;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
namespace Vulkan {
|
||||
|
||||
using PushConstants = std::array<u32, 4>;
|
||||
using PushConstants = std::array<u32, 4 + 2>;
|
||||
|
||||
SGSR::SGSR(const Device& device, MemoryAllocator& memory_allocator, size_t image_count, VkExtent2D extent, bool edge_dir)
|
||||
: m_device{device}, m_memory_allocator{memory_allocator}
|
||||
|
|
@ -110,6 +110,8 @@ VkImageView SGSR::Draw(Scheduler& scheduler, size_t image_index, VkImage source_
|
|||
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);
|
||||
viewport_con[4] = std::bit_cast<u32>(viewport_width / input_image_width);
|
||||
viewport_con[5] = std::bit_cast<u32>(viewport_height / input_image_height);
|
||||
|
||||
UploadImages(scheduler);
|
||||
UpdateDescriptorSets(source_image_view, image_index);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue