@@ -69,8 +69,7 @@ ResourceInfo ResourceInfo::SRV(Value *Symbol, StringRef Name,
69
69
ResourceInfo RI (ResourceClass::SRV, Kind, Symbol, Name);
70
70
assert (RI.isTyped () && !(RI.isStruct () || RI.isMultiSample ()) &&
71
71
" Invalid ResourceKind for SRV constructor." );
72
- RI.Typed .ElementTy = ElementTy;
73
- RI.Typed .ElementCount = ElementCount;
72
+ RI.setTyped (ElementTy, ElementCount);
74
73
return RI;
75
74
}
76
75
@@ -83,8 +82,7 @@ ResourceInfo ResourceInfo::StructuredBuffer(Value *Symbol, StringRef Name,
83
82
uint32_t Stride, Align Alignment) {
84
83
ResourceInfo RI (ResourceClass::SRV, ResourceKind::StructuredBuffer, Symbol,
85
84
Name);
86
- RI.Struct .Stride = Stride;
87
- RI.Struct .Alignment = Alignment;
85
+ RI.setStruct (Stride, Alignment);
88
86
return RI;
89
87
}
90
88
@@ -93,9 +91,8 @@ ResourceInfo ResourceInfo::Texture2DMS(Value *Symbol, StringRef Name,
93
91
uint32_t ElementCount,
94
92
uint32_t SampleCount) {
95
93
ResourceInfo RI (ResourceClass::SRV, ResourceKind::Texture2DMS, Symbol, Name);
96
- RI.Typed .ElementTy = ElementTy;
97
- RI.Typed .ElementCount = ElementCount;
98
- RI.MultiSample .Count = SampleCount;
94
+ RI.setTyped (ElementTy, ElementCount);
95
+ RI.setMultiSample (SampleCount);
99
96
return RI;
100
97
}
101
98
@@ -105,9 +102,8 @@ ResourceInfo ResourceInfo::Texture2DMSArray(Value *Symbol, StringRef Name,
105
102
uint32_t SampleCount) {
106
103
ResourceInfo RI (ResourceClass::SRV, ResourceKind::Texture2DMSArray, Symbol,
107
104
Name);
108
- RI.Typed .ElementTy = ElementTy;
109
- RI.Typed .ElementCount = ElementCount;
110
- RI.MultiSample .Count = SampleCount;
105
+ RI.setTyped (ElementTy, ElementCount);
106
+ RI.setMultiSample (SampleCount);
111
107
return RI;
112
108
}
113
109
@@ -118,20 +114,15 @@ ResourceInfo ResourceInfo::UAV(Value *Symbol, StringRef Name,
118
114
ResourceInfo RI (ResourceClass::UAV, Kind, Symbol, Name);
119
115
assert (RI.isTyped () && !(RI.isStruct () || RI.isMultiSample ()) &&
120
116
" Invalid ResourceKind for UAV constructor." );
121
- RI.Typed .ElementTy = ElementTy;
122
- RI.Typed .ElementCount = ElementCount;
123
- RI.UAVFlags .GloballyCoherent = GloballyCoherent;
124
- RI.UAVFlags .IsROV = IsROV;
125
- RI.UAVFlags .HasCounter = false ;
117
+ RI.setTyped (ElementTy, ElementCount);
118
+ RI.setUAV (GloballyCoherent, /* HasCounter=*/ false , IsROV);
126
119
return RI;
127
120
}
128
121
129
122
ResourceInfo ResourceInfo::RWRawBuffer (Value *Symbol, StringRef Name,
130
123
bool GloballyCoherent, bool IsROV) {
131
124
ResourceInfo RI (ResourceClass::UAV, ResourceKind::RawBuffer, Symbol, Name);
132
- RI.UAVFlags .GloballyCoherent = GloballyCoherent;
133
- RI.UAVFlags .IsROV = IsROV;
134
- RI.UAVFlags .HasCounter = false ;
125
+ RI.setUAV (GloballyCoherent, /* HasCounter=*/ false , IsROV);
135
126
return RI;
136
127
}
137
128
@@ -141,11 +132,8 @@ ResourceInfo ResourceInfo::RWStructuredBuffer(Value *Symbol, StringRef Name,
141
132
bool HasCounter) {
142
133
ResourceInfo RI (ResourceClass::UAV, ResourceKind::StructuredBuffer, Symbol,
143
134
Name);
144
- RI.Struct .Stride = Stride;
145
- RI.Struct .Alignment = Alignment;
146
- RI.UAVFlags .GloballyCoherent = GloballyCoherent;
147
- RI.UAVFlags .IsROV = IsROV;
148
- RI.UAVFlags .HasCounter = HasCounter;
135
+ RI.setStruct (Stride, Alignment);
136
+ RI.setUAV (GloballyCoherent, HasCounter, IsROV);
149
137
return RI;
150
138
}
151
139
@@ -155,12 +143,9 @@ ResourceInfo ResourceInfo::RWTexture2DMS(Value *Symbol, StringRef Name,
155
143
uint32_t SampleCount,
156
144
bool GloballyCoherent) {
157
145
ResourceInfo RI (ResourceClass::UAV, ResourceKind::Texture2DMS, Symbol, Name);
158
- RI.Typed .ElementTy = ElementTy;
159
- RI.Typed .ElementCount = ElementCount;
160
- RI.UAVFlags .GloballyCoherent = GloballyCoherent;
161
- RI.UAVFlags .IsROV = false ;
162
- RI.UAVFlags .HasCounter = false ;
163
- RI.MultiSample .Count = SampleCount;
146
+ RI.setTyped (ElementTy, ElementCount);
147
+ RI.setUAV (GloballyCoherent, /* HasCounter=*/ false , /* IsROV=*/ false );
148
+ RI.setMultiSample (SampleCount);
164
149
return RI;
165
150
}
166
151
@@ -171,23 +156,18 @@ ResourceInfo ResourceInfo::RWTexture2DMSArray(Value *Symbol, StringRef Name,
171
156
bool GloballyCoherent) {
172
157
ResourceInfo RI (ResourceClass::UAV, ResourceKind::Texture2DMSArray, Symbol,
173
158
Name);
174
- RI.Typed .ElementTy = ElementTy;
175
- RI.Typed .ElementCount = ElementCount;
176
- RI.UAVFlags .GloballyCoherent = GloballyCoherent;
177
- RI.UAVFlags .IsROV = false ;
178
- RI.UAVFlags .HasCounter = false ;
179
- RI.MultiSample .Count = SampleCount;
159
+ RI.setTyped (ElementTy, ElementCount);
160
+ RI.setUAV (GloballyCoherent, /* HasCounter=*/ false , /* IsROV=*/ false );
161
+ RI.setMultiSample (SampleCount);
180
162
return RI;
181
163
}
182
164
183
165
ResourceInfo ResourceInfo::FeedbackTexture2D (Value *Symbol, StringRef Name,
184
166
SamplerFeedbackType FeedbackTy) {
185
167
ResourceInfo RI (ResourceClass::UAV, ResourceKind::FeedbackTexture2D, Symbol,
186
168
Name);
187
- RI.UAVFlags .GloballyCoherent = false ;
188
- RI.UAVFlags .IsROV = false ;
189
- RI.UAVFlags .HasCounter = false ;
190
- RI.Feedback .Type = FeedbackTy;
169
+ RI.setUAV (/* GloballyCoherent=*/ false , /* HasCounter=*/ false , /* IsROV=*/ false );
170
+ RI.setFeedback (FeedbackTy);
191
171
return RI;
192
172
}
193
173
@@ -196,24 +176,22 @@ ResourceInfo::FeedbackTexture2DArray(Value *Symbol, StringRef Name,
196
176
SamplerFeedbackType FeedbackTy) {
197
177
ResourceInfo RI (ResourceClass::UAV, ResourceKind::FeedbackTexture2DArray,
198
178
Symbol, Name);
199
- RI.UAVFlags .GloballyCoherent = false ;
200
- RI.UAVFlags .IsROV = false ;
201
- RI.UAVFlags .HasCounter = false ;
202
- RI.Feedback .Type = FeedbackTy;
179
+ RI.setUAV (/* GloballyCoherent=*/ false , /* HasCounter=*/ false , /* IsROV=*/ false );
180
+ RI.setFeedback (FeedbackTy);
203
181
return RI;
204
182
}
205
183
206
184
ResourceInfo ResourceInfo::CBuffer (Value *Symbol, StringRef Name,
207
185
uint32_t Size) {
208
186
ResourceInfo RI (ResourceClass::CBuffer, ResourceKind::CBuffer, Symbol, Name);
209
- RI.CBufferSize = Size;
187
+ RI.setCBuffer ( Size) ;
210
188
return RI;
211
189
}
212
190
213
191
ResourceInfo ResourceInfo::Sampler (Value *Symbol, StringRef Name,
214
192
SamplerType SamplerTy) {
215
193
ResourceInfo RI (ResourceClass::Sampler, ResourceKind::Sampler, Symbol, Name);
216
- RI.SamplerTy = SamplerTy ;
194
+ RI.setSampler ( SamplerTy) ;
217
195
return RI;
218
196
}
219
197
0 commit comments