Trying to fix fluid pass
This commit is contained in:
Vendored
-4
@@ -36,10 +36,6 @@
|
|||||||
"name": "ASAN_OPTIONS",
|
"name": "ASAN_OPTIONS",
|
||||||
"value": "detect_leaks=0",
|
"value": "detect_leaks=0",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "VK_INSTANCE_LAYERS",
|
|
||||||
"value": "VK_LAYER_KHRONOS_validation",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "DISABLE_VK_LAYER_VALVE_steam_overlay_1",
|
"name": "DISABLE_VK_LAYER_VALVE_steam_overlay_1",
|
||||||
"value": "1",
|
"value": "1",
|
||||||
|
|||||||
@@ -73,22 +73,15 @@ void FluidRenderPass::render() {
|
|||||||
void FluidRenderPass::endFrame() {}
|
void FluidRenderPass::endFrame() {}
|
||||||
|
|
||||||
void FluidRenderPass::publishOutputs() {
|
void FluidRenderPass::publishOutputs() {
|
||||||
depthTexture = graphics->createTexture2D(TextureCreateInfo{
|
|
||||||
.format = Gfx::SE_FORMAT_D32_SFLOAT,
|
|
||||||
.width = viewport->getWidth(),
|
|
||||||
.height = viewport->getHeight(),
|
|
||||||
.usage = Gfx::SE_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
|
|
||||||
.name = "FluidDepth",
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluidRenderPass::createRenderPass() {
|
void FluidRenderPass::createRenderPass() {
|
||||||
colorAttachment = Gfx::RenderTargetAttachment(viewport, Gfx::SE_IMAGE_LAYOUT_UNDEFINED, Gfx::SE_IMAGE_LAYOUT_PRESENT_SRC_KHR,
|
colorAttachment = resources->requestRenderTarget("BASEPASS_COLOR");
|
||||||
Gfx::SE_ATTACHMENT_LOAD_OP_CLEAR, Gfx::SE_ATTACHMENT_STORE_OP_STORE);
|
colorAttachment.setLoadOp(Gfx::SE_ATTACHMENT_LOAD_OP_LOAD);
|
||||||
depthAttachment = Gfx::RenderTargetAttachment(depthTexture->getDefaultView(), Gfx::SE_IMAGE_LAYOUT_UNDEFINED,
|
colorAttachment.setInitialLayout(Gfx::SE_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
||||||
Gfx::SE_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, Gfx::SE_ATTACHMENT_LOAD_OP_CLEAR,
|
depthAttachment = resources->requestRenderTarget("BASEPASS_DEPTH");
|
||||||
Gfx::SE_ATTACHMENT_STORE_OP_DONT_CARE);
|
depthAttachment.setLoadOp(Gfx::SE_ATTACHMENT_LOAD_OP_LOAD);
|
||||||
depthAttachment.clear.depthStencil.depth = 0.0f;
|
depthAttachment.setInitialLayout(Gfx::SE_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);
|
||||||
Gfx::RenderTargetLayout layout = Gfx::RenderTargetLayout{
|
Gfx::RenderTargetLayout layout = Gfx::RenderTargetLayout{
|
||||||
.colorAttachments = {colorAttachment},
|
.colorAttachments = {colorAttachment},
|
||||||
.depthAttachment = depthAttachment,
|
.depthAttachment = depthAttachment,
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ class FluidRenderPass : public RenderPass {
|
|||||||
private:
|
private:
|
||||||
Gfx::RenderTargetAttachment colorAttachment;
|
Gfx::RenderTargetAttachment colorAttachment;
|
||||||
Gfx::RenderTargetAttachment depthAttachment;
|
Gfx::RenderTargetAttachment depthAttachment;
|
||||||
Gfx::OTexture2D depthTexture;
|
|
||||||
|
|
||||||
Gfx::ODescriptorSet viewParamsSet;
|
Gfx::ODescriptorSet viewParamsSet;
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ RayTracingPass::RayTracingPass(Gfx::PGraphics graphics, PScene scene) : RenderPa
|
|||||||
.mainFile = "ClosestHit",
|
.mainFile = "ClosestHit",
|
||||||
.useMaterial = true,
|
.useMaterial = true,
|
||||||
.rayTracing = true,
|
.rayTracing = true,
|
||||||
.dumpIntermediates = true,
|
|
||||||
});
|
});
|
||||||
skyBox = AssetRegistry::findEnvironmentMap("", "newport_loft")->getSkybox();
|
skyBox = AssetRegistry::findEnvironmentMap("", "newport_loft")->getSkybox();
|
||||||
skyBoxSampler = graphics->createSampler({});
|
skyBoxSampler = graphics->createSampler({});
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ SurfaceExtractPass::SurfaceExtractPass(Gfx::PGraphics graphics, PScene scene) :
|
|||||||
.modules = {"MarchingCubes"},
|
.modules = {"MarchingCubes"},
|
||||||
.entryPoints = {{"marchingCubes", "MarchingCubes"}},
|
.entryPoints = {{"marchingCubes", "MarchingCubes"}},
|
||||||
.rootSignature = pipelineLayout,
|
.rootSignature = pipelineLayout,
|
||||||
|
.dumpIntermediate = true,
|
||||||
});
|
});
|
||||||
pipelineLayout->create();
|
pipelineLayout->create();
|
||||||
computeShader = graphics->createComputeShader({0});
|
computeShader = graphics->createComputeShader({0});
|
||||||
@@ -100,4 +101,4 @@ void SurfaceExtractPass::endFrame() {}
|
|||||||
|
|
||||||
void SurfaceExtractPass::publishOutputs() {}
|
void SurfaceExtractPass::publishOutputs() {}
|
||||||
|
|
||||||
void SurfaceExtractPass::createRenderPass() { }
|
void SurfaceExtractPass::createRenderPass() {}
|
||||||
@@ -268,7 +268,7 @@ void RenderCommand::bindDescriptor(Gfx::PDescriptorSet descriptor) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (descriptorSet->setHandle->constantsBuffer != nullptr) {
|
if (descriptorSet->setHandle->constantsBuffer != nullptr) {
|
||||||
descriptorSet->setHandle->bind();
|
descriptorSet->setHandle->constantsBuffer->bind();
|
||||||
boundResources.add(PBufferAllocation(descriptorSet->setHandle->constantsBuffer));
|
boundResources.add(PBufferAllocation(descriptorSet->setHandle->constantsBuffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ void RenderCommand::bindDescriptor(const Array<Gfx::PDescriptorSet>& descriptorS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (descriptorSet->setHandle->constantsBuffer != nullptr) {
|
if (descriptorSet->setHandle->constantsBuffer != nullptr) {
|
||||||
descriptorSet->setHandle->bind();
|
descriptorSet->setHandle->constantsBuffer->bind();
|
||||||
boundResources.add(PBufferAllocation(descriptorSet->setHandle->constantsBuffer));
|
boundResources.add(PBufferAllocation(descriptorSet->setHandle->constantsBuffer));
|
||||||
}
|
}
|
||||||
sets[layout->findParameter(descriptorSet->getName())] = descriptorSet->getHandle();
|
sets[layout->findParameter(descriptorSet->getName())] = descriptorSet->getHandle();
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ GameView::GameView(Gfx::PGraphics graphics, PWindow window, const ViewportCreate
|
|||||||
renderGraph.addPass(new LightCullingPass(graphics, scene));
|
renderGraph.addPass(new LightCullingPass(graphics, scene));
|
||||||
renderGraph.addPass(new ShadowPass(graphics, scene));
|
renderGraph.addPass(new ShadowPass(graphics, scene));
|
||||||
renderGraph.addPass(new BasePass(graphics, scene));
|
renderGraph.addPass(new BasePass(graphics, scene));
|
||||||
// renderGraph.addPass(new SimulationComputePass(graphics, scene));
|
renderGraph.addPass(new SimulationComputePass(graphics, scene));
|
||||||
// renderGraph.addPass(new SurfaceExtractPass(graphics, scene));
|
renderGraph.addPass(new SurfaceExtractPass(graphics, scene));
|
||||||
// renderGraph.addPass(new FluidRenderPass(graphics, scene));
|
renderGraph.addPass(new FluidRenderPass(graphics, scene));
|
||||||
renderGraph.addPass(new ToneMappingPass(graphics));
|
renderGraph.addPass(new ToneMappingPass(graphics));
|
||||||
renderGraph.setViewport(viewport);
|
renderGraph.setViewport(viewport);
|
||||||
renderGraph.createRenderPass();
|
renderGraph.createRenderPass();
|
||||||
|
|||||||
Reference in New Issue
Block a user