Fixed some render graph ctors and added if checks for buffers
This commit is contained in:
parent
335c19cfc7
commit
8ac2c39e2b
|
@ -40,8 +40,8 @@ namespace Sandbox
|
|||
|
||||
// Create Stress Test Objects
|
||||
static const SHVec3 TEST_OBJ_SCALE = { 0.2f, 0.2f, 0.2f };
|
||||
constexpr int NUM_ROWS = 200;
|
||||
constexpr int NUM_COLS = 100;
|
||||
constexpr int NUM_ROWS = 1;
|
||||
constexpr int NUM_COLS = 1;
|
||||
static const SHVec3 TEST_OBJ_SPACING = { 1.0f, 1.0f, 1.0f };
|
||||
static const SHVec3 TEST_OBJ_START_POS = { - (NUM_COLS / 2 * TEST_OBJ_SPACING.x ), 0.0f, 0.0f };
|
||||
for (int z = 0; z < NUM_ROWS; ++z)
|
||||
|
|
|
@ -324,11 +324,14 @@ namespace SHADE
|
|||
void SHVkCommandBuffer::BindVertexBuffer (uint32_t bindingPoint, Handle<SHVkBuffer> const& buffer, vk::DeviceSize offset) noexcept
|
||||
{
|
||||
if (cmdBufferState == SH_CMD_BUFFER_STATE::RECORDING)
|
||||
{
|
||||
if (buffer)
|
||||
{
|
||||
auto bufferHandle = buffer->GetVkBuffer();
|
||||
vkCommandBuffer.bindVertexBuffers (bindingPoint, 1, &bufferHandle, &offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
/*!
|
||||
|
@ -445,6 +448,7 @@ namespace SHADE
|
|||
return;
|
||||
}
|
||||
|
||||
if (indirectDrawData)
|
||||
vkCommandBuffer.drawIndexedIndirect(indirectDrawData->GetVkBuffer(), 0, drawCount, sizeof(vk::DrawIndexedIndirectCommand));
|
||||
}
|
||||
|
||||
|
|
|
@ -130,6 +130,7 @@ namespace SHADE
|
|||
}
|
||||
|
||||
// Transfer to GPU
|
||||
if (transformDataBuffer[frameIndex])
|
||||
transformDataBuffer[frameIndex]->WriteToMemory(transformData.data(), transformData.size() * sizeof(SHMatrix), 0, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -135,11 +135,13 @@ namespace SHADE
|
|||
//worldRenderGraph->AddResource("Position", SH_ATT_DESC_TYPE::COLOR, windowDims.first, windowDims.second, vk::Format::eR16G16B16A16Sfloat);
|
||||
//worldRenderGraph->AddResource("Normals", SH_ATT_DESC_TYPE::COLOR, windowDims.first, windowDims.second, vk::Format::eR16G16B16A16Sfloat);
|
||||
//worldRenderGraph->AddResource("Composite", SH_ATT_DESC_TYPE::COLOR, windowDims.first, windowDims.second, vk::Format::eR16G16B16A16Sfloat);
|
||||
worldRenderGraph->AddResource("Scene", SH_ATT_DESC_TYPE::COLOR, windowDims.first, windowDims.second, vk::Format::eB8G8R8A8Unorm);
|
||||
worldRenderGraph->AddResource("Present", SH_ATT_DESC_TYPE::COLOR_PRESENT, windowDims.first, windowDims.second);
|
||||
auto node = worldRenderGraph->AddNode("G-Buffer", { /*"Composite", "Position", "Normals",*/ "Present" }, {}); // no predecessors
|
||||
auto node = worldRenderGraph->AddNode("G-Buffer", { /*"Composite", "Position", */"Present" }, {}); // no predecessors
|
||||
|
||||
//First subpass to write to G-Buffer
|
||||
auto gBufferWriteSubpass = node->AddSubpass("G-Buffer Write");
|
||||
//gBufferWriteSubpass->AddColorOutput("Scene");
|
||||
gBufferWriteSubpass->AddColorOutput("Present");
|
||||
//writeSubpass->AddColorOutput("Normals");
|
||||
|
||||
|
@ -149,11 +151,11 @@ namespace SHADE
|
|||
//compositeSubpass->AddInput("Normals");
|
||||
//compositeSubpass->AddInput("Position");
|
||||
|
||||
#ifdef SHEDITOR
|
||||
//#ifdef SHEDITOR
|
||||
auto imguiNode = worldRenderGraph->AddNode("ImGui Node", { "Present" }, {});
|
||||
auto imguiSubpass = imguiNode->AddSubpass("ImGui Draw");
|
||||
imguiSubpass->AddColorOutput("Present");
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
worldRenderGraph->Generate();
|
||||
|
||||
|
|
|
@ -524,6 +524,7 @@ namespace SHADE
|
|||
, configured{ rhs.configured }
|
||||
, executed{ rhs.executed }
|
||||
, ptrToResources{ rhs.ptrToResources }
|
||||
, pipelineLibrary{ std::move (rhs.pipelineLibrary) }
|
||||
{
|
||||
rhs.renderpass = {};
|
||||
}
|
||||
|
@ -544,6 +545,7 @@ namespace SHADE
|
|||
resourceAttachmentMapping = std::move(rhs.resourceAttachmentMapping);
|
||||
subpassIndexing = std::move(rhs.subpassIndexing);
|
||||
ptrToResources = std::move(rhs.ptrToResources);
|
||||
pipelineLibrary = std::move (rhs.pipelineLibrary);
|
||||
|
||||
rhs.renderpass = {};
|
||||
|
||||
|
@ -993,6 +995,34 @@ namespace SHADE
|
|||
|
||||
}
|
||||
|
||||
SHRenderGraph::SHRenderGraph(SHRenderGraph&& rhs) noexcept
|
||||
: logicalDeviceHdl{ rhs.logicalDeviceHdl }
|
||||
, swapchainHdl{ rhs.swapchainHdl}
|
||||
, nodeIndexing {std::move (rhs.nodeIndexing)}
|
||||
, nodes{ std::move (rhs.nodes)}
|
||||
, graphResources{std::move(rhs.graphResources)}
|
||||
, resourceManager{std::move (rhs.resourceManager)}
|
||||
, globalData {rhs.globalData}
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SHRenderGraph& SHRenderGraph::operator=(SHRenderGraph&& rhs) noexcept
|
||||
{
|
||||
if (&rhs == this)
|
||||
return *this;
|
||||
|
||||
logicalDeviceHdl = rhs.logicalDeviceHdl;
|
||||
swapchainHdl = rhs.swapchainHdl;
|
||||
nodeIndexing = std::move(rhs.nodeIndexing);
|
||||
nodes = std::move(rhs.nodes);
|
||||
graphResources = std::move(rhs.graphResources);
|
||||
resourceManager = std::move(rhs.resourceManager);
|
||||
globalData = rhs.globalData;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
/*!
|
||||
|
||||
|
|
|
@ -279,6 +279,9 @@ namespace SHADE
|
|||
/* CTORS AND DTORS */
|
||||
/*-----------------------------------------------------------------------*/
|
||||
SHRenderGraph (void) noexcept;
|
||||
SHRenderGraph(SHRenderGraph&& rhs) noexcept;
|
||||
SHRenderGraph& operator=(SHRenderGraph&& rhs) noexcept;
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
/* PUBLIC MEMBER FUNCTIONS */
|
||||
|
|
Loading…
Reference in New Issue