Skip to content

Commit 27294ab

Browse files
committed
wip
1 parent 40012fa commit 27294ab

32 files changed

Lines changed: 309 additions & 104 deletions

sources/HAL/API/D3D12/HAL.D3D12.Device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ namespace HAL
196196
props.mesh_shader = options7.MeshShaderTier >= D3D12_MESH_SHADER_TIER_1;
197197
props.full_bindless = supportedShaderModel.HighestShaderModel >= D3D_SHADER_MODEL_6_6;
198198
props.direct_gpu_upload_heap = options16.GPUUploadHeapSupported;
199-
props.work_graph = options21.WorkGraphsTier != D3D12_WORK_GRAPHS_TIER_NOT_SUPPORTED;
199+
props.work_graph = false;//options21.WorkGraphsTier != D3D12_WORK_GRAPHS_TIER_NOT_SUPPORTED;
200200

201201
return props;
202202
}
@@ -279,7 +279,7 @@ namespace HAL
279279
properties.full_bindless = supportedShaderModel.HighestShaderModel >= D3D_SHADER_MODEL_6_6;
280280
properties.mesh_shader = options7.MeshShaderTier >= D3D12_MESH_SHADER_TIER_1;
281281
properties.direct_gpu_upload_heap = options16.GPUUploadHeapSupported;
282-
properties.work_graph = options21.WorkGraphsTier != D3D12_WORK_GRAPHS_TIER_NOT_SUPPORTED;
282+
properties.work_graph = false;//options21.WorkGraphsTier != D3D12_WORK_GRAPHS_TIER_NOT_SUPPORTED;
283283

284284
if constexpr (HAL::Debug::ValidationErrors)
285285
{

sources/HAL/HAL.ResourceViews.ixx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ export
377377
HLSL::StructuredBuffer<T> structuredBuffer;
378378
HLSL::RWStructuredBuffer<T> rwStructuredBuffer;
379379
HLSL::AppendStructuredBuffer<T> appendStructuredBuffer;
380+
HLSL::ConsumeStructuredBuffer<T> consumeStructuredBuffer;
380381

381382
StructuredBufferView() = default;
382383
CounterView counter_view;
@@ -451,17 +452,17 @@ export
451452
counter_view = counter_view.resource->create_view<CounterView>(frame, 0);
452453
}
453454

454-
auto hlsl = frame.alloc_descriptor(5, DescriptorHeapIndex{
455+
auto hlsl = frame.alloc_descriptor(6, DescriptorHeapIndex{
455456
HAL::DescriptorHeapType::CBV_SRV_UAV,
456457
HAL::DescriptorHeapFlags::ShaderVisible
457458
});
458459

459460
structuredBuffer = HLSL::StructuredBuffer<T>(hlsl[0]);
460461
rwStructuredBuffer = HLSL::RWStructuredBuffer<T>(hlsl[1]);
461462
appendStructuredBuffer = HLSL::AppendStructuredBuffer<T>(hlsl[2]);
463+
consumeStructuredBuffer = HLSL::ConsumeStructuredBuffer<T>(hlsl[3]);
462464

463-
464-
rwRAW = HLSL::RWBuffer<std::byte>(hlsl[3]);
465+
rwRAW = HLSL::RWBuffer<std::byte>(hlsl[4]);
465466

466467
// constBuffer = HLSL::ConstBuffer<T>(hlsl[4]);
467468

@@ -483,9 +484,16 @@ export
483484
rwRAW.create(resource, Format::R8_UINT, static_cast<UINT>(offset), static_cast<UINT>(size));
484485

485486
if (desc.counted != counterType::NONE)
486-
appendStructuredBuffer.create(get_counter_buffer(), get_counter_offset(), resource,
487+
{
488+
appendStructuredBuffer.create(get_counter_buffer(), get_counter_offset(), resource,
487489
static_cast<UINT>(offset / sizeof(Underlying<T>)),
488490
static_cast<UINT>(size / sizeof(Underlying<T>)));
491+
492+
consumeStructuredBuffer.create(get_counter_buffer(), get_counter_offset(), resource,
493+
static_cast<UINT>(offset / sizeof(Underlying<T>)),
494+
static_cast<UINT>(size / sizeof(Underlying<T>)));
495+
}
496+
489497
}
490498
}
491499

sources/HAL/autogen/autogen.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ std::optional<SlotID> get_slot(std::string_view slot_name)
9393
if(slot_name == "FrameClassificationInitDispatch") return SlotID::FrameClassificationInitDispatch;
9494
if(slot_name == "ReflectionCombine") return SlotID::ReflectionCombine;
9595
if(slot_name == "WorkGraphTest") return SlotID::WorkGraphTest;
96-
if(slot_name == "WorkGREmulation") return SlotID::WorkGREmulation;
96+
if(slot_name == "WorkGR_ClassifyPixels_NodeEmulation") return SlotID::WorkGR_ClassifyPixels_NodeEmulation;
97+
if(slot_name == "WorkGR_Shadows_NodeEmulation") return SlotID::WorkGR_Shadows_NodeEmulation;
9798
return std::nullopt;
9899
}
99100

