@@ -64,66 +64,58 @@ bool ResourceInfo::isMultiSample() const {
64
64
}
65
65
66
66
ResourceInfo ResourceInfo::SRV (Value *Symbol, StringRef Name,
67
- ResourceBinding Binding, uint32_t UniqueID,
68
67
ElementType ElementTy, uint32_t ElementCount,
69
68
ResourceKind Kind) {
70
- ResourceInfo RI (ResourceClass::SRV, Kind, Symbol, Name, Binding, UniqueID );
69
+ ResourceInfo RI (ResourceClass::SRV, Kind, Symbol, Name);
71
70
assert (RI.isTyped () && !(RI.isStruct () || RI.isMultiSample ()) &&
72
71
" Invalid ResourceKind for SRV constructor." );
73
72
RI.Typed .ElementTy = ElementTy;
74
73
RI.Typed .ElementCount = ElementCount;
75
74
return RI;
76
75
}
77
76
78
- ResourceInfo ResourceInfo::RawBuffer (Value *Symbol, StringRef Name,
79
- ResourceBinding Binding,
80
- uint32_t UniqueID) {
81
- ResourceInfo RI (ResourceClass::SRV, ResourceKind::RawBuffer, Symbol, Name,
82
- Binding, UniqueID);
77
+ ResourceInfo ResourceInfo::RawBuffer (Value *Symbol, StringRef Name) {
78
+ ResourceInfo RI (ResourceClass::SRV, ResourceKind::RawBuffer, Symbol, Name);
83
79
return RI;
84
80
}
85
81
86
82
ResourceInfo ResourceInfo::StructuredBuffer (Value *Symbol, StringRef Name,
87
- ResourceBinding Binding,
88
- uint32_t UniqueID, uint32_t Stride,
89
- Align Alignment) {
83
+ uint32_t Stride, Align Alignment) {
90
84
ResourceInfo RI (ResourceClass::SRV, ResourceKind::StructuredBuffer, Symbol,
91
- Name, Binding, UniqueID );
85
+ Name);
92
86
RI.Struct .Stride = Stride;
93
87
RI.Struct .Alignment = Alignment;
94
88
return RI;
95
89
}
96
90
97
91
ResourceInfo ResourceInfo::Texture2DMS (Value *Symbol, StringRef Name,
98
- ResourceBinding Binding,
99
- uint32_t UniqueID, ElementType ElementTy,
92
+ ElementType ElementTy,
100
93
uint32_t ElementCount,
101
94
uint32_t SampleCount) {
102
- ResourceInfo RI (ResourceClass::SRV, ResourceKind::Texture2DMS, Symbol, Name,
103
- Binding, UniqueID);
95
+ ResourceInfo RI (ResourceClass::SRV, ResourceKind::Texture2DMS, Symbol, Name);
104
96
RI.Typed .ElementTy = ElementTy;
105
97
RI.Typed .ElementCount = ElementCount;
106
98
RI.MultiSample .Count = SampleCount;
107
99
return RI;
108
100
}
109
101
110
- ResourceInfo ResourceInfo::Texture2DMSArray (
111
- Value *Symbol, StringRef Name, ResourceBinding Binding, uint32_t UniqueID,
112
- ElementType ElementTy, uint32_t ElementCount, uint32_t SampleCount) {
102
+ ResourceInfo ResourceInfo::Texture2DMSArray (Value *Symbol, StringRef Name,
103
+ ElementType ElementTy,
104
+ uint32_t ElementCount,
105
+ uint32_t SampleCount) {
113
106
ResourceInfo RI (ResourceClass::SRV, ResourceKind::Texture2DMSArray, Symbol,
114
- Name, Binding, UniqueID );
107
+ Name);
115
108
RI.Typed .ElementTy = ElementTy;
116
109
RI.Typed .ElementCount = ElementCount;
117
110
RI.MultiSample .Count = SampleCount;
118
111
return RI;
119
112
}
120
113
121
114
ResourceInfo ResourceInfo::UAV (Value *Symbol, StringRef Name,
122
- ResourceBinding Binding, uint32_t UniqueID,
123
115
ElementType ElementTy, uint32_t ElementCount,
124
116
bool GloballyCoherent, bool IsROV,
125
117
ResourceKind Kind) {
126
- ResourceInfo RI (ResourceClass::UAV, Kind, Symbol, Name, Binding, UniqueID );
118
+ ResourceInfo RI (ResourceClass::UAV, Kind, Symbol, Name);
127
119
assert (RI.isTyped () && !(RI.isStruct () || RI.isMultiSample ()) &&
128
120
" Invalid ResourceKind for UAV constructor." );
129
121
RI.Typed .ElementTy = ElementTy;
@@ -135,25 +127,20 @@ ResourceInfo ResourceInfo::UAV(Value *Symbol, StringRef Name,
135
127
}
136
128
137
129
ResourceInfo ResourceInfo::RWRawBuffer (Value *Symbol, StringRef Name,
138
- ResourceBinding Binding,
139
- uint32_t UniqueID, bool GloballyCoherent,
140
- bool IsROV) {
141
- ResourceInfo RI (ResourceClass::UAV, ResourceKind::RawBuffer, Symbol, Name,
142
- Binding, UniqueID);
130
+ bool GloballyCoherent, bool IsROV) {
131
+ ResourceInfo RI (ResourceClass::UAV, ResourceKind::RawBuffer, Symbol, Name);
143
132
RI.UAVFlags .GloballyCoherent = GloballyCoherent;
144
133
RI.UAVFlags .IsROV = IsROV;
145
134
RI.UAVFlags .HasCounter = false ;
146
135
return RI;
147
136
}
148
137
149
138
ResourceInfo ResourceInfo::RWStructuredBuffer (Value *Symbol, StringRef Name,
150
- ResourceBinding Binding,
151
- uint32_t UniqueID,
152
139
uint32_t Stride, Align Alignment,
153
140
bool GloballyCoherent, bool IsROV,
154
141
bool HasCounter) {
155
142
ResourceInfo RI (ResourceClass::UAV, ResourceKind::StructuredBuffer, Symbol,
156
- Name, Binding, UniqueID );
143
+ Name);
157
144
RI.Struct .Stride = Stride;
158
145
RI.Struct .Alignment = Alignment;
159
146
RI.UAVFlags .GloballyCoherent = GloballyCoherent;
@@ -162,13 +149,12 @@ ResourceInfo ResourceInfo::RWStructuredBuffer(Value *Symbol, StringRef Name,
162
149
return RI;
163
150
}
164
151
165
- ResourceInfo
166
- ResourceInfo::RWTexture2DMS (Value *Symbol, StringRef Name,
167
- ResourceBinding Binding, uint32_t UniqueID,
168
- ElementType ElementTy, uint32_t ElementCount,
169
- uint32_t SampleCount, bool GloballyCoherent) {
170
- ResourceInfo RI (ResourceClass::UAV, ResourceKind::Texture2DMS, Symbol, Name,
171
- Binding, UniqueID);
152
+ ResourceInfo ResourceInfo::RWTexture2DMS (Value *Symbol, StringRef Name,
153
+ ElementType ElementTy,
154
+ uint32_t ElementCount,
155
+ uint32_t SampleCount,
156
+ bool GloballyCoherent) {
157
+ ResourceInfo RI (ResourceClass::UAV, ResourceKind::Texture2DMS, Symbol, Name);
172
158
RI.Typed .ElementTy = ElementTy;
173
159
RI.Typed .ElementCount = ElementCount;
174
160
RI.UAVFlags .GloballyCoherent = GloballyCoherent;
@@ -178,13 +164,13 @@ ResourceInfo::RWTexture2DMS(Value *Symbol, StringRef Name,
178
164
return RI;
179
165
}
180
166
181
- ResourceInfo
182
- ResourceInfo::RWTexture2DMSArray (Value *Symbol, StringRef Name ,
183
- ResourceBinding Binding, uint32_t UniqueID ,
184
- ElementType ElementTy, uint32_t ElementCount ,
185
- uint32_t SampleCount, bool GloballyCoherent) {
167
+ ResourceInfo ResourceInfo::RWTexture2DMSArray (Value *Symbol, StringRef Name,
168
+ ElementType ElementTy ,
169
+ uint32_t ElementCount ,
170
+ uint32_t SampleCount ,
171
+ bool GloballyCoherent) {
186
172
ResourceInfo RI (ResourceClass::UAV, ResourceKind::Texture2DMSArray, Symbol,
187
- Name, Binding, UniqueID );
173
+ Name);
188
174
RI.Typed .ElementTy = ElementTy;
189
175
RI.Typed .ElementCount = ElementCount;
190
176
RI.UAVFlags .GloballyCoherent = GloballyCoherent;
@@ -195,11 +181,9 @@ ResourceInfo::RWTexture2DMSArray(Value *Symbol, StringRef Name,
195
181
}
196
182
197
183
ResourceInfo ResourceInfo::FeedbackTexture2D (Value *Symbol, StringRef Name,
198
- ResourceBinding Binding,
199
- uint32_t UniqueID,
200
184
SamplerFeedbackType FeedbackTy) {
201
185
ResourceInfo RI (ResourceClass::UAV, ResourceKind::FeedbackTexture2D, Symbol,
202
- Name, Binding, UniqueID );
186
+ Name);
203
187
RI.UAVFlags .GloballyCoherent = false ;
204
188
RI.UAVFlags .IsROV = false ;
205
189
RI.UAVFlags .HasCounter = false ;
@@ -209,10 +193,9 @@ ResourceInfo ResourceInfo::FeedbackTexture2D(Value *Symbol, StringRef Name,
209
193
210
194
ResourceInfo
211
195
ResourceInfo::FeedbackTexture2DArray (Value *Symbol, StringRef Name,
212
- ResourceBinding Binding, uint32_t UniqueID,
213
196
SamplerFeedbackType FeedbackTy) {
214
197
ResourceInfo RI (ResourceClass::UAV, ResourceKind::FeedbackTexture2DArray,
215
- Symbol, Name, Binding, UniqueID );
198
+ Symbol, Name);
216
199
RI.UAVFlags .GloballyCoherent = false ;
217
200
RI.UAVFlags .IsROV = false ;
218
201
RI.UAVFlags .HasCounter = false ;
@@ -221,27 +204,22 @@ ResourceInfo::FeedbackTexture2DArray(Value *Symbol, StringRef Name,
221
204
}
222
205
223
206
ResourceInfo ResourceInfo::CBuffer (Value *Symbol, StringRef Name,
224
- ResourceBinding Binding, uint32_t UniqueID,
225
207
uint32_t Size) {
226
- ResourceInfo RI (ResourceClass::CBuffer, ResourceKind::CBuffer, Symbol, Name,
227
- Binding, UniqueID);
208
+ ResourceInfo RI (ResourceClass::CBuffer, ResourceKind::CBuffer, Symbol, Name);
228
209
RI.CBufferSize = Size;
229
210
return RI;
230
211
}
231
212
232
213
ResourceInfo ResourceInfo::Sampler (Value *Symbol, StringRef Name,
233
- ResourceBinding Binding, uint32_t UniqueID,
234
214
SamplerType SamplerTy) {
235
- ResourceInfo RI (ResourceClass::Sampler, ResourceKind::Sampler, Symbol, Name,
236
- Binding, UniqueID);
215
+ ResourceInfo RI (ResourceClass::Sampler, ResourceKind::Sampler, Symbol, Name);
237
216
RI.SamplerTy = SamplerTy;
238
217
return RI;
239
218
}
240
219
241
220
bool ResourceInfo::operator ==(const ResourceInfo &RHS) const {
242
- if (std::tie (Symbol, Name, Binding, UniqueID, RC, Kind) !=
243
- std::tie (RHS.Symbol , RHS.Name , RHS.Binding , RHS.UniqueID , RHS.RC ,
244
- RHS.Kind ))
221
+ if (std::tie (Symbol, Name, Binding, RC, Kind) !=
222
+ std::tie (RHS.Symbol , RHS.Name , RHS.Binding , RHS.RC , RHS.Kind ))
245
223
return false ;
246
224
if (isCBuffer ())
247
225
return CBufferSize == RHS.CBufferSize ;
@@ -278,7 +256,7 @@ MDTuple *ResourceInfo::getAsMetadata(LLVMContext &Ctx) const {
278
256
Constant::getIntegerValue (I1Ty, APInt (1 , V)));
279
257
};
280
258
281
- MDVals.push_back (getIntMD (UniqueID));
259
+ MDVals.push_back (getIntMD (Binding. UniqueID ));
282
260
MDVals.push_back (ValueAsMetadata::get (Symbol));
283
261
MDVals.push_back (MDString::get (Ctx, Name));
284
262
MDVals.push_back (getIntMD (Binding.Space ));
0 commit comments