Skip to content

Commit

Permalink
convert to dynamic rendering over render passes
Browse files Browse the repository at this point in the history
  • Loading branch information
WinteryFox committed Jan 29, 2024
1 parent 1ead02e commit 07b2c27
Show file tree
Hide file tree
Showing 29 changed files with 699 additions and 672 deletions.
7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/discord.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions src/engine/AttachmentInfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once

namespace Vixen {
enum class LoadAction;

enum class StoreAction;

struct AttachmentInfo {
LoadAction loadAction;

StoreAction storeAction;

VkImageLayout layout;

VkImageView loadStoreTarget;

VkImageView resolveTarget;

glm::vec4 clearColor;

float clearDepth;

uint32_t clearStencil;
};
}
4 changes: 4 additions & 0 deletions src/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ set(
IndexFormat.h
PrimitiveTopology.h
VertexAttribute.h
AttachmentInfo.h
LoadAction.h
StoreAction.h
Rectangle.h
)

add_library(Vixen STATIC ${SOURCES})
Expand Down
9 changes: 9 additions & 0 deletions src/engine/LoadAction.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

namespace Vixen {
enum class LoadAction {
Load,
Clear,
DontCare
};
}
13 changes: 13 additions & 0 deletions src/engine/Rectangle.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

namespace Vixen {
struct Rectangle {
float x;

float y;

float width;

float height;
};
}
10 changes: 10 additions & 0 deletions src/engine/StoreAction.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once

namespace Vixen {
enum class StoreAction {
Store,
Resolve,
StoreAndResolve,
DontCare
};
}
4 changes: 0 additions & 4 deletions src/engine/vk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,12 @@ add_library(
VkRenderer.h
VkPipelineLayout.cpp
VkPipelineLayout.h
VkRenderPass.cpp
VkRenderPass.h
VkCommandBuffer.cpp
VkCommandBuffer.h
VkCommandPool.cpp
VkCommandPool.h
VkFence.cpp
VkFence.h
VkFramebuffer.cpp
VkFramebuffer.h
VkImage.cpp
VkImage.h
VkImageView.cpp
Expand Down
25 changes: 18 additions & 7 deletions src/engine/vk/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,24 @@ namespace Vixen::Vk {

VkPhysicalDeviceFeatures deviceFeatures{};

VkDeviceCreateInfo deviceInfo{};
deviceInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
deviceInfo.queueCreateInfoCount = queueInfos.size();
deviceInfo.pQueueCreateInfos = queueInfos.data();
deviceInfo.pEnabledFeatures = &deviceFeatures;
deviceInfo.enabledExtensionCount = extensions.size();
deviceInfo.ppEnabledExtensionNames = extensions.data();
VkPhysicalDeviceDynamicRenderingFeatures dynamicRenderingFeatures{
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES,
.pNext = nullptr,
.dynamicRendering = VK_TRUE
};

VkDeviceCreateInfo deviceInfo{
.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
.pNext = &dynamicRenderingFeatures,
.flags = 0,
.queueCreateInfoCount = static_cast<uint32_t>(queueInfos.size()),
.pQueueCreateInfos = queueInfos.data(),
.enabledLayerCount = 0,
.ppEnabledLayerNames = nullptr,
.enabledExtensionCount = static_cast<uint32_t>(extensions.size()),
.ppEnabledExtensionNames = extensions.data(),
.pEnabledFeatures = &deviceFeatures
};

spdlog::info(
"Creating new Vulkan device using GPU \"{}\" Vulkan {}",
Expand Down
Loading

0 comments on commit 07b2c27

Please sign in to comment.