@@ -183,7 +184,8 @@ uint get_table_index(SlotID id)
183184
if(id == SlotID::FrameClassificationInitDispatch) return Slots::FrameClassificationInitDispatch::Slot::ID;
184185
if(id == SlotID::ReflectionCombine) return Slots::ReflectionCombine::Slot::ID;
185186
if(id == SlotID::WorkGraphTest) return Slots::WorkGraphTest::Slot::ID;
186-
if(id == SlotID::WorkGREmulation) return Slots::WorkGREmulation::Slot::ID;
187+
if(id == SlotID::WorkGR_ClassifyPixels_NodeEmulation) return Slots::WorkGR_ClassifyPixels_NodeEmulation::Slot::ID;
188+
if(id == SlotID::WorkGR_Shadows_NodeEmulation) return Slots::WorkGR_Shadows_NodeEmulation::Slot::ID;
187189
return -1;
188190
}
189191

@@ -273,6 +275,7 @@ std::string get_slot_name(SlotID id)
273275
if(id == SlotID::FrameClassificationInitDispatch) return "FrameClassificationInitDispatch";
274276
if(id == SlotID::ReflectionCombine) return "ReflectionCombine";
275277
if(id == SlotID::WorkGraphTest) return "WorkGraphTest";
276-
if(id == SlotID::WorkGREmulation) return "WorkGREmulation";
278+
if(id == SlotID::WorkGR_ClassifyPixels_NodeEmulation) return "WorkGR_ClassifyPixels_NodeEmulation";
279+
if(id == SlotID::WorkGR_Shadows_NodeEmulation) return "WorkGR_Shadows_NodeEmulation";
277280
return "UNKNOWN";
278281
}

sources/HAL/autogen/autogen.ixx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,10 @@ export import :Autogen.Slots.WorkGraphTest;
222222
export import :Autogen.Tables.WorkGraphTest;
223223
export import :Autogen.Tables.GraphInput;
224224
export import :Autogen.Tables.TileRecord;
225-
export import :Autogen.Slots.WorkGREmulation;
226-
export import :Autogen.Tables.WorkGREmulation;
225+
export import :Autogen.Slots.WorkGR_ClassifyPixels_NodeEmulation;
226+
export import :Autogen.Tables.WorkGR_ClassifyPixels_NodeEmulation;
227+
export import :Autogen.Slots.WorkGR_Shadows_NodeEmulation;
228+
export import :Autogen.Tables.WorkGR_Shadows_NodeEmulation;
227229
export import :Autogen.PSO.BlueNoise;
228230
export import :Autogen.PSO.BRDF;
229231
export import :Autogen.PSO.DenoiserReflectionReproject;

sources/HAL/autogen/enums.ixx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ export
223223
WorkGraphTest = "WorkGraphTest"_crc32,
224224
GraphInput = "GraphInput"_crc32,
225225
TileRecord = "TileRecord"_crc32,
226-
WorkGREmulation = "WorkGREmulation"_crc32
226+
WorkGR_ClassifyPixels_NodeEmulation = "WorkGR_ClassifyPixels_NodeEmulation"_crc32,
227+
WorkGR_Shadows_NodeEmulation = "WorkGR_Shadows_NodeEmulation"_crc32
227228
};
228229
}

sources/HAL/autogen/layout/DefaultLayout.layout.ixx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,28 @@ export struct DefaultLayout: public FrameLayout
9494
static inline const std::vector<uint> tables = { 34, 36 };
9595
};
9696

97-
struct WorkGREmulation
97+
struct WorkGR_ClassifyPixels_NodeEmulation
9898
{
9999
static const uint ID = 12;
100100
static const uint CB = 5;
101101
static const uint CB_ID = 37;
102-
static const uint UAV = 2;
102+
static const uint UAV = 1;
103103
static const uint UAV_ID = 39;
104104
static inline const std::vector<uint> tables = { 37, 39 };
105105
};
106106

