Progress i guess
This commit is contained in:
@@ -19,6 +19,7 @@ DepthPrepass::DepthPrepass(Gfx::PGraphics graphics, PScene scene)
|
||||
|
||||
depthPrepassLayout = graphics->createPipelineLayout();
|
||||
depthPrepassLayout->addDescriptorLayout(INDEX_VIEW_PARAMS, viewParamsLayout);
|
||||
graphics->getShaderCompiler()->registerRenderPass("DepthPass", "LegacyBasePass");
|
||||
}
|
||||
|
||||
DepthPrepass::~DepthPrepass()
|
||||
@@ -43,18 +44,18 @@ void DepthPrepass::render()
|
||||
{
|
||||
permutation.useMeshShading = true;
|
||||
permutation.hasTaskShader = true;
|
||||
std::memcpy(permutation.taskFile, "MeshletBasePass", sizeof("MeshletBasePass"));
|
||||
std::memcpy(permutation.vertexMeshFile, "MeshletBasePass", sizeof("MeshletBasePass"));
|
||||
std::strncpy(permutation.taskFile, "MeshletBasePass", sizeof("MeshletBasePass"));
|
||||
std::strncpy(permutation.vertexMeshFile, "MeshletBasePass", sizeof("MeshletBasePass"));
|
||||
}
|
||||
else
|
||||
{
|
||||
permutation.useMeshShading = false;
|
||||
std::memcpy(permutation.vertexMeshFile, "LegacyBasePass", sizeof("LegacyBasePass"));
|
||||
std::strncpy(permutation.vertexMeshFile, "LegacyBasePass", sizeof("LegacyBasePass"));
|
||||
}
|
||||
graphics->beginRenderPass(renderPass);
|
||||
for (VertexData* vertexData : VertexData::getList())
|
||||
{
|
||||
std::memcpy(permutation.vertexDataName, vertexData->getTypeName().c_str(), std::strlen(vertexData->getTypeName().c_str()));
|
||||
std::strncpy(permutation.vertexDataName, vertexData->getTypeName().c_str(), sizeof(permutation.vertexDataName));
|
||||
const auto& materials = vertexData->getMaterialData();
|
||||
for (const auto& [_, materialData] : materials)
|
||||
{
|
||||
@@ -64,7 +65,7 @@ void DepthPrepass::render()
|
||||
// Material => per material
|
||||
// VertexData => per meshtype
|
||||
// SceneData => per material instance
|
||||
std::memcpy(permutation.materialName, materialData.material->getName().c_str(), std::strlen(materialData.material->getName().c_str()));
|
||||
std::strncpy(permutation.materialName, materialData.material->getName().c_str(), sizeof(permutation.materialName));
|
||||
Gfx::PermutationId id(permutation);
|
||||
|
||||
Gfx::PRenderCommand command = graphics->createRenderCommand("DepthRender");
|
||||
|
||||
@@ -18,8 +18,8 @@ public:
|
||||
virtual void createRenderPass() override;
|
||||
static void modifyRenderPassMacros(Map<const char*, const char*>& defines);
|
||||
private:
|
||||
Gfx::PRenderTargetAttachment depthAttachment;
|
||||
Gfx::PTexture2D depthBuffer;
|
||||
Gfx::ORenderTargetAttachment depthAttachment;
|
||||
Gfx::OTexture2D depthBuffer;
|
||||
|
||||
Array<Gfx::PDescriptorSet> descriptorSets;
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ void LightCullingPass::setupFrustums()
|
||||
dispatchParams.numThreads = numThreads;
|
||||
dispatchParams.numThreadGroups = numThreadGroups;
|
||||
|
||||
Gfx::ODescriptorLayout frustumDescriptorLayout = graphics->createDescriptorLayout("FrustumLayout");
|
||||
frustumDescriptorLayout = graphics->createDescriptorLayout("FrustumLayout");
|
||||
frustumDescriptorLayout->addDescriptorBinding(0, Gfx::SE_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
|
||||
frustumDescriptorLayout->addDescriptorBinding(1, Gfx::SE_DESCRIPTOR_TYPE_STORAGE_BUFFER);
|
||||
frustumLayout = graphics->createPipelineLayout();
|
||||
|
||||
@@ -45,6 +45,7 @@ private:
|
||||
Gfx::OShaderBuffer frustumBuffer;
|
||||
Gfx::OUniformBuffer dispatchParamsBuffer;
|
||||
Gfx::OUniformBuffer viewParamsBuffer;
|
||||
Gfx::ODescriptorLayout frustumDescriptorLayout;
|
||||
Gfx::PDescriptorSet frustumDescriptorSet;
|
||||
Gfx::OComputeShader frustumShader;
|
||||
Gfx::OPipelineLayout frustumLayout;
|
||||
|
||||
@@ -38,7 +38,7 @@ protected:
|
||||
PRenderGraphResources resources;
|
||||
static constexpr uint32 INDEX_VIEW_PARAMS = 0;
|
||||
Gfx::ODescriptorLayout viewParamsLayout;
|
||||
Gfx::OShaderBuffer viewParamsBuffer;
|
||||
Gfx::OUniformBuffer viewParamsBuffer;
|
||||
Gfx::PDescriptorSet viewParamsSet;
|
||||
Gfx::ORenderPass renderPass;
|
||||
Gfx::PGraphics graphics;
|
||||
|
||||
@@ -169,14 +169,13 @@ void SkyboxRenderPass::createRenderPass()
|
||||
createInfo.name = "SkyboxVertex";
|
||||
createInfo.mainModule = "Skybox";
|
||||
createInfo.entryPoint = "vertexMain";
|
||||
createInfo.defines["INDEX_VIEW_PARAMS"] = "0";
|
||||
Gfx::PVertexShader vertexShader = graphics->createVertexShader(createInfo);
|
||||
vertexShader = graphics->createVertexShader(createInfo);
|
||||
|
||||
createInfo.name = "SkyboxFragment";
|
||||
createInfo.entryPoint = "fragmentMain";
|
||||
Gfx::PFragmentShader fragmentShader = graphics->createFragmentShader(createInfo);
|
||||
fragmentShader = graphics->createFragmentShader(createInfo);
|
||||
|
||||
Gfx::PVertexDeclaration vertexDecl = graphics->createVertexDeclaration({
|
||||
declaration = graphics->createVertexDeclaration({
|
||||
Gfx::VertexElement {
|
||||
.binding = 0,
|
||||
.offset = 0,
|
||||
@@ -187,7 +186,7 @@ void SkyboxRenderPass::createRenderPass()
|
||||
});
|
||||
|
||||
Gfx::LegacyPipelineCreateInfo gfxInfo;
|
||||
gfxInfo.vertexDeclaration = vertexDecl;
|
||||
gfxInfo.vertexDeclaration = declaration;
|
||||
gfxInfo.vertexShader = vertexShader;
|
||||
gfxInfo.fragmentShader = fragmentShader;
|
||||
gfxInfo.rasterizationState.polygonMode = Gfx::SE_POLYGON_MODE_FILL;
|
||||
|
||||
@@ -26,6 +26,9 @@ private:
|
||||
Gfx::ODescriptorLayout descriptorLayout;
|
||||
Gfx::PDescriptorSet descriptorSet;
|
||||
Gfx::OPipelineLayout pipelineLayout;
|
||||
Gfx::OVertexDeclaration declaration;
|
||||
Gfx::OVertexShader vertexShader;
|
||||
Gfx::OFragmentShader fragmentShader;
|
||||
Gfx::OGraphicsPipeline pipeline;
|
||||
Gfx::OSamplerState skyboxSampler;
|
||||
Component::Skybox skybox;
|
||||
|
||||
@@ -155,8 +155,8 @@ void UIPass::createRenderPass()
|
||||
},
|
||||
.dynamic = false,
|
||||
};
|
||||
Gfx::PUniformBuffer uniformBuffer = graphics->createUniformBuffer(info);
|
||||
Gfx::PSamplerState backgroundSampler = graphics->createSamplerState({});
|
||||
Gfx::OUniformBuffer uniformBuffer = graphics->createUniformBuffer(info);
|
||||
Gfx::OSamplerState backgroundSampler = graphics->createSamplerState({});
|
||||
|
||||
info = {
|
||||
.sourceData = {
|
||||
|
||||
Reference in New Issue
Block a user