Apparently it is still not working???
This commit is contained in:
@@ -26,7 +26,7 @@ void Seele::addDebugVertex(DebugVertex vert) { gDebugVertices.add(vert); }
|
||||
void Seele::addDebugVertices(Array<DebugVertex> verts) { gDebugVertices.addAll(verts); }
|
||||
|
||||
BasePass::BasePass(Gfx::PGraphics graphics, PScene scene) : RenderPass(graphics, scene) {
|
||||
waterRenderer = new WaterRenderer(graphics, scene, viewParamsLayout);
|
||||
//waterRenderer = new WaterRenderer(graphics, scene, viewParamsLayout);
|
||||
basePassLayout = graphics->createPipelineLayout("BasePassLayout");
|
||||
|
||||
basePassLayout->addDescriptorLayout(viewParamsLayout);
|
||||
@@ -145,7 +145,6 @@ void BasePass::render() {
|
||||
transparentCulling->writeChanges();
|
||||
|
||||
query->beginQuery();
|
||||
timestamps->begin();
|
||||
timestamps->write(Gfx::SE_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "BaseBegin");
|
||||
graphics->beginRenderPass(renderPass);
|
||||
Array<Gfx::ORenderCommand> commands;
|
||||
@@ -196,7 +195,7 @@ void BasePass::render() {
|
||||
},
|
||||
.rasterizationState =
|
||||
{
|
||||
.cullMode = Gfx::SeCullModeFlags(twoSided ? Gfx::SE_CULL_MODE_NONE : Gfx::SE_CULL_MODE_BACK_BIT),
|
||||
.cullMode = Gfx::SE_CULL_MODE_NONE,
|
||||
},
|
||||
.colorBlend =
|
||||
{
|
||||
@@ -374,7 +373,6 @@ void BasePass::render() {
|
||||
graphics->endRenderPass();
|
||||
query->endQuery();
|
||||
timestamps->write(Gfx::SE_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, "BaseEnd");
|
||||
timestamps->end();
|
||||
gDebugVertices.clear();
|
||||
}
|
||||
|
||||
@@ -426,13 +424,13 @@ void BasePass::publishOutputs() {
|
||||
resources->registerRenderPassOutput("BASEPASS_DEPTH", depthAttachment);
|
||||
|
||||
timestamps = graphics->createTimestampQuery(2, "BaseTS");
|
||||
resources->registerTimestampQueryOutput("BASE_TS", timestamps);
|
||||
query = graphics->createPipelineStatisticsQuery("BasePassPipelineStatistics");
|
||||
resources->registerQueryOutput("BASEPASS_QUERY", query);
|
||||
}
|
||||
|
||||
void BasePass::createRenderPass() {
|
||||
cullingBuffer = resources->requestBuffer("CULLINGBUFFER");
|
||||
timestamps = resources->requestTimestampQuery("TIMESTAMPS");
|
||||
|
||||
Gfx::RenderTargetLayout layout = Gfx::RenderTargetLayout{
|
||||
.colorAttachments = {msColorAttachment},
|
||||
@@ -472,7 +470,7 @@ void BasePass::createRenderPass() {
|
||||
oLightGrid = resources->requestTexture("LIGHTCULLING_OLIGHTGRID");
|
||||
tLightGrid = resources->requestTexture("LIGHTCULLING_TLIGHTGRID");
|
||||
|
||||
waterRenderer->setViewport(viewport, renderPass);
|
||||
//waterRenderer->setViewport(viewport, renderPass);
|
||||
|
||||
// Debug rendering
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ class BasePass : public RenderPass {
|
||||
Gfx::ODescriptorLayout lightCullingLayout;
|
||||
|
||||
Gfx::OPipelineStatisticsQuery query;
|
||||
Gfx::OTimestampQuery timestamps;
|
||||
Gfx::PTimestampQuery timestamps;
|
||||
|
||||
Gfx::PShaderBuffer cullingBuffer;
|
||||
|
||||
|
||||
@@ -40,13 +40,10 @@ CachedDepthPass::CachedDepthPass(Gfx::PGraphics graphics, PScene scene) : Render
|
||||
|
||||
CachedDepthPass::~CachedDepthPass() {}
|
||||
|
||||
void CachedDepthPass::beginFrame(const Component::Camera& cam) {
|
||||
RenderPass::beginFrame(cam);
|
||||
}
|
||||
void CachedDepthPass::beginFrame(const Component::Camera& cam) { RenderPass::beginFrame(cam); }
|
||||
|
||||
void CachedDepthPass::render() {
|
||||
query->beginQuery();
|
||||
timestamps->begin();
|
||||
timestamps->write(Gfx::SE_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "CachedBegin");
|
||||
graphics->beginRenderPass(renderPass);
|
||||
Array<Gfx::ORenderCommand> commands;
|
||||
@@ -78,6 +75,10 @@ void CachedDepthPass::render() {
|
||||
.fragmentShader = collection->fragmentShader,
|
||||
.renderPass = renderPass,
|
||||
.pipelineLayout = collection->pipelineLayout,
|
||||
.rasterizationState =
|
||||
{
|
||||
.cullMode = Gfx::SE_CULL_MODE_NONE,
|
||||
},
|
||||
.colorBlend =
|
||||
{
|
||||
.attachmentCount = 1,
|
||||
@@ -91,6 +92,10 @@ void CachedDepthPass::render() {
|
||||
.fragmentShader = collection->fragmentShader,
|
||||
.renderPass = renderPass,
|
||||
.pipelineLayout = collection->pipelineLayout,
|
||||
.rasterizationState =
|
||||
{
|
||||
.cullMode = Gfx::SE_CULL_MODE_NONE,
|
||||
},
|
||||
.colorBlend =
|
||||
{
|
||||
.attachmentCount = 1,
|
||||
@@ -128,7 +133,6 @@ void CachedDepthPass::render() {
|
||||
graphics->executeCommands(std::move(commands));
|
||||
graphics->endRenderPass();
|
||||
timestamps->write(Gfx::SE_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, "CachedEnd");
|
||||
timestamps->end();
|
||||
query->endQuery();
|
||||
}
|
||||
|
||||
@@ -163,8 +167,8 @@ void CachedDepthPass::publishOutputs() {
|
||||
query = graphics->createPipelineStatisticsQuery("CachedPipelineStatistics");
|
||||
resources->registerQueryOutput("CACHED_QUERY", query);
|
||||
|
||||
timestamps = graphics->createTimestampQuery(2, "CachedTS");
|
||||
resources->registerTimestampQueryOutput("CACHED_TS", timestamps);
|
||||
timestamps = graphics->createTimestampQuery(7, "CachedTS");
|
||||
resources->registerTimestampQueryOutput("TIMESTAMPS", timestamps);
|
||||
}
|
||||
|
||||
void CachedDepthPass::createRenderPass() {
|
||||
|
||||
@@ -93,7 +93,6 @@ void DepthCullingPass::render() {
|
||||
set->updateBuffer(1, depthMipBuffer);
|
||||
set->writeChanges();
|
||||
|
||||
timestamps->begin();
|
||||
timestamps->write(Gfx::SE_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "MipBegin");
|
||||
Gfx::OComputeCommand computeCommand = graphics->createComputeCommand("InitialReduce");
|
||||
computeCommand->bindPipeline(depthInitialReduce);
|
||||
@@ -160,6 +159,10 @@ void DepthCullingPass::render() {
|
||||
.fragmentShader = collection->fragmentShader,
|
||||
.renderPass = renderPass,
|
||||
.pipelineLayout = collection->pipelineLayout,
|
||||
.rasterizationState =
|
||||
{
|
||||
.cullMode = Gfx::SE_CULL_MODE_NONE,
|
||||
},
|
||||
.colorBlend =
|
||||
{
|
||||
.attachmentCount = 1,
|
||||
@@ -173,6 +176,10 @@ void DepthCullingPass::render() {
|
||||
.fragmentShader = collection->fragmentShader,
|
||||
.renderPass = renderPass,
|
||||
.pipelineLayout = collection->pipelineLayout,
|
||||
.rasterizationState =
|
||||
{
|
||||
.cullMode = Gfx::SE_CULL_MODE_NONE,
|
||||
},
|
||||
.colorBlend =
|
||||
{
|
||||
.attachmentCount = 1,
|
||||
@@ -210,7 +217,6 @@ void DepthCullingPass::render() {
|
||||
graphics->executeCommands(std::move(commands));
|
||||
graphics->endRenderPass();
|
||||
timestamps->write(Gfx::SE_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, "CullingEnd");
|
||||
timestamps->end();
|
||||
query->endQuery();
|
||||
// Sync depth read/write with compute read
|
||||
depthAttachment.getTexture()->pipelineBarrier(
|
||||
@@ -243,8 +249,6 @@ void DepthCullingPass::publishOutputs() {
|
||||
.data = nullptr,
|
||||
},
|
||||
.numElements = bufferSize,
|
||||
.clearValue = 0,
|
||||
.createCleared = true,
|
||||
.dynamic = true,
|
||||
.name = "DepthMipBuffer",
|
||||
});
|
||||
@@ -269,14 +273,13 @@ void DepthCullingPass::publishOutputs() {
|
||||
|
||||
depthMipGen = graphics->createComputePipeline(pipelineCreateInfo);
|
||||
|
||||
timestamps = graphics->createTimestampQuery(3, "CullingTS");
|
||||
resources->registerTimestampQueryOutput("DEPTH_TS", timestamps);
|
||||
query = graphics->createPipelineStatisticsQuery("DepthPipelineStatistics");
|
||||
resources->registerQueryOutput("DEPTH_QUERY", query);
|
||||
}
|
||||
|
||||
void DepthCullingPass::createRenderPass() {
|
||||
cullingBuffer = resources->requestBuffer("CULLINGBUFFER");
|
||||
timestamps = resources->requestTimestampQuery("TIMESTAMPS");
|
||||
|
||||
depthAttachment = resources->requestRenderTarget("DEPTHPREPASS_DEPTH");
|
||||
depthAttachment.setInitialLayout(Gfx::SE_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);
|
||||
|
||||
@@ -35,7 +35,7 @@ class DepthCullingPass : public RenderPass {
|
||||
Gfx::ODescriptorLayout depthAttachmentLayout;
|
||||
Gfx::OPipelineLayout depthCullingLayout;
|
||||
Gfx::OPipelineStatisticsQuery query;
|
||||
Gfx::OTimestampQuery timestamps;
|
||||
Gfx::PTimestampQuery timestamps;
|
||||
|
||||
Gfx::OPipelineLayout depthComputeLayout;
|
||||
Gfx::OComputeShader depthInitialReduceShader;
|
||||
|
||||
@@ -37,7 +37,6 @@ void LightCullingPass::beginFrame(const Component::Camera& cam) {
|
||||
|
||||
void LightCullingPass::render() {
|
||||
query->beginQuery();
|
||||
timestamps->begin();
|
||||
timestamps->write(Gfx::SE_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "LightCullBegin");
|
||||
oLightGrid->pipelineBarrier(Gfx::SE_ACCESS_SHADER_READ_BIT, Gfx::SE_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, Gfx::SE_ACCESS_SHADER_WRITE_BIT,
|
||||
Gfx::SE_PIPELINE_STAGE_COMPUTE_SHADER_BIT);
|
||||
@@ -64,7 +63,6 @@ void LightCullingPass::render() {
|
||||
// std::cout << "Execute" << std::endl;
|
||||
graphics->executeCommands(std::move(commands));
|
||||
timestamps->write(Gfx::SE_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, "LightCullEnd");
|
||||
timestamps->end();
|
||||
query->endQuery();
|
||||
oLightIndexList->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);
|
||||
@@ -227,13 +225,12 @@ void LightCullingPass::publishOutputs() {
|
||||
resources->registerTextureOutput("LIGHTCULLING_OLIGHTGRID", Gfx::PTexture2D(oLightGrid));
|
||||
resources->registerTextureOutput("LIGHTCULLING_TLIGHTGRID", Gfx::PTexture2D(tLightGrid));
|
||||
|
||||
timestamps = graphics->createTimestampQuery(2, "LightCullTS");
|
||||
resources->registerTimestampQueryOutput("LIGHTCULL_TS", timestamps);
|
||||
query = graphics->createPipelineStatisticsQuery("LightCullPipelineStatistics");
|
||||
resources->registerQueryOutput("LIGHTCULL_QUERY", query);
|
||||
}
|
||||
|
||||
void LightCullingPass::createRenderPass() {
|
||||
timestamps = resources->requestTimestampQuery("TIMESTAMPS");
|
||||
depthAttachment = resources->requestRenderTarget("DEPTHPREPASS_DEPTH").getTexture();
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ class LightCullingPass : public RenderPass {
|
||||
Gfx::PComputePipeline cullingPipeline;
|
||||
Gfx::PComputePipeline cullingEnabledPipeline;
|
||||
Gfx::OPipelineStatisticsQuery query;
|
||||
Gfx::OTimestampQuery timestamps;
|
||||
Gfx::PTimestampQuery timestamps;
|
||||
};
|
||||
DEFINE_REF(LightCullingPass)
|
||||
} // namespace Seele
|
||||
|
||||
@@ -26,7 +26,6 @@ void VisibilityPass::render() {
|
||||
visibilitySet->writeChanges();
|
||||
|
||||
query->beginQuery();
|
||||
timestamps->begin();
|
||||
timestamps->write(Gfx::SE_PIPELINE_STAGE_TOP_OF_PIPE_BIT, "VisibilityBegin");
|
||||
Gfx::OComputeCommand command = graphics->createComputeCommand("VisibilityCommand");
|
||||
command->bindPipeline(visibilityPipeline);
|
||||
@@ -36,7 +35,6 @@ void VisibilityPass::render() {
|
||||
commands.add(std::move(command));
|
||||
graphics->executeCommands(std::move(commands));
|
||||
timestamps->write(Gfx::SE_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, "VisibilityEnd");
|
||||
timestamps->end();
|
||||
query->endQuery();
|
||||
cullingBuffer->pipelineBarrier(Gfx::SE_ACCESS_SHADER_WRITE_BIT, Gfx::SE_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
||||
Gfx::SE_ACCESS_SHADER_READ_BIT,
|
||||
@@ -88,11 +86,11 @@ void VisibilityPass::publishOutputs() {
|
||||
});
|
||||
resources->registerBufferOutput("CULLINGBUFFER", cullingBuffer);
|
||||
|
||||
timestamps = graphics->createTimestampQuery(2, "VisibilityTS");
|
||||
resources->registerTimestampQueryOutput("VISIBILITY_TS", timestamps);
|
||||
|
||||
query = graphics->createPipelineStatisticsQuery("VisibilityPipelineStatistics");
|
||||
resources->registerQueryOutput("VISIBILITY_QUERY", query);
|
||||
}
|
||||
|
||||
void VisibilityPass::createRenderPass() { visibilityAttachment = resources->requestRenderTarget("VISIBILITY"); }
|
||||
void VisibilityPass::createRenderPass() {
|
||||
visibilityAttachment = resources->requestRenderTarget("VISIBILITY");
|
||||
timestamps = resources->requestTimestampQuery("TIMESTAMPS");
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class VisibilityPass : public RenderPass {
|
||||
Gfx::OComputeShader visibilityShader;
|
||||
Gfx::PComputePipeline visibilityPipeline;
|
||||
Gfx::OPipelineStatisticsQuery query;
|
||||
Gfx::OTimestampQuery timestamps;
|
||||
Gfx::PTimestampQuery timestamps;
|
||||
|
||||
// Holds culling information for every meshlet for each instance
|
||||
Gfx::OShaderBuffer cullingBuffer;
|
||||
|
||||
Reference in New Issue
Block a user