107+
struct WorkGR_Shadows_NodeEmulation
108+
{
109+
static const uint ID = 13;
110+
static const uint CB = 2;
111+
static const uint CB_ID = 40;
112+
static const uint UAV = 1;
113+
static const uint UAV_ID = 42;
114+
static inline const std::vector<uint> tables = { 40, 42 };
115+
};
116+
107117
template<class Processor> static void for_each(Processor& processor)
108118
{
109-
processor.template process<CameraData, SceneData, PassData, DebugInfo, Instance0, Instance1, Instance2, Instance3, Instance4, Instance5, Raytracing, MaterialData, WorkGREmulation>({ HAL::Samplers::SamplerLinearWrapDesc, HAL::Samplers::SamplerPointClampDesc, HAL::Samplers::SamplerLinearClampDesc, HAL::Samplers::SamplerAnisoBorderDesc, HAL::Samplers::SamplerPointBorderDesc });
119+
processor.template process<CameraData, SceneData, PassData, DebugInfo, Instance0, Instance1, Instance2, Instance3, Instance4, Instance5, Raytracing, MaterialData, WorkGR_ClassifyPixels_NodeEmulation, WorkGR_Shadows_NodeEmulation>({ HAL::Samplers::SamplerLinearWrapDesc, HAL::Samplers::SamplerPointClampDesc, HAL::Samplers::SamplerLinearClampDesc, HAL::Samplers::SamplerAnisoBorderDesc, HAL::Samplers::SamplerPointBorderDesc });
110120
}
111121
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// ============================================================================
2+
// THIS FILE IS AUTOMATICALLY GENERATED - DO NOT MANUALLY EDIT
3+
// ============================================================================
4+
// Generated by SigParser from .sig files in sources/SIGParser/sigs/
5+
// Changes will be lost on next generation. Edit the .sig source files instead.
6+
// ============================================================================
7+
export module HAL:Autogen.Slots.WorkGR_ClassifyPixels_NodeEmulation;
8+
import Core;
9+
import :Autogen.Tables.WorkGR_ClassifyPixels_NodeEmulation;
10+
import :Autogen.Layouts.DefaultLayout;
11+
import :SIG;
12+
import :Types;
13+
import :Enums;
14+
import :Slots;
15+
16+
export namespace Slots
17+
{
18+
struct WorkGR_ClassifyPixels_NodeEmulation :public DataHolder<WorkGR_ClassifyPixels_NodeEmulation, SlotID::WorkGR_ClassifyPixels_NodeEmulation, Table::WorkGR_ClassifyPixels_NodeEmulation, DefaultLayout::WorkGR_ClassifyPixels_NodeEmulation>
19+
{
20+
static constexpr SIG_TYPE TYPE = SIG_TYPE::Slot;
21+
WorkGR_ClassifyPixels_NodeEmulation() = default;
22+
};
23+
}

sources/HAL/autogen/slots/WorkGREmulation.ixx renamed to sources/HAL/autogen/slots/WorkGR_Shadows_NodeEmulation.ixx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
// Generated by SigParser from .sig files in sources/SIGParser/sigs/
55
// Changes will be lost on next generation. Edit the .sig source files instead.
66
// ============================================================================
7-
export module HAL:Autogen.Slots.WorkGREmulation;
7+
export module HAL:Autogen.Slots.WorkGR_Shadows_NodeEmulation;
88
import Core;
9-
import :Autogen.Tables.WorkGREmulation;
9+
import :Autogen.Tables.WorkGR_Shadows_NodeEmulation;
1010
import :Autogen.Layouts.DefaultLayout;
1111
import :SIG;
1212
import :Types;
1313
import :Enums;
1414
import :Slots;
1515

16-
export namespace Slots
16+
export namespace Slots
1717
{
18-
struct WorkGREmulation :public DataHolder<WorkGREmulation, SlotID::WorkGREmulation, Table::WorkGREmulation, DefaultLayout::WorkGREmulation>
18+
struct WorkGR_Shadows_NodeEmulation :public DataHolder<WorkGR_Shadows_NodeEmulation, SlotID::WorkGR_Shadows_NodeEmulation, Table::WorkGR_Shadows_NodeEmulation, DefaultLayout::WorkGR_Shadows_NodeEmulation>
1919
{
2020
static constexpr SIG_TYPE TYPE = SIG_TYPE::Slot;
21-
WorkGREmulation() = default;
21+
WorkGR_Shadows_NodeEmulation() = default;
2222
};
23-
}
23+
}

sources/HAL/autogen/tables/WorkGREmulation.table.ixx renamed to sources/HAL/autogen/tables/WorkGR_ClassifyPixels_NodeEmulation.table.ixx

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Generated by SigParser from .sig files in sources/SIGParser/sigs/
55
// Changes will be lost on next generation. Edit the .sig source files instead.
66
// ============================================================================
7-
export module HAL:Autogen.Tables.WorkGREmulation;
7+
export module HAL:Autogen.Tables.WorkGR_ClassifyPixels_NodeEmulation;
88

