Runs on MacOS, tho window size is terrible
This commit is contained in:
@@ -71,7 +71,6 @@ void BasePass::render()
|
||||
tLightGrid->pipelineBarrier(
|
||||
Gfx::SE_ACCESS_SHADER_WRITE_BIT, Gfx::SE_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
||||
Gfx::SE_ACCESS_SHADER_READ_BIT, Gfx::SE_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
|
||||
colorBuffer->changeLayout(Gfx::SE_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
||||
|
||||
descriptorSets[INDEX_VIEW_PARAMS] = viewParamsSet;
|
||||
descriptorSets[INDEX_LIGHT_ENV] = scene->getLightEnvironment()->getDescriptorSet();
|
||||
@@ -186,14 +185,7 @@ void BasePass::endFrame()
|
||||
|
||||
void BasePass::publishOutputs()
|
||||
{
|
||||
colorBuffer = graphics->createTexture2D(TextureCreateInfo{
|
||||
.format = viewport->getOwner()->getBackBuffer()->getFormat(),
|
||||
.width = viewport->getWidth(),
|
||||
.height = viewport->getHeight(),
|
||||
.samples = viewport->getSamples(),
|
||||
.usage = Gfx::SE_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
|
||||
});
|
||||
colorAttachment = new Gfx::RenderTargetAttachment(colorBuffer, Gfx::SE_ATTACHMENT_LOAD_OP_CLEAR, Gfx::SE_ATTACHMENT_STORE_OP_STORE);
|
||||
colorAttachment = new Gfx::SwapchainAttachment(viewport, Gfx::SE_ATTACHMENT_LOAD_OP_CLEAR, Gfx::SE_ATTACHMENT_STORE_OP_STORE);
|
||||
resources->registerRenderPassOutput("BASEPASS_COLOR", colorAttachment);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ public:
|
||||
static void modifyRenderPassMacros(Map<const char*, const char*>& defines);
|
||||
private:
|
||||
Gfx::ORenderTargetAttachment colorAttachment;
|
||||
Gfx::OTexture2D colorBuffer;
|
||||
Gfx::PTexture2D depthBuffer;
|
||||
Gfx::PShaderBuffer oLightIndexList;
|
||||
Gfx::PShaderBuffer tLightIndexList;
|
||||
|
||||
@@ -148,26 +148,19 @@ void DepthPrepass::publishOutputs()
|
||||
.format = Gfx::SE_FORMAT_D32_SFLOAT,
|
||||
.width = viewport->getOwner()->getFramebufferWidth(),
|
||||
.height = viewport->getOwner()->getFramebufferHeight(),
|
||||
.samples = viewport->getSamples(),
|
||||
.usage = Gfx::SE_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
|
||||
};
|
||||
depthBuffer = graphics->createTexture2D(depthBufferInfo);
|
||||
depthAttachment =
|
||||
new Gfx::RenderTargetAttachment(depthBuffer, Gfx::SE_ATTACHMENT_LOAD_OP_CLEAR, Gfx::SE_ATTACHMENT_STORE_OP_STORE);
|
||||
depthAttachment->clear.depthStencil.depth = 1.0f;
|
||||
depthBufferInfo.samples = Gfx::SE_SAMPLE_COUNT_1_BIT;
|
||||
depthResolveBuffer = graphics->createTexture2D(depthBufferInfo);
|
||||
depthResolveAttachment =
|
||||
new Gfx::RenderTargetAttachment(depthResolveBuffer, Gfx::SE_ATTACHMENT_LOAD_OP_DONT_CARE, Gfx::SE_ATTACHMENT_STORE_OP_STORE);
|
||||
resources->registerRenderPassOutput("DEPTHPREPASS_DEPTH", depthAttachment);
|
||||
resources->registerRenderPassOutput("DEPTHPREPASS_RESOLVED_DEPTH", depthResolveAttachment);
|
||||
}
|
||||
|
||||
void DepthPrepass::createRenderPass()
|
||||
{
|
||||
Gfx::ORenderTargetLayout layout = new Gfx::RenderTargetLayout{
|
||||
.depthAttachment = depthAttachment,
|
||||
.depthResolveAttachment = depthResolveAttachment,
|
||||
};
|
||||
renderPass = graphics->createRenderPass(std::move(layout), viewport);
|
||||
}
|
||||
|
||||
@@ -19,9 +19,7 @@ public:
|
||||
static void modifyRenderPassMacros(Map<const char*, const char*>& defines);
|
||||
private:
|
||||
Gfx::ORenderTargetAttachment depthAttachment;
|
||||
Gfx::ORenderTargetAttachment depthResolveAttachment;
|
||||
Gfx::OTexture2D depthBuffer;
|
||||
Gfx::OTexture2D depthResolveBuffer;
|
||||
|
||||
Array<Gfx::PDescriptorSet> descriptorSets;
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ void LightCullingPass::publishOutputs()
|
||||
|
||||
void LightCullingPass::createRenderPass()
|
||||
{
|
||||
depthAttachment = resources->requestRenderTarget("DEPTHPREPASS_RESOLVED_DEPTH")->getTexture();
|
||||
depthAttachment = resources->requestRenderTarget("DEPTHPREPASS_DEPTH")->getTexture();
|
||||
}
|
||||
|
||||
void LightCullingPass::modifyRenderPassMacros(Map<const char*, const char*>&)
|
||||
|
||||
@@ -51,8 +51,6 @@ void SkyboxRenderPass::render()
|
||||
renderCommand->draw(36, 1, 0, 0);
|
||||
graphics->executeCommands(Array{ renderCommand });
|
||||
graphics->endRenderPass();
|
||||
baseColorAttachment->getTexture()->changeLayout(Gfx::SE_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
|
||||
graphics->resolveTexture(baseColorAttachment->getTexture(), viewport->getOwner()->getBackBuffer());
|
||||
}
|
||||
|
||||
void SkyboxRenderPass::endFrame()
|
||||
|
||||
Reference in New Issue
Block a user