Skip to content

Commit 91a0df4

Browse files
committed
v1.1.0
1 parent cda50c7 commit 91a0df4

File tree

14 files changed

+75
-72
lines changed

14 files changed

+75
-72
lines changed

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
libs/Cauldron/libs/DXC/bin/dxcompiler.dll filter=lfs diff=lfs merge=lfs -text
2+
libs/Cauldron/libs/DXC/bin/dxc.exe filter=lfs diff=lfs merge=lfs -text
3+
libs/Cauldron/libs/DXC/bin/dxil.dll filter=lfs diff=lfs merge=lfs -text
4+
libs/Cauldron/libs/DXC/bin/x64/dxcompiler.dll filter=lfs diff=lfs merge=lfs -text
5+
libs/Cauldron/libs/DXC/bin/x64/dxc.exe filter=lfs diff=lfs merge=lfs -text
6+
libs/Cauldron/libs/DXC/bin/x64/dxil.dll filter=lfs diff=lfs merge=lfs -text
7+
libs/Cauldron/libs/DXCwg/*.exe filter=lfs diff=lfs merge=lfs -text
8+
libs/Cauldron/libs/DXCwg/*.dll filter=lfs diff=lfs merge=lfs -text

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,4 +355,8 @@ ASALocalRun/
355355
healthchecksdb
356356

357357
# Backup folder for Package Reference Convert tool in Visual Studio 2017
358-
MigrationBackup/
358+
MigrationBackup/
359+
/libs/Cauldron/libs/DXCwg/*.exe
360+
/libs/Cauldron/libs/DXCwg/*.dll
361+
/libs/Cauldron/libs/DXCwg/LICENSE*.txt
362+
/libs/Cauldron/libs/DXCwg/LICENCE*.txt

.gitmodules

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[submodule "media/Cauldron-Media"]
22
path = media/Cauldron-Media
3-
url = ../Cauldron-Media.git
3+
url = https://github.com/GPUOpen-LibrariesAndSDKs/Cauldron-Media.git
44
[submodule "libs/Cauldron"]
5-
path = libs/Cauldron
6-
url = ../Cauldron.git
7-
branch = WorkGraphComputeRasterizer
5+
path = libs/Cauldron
6+
url = ../Cauldron.git
7+
branch = WorkGraphComputeRasterizer

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
4646
add_compile_options(/MP)
4747

4848
if(GFX_API_WG)
49-
add_definitions(-DENABLE_EXPERIMENTAL_WORKGRAPHS)
49+
add_definitions(-DENABLE_WORKGRAPHS)
5050
endif()
5151

5252
# reference libs used by both backends

libs/Cauldron

Submodule Cauldron updated 196 files

readme.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ To build the Work Graphs Compute Rasterizer Sample, you must first install the f
1414
- [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)
1515
- [Windows 10 SDK 10.0.18362.0](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk)
1616

17-
Then follow the next steps:
17+
### Getting up and running
18+
19+
Follow the next steps:
1820

1921
1) Clone the repo with its submodules:
2022
```
@@ -29,16 +31,12 @@ Then follow the next steps:
2931
3032
3) Open the solution in the DX12 directory, compile and run. VK isn't supported.
3133
32-
4) The define `ENABLE_EXPERIMENTAL_WORKGRAPHS` enables Work graphs. It's enabled by
33-
default. It can be disabled if [PIX](https://devblogs.microsoft.com/pix/introduction/),
34-
[RenderDoc](https://renderdoc.org) or another tool without Work graphs
35-
support is used to debug. Use CMake to disable the feature:
34+
4) The define `ENABLE_WORKGRAPHS` enables Work graphs. It's enabled by default. It can be disabled if [PIX](https://devblogs.microsoft.com/pix/introduction/), [RenderDoc](https://renderdoc.org) or another tool without Work graphs support is used to debug. Use CMake to disable the feature:
3635
```
3736
> cmake -DGFX_API_WG=OFF
3837
```
3938
40-
5) The media samples from Cauldron may change and not all scenes may load,
41-
you can adjust scenes in [src\Common\GLTFSample.json](src\Common\GLTFSample.json)
39+
5) The media samples from Cauldron may change and not all scenes may load, you can adjust scenes in [src\Common\GLTFSample.json](src\Common\GLTFSample.json)
4240
4341
6) You can request precise profiling data through commandline by passing json as arguments:
4442
```
@@ -49,34 +47,36 @@ Then follow the next steps:
4947
"warmUpFrames": 50, "durationFrames": 20 } }
5048
```
5149
52-
algorithm:\
53-
0 - monolithic compute rasterizer, called once per object\
54-
1 - monolithic compute rasterizer, all objects are consumed by one ExecuteIndirect\
55-
2 - multi-pass compute rasterizer, all objects are consumed by a pipeline of three ExecuteIndirect\
56-
3 - workgraph rasterizer, called once per object\
57-
4 - workgraph rasterizer, called once in total with all object batched\
58-
5 - workgraph rasterizer, all objects are consumed by an initial Broadcaster node
50+
These are the custom parameters for the rasterizer, the many other options can be looked up in the Cauldron docs:
51+
52+
`algorithm`:
53+
> 0 - monolithic compute rasterizer, called once per object
54+
> 1 - monolithic compute rasterizer, all objects are consumed by one ExecuteIndirect
55+
> 2 - multi-pass compute rasterizer, all objects are consumed by a pipeline of three ExecuteIndirect
56+
> 3 - workgraph rasterizer, called once per object
57+
> 4 - workgraph rasterizer, called once in total with all object batched
58+
> 5 - workgraph rasterizer, all objects are consumed by an initial Broadcaster node
5959
60-
bins:\
61-
1 to 15: number of buckets/bins to group triangles by, 2^(bin-1) = area
60+
`bins`:
61+
> 1 to 15: number of buckets/bins to group triangles by, 2^(bin-1) = area
6262
63-
threadlaunch:\
64-
false/true: use a thread-launch or coalesce node for triangle rasterization
63+
`threadlaunch`:
64+
> false/true: use a thread-launch or coalesce node for triangle rasterization
6565
66-
profile:\
67-
false/true: enables automatic profiling and generation of a csv file
66+
`profile`:
67+
> false/true: enables automatic profiling and generation of a csv file
6868
69-
filter:\
70-
label: the label of the pass to collect timestamps for, if empty all passes are included in the csv
69+
`filter`:
70+
> label: the label of the pass to collect timestamps for, if empty all passes are included in the csv
7171
72-
resultsFilename:\
73-
filename: the name of the csv in the current directory
72+
`resultsFilename`:
73+
> filename: the name of the csv in the current directory
7474
75-
warmUpFrames:\
76-
0 to inf: how many frames to wait for initialization to settle
75+
`warmUpFrames`:
76+
> 0 to inf: how many frames to wait for initialization to settle
7777
78-
durationFrames:\
79-
0 to inf: how many frames to include in the csv
78+
`durationFrames`:
79+
> 0 to inf: how many frames to include in the csv
8080
8181
The values in the resulting csv are raw gpu ticks without any conversion.
8282

screenshot.png

15 KB
Loading

src/DX12/GLTFSample.cpp

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// AMD SampleDX12 sample code
22
//
3-
// Copyright(c) 2023 Advanced Micro Devices, Inc.All rights reserved.
3+
// Copyright(c) 2024 Advanced Micro Devices, Inc.All rights reserved.
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files(the "Software"), to deal
66
// in the Software without restriction, including without limitation the rights
@@ -48,8 +48,12 @@ void GLTFSample::OnParseCommandLine(LPSTR lpCmdLine, uint32_t* pWidth, uint32_t*
4848

4949
// ADJUSTMENT: support z-buffer rasterizer custom parameters
5050
m_homogeneous = true;
51+
#if ENABLE_WORKGRAPHS
52+
m_algorithm = 5;
53+
#else
5154
m_algorithm = 2;
52-
m_numberOfBins = 12;
55+
#endif
56+
m_numberOfBins = 15;
5357
m_fixExpansion = true;
5458
m_threadLaunch = true;
5559
m_smoothing = true;
@@ -500,14 +504,14 @@ void GLTFSample::OnRender()
500504
Sleep(0);
501505
}
502506

503-
#ifdef ENABLE_EXPERIMENTAL_WORKGRAPHS
507+
#ifdef ENABLE_WORKGRAPHS
504508
// Configure Agility SDK version
505509
extern "C" {
506-
__declspec(dllexport) extern const UINT D3D12SDKVersion = 711;
510+
__declspec(dllexport) extern const UINT D3D12SDKVersion = 613;
507511
}
508512
// Configure Agility SDK path
509513
extern "C" {
510-
__declspec(dllexport) extern const char* D3D12SDKPath = ".\\d3d12wg\\";
514+
__declspec(dllexport) extern const char* D3D12SDKPath = ".\\d3d12\\";
511515
}
512516
#endif
513517

@@ -521,22 +525,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
521525
LPSTR lpCmdLine,
522526
int nCmdShow)
523527
{
524-
LPCSTR Name = "DX12 Work Graphs Compute Rasterizer Sample v1.0";
525-
526-
// Enable experimental features
527-
{
528-
const IID ids[] = {
529-
D3D12ExperimentalShaderModels,
530-
#ifdef ENABLE_EXPERIMENTAL_WORKGRAPHS
531-
D3D12StateObjectsExperiment
532-
#endif
533-
};
534-
535-
void* configStructs[] = { nullptr, nullptr };
536-
UINT configStructSizes[] = { 0, 0 };
537-
ThrowIfFailed(
538-
D3D12EnableExperimentalFeatures(_countof(ids), ids, configStructs, configStructSizes));
539-
}
528+
LPCSTR Name = "DX12 Work Graphs Compute Rasterizer Sample v1.1";
540529

541530
// create new DX sample
542531
return RunFramework(hInstance, lpCmdLine, nCmdShow, new GLTFSample(Name));

src/DX12/GLTFSample.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// AMD SampleDX12 sample code
22
//
3-
// Copyright(c) 2023 Advanced Micro Devices, Inc.All rights reserved.
3+
// Copyright(c) 2024 Advanced Micro Devices, Inc.All rights reserved.
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files(the "Software"), to deal
66
// in the Software without restriction, including without limitation the rights

src/DX12/Renderer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// AMD SampleDX12 sample code
22
//
3-
// Copyright(c) 2023 Advanced Micro Devices, Inc.All rights reserved.
3+
// Copyright(c) 2024 Advanced Micro Devices, Inc.All rights reserved.
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files(the "Software"), to deal
66
// in the Software without restriction, including without limitation the rights
@@ -31,12 +31,12 @@ void Renderer::OnCreate(Device* pDevice, SwapChain *pSwapChain, float FontSize)
3131
{
3232
m_pDevice = pDevice;
3333

34-
#ifdef ENABLE_EXPERIMENTAL_WORKGRAPHS
34+
#ifdef ENABLE_WORKGRAPHS
3535
// Check work-graph support
3636
//
37-
D3D12_FEATURE_DATA_D3D12_OPTIONS_EXPERIMENTAL Options;
37+
D3D12_FEATURE_DATA_D3D12_OPTIONS21 Options;
3838
ThrowIfFailed(pDevice->GetDevice()->CheckFeatureSupport(
39-
D3D12_FEATURE_D3D12_OPTIONS_EXPERIMENTAL, &Options, sizeof(Options)));
39+
D3D12_FEATURE_D3D12_OPTIONS21, &Options, sizeof(Options)));
4040
if (Options.WorkGraphsTier == D3D12_WORK_GRAPHS_TIER_NOT_SUPPORTED) {
4141
throw std::runtime_error("Device does not report support for work graphs");
4242
}
@@ -114,7 +114,7 @@ void Renderer::OnCreate(Device* pDevice, SwapChain *pSwapChain, float FontSize)
114114
m_Bloom.OnCreate(pDevice, &m_ResourceViewHeaps, &m_ConstantBufferRing, &m_VidMemBufferPool, DXGI_FORMAT_R16G16B16A16_FLOAT);
115115
m_TAA.OnCreate(pDevice, &m_ResourceViewHeaps, &m_VidMemBufferPool);
116116
m_MagnifierPS.OnCreate(pDevice, &m_ResourceViewHeaps, &m_ConstantBufferRing, &m_VidMemBufferPool, DXGI_FORMAT_R16G16B16A16_FLOAT);
117-
m_Debug.OnCreate(pDevice, &m_ResourceViewHeaps, &m_VidMemBufferPool, DXGI_FORMAT_R16G16B16A16_FLOAT);
117+
m_Debug.OnCreate(pDevice, &m_ResourceViewHeaps, &m_ConstantBufferRing, &m_VidMemBufferPool, DXGI_FORMAT_R16G16B16A16_FLOAT);
118118

119119
// Create tonemapping pass
120120
m_ToneMappingPS.OnCreate(pDevice, &m_ResourceViewHeaps, &m_ConstantBufferRing, &m_VidMemBufferPool, pSwapChain->GetFormat());
@@ -163,7 +163,7 @@ void Renderer::OnDestroy()
163163
m_ResourceViewHeaps.OnDestroy();
164164
m_CommandListRing.OnDestroy();
165165

166-
#ifdef ENABLE_EXPERIMENTAL_WORKGRAPHS
166+
#ifdef ENABLE_WORKGRAPHS
167167
m_pDevice8Native->Release();
168168
#endif
169169
}
@@ -713,7 +713,7 @@ void Renderer::OnRender(const UIState* pState, const Camera& Cam, SwapChain* pSw
713713
};
714714
pCmdLst1->ResourceBarrier(1, preResolve);
715715

716-
m_Debug.Draw(pCmdLst1, &m_VBufferSRV);
716+
m_Debug.Draw(pCmdLst1, &m_VBufferSRV, pState->showBins);
717717

718718
D3D12_RESOURCE_BARRIER postResolve[1] = {
719719
CD3DX12_RESOURCE_BARRIER::Transition(m_VBuffer.GetResource(), D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, D3D12_RESOURCE_STATE_UNORDERED_ACCESS),

0 commit comments

Comments
 (0)