re-add clear colors to beginrendering
This commit is contained in:
parent
f1607043e5
commit
b1902658aa
18
vulkan.d
18
vulkan.d
@ -435,6 +435,9 @@ struct Vulkan
|
|||||||
BufferView a_buffer_view;
|
BufferView a_buffer_view;
|
||||||
ImageView aux_image;
|
ImageView aux_image;
|
||||||
|
|
||||||
|
f32[4] color_clear;
|
||||||
|
f32[4] depth_clear;
|
||||||
|
|
||||||
alias queues this;
|
alias queues this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -770,6 +773,13 @@ BeginFrame(Vulkan* vk)
|
|||||||
VkCheckA("BeginFrame failure: vkBeginCommandBuffer error", result);
|
VkCheckA("BeginFrame failure: vkBeginCommandBuffer error", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetClearColors(Vulkan* vk, f32[4] color_clear, f32[4] depth_clear)
|
||||||
|
{
|
||||||
|
vk.color_clear = color_clear;
|
||||||
|
vk.depth_clear = depth_clear;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BeginRendering(Vulkan* vk)
|
BeginRendering(Vulkan* vk)
|
||||||
{
|
{
|
||||||
@ -782,12 +792,12 @@ BeginRendering(Vulkan* vk)
|
|||||||
VkClearValue[2] clear_color = [
|
VkClearValue[2] clear_color = [
|
||||||
{
|
{
|
||||||
color: {
|
color: {
|
||||||
float32: [0.0, 0.0, 0.0, 1.0],
|
float32: vk.color_clear,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: {
|
color: {
|
||||||
float32: [0.0, 0.0, 0.0, 0.0],
|
float32: vk.depth_clear,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -806,8 +816,8 @@ BeginRendering(Vulkan* vk)
|
|||||||
height: vk.swapchain_extent.height,
|
height: vk.swapchain_extent.height,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
//clearValueCount: cast(u32)clear_color.length,
|
clearValueCount: cast(u32)clear_color.length,
|
||||||
//pClearValues: clear_color.ptr,
|
pClearValues: clear_color.ptr,
|
||||||
};
|
};
|
||||||
|
|
||||||
vkCmdBeginRenderPass(vk.cmds[vk.frame_index], &pass_info, VK_SUBPASS_CONTENTS_INLINE);
|
vkCmdBeginRenderPass(vk.cmds[vk.frame_index], &pass_info, VK_SUBPASS_CONTENTS_INLINE);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user