[Vulkan] Support window scissor in IssueCopy

This commit is contained in:
DrChat
2017-12-21 22:38:35 -06:00
parent 2e1d33b8d3
commit 4cfe1e3203
22 changed files with 324 additions and 184 deletions

View File

@@ -32,13 +32,21 @@ class Blitter {
void Shutdown();
// Queues commands to blit a texture to another texture.
//
// src_rect is the rectangle of pixels to copy from the source
// src_extents is the actual size of the source image
// dst_rect is the rectangle of pixels that are replaced with the source
// dst_extents is the actual size of the destination image
// dst_framebuffer must only have one attachment, the target texture.
// viewport is the viewport rect (set to {0, 0, dst_w, dst_h} if unsure)
// scissor is the scissor rect for the dest (set to dst size if unsure)
void BlitTexture2D(VkCommandBuffer command_buffer, VkFence fence,
VkImageView src_image_view, VkRect2D src_rect,
VkExtent2D src_extents, VkFormat dst_image_format,
VkOffset2D dst_offset, VkExtent2D dst_extents,
VkFramebuffer dst_framebuffer, VkFilter filter,
bool color_or_depth, bool swap_channels);
VkRect2D dst_rect, VkExtent2D dst_extents,
VkFramebuffer dst_framebuffer, VkViewport viewport,
VkRect2D scissor, VkFilter filter, bool color_or_depth,
bool swap_channels);
void CopyColorTexture2D(VkCommandBuffer command_buffer, VkFence fence,
VkImage src_image, VkImageView src_image_view,
@@ -56,11 +64,12 @@ class Blitter {
private:
struct VtxPushConstants {
float src_uv[4]; // 0x00
float dst_uv[4]; // 0x10
};
struct PixPushConstants {
int _pad[3]; // 0x10
int swap; // 0x1C
int _pad[3]; // 0x20
int swap; // 0x2C
};
VkPipeline GetPipeline(VkRenderPass render_pass, VkShaderModule frag_shader,