clear is here, draw is not
This commit is contained in:
@@ -37,7 +37,8 @@ DECLARE_VULKAN_COMMAND(Begin)
|
||||
VkRenderingAttachmentInfo a = {};
|
||||
a.sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO;
|
||||
a.imageLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||
a.loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||
a.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
||||
a.clearValue.color.float32[1] = 1;
|
||||
a.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
||||
a.imageView = ((CVkImage*)VulkanGetObject(i.m_stImage, iCurrentFrame))->m_imageView;
|
||||
attachments.AppendTail(a);
|
||||
@@ -74,3 +75,31 @@ DECLARE_VULKAN_COMMAND(DrawPrimitives)
|
||||
{
|
||||
vkCmdDraw(hCommandBuffer, nVertexCount, nInstanceCount, nFirstVertex, nFirstInstance);
|
||||
}
|
||||
|
||||
DECLARE_VULKAN_COMMAND(SetScissors)
|
||||
{
|
||||
VkRect2D r = {
|
||||
.offset = {
|
||||
iX,
|
||||
iY,
|
||||
},
|
||||
.extent = {
|
||||
uWidth,
|
||||
uHeight,
|
||||
},
|
||||
};
|
||||
vkCmdSetScissorWithCount(hCommandBuffer, 1, &r);
|
||||
}
|
||||
|
||||
DECLARE_VULKAN_COMMAND(SetViewport)
|
||||
{
|
||||
VkViewport v = {
|
||||
fX,
|
||||
fY,
|
||||
fWidth,
|
||||
fHeight,
|
||||
fDepthMin,
|
||||
fDepthMax
|
||||
};
|
||||
vkCmdSetViewportWithCount(hCommandBuffer, 1, &v);
|
||||
}
|
||||
|
||||
28
materialsystem/vulkan/commands/transfer.cpp
Normal file
28
materialsystem/vulkan/commands/transfer.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include "../vulkan_state.h"
|
||||
#include "../commands.h"
|
||||
#include "materialsystem/imaterialsystem.h"
|
||||
#include "tier0/platform.h"
|
||||
#include "tier1/utlvector.h"
|
||||
|
||||
DECLARE_VULKAN_COMMAND(Blit)
|
||||
{
|
||||
CVkImage *pVkInputImage = (CVkImage*)VulkanGetObject(stInputImage, iCurrentFrame);
|
||||
CVkImage *pVkOutputImage = (CVkImage*)VulkanGetObject(stOutputImage, iCurrentFrame);
|
||||
VkImageBlit stBlit = {
|
||||
.srcSubresource = {
|
||||
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
.layerCount = 1,
|
||||
},
|
||||
.dstSubresource = {
|
||||
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
.layerCount = 1,
|
||||
},
|
||||
};
|
||||
stBlit.srcOffsets[0].x = iSrcMin[0];
|
||||
stBlit.srcOffsets[0].y = iSrcMin[1];
|
||||
stBlit.srcOffsets[0].z = iSrcMin[2];
|
||||
stBlit.srcOffsets[1].x = iSrcMax[0];
|
||||
stBlit.srcOffsets[1].y = iSrcMax[1];
|
||||
stBlit.srcOffsets[1].z = iSrcMax[2];
|
||||
vkCmdBlitImage(hCommandBuffer, pVkInputImage->m_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, pVkOutputImage->m_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &stBlit, VK_FILTER_NEAREST)
|
||||
}
|
||||
Reference in New Issue
Block a user