Skip to content

Commit

Permalink
tweak viewportInfo
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Pollind <[email protected]>
  • Loading branch information
pollend committed Jan 5, 2024
1 parent 43c0d36 commit dca218e
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 38 deletions.
11 changes: 5 additions & 6 deletions HPL2/include/graphics/RendererDeferred2.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ namespace hpl {
static constexpr uint32_t LightClusterSlices = 24;
static constexpr uint32_t TransientImagePoolCount = 256;

static constexpr uint32_t SceneDescriptorBatchCount = 128;

static constexpr uint32_t IndirectArgumentSize = 8 * sizeof(uint32_t);

struct RootConstantDrawIndexArguments {
Expand Down Expand Up @@ -181,7 +183,6 @@ namespace hpl {
MaterialSet& resolveSet(MaterialSetType set);
};
ResourceMaterial& resolveResourceMaterial(cMaterial* material);
uint32_t resolveObjectSlot(uint32_t uid, std::function<void(uint32_t)> initializeHandler);

UniqueViewportData<ViewportData> m_boundViewportData;

Expand All @@ -204,6 +205,7 @@ namespace hpl {
SharedRootSignature m_sceneRootSignature;
SharedDescriptorSet m_sceneDescriptorConstSet;
std::array<SharedDescriptorSet, ForgeRenderer::SwapChainLength> m_sceneDescriptorPerFrameSet;
std::array<SharedDescriptorSet, ForgeRenderer::SwapChainLength> m_sceneDescriptorPerBatch;

SharedShader m_visibilityBufferPassShader;
SharedShader m_visibilityBufferAlphaPassShader;
Expand All @@ -219,16 +221,11 @@ namespace hpl {
std::array<SharedBuffer, ForgeRenderer::SwapChainLength> m_indirectDrawArgsBuffer;

std::array<SharedSampler, resource::MaterialSceneSamplersCount> m_materialSampler;
folly::F14ValueMap<uint32_t, uint32_t> m_objectDescriptorLookup;

SharedTexture m_emptyTexture2D;
SharedTexture m_emptyTextureCube;
Image* m_dissolveImage;

uint32_t m_activeFrame = 0;
uint32_t m_objectIndex = 0;
uint32_t m_indirectDrawIndex = 0;

cRenderList m_rendererList;

SharedRootSignature m_lightClusterRootSignature;
Expand Down Expand Up @@ -311,13 +308,15 @@ namespace hpl {
SharedPipeline m_translucencyWaterPipelineNoDepth;

CopyTextureSubpass4 m_copySubpass;
GPURingBuffer m_viewportRingBuffer;

// variables that are persistent for the frame
struct TransientFrameVars {
folly::F14ValueMap<iRenderable*, uint32_t> m_objectSlotIndex;
uint32_t m_objectIndex = 0;
uint32_t m_indirectIndex = 0;
uint32_t m_particleIndex = 0;
uint32_t m_scenePerBatchIndex = 0;
};
ResetFrameHandler m_resetHandler;
TransientFrameVariable<TransientFrameVars> m_variables;
Expand Down
5 changes: 4 additions & 1 deletion HPL2/include/graphics/SceneResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "graphics/Material.h"

#include "Common_3/Utilities/Math/MathTypes.h"
#include "math/cFrustum.h"
#include <FixPreprocessor.h>

#include <functional>
Expand All @@ -26,6 +27,7 @@ namespace hpl::resource {

static constexpr uint32_t MaxReflectionBuffers = 4;
static constexpr uint32_t MaxObjectUniforms = 4096;
static constexpr uint32_t MaxViewportUniforms = 24;

static constexpr uint32_t MaxSolidDiffuseMaterials = 2048;
static constexpr uint32_t MaxWaterMaterials = 16;
Expand Down Expand Up @@ -53,6 +55,8 @@ namespace hpl::resource {

struct ViewportInfo {
static constexpr uint32_t PrmaryViewportIndex = 0;
static ViewportInfo create(cFrustum* frustum, float4 rect);

mat4 m_invViewMat;
mat4 m_invProjMat;
mat4 m_invViewProj;
Expand Down Expand Up @@ -81,7 +85,6 @@ namespace hpl::resource {

struct SceneInfoResource {
WorldInfo m_worldInfo;
ViewportInfo m_viewports[64];
};

struct SceneObject {
Expand Down
2 changes: 1 addition & 1 deletion HPL2/resource/decal_shade.vert.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ VSOutput VS_MAIN(VSInput In, SV_InstanceID(uint) InstanceID)
INIT_MAIN;

VSOutput Out;
ViewportInfo info = Get(viewports)[PRIMARY_VIEWPORT_INDEX];
ViewportInfo info = Get(viewport);
#if !defined(INDIRECT_ROOT_CONSTANT)
Out.drawID = InstanceID;
const Decal decal = Get(decals)[InstanceID];
Expand Down
2 changes: 1 addition & 1 deletion HPL2/resource/particle_shade.vert.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ VSOutput VS_MAIN(VSInput In, SV_InstanceID(uint) InstanceID)
INIT_MAIN;
VSOutput Out;

ViewportInfo info = Get(viewports)[PRIMARY_VIEWPORT_INDEX];
ViewportInfo info = Get(viewport);
#if !defined(INDIRECT_ROOT_CONSTANT)
Out.drawID = InstanceID;
const Particle particle = Get(particles)[InstanceID];
Expand Down
2 changes: 1 addition & 1 deletion HPL2/resource/scene_light_cluster.comp.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void CS_MAIN(SV_GroupThreadID(uint3) threadInGroupId, SV_GroupID(uint3) groupId)
const float invClusterWidth = 1.0f / float(LIGHT_CLUSTER_WIDTH);
const float invClusterHeight = 1.0f / float(LIGHT_CLUSTER_HEIGHT);

ViewportInfo viewInfo = Get(viewports)[PRIMARY_VIEWPORT_INDEX];
ViewportInfo viewInfo = Get(viewport);
float2 screenDim = viewInfo.rect.zw;

//Near and far values of the cluster in view space
Expand Down
11 changes: 7 additions & 4 deletions HPL2/resource/scene_light_cluster_resource.h.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

CBUFFER(sceneInfo, UPDATE_FREQ_PER_FRAME, b0, binding = 0) {
DATA(WorldInfo, worldInfo, None);
DATA(ViewportInfo, viewports[64], None);
};

RES(Buffer(Light), lights, UPDATE_FREQ_PER_FRAME, t0, binding = 1);
RES(RWBuffer(atomic_uint), lightClustersCount, UPDATE_FREQ_PER_FRAME, u0, binding = 2);
RES(RWBuffer(atomic_uint), lightClusters, UPDATE_FREQ_PER_FRAME, u1, binding = 3);
CBUFFER(viewportBlock, UPDATE_FREQ_PER_FRAME, b1, binding = 1) {
DATA(ViewportInfo, viewport, None);
};

RES(Buffer(Light), lights, UPDATE_FREQ_PER_FRAME, t0, binding = 2);
RES(RWBuffer(atomic_uint), lightClustersCount, UPDATE_FREQ_PER_FRAME, u0, binding = 3);
RES(RWBuffer(atomic_uint), lightClusters, UPDATE_FREQ_PER_FRAME, u1, binding = 4);

2 changes: 1 addition & 1 deletion HPL2/resource/scene_light_cluster_spotlight.comp.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ void CS_MAIN(SV_GroupThreadID(uint3) threadInGroupId, SV_GroupID(uint3) groupId)
const float invClusterWidth = 1.0f / float(LIGHT_CLUSTER_WIDTH);
const float invClusterHeight = 1.0f / float(LIGHT_CLUSTER_HEIGHT);

ViewportInfo viewInfo = Get(viewports)[PRIMARY_VIEWPORT_INDEX];
ViewportInfo viewInfo = Get(viewport);
float2 screenDim = viewInfo.rect.zw;

//Near and far values of the cluster in view space
Expand Down
5 changes: 4 additions & 1 deletion HPL2/resource/scene_resource.h.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ RES(SamplerState, sceneSampler, UPDATE_FREQ_NONE, s3, binding = 3);

CBUFFER(sceneInfo, UPDATE_FREQ_PER_FRAME, b1, binding = 4) {
DATA(WorldInfo, worldInfo, None);
DATA(ViewportInfo, viewports[64], None);
};

CBUFFER(viewportBlock, UPDATE_FREQ_PER_BATCH, b2, binding = 4) {
DATA(ViewportInfo, viewport, None);
};

RES(Buffer(UniformObject), sceneObjects, UPDATE_FREQ_PER_FRAME, t0, binding = 5);
Expand Down
2 changes: 1 addition & 1 deletion HPL2/resource/translucency_shade.frag.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PsOut PS_MAIN(PsIn In, SV_PrimitiveID(uint) primitiveID)
#else
UniformObject obj = Get(sceneObjects)[Get(indirectDrawId)];
#endif
ViewportInfo viewInfo = Get(viewports)[PRIMARY_VIEWPORT_INDEX];
ViewportInfo viewInfo = Get(viewport);

TranslucentMaterial material = Get(sceneTranslucentMat)[obj.materialIndex];
float4 finalColor = float4(0.0, 0.0 ,0.0, 1.0);
Expand Down
2 changes: 1 addition & 1 deletion HPL2/resource/translucency_shade.vert.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ VSOutput VS_MAIN(VSInput In, SV_InstanceID(uint) InstanceID)
#else
const UniformObject obj = Get(sceneObjects)[Get(indirectDrawId)];
#endif
ViewportInfo viewInfo = Get(viewports)[PRIMARY_VIEWPORT_INDEX];
ViewportInfo viewInfo = Get(viewport);
float4x4 modelView = mul(viewInfo.viewMat, obj.modelMat);
float4x4 modelViewPrj = mul(viewInfo.projMat, modelView);

Expand Down
2 changes: 1 addition & 1 deletion HPL2/resource/translucency_water_shade.frag.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PsOut PS_MAIN(PsIn In, SV_PrimitiveID(uint) primitiveID)
#else
UniformObject obj = Get(sceneObjects)[Get(indirectDrawId)];
#endif
ViewportInfo viewInfo = Get(viewports)[PRIMARY_VIEWPORT_INDEX];
ViewportInfo viewInfo = Get(viewport);

WaterMaterial material = Get(sceneWaterMat)[obj.materialIndex];

Expand Down
2 changes: 1 addition & 1 deletion HPL2/resource/visibilityBuffer_alpha_pass.vert.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ VSOutput VS_MAIN(VSInput In, SV_InstanceID(uint) InstanceID)
#else
const UniformObject obj = Get(sceneObjects)[Get(indirectDrawId)];
#endif
ViewportInfo viewInfo = Get(viewports)[PRIMARY_VIEWPORT_INDEX];
ViewportInfo viewInfo = Get(viewport);
float4x4 modelView = mul(viewInfo.viewMat, obj.modelMat);
float4x4 modelViewPrj = mul(viewInfo.projMat, modelView);

Expand Down
2 changes: 1 addition & 1 deletion HPL2/resource/visibilityBuffer_pass.vert.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ VSOutput VS_MAIN(VSInput In, SV_InstanceID(uint) InstanceID)
INIT_MAIN;
VSOutput Out;

ViewportInfo info = Get(viewports)[PRIMARY_VIEWPORT_INDEX];
ViewportInfo info = Get(viewport);
#if !defined(INDIRECT_ROOT_CONSTANT)
Out.drawID = InstanceID;
float4x4 modelView = mul(info.viewMat, Get(sceneObjects)[InstanceID].modelMat);
Expand Down
2 changes: 1 addition & 1 deletion HPL2/resource/visibility_emit_shade_pass.frag.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ float4 PS_MAIN(PsIn In)
UniformObject obj = Get(sceneObjects)[objectId];
uint startIndex = obj.indexOffset;
uint vertexOffset = obj.vertexOffset;
ViewportInfo viewInfo = Get(viewports)[PRIMARY_VIEWPORT_INDEX];
ViewportInfo viewInfo = Get(viewport);

float4x4 vp = mul(viewInfo.projMat, viewInfo.viewMat);
float4x4 mvp = mul(vp, obj.modelMat);
Expand Down
2 changes: 1 addition & 1 deletion HPL2/resource/visibility_shade_pass.frag.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ float4 PS_MAIN(PsIn In)
UniformObject obj = Get(sceneObjects)[objectId];
uint startIndex = obj.indexOffset;
uint vertexOffset = obj.vertexOffset;
ViewportInfo viewInfo = Get(viewports)[PRIMARY_VIEWPORT_INDEX];
ViewportInfo viewInfo = Get(viewport);

float4x4 vp = mul(viewInfo.projMat, viewInfo.viewMat);
float4x4 mvp = mul(vp, obj.modelMat);
Expand Down
54 changes: 39 additions & 15 deletions HPL2/sources/graphics/RendererDeferred2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ namespace hpl {
: iRenderer("Deferred2", apGraphics, apResources),
m_copySubpass(*Interface<ForgeRenderer>::Get()){
auto* forgeRenderer = Interface<ForgeRenderer>::Get();
addUniformGPURingBuffer(forgeRenderer->Rend(), sizeof(resource::ViewportInfo) * resource::MaxViewportUniforms, &m_viewportRingBuffer, true);
m_sceneTexture2DPool = BindlessDescriptorPool(ForgeRenderer::SwapChainLength, resource::MaxScene2DTextureCount);
m_sceneTextureCubePool = BindlessDescriptorPool(ForgeRenderer::SwapChainLength, resource::MaxSceneCubeTextureCount);
m_sceneTransientImage2DPool = ImageBindlessPool(&m_sceneTexture2DPool, TransientImagePoolCount);
Expand Down Expand Up @@ -1294,6 +1295,11 @@ namespace hpl {
addDescriptorSet(forgeRenderer->Rend(), &descriptorSetDesc, descSet);
return true;
});
m_sceneDescriptorPerBatch[swapchainIndex].Load(forgeRenderer->Rend(), [&](DescriptorSet** descSet) {
DescriptorSetDesc descriptorSetDesc{ m_sceneRootSignature.m_handle, DESCRIPTOR_UPDATE_FREQ_PER_BATCH, SceneDescriptorBatchCount };
addDescriptorSet(forgeRenderer->Rend(), &descriptorSetDesc, descSet);
return true;
});
{
std::array params = {
DescriptorData{ .pName = "decals", .ppBuffers = &m_decalBuffer[swapchainIndex].m_handle },
Expand Down Expand Up @@ -1323,12 +1329,10 @@ namespace hpl {
auto& opaqueSet = graphicsAllocator->resolveSet(GraphicsAllocator::AllocationSet::OpaqueSet);

std::array params = {

DescriptorData{ .pName = "dissolveTexture", .ppTextures = &m_dissolveImage->GetTexture().m_handle },
DescriptorData{ .pName = "sceneDiffuseMat", .ppBuffers = &m_diffuseMatUniformBuffer.m_handle },
DescriptorData{ .pName = "sceneTranslucentMat", .ppBuffers = &m_translucencyMatBuffer.m_handle },
DescriptorData{ .pName = "sceneWaterMat", .ppBuffers = &m_waterMatBuffer.m_handle },
// DescriptorData{ .pName = "sceneFilters", .mCount = samplers.size(), .ppSamplers = samplers.data() },
DescriptorData{ .pName = "vtxOpaqueIndex", .ppBuffers = &opaqueSet.indexBuffer().m_handle },
DescriptorData{ .pName = "vtxOpaquePosition",
.ppBuffers = &opaqueSet.getStreamBySemantic(ShaderSemantic::SEMANTIC_POSITION)->buffer().m_handle },
Expand Down Expand Up @@ -1484,6 +1488,7 @@ namespace hpl {
vars.m_indirectIndex = 0;
vars.m_particleIndex = 0;
vars.m_objectSlotIndex.clear();
vars.m_scenePerBatchIndex = 0;
});

auto viewportDatum = m_boundViewportData.resolve(viewport);
Expand Down Expand Up @@ -1620,6 +1625,29 @@ namespace hpl {
updateDescriptorSet(
forgeRenderer->Rend(), 0, m_sceneDescriptorPerFrameSet[frame.m_frameIndex].m_handle, params.size(), params.data());
}

const uint32_t mainViewportBatch = frameVars.m_scenePerBatchIndex++;
{
GPURingBufferOffset uniformBlock = getGPURingBufferOffset(&m_viewportRingBuffer, sizeof(resource::ViewportInfo));
BufferUpdateDesc updateDesc = { uniformBlock.pBuffer, uniformBlock.mOffset };
beginUpdateResource(&updateDesc);
resource::ViewportInfo* viewportInfo = reinterpret_cast<resource::ViewportInfo*>(updateDesc.pMappedData);
(*viewportInfo) = resource::ViewportInfo::create(apFrustum, float4(0.0f, 0.0f, static_cast<float>(viewportDatum->m_size.x), static_cast<float>(viewportDatum->m_size.y)));
endUpdateResource(&updateDesc);

DescriptorDataRange range = { (uint32_t)uniformBlock.mOffset, sizeof(resource::ViewportInfo) };
{
std::array params = {
DescriptorData{ .pName = "viewportBlock", .pRanges = &range, .ppBuffers = &uniformBlock.pBuffer},
};
updateDescriptorSet(
forgeRenderer->Rend(), 0, m_lightDescriptorPerFrameSet[frame.m_frameIndex].m_handle, params.size(), params.data());
updateDescriptorSet(
forgeRenderer->Rend(), mainViewportBatch, m_sceneDescriptorPerBatch[frame.m_frameIndex].m_handle, params.size(), params.data());
}

}

{
BufferUpdateDesc updateDesc = { m_perSceneInfoBuffer[frame.m_frameIndex].m_handle, 0, sizeof(resource::SceneInfoResource) };
beginUpdateResource(&updateDesc);
Expand All @@ -1631,18 +1659,6 @@ namespace hpl {
sceneInfo->m_worldInfo.m_oneMinusFogAlpha = 1.0f - apWorld->GetFogColor().a;
sceneInfo->m_worldInfo.m_fogFalloffExp = apWorld->GetFogFalloffExp();
sceneInfo->m_worldInfo.m_flags = (apWorld->GetFogActive() ? resource::WorldFogEnabled : 0);

auto& primaryViewport = sceneInfo->m_viewports[resource::ViewportInfo::PrmaryViewportIndex];
primaryViewport.m_viewMat = apFrustum->GetViewMat();
primaryViewport.m_projMat = apFrustum->GetProjectionMat();
primaryViewport.m_invProjMat = inverse(apFrustum->GetProjectionMat());
primaryViewport.m_invViewMat = inverse(apFrustum->GetViewMat());
primaryViewport.m_invViewProj = inverse(primaryViewport.m_projMat * primaryViewport.m_viewMat);
primaryViewport.m_zFar = apFrustum->GetFarPlane();
primaryViewport.m_zNear = apFrustum->GetNearPlane();
primaryViewport.m_rect =
float4(0.0f, 0.0f, static_cast<float>(viewportDatum->m_size.x), static_cast<float>(viewportDatum->m_size.y));
primaryViewport.m_cameraPosition = v3ToF3(cMath::ToForgeVec3(apFrustum->GetOrigin()));
endUpdateResource(&updateDesc);
}

Expand Down Expand Up @@ -1742,7 +1758,7 @@ namespace hpl {
translucenctArgs.push_back({
TranslucentDrawType::Particle,
renderable,
material->GetDepthTest() ?
material->GetDepthTest()?
m_particlePipeline.getPipelineByBlendMode(material->GetBlendMode()).m_handle:
m_particlePipelineNoDepth.getPipelineByBlendMode(material->GetBlendMode()).m_handle,
nullptr,
Expand Down Expand Up @@ -2186,6 +2202,7 @@ namespace hpl {
cmdBindIndexBuffer(cmd, opaqueSet.indexBuffer().m_handle, INDEX_TYPE_UINT32, 0);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorConstSet.m_handle);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorPerFrameSet[frame.m_frameIndex].m_handle);
cmdBindDescriptorSet(cmd, mainViewportBatch, m_sceneDescriptorPerBatch[frame.m_frameIndex].m_handle);
cmdExecuteIndirect(
cmd,
m_cmdSignatureVBPass,
Expand Down Expand Up @@ -2227,6 +2244,7 @@ namespace hpl {
cmdBindIndexBuffer(cmd, opaqueSet.indexBuffer().m_handle, INDEX_TYPE_UINT32, 0);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorConstSet.m_handle);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorPerFrameSet[frame.m_frameIndex].m_handle);
cmdBindDescriptorSet(cmd, mainViewportBatch, m_sceneDescriptorPerBatch[frame.m_frameIndex].m_handle);
cmdExecuteIndirect(
cmd,
m_cmdSignatureVBPass,
Expand Down Expand Up @@ -2263,6 +2281,7 @@ namespace hpl {
cmdBindPipeline(cmd, m_visbilityEmitBufferPass.m_handle);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorConstSet.m_handle);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorPerFrameSet[frame.m_frameIndex].m_handle);
cmdBindDescriptorSet(cmd, mainViewportBatch, m_sceneDescriptorPerBatch[frame.m_frameIndex].m_handle);
cmdDraw(cmd, 3, 0);
//cmdEndDebugMarker(cmd);
}
Expand Down Expand Up @@ -2293,6 +2312,7 @@ namespace hpl {
opaqueSet.cmdBindGeometrySet(cmd, semantics);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorConstSet.m_handle);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorPerFrameSet[frame.m_frameIndex].m_handle);
cmdBindDescriptorSet(cmd, mainViewportBatch, m_sceneDescriptorPerBatch[frame.m_frameIndex].m_handle);

struct DecalDrawArg {
SharedPipeline* pipeline;
Expand Down Expand Up @@ -2343,6 +2363,7 @@ namespace hpl {
cmdSetScissor(cmd, 0, 0, viewportDatum->m_size.x, viewportDatum->m_size.y);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorConstSet.m_handle);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorPerFrameSet[frame.m_frameIndex].m_handle);
cmdBindDescriptorSet(cmd, mainViewportBatch, m_sceneDescriptorPerBatch[frame.m_frameIndex].m_handle);
cmdBindPipeline(cmd, m_visiblityShadePass.m_handle);
cmdDraw(cmd, 3, 0);
// cmdEndDebugMarker(cmd);
Expand Down Expand Up @@ -2413,6 +2434,7 @@ namespace hpl {
particleSet.cmdBindGeometrySet(cmd, semantics);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorConstSet.m_handle);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorPerFrameSet[frame.m_frameIndex].m_handle);
cmdBindDescriptorSet(cmd, mainViewportBatch, m_sceneDescriptorPerBatch[frame.m_frameIndex].m_handle);
cmdBindPipeline(cmd, arg.pipeline);
if (m_supportIndirectRootConstant) {
const uint32_t pushConstantIndex =
Expand All @@ -2431,6 +2453,7 @@ namespace hpl {
opaqueSet.cmdBindGeometrySet(cmd, semantics);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorConstSet.m_handle);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorPerFrameSet[frame.m_frameIndex].m_handle);
cmdBindDescriptorSet(cmd, mainViewportBatch, m_sceneDescriptorPerBatch[frame.m_frameIndex].m_handle);
cmdBindPipeline(cmd, m_translucencyWaterPipeline.m_handle);
if (m_supportIndirectRootConstant) {
const uint32_t pushConstantIndex =
Expand All @@ -2450,6 +2473,7 @@ namespace hpl {
opaqueSet.cmdBindGeometrySet(cmd, semantics);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorConstSet.m_handle);
cmdBindDescriptorSet(cmd, 0, m_sceneDescriptorPerFrameSet[frame.m_frameIndex].m_handle);
cmdBindDescriptorSet(cmd, mainViewportBatch, m_sceneDescriptorPerBatch[frame.m_frameIndex].m_handle);
cmdBindPipeline(cmd, arg.pipeline);

if (m_supportIndirectRootConstant) {
Expand Down
Loading

0 comments on commit dca218e

Please sign in to comment.