Skip to content

Commit 915abb1

Browse files
committed
add testing of computed offsets
1 parent b2d4b85 commit 915abb1

File tree

2 files changed

+120
-0
lines changed

2 files changed

+120
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# RUN: yaml2obj %s | obj2yaml | FileCheck %s
2+
3+
## This test checks that we correctly compute the StaticSamplersOffset for each
4+
## of the root parameter types (version 1.0 variants)
5+
6+
## StaticSamplerOffset
7+
## = 24 (root signature header)
8+
## + 12 (header) + 12 (root constants)
9+
## + 12 (header) + 8 (v1.1 root descriptor)
10+
## + 12 (header) + 8 (root descriptor table)
11+
## + 20 (v1.1 descriptor range)
12+
## + 0 (root flags)
13+
## = 108
14+
15+
# CHECK: StaticSamplersOffset: 108
16+
17+
--- !dxcontainer
18+
Header:
19+
Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
20+
0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ]
21+
Version:
22+
Major: 1
23+
Minor: 0
24+
PartCount: 1
25+
PartOffsets: [ 60 ]
26+
Parts:
27+
- Name: RTS0
28+
Size: 108
29+
RootSignature:
30+
Version: 1
31+
NumRootParameters: 3
32+
RootParametersOffset: 24
33+
NumStaticSamplers: 0
34+
StaticSamplersOffset: 108
35+
Parameters:
36+
- ParameterType: 1 # RootConstants
37+
ShaderVisibility: 0
38+
Constants:
39+
Num32BitValues: 16
40+
ShaderRegister: 15
41+
RegisterSpace: 14
42+
- ParameterType: 2 # SRV
43+
ShaderVisibility: 0
44+
Descriptor:
45+
ShaderRegister: 31
46+
RegisterSpace: 32
47+
DATA_STATIC_WHILE_SET_AT_EXECUTE: true
48+
- ParameterType: 0 # Descriptor Table
49+
ShaderVisibility: 0
50+
Table:
51+
NumRanges: 1
52+
Ranges:
53+
- RangeType: 0 # CBV
54+
NumDescriptors: -1
55+
BaseShaderRegister: 42
56+
RegisterSpace: 43
57+
OffsetInDescriptorsFromTableStart: 41
58+
DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS: true
59+
AllowInputAssemblerInputLayout: true
60+
DenyGeometryShaderRootAccess: true
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# RUN: yaml2obj %s | obj2yaml | FileCheck %s
2+
3+
## This test checks that we correctly compute the StaticSamplersOffset for each
4+
## of the root parameter types (version 1.1 variants)
5+
6+
## StaticSamplerOffset
7+
## = 24 (root signature header)
8+
## + 12 (header) + 12 (root constants)
9+
## + 12 (header) + 12 (v1.1 root descriptor)
10+
## + 12 (header) + 8 (root descriptor table)
11+
## + 24 (v1.1 descriptor range)
12+
## + 0 (root flags)
13+
## = 116
14+
15+
# CHECK: StaticSamplersOffset: 116
16+
17+
--- !dxcontainer
18+
Header:
19+
Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
20+
0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ]
21+
Version:
22+
Major: 1
23+
Minor: 0
24+
PartCount: 1
25+
PartOffsets: [ 60 ]
26+
Parts:
27+
- Name: RTS0
28+
Size: 116
29+
RootSignature:
30+
Version: 2
31+
NumRootParameters: 3
32+
RootParametersOffset: 24
33+
NumStaticSamplers: 0
34+
StaticSamplersOffset: 116
35+
Parameters:
36+
- ParameterType: 1 # RootConstants
37+
ShaderVisibility: 0
38+
Constants:
39+
Num32BitValues: 16
40+
ShaderRegister: 15
41+
RegisterSpace: 14
42+
- ParameterType: 2 # SRV
43+
ShaderVisibility: 0
44+
Descriptor:
45+
ShaderRegister: 31
46+
RegisterSpace: 32
47+
DATA_STATIC_WHILE_SET_AT_EXECUTE: true
48+
- ParameterType: 0 # Descriptor Table
49+
ShaderVisibility: 0
50+
Table:
51+
NumRanges: 1
52+
Ranges:
53+
- RangeType: 0 # CBV
54+
NumDescriptors: -1
55+
BaseShaderRegister: 42
56+
RegisterSpace: 43
57+
OffsetInDescriptorsFromTableStart: 41
58+
DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS: true
59+
AllowInputAssemblerInputLayout: true
60+
DenyGeometryShaderRootAccess: true

0 commit comments

Comments
 (0)