Skip to content

Commit 1f17239

Browse files
committed
New XDK samples
1 parent 51fc103 commit 1f17239

File tree

161 files changed

+30377
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+30377
-1
lines changed

Kits/ATGTK/FullScreenQuad/FullScreenQuad.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ enum RootParameterIndex
2525
{
2626
ConstantBuffer,
2727
TextureSRV,
28+
TextureSRV_2,
2829
Count
2930
};
3031

@@ -38,6 +39,7 @@ void FullScreenQuad::Initialize(_In_ ID3D12Device* d3dDevice)
3839
D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
3940

4041
CD3DX12_DESCRIPTOR_RANGE textureSRVs(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 0);
42+
CD3DX12_DESCRIPTOR_RANGE textureSRVs_2(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 1);
4143

4244
CD3DX12_STATIC_SAMPLER_DESC sampler(
4345
0, // register
@@ -56,6 +58,7 @@ void FullScreenQuad::Initialize(_In_ ID3D12Device* d3dDevice)
5658
CD3DX12_ROOT_PARAMETER rootParameters[static_cast<uint32_t>(RootParameterIndex::Count)] = {};
5759
rootParameters[RootParameterIndex::ConstantBuffer].InitAsConstantBufferView(0, 0, D3D12_SHADER_VISIBILITY_PIXEL);
5860
rootParameters[RootParameterIndex::TextureSRV].InitAsDescriptorTable(1, &textureSRVs, D3D12_SHADER_VISIBILITY_PIXEL);
61+
rootParameters[RootParameterIndex::TextureSRV_2].InitAsDescriptorTable(1, &textureSRVs_2, D3D12_SHADER_VISIBILITY_PIXEL);
5962

6063
CD3DX12_ROOT_SIGNATURE_DESC rootSignatureDesc;
6164
rootSignatureDesc.Init(_countof(rootParameters), rootParameters, 1, &sampler, rootSignatureFlags);
@@ -77,6 +80,24 @@ void FullScreenQuad::Draw(
7780
d3dCommandList->SetGraphicsRootSignature(m_d3dRootSignature.Get());
7881
d3dCommandList->SetGraphicsRootConstantBufferView(RootParameterIndex::ConstantBuffer, constantBuffer);
7982
d3dCommandList->SetGraphicsRootDescriptorTable(RootParameterIndex::TextureSRV, texture);
83+
d3dCommandList->SetGraphicsRootDescriptorTable(RootParameterIndex::TextureSRV_2, texture);
84+
d3dCommandList->SetPipelineState(d3dPSO);
85+
d3dCommandList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
86+
d3dCommandList->DrawInstanced(3, 1, 0, 0);
87+
}
88+
89+
_Use_decl_annotations_
90+
void FullScreenQuad::Draw(
91+
ID3D12GraphicsCommandList* d3dCommandList,
92+
ID3D12PipelineState* d3dPSO,
93+
D3D12_GPU_DESCRIPTOR_HANDLE texture,
94+
D3D12_GPU_DESCRIPTOR_HANDLE texture2,
95+
D3D12_GPU_VIRTUAL_ADDRESS constantBuffer)
96+
{
97+
d3dCommandList->SetGraphicsRootSignature(m_d3dRootSignature.Get());
98+
d3dCommandList->SetGraphicsRootConstantBufferView(RootParameterIndex::ConstantBuffer, constantBuffer);
99+
d3dCommandList->SetGraphicsRootDescriptorTable(RootParameterIndex::TextureSRV, texture);
100+
d3dCommandList->SetGraphicsRootDescriptorTable(RootParameterIndex::TextureSRV_2, texture2);
80101
d3dCommandList->SetPipelineState(d3dPSO);
81102
d3dCommandList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
82103
d3dCommandList->DrawInstanced(3, 1, 0, 0);

Kits/ATGTK/FullScreenQuad/FullScreenQuad.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ namespace DX
2222
public:
2323
void Initialize(_In_ ID3D12Device* d3dDevice);
2424
void Draw(_In_ ID3D12GraphicsCommandList* d3dCommandList, _In_ ID3D12PipelineState* d3dPSO, D3D12_GPU_DESCRIPTOR_HANDLE texture, D3D12_GPU_VIRTUAL_ADDRESS constantBuffer = 0);
25+
void Draw(_In_ ID3D12GraphicsCommandList* d3dCommandList, _In_ ID3D12PipelineState* d3dPSO, D3D12_GPU_DESCRIPTOR_HANDLE texture, D3D12_GPU_DESCRIPTOR_HANDLE texture2, D3D12_GPU_VIRTUAL_ADDRESS constantBuffer = 0);
2526

2627
void ReleaseDevice();
2728

Kits/ATGTK/FullScreenQuad/FullScreenQuad.hlsli

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
1717
" DENY_HULL_SHADER_ROOT_ACCESS )," \
1818
"CBV(b0, visibility = SHADER_VISIBILITY_PIXEL ), " \
19-
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
19+
"DescriptorTable (SRV(t0), visibility = SHADER_VISIBILITY_PIXEL),"\
20+
"DescriptorTable (SRV(t1), visibility = SHADER_VISIBILITY_PIXEL),"\
2021
"StaticSampler(s0,"\
2122
" filter = FILTER_MIN_MAG_MIP_POINT,"\
2223
" addressU = TEXTURE_ADDRESS_CLAMP,"\

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,15 @@ This repo contains game development samples written by the Microsoft Xbox Advanc
200200
</tr>
201201
</table>
202202

203+
<table>
204+
<tr>
205+
<td>Xbox One (XDK only)</td>
206+
<td><a href="XDKSamples/Graphics/AsyncPresent">AsyncPresent</a></td>
207+
<td><a href="XDKSamples/Graphics/HLSLSymbols">HLSL Symbols</a></td>
208+
<td><a href="XDKSamples/Graphics/SimpleDmaDecompression">Simple DMA Decompression</a></td>
209+
</tr>
210+
</table>
211+
203212
### System
204213

205214
<table>
53.5 KB
Loading
29.8 KB
Loading
1.32 MB
Loading
18.9 KB
Loading
110 KB
Loading

0 commit comments

Comments
 (0)