-
Notifications
You must be signed in to change notification settings - Fork 57
/
RtxdiResources.h
63 lines (55 loc) · 2.34 KB
/
RtxdiResources.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/***************************************************************************
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
**************************************************************************/
#pragma once
#include <nvrhi/nvrhi.h>
namespace rtxdi
{
class RISBufferSegmentAllocator;
class ReSTIRDIContext;
class ImportanceSamplingContext;
}
class RtxdiResources
{
private:
bool m_NeighborOffsetsInitialized = false;
uint32_t m_MaxEmissiveMeshes = 0;
uint32_t m_MaxEmissiveTriangles = 0;
uint32_t m_MaxPrimitiveLights = 0;
uint32_t m_MaxGeometryInstances = 0;
public:
nvrhi::BufferHandle TaskBuffer;
nvrhi::BufferHandle PrimitiveLightBuffer;
nvrhi::BufferHandle LightDataBuffer;
nvrhi::BufferHandle GeometryInstanceToLightBuffer;
nvrhi::BufferHandle LightIndexMappingBuffer;
nvrhi::BufferHandle RisBuffer;
nvrhi::BufferHandle RisLightDataBuffer;
nvrhi::BufferHandle NeighborOffsetsBuffer;
nvrhi::BufferHandle LightReservoirBuffer;
nvrhi::BufferHandle SecondaryGBuffer;
nvrhi::TextureHandle EnvironmentPdfTexture;
nvrhi::TextureHandle LocalLightPdfTexture;
nvrhi::BufferHandle GIReservoirBuffer;
RtxdiResources(
nvrhi::IDevice* device,
const rtxdi::ReSTIRDIContext& context,
const rtxdi::RISBufferSegmentAllocator& risBufferSegmentAllocator,
uint32_t maxEmissiveMeshes,
uint32_t maxEmissiveTriangles,
uint32_t maxPrimitiveLights,
uint32_t maxGeometryInstances,
uint32_t environmentMapWidth,
uint32_t environmentMapHeight);
void InitializeNeighborOffsets(nvrhi::ICommandList* commandList, uint32_t neighborOffsetCount);
uint32_t GetMaxEmissiveMeshes() const { return m_MaxEmissiveMeshes; }
uint32_t GetMaxEmissiveTriangles() const { return m_MaxEmissiveTriangles; }
uint32_t GetMaxPrimitiveLights() const { return m_MaxPrimitiveLights; }
uint32_t GetMaxGeometryInstances() const { return m_MaxGeometryInstances; }
};