Apply clang-format to demos project as well

This commit is contained in:
baldurk
2020-01-16 12:40:47 +00:00
parent ca07c1626e
commit 892abb686f
2 changed files with 20 additions and 33 deletions
+1 -3
View File
@@ -57,6 +57,4 @@ if ! valid_clang_format; then
fi;
# Search through the code that should be formatted, exclude any non-renderdoc code.
FILES=$(find qrenderdoc/ renderdoc/ renderdoccmd/ renderdocshim/ -type f -regex '.*\(/3rdparty/\|/official/\|resource.h\).*' -prune -o -regex '.*\.\(c\|cpp\|h\|vert\|frag\|geom\|comp\|hlsl\)$' -print)
$CLANG_FORMAT -i -style=file $FILES
find qrenderdoc/ renderdoc/ renderdoccmd/ renderdocshim/ util/test/demos/ -type f -regex '.*\(/3rdparty/\|/official/\|resource.h\).*' -prune -o -regex '.*\.\(c\|cpp\|h\|vert\|frag\|geom\|comp\|hlsl\)$' -print0 | xargs -0 -n1 $CLANG_FORMAT -i -style=file
@@ -143,33 +143,29 @@ void main()
};
AllocatedBuffer stencilVB(
this,
vkh::BufferCreateInfo(sizeof(stencilTri),
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT),
this, vkh::BufferCreateInfo(sizeof(stencilTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT |
VK_BUFFER_USAGE_TRANSFER_DST_BIT),
VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU}));
stencilVB.upload(stencilTri);
AllocatedBuffer depthVB(
this,
vkh::BufferCreateInfo(sizeof(depthTri),
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT),
this, vkh::BufferCreateInfo(sizeof(depthTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT |
VK_BUFFER_USAGE_TRANSFER_DST_BIT),
VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU}));
depthVB.upload(depthTri);
AllocatedBuffer inputAttVB(
this,
vkh::BufferCreateInfo(sizeof(inputAttTri),
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT),
this, vkh::BufferCreateInfo(sizeof(inputAttTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT |
VK_BUFFER_USAGE_TRANSFER_DST_BIT),
VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU}));
inputAttVB.upload(inputAttTri);
AllocatedBuffer colorVB(
this,
vkh::BufferCreateInfo(sizeof(DefaultTri),
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT),
this, vkh::BufferCreateInfo(sizeof(DefaultTri), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT |
VK_BUFFER_USAGE_TRANSFER_DST_BIT),
VmaAllocationCreateInfo({0, VMA_MEMORY_USAGE_CPU_TO_GPU}));
colorVB.upload(colorTri);
@@ -265,8 +261,7 @@ void main()
renderPassCreateInfo.addSubpass(
{vkh::AttachmentReference2KHR(0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
VK_IMAGE_ASPECT_COLOR_BIT)},
vkh::AttachmentReference2KHR(),
{},
vkh::AttachmentReference2KHR(), {},
{vkh::AttachmentReference2KHR(1, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
VK_IMAGE_ASPECT_DEPTH_BIT)});
@@ -311,11 +306,10 @@ void main()
CHECK_VKR(vkCreateImageView(
device, vkh::ImageViewCreateInfo(colorImg.image, VK_IMAGE_VIEW_TYPE_2D, mainWindow->format),
NULL, &colorView));
CHECK_VKR(
vkCreateFramebuffer(device,
vkh::FramebufferCreateInfo(renderPass, {colorView, depthStencilView},
mainWindow->scissor.extent),
NULL, &frameBuffer));
CHECK_VKR(vkCreateFramebuffer(
device, vkh::FramebufferCreateInfo(renderPass, {colorView, depthStencilView},
mainWindow->scissor.extent),
NULL, &frameBuffer));
}
VkPipeline stencilPipe = VK_NULL_HANDLE;
@@ -340,8 +334,7 @@ void main()
stencilPipeCreateInfo.vertexInputState.vertexBindingDescriptions = {
vkh::vertexBind(0, DefaultA2V)};
stencilPipeCreateInfo.vertexInputState.vertexAttributeDescriptions = {
vkh::vertexAttr(0, 0, DefaultA2V, pos),
vkh::vertexAttr(1, 0, DefaultA2V, col),
vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col),
vkh::vertexAttr(2, 0, DefaultA2V, uv),
};
stencilPipeCreateInfo.stages = {
@@ -368,8 +361,7 @@ void main()
depthPipeCreateInfo.vertexInputState.vertexBindingDescriptions = {
vkh::vertexBind(0, DefaultA2V)};
depthPipeCreateInfo.vertexInputState.vertexAttributeDescriptions = {
vkh::vertexAttr(0, 0, DefaultA2V, pos),
vkh::vertexAttr(1, 0, DefaultA2V, col),
vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col),
vkh::vertexAttr(2, 0, DefaultA2V, uv),
};
depthPipeCreateInfo.stages = {
@@ -396,8 +388,7 @@ void main()
inputAttPipeCreateInfo.vertexInputState.vertexBindingDescriptions = {
vkh::vertexBind(0, DefaultA2V)};
inputAttPipeCreateInfo.vertexInputState.vertexAttributeDescriptions = {
vkh::vertexAttr(0, 0, DefaultA2V, pos),
vkh::vertexAttr(1, 0, DefaultA2V, col),
vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col),
vkh::vertexAttr(2, 0, DefaultA2V, uv),
};
inputAttPipeCreateInfo.stages = {
@@ -424,8 +415,7 @@ void main()
colorPipeCreateInfo.vertexInputState.vertexBindingDescriptions = {
vkh::vertexBind(0, DefaultA2V)};
colorPipeCreateInfo.vertexInputState.vertexAttributeDescriptions = {
vkh::vertexAttr(0, 0, DefaultA2V, pos),
vkh::vertexAttr(1, 0, DefaultA2V, col),
vkh::vertexAttr(0, 0, DefaultA2V, pos), vkh::vertexAttr(1, 0, DefaultA2V, col),
vkh::vertexAttr(2, 0, DefaultA2V, uv),
};
colorPipeCreateInfo.stages = {
@@ -465,9 +455,8 @@ void main()
});
vkCmdBeginRenderPass(
cmd,
vkh::RenderPassBeginInfo(renderPass, frameBuffer, mainWindow->scissor,
{vkh::ClearValue(1, 0, 1, 1), vkh::ClearValue(1.0f, 0)}),
cmd, vkh::RenderPassBeginInfo(renderPass, frameBuffer, mainWindow->scissor,
{vkh::ClearValue(1, 0, 1, 1), vkh::ClearValue(1.0f, 0)}),
VK_SUBPASS_CONTENTS_INLINE);
vkCmdSetViewport(cmd, 0, 1, &mainWindow->viewport);
vkCmdSetScissor(cmd, 0, 1, &mainWindow->scissor);