99
import Core;
1010
import :SIG;
@@ -13,60 +13,52 @@ import :HLSL;
1313
import :Enums;
1414
import :Autogen.Tables.GraphInput;
1515
import :Autogen.Tables.TileRecord;
16+
1617
export namespace Table
1718
{
1819
#pragma pack(push, 1)
1920

20-
struct WorkGREmulation
21+
struct WorkGR_ClassifyPixels_NodeEmulation
2122
{
22-
static constexpr SlotID ID = SlotID::WorkGREmulation;
23+
static constexpr SlotID ID = SlotID::WorkGR_ClassifyPixels_NodeEmulation;
2324
uint YZBase;
24-
HLSL::AppendStructuredBuffer<TileRecord> tileRecordAppend;
25-
HLSL::ConsumeStructuredBuffer<TileRecord> tileRecordConsume;
25+
HLSL::AppendStructuredBuffer<TileRecord> Shadows_Node;
2626
GraphInput graphInput;
27-
HLSL::AppendStructuredBuffer<TileRecord>& GetTileRecordAppend() { return tileRecordAppend; }
28-
HLSL::ConsumeStructuredBuffer<TileRecord>& GetTileRecordConsume() { return tileRecordConsume; }
2927
uint& GetYZBase() { return YZBase; }
28+
HLSL::AppendStructuredBuffer<TileRecord>& GetShadows_Node() { return Shadows_Node; }
3029
GraphInput& GetGraphInput() { return graphInput; }
3130
static constexpr SIG_TYPE TYPE = SIG_TYPE::Table;
3231
template<class Compiler>
3332
void compile(Compiler& compiler) const
3433
{
3534
compiler.compile(YZBase);
36-
compiler.compile(tileRecordAppend);
37-
compiler.compile(tileRecordConsume);
35+
compiler.compile(Shadows_Node);
3836
compiler.compile(graphInput);
3937
}
4038
struct Compiled
4139
{
4240
uint YZBase; // uint
43-
uint tileRecordAppend; // AppendStructuredBuffer<TileRecord>
44-
uint tileRecordConsume; // ConsumeStructuredBuffer<TileRecord>
41+
uint Shadows_Node; // AppendStructuredBuffer<TileRecord>
4542
GraphInput::Compiled graphInput; // GraphInput
4643

47-
4844
private:
4945
SERIALIZE()
5046
{
5147
ar& NVP(graphInput);
5248
ar& NVP(YZBase);
5349
}
54-
55-
5650
};
5751

5852
static std::string get_typename()
5953
{
60-
return "Tables::WorkGREmulation";
54+
return "Tables::WorkGR_ClassifyPixels_NodeEmulation";
6155
}
6256
private:
6357
SERIALIZE()
6458
{
6559
ar& NVP(graphInput);
6660
ar& NVP(YZBase);
6761
}
68-
6962
};
7063
#pragma pack(pop)
7164
}
72-
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// ============================================================================
2+
// THIS FILE IS AUTOMATICALLY GENERATED - DO NOT MANUALLY EDIT
3+
// ============================================================================
4+
// Generated by SigParser from .sig files in sources/SIGParser/sigs/
5+
// Changes will be lost on next generation. Edit the .sig source files instead.
6+
// ============================================================================
7+
export module HAL:Autogen.Tables.WorkGR_Shadows_NodeEmulation;
8+
9+
import Core;
10+
import :SIG;
11+
import :Types;
12+
import :HLSL;
13+
import :Enums;
14+
import :Autogen.Tables.TileRecord;
15+
16+
export namespace Table
17+
{
18+
#pragma pack(push, 1)
19+
20+
struct WorkGR_Shadows_NodeEmulation
21+
{
22+
static constexpr SlotID ID = SlotID::WorkGR_Shadows_NodeEmulation;
23+
HLSL::ConsumeStructuredBuffer<TileRecord> input;
24+
HLSL::ConsumeStructuredBuffer<TileRecord>& GetInput() { return input; }
25+
static constexpr SIG_TYPE TYPE = SIG_TYPE::Table;
26+
template<class Compiler>
27+
void compile(Compiler& compiler) const
28+
{
29+
compiler.compile(input);
30+
}
31+
struct Compiled
32+
{
33+
uint input; // ConsumeStructuredBuffer<TileRecord>
34+
35+
private:
36+
SERIALIZE()
37+
{
38+
}
39+
};
40+
41+
static std::string get_typename()
42+
{
43+
return "Tables::WorkGR_Shadows_NodeEmulation";
44+
}
45+
private:
46+
SERIALIZE()
47+
{
48+
}
49+
};
50+
#pragma pack(pop)
51+
}

0 commit comments

Comments
 (0)