add set scissor functions
This commit is contained in:
parent
b3639d9c88
commit
9824b0c25b
34
vulkan.d
34
vulkan.d
@ -1544,16 +1544,34 @@ BindPipeline(Vulkan* vk, VkCommandBuffer cmd, PipelineHandles* pipeline)
|
||||
|
||||
vkCmdSetViewport(cmd, 0, 1, &viewport);
|
||||
|
||||
VkRect2D scissor = {
|
||||
extent: {
|
||||
width: vk.swapchain_extent.width,
|
||||
height: vk.swapchain_extent.height,
|
||||
},
|
||||
};
|
||||
|
||||
vkCmdSetScissor(cmd, 0, 1, &scissor);
|
||||
ResetScissor(vk, cmd);
|
||||
}
|
||||
|
||||
void
|
||||
SetScissor(Vulkan* vk, u32 x, u32 y, u32 h, u32 w)
|
||||
{
|
||||
VkRect2D scissor = {
|
||||
offset: { x: x, y: y },
|
||||
extent: { width: w, height: h },
|
||||
};
|
||||
|
||||
vkCmdSetScissor(vk.cmds[vk.frame_index], 0, 1, &scissor);
|
||||
}
|
||||
|
||||
void
|
||||
ResetScissor(Vulkan* vk, VkCommandBuffer cmd = cast(VkCommandBuffer)VK_NULL_HANDLE)
|
||||
{
|
||||
cmd = cmd == VK_NULL_HANDLE ? vk.cmds[vk.frame_index] : cmd;
|
||||
|
||||
VkRect2D scissor = {
|
||||
offset: { x: 0, y: 0 },
|
||||
extent: { width: vk.swapchain_extent.width, height: vk.swapchain_extent.height },
|
||||
};
|
||||
|
||||
vkCmdSetScissor(cmd, 0, 1, &scissor);
|
||||
}
|
||||
|
||||
|
||||
pragma(inline): void
|
||||
Transition(VkCommandBuffer cmd, VkImage image, VkImageLayout current_layout, VkImageLayout new_layout)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user