@@ -39,7 +39,7 @@ namespace filamat {
39
39
40
40
MaterialUniformInterfaceBlockChunk::MaterialUniformInterfaceBlockChunk (
41
41
BufferInterfaceBlock const & uib) :
42
- Chunk (ChunkType:: MaterialUib),
42
+ Chunk (MaterialUib),
43
43
mUib (uib) {
44
44
}
45
45
@@ -60,7 +60,7 @@ void MaterialUniformInterfaceBlockChunk::flatten(Flattener& f) {
60
60
61
61
MaterialSamplerInterfaceBlockChunk::MaterialSamplerInterfaceBlockChunk (
62
62
SamplerInterfaceBlock const & sib) :
63
- Chunk (ChunkType:: MaterialSib),
63
+ Chunk (MaterialSib),
64
64
mSib (sib) {
65
65
}
66
66
@@ -81,7 +81,7 @@ void MaterialSamplerInterfaceBlockChunk::flatten(Flattener& f) {
81
81
// ------------------------------------------------------------------------------------------------
82
82
83
83
MaterialSubpassInterfaceBlockChunk::MaterialSubpassInterfaceBlockChunk (SubpassInfo const & subpass) :
84
- Chunk (ChunkType:: MaterialSubpass),
84
+ Chunk (MaterialSubpass),
85
85
mSubpass (subpass) {
86
86
}
87
87
@@ -101,8 +101,8 @@ void MaterialSubpassInterfaceBlockChunk::flatten(Flattener& f) {
101
101
// ------------------------------------------------------------------------------------------------
102
102
103
103
MaterialConstantParametersChunk::MaterialConstantParametersChunk (
104
- utils:: FixedCapacityVector<MaterialConstant> constants)
105
- : Chunk(ChunkType:: MaterialConstants), mConstants (std::move(constants)) {}
104
+ FixedCapacityVector<MaterialConstant> constants)
105
+ : Chunk(MaterialConstants), mConstants (std::move(constants)) {}
106
106
107
107
void MaterialConstantParametersChunk::flatten (Flattener& f) {
108
108
f.writeUint64 (mConstants .size ());
@@ -115,8 +115,8 @@ void MaterialConstantParametersChunk::flatten(Flattener& f) {
115
115
// ------------------------------------------------------------------------------------------------
116
116
117
117
MaterialPushConstantParametersChunk::MaterialPushConstantParametersChunk (
118
- CString const & structVarName, utils:: FixedCapacityVector<MaterialPushConstant> constants)
119
- : Chunk(ChunkType:: MaterialPushConstants),
118
+ CString const & structVarName, FixedCapacityVector<MaterialPushConstant> constants)
119
+ : Chunk(MaterialPushConstants),
120
120
mStructVarName (structVarName),
121
121
mConstants(std::move(constants)) {}
122
122
@@ -133,7 +133,7 @@ void MaterialPushConstantParametersChunk::flatten(Flattener& f) {
133
133
// ------------------------------------------------------------------------------------------------
134
134
135
135
MaterialBindingUniformInfoChunk::MaterialBindingUniformInfoChunk (Container list) noexcept
136
- : Chunk(ChunkType:: MaterialBindingUniformInfo),
136
+ : Chunk(MaterialBindingUniformInfo),
137
137
mBindingUniformInfo(std::move(list)) {
138
138
}
139
139
@@ -155,7 +155,7 @@ void MaterialBindingUniformInfoChunk::flatten(Flattener& f) {
155
155
// ------------------------------------------------------------------------------------------------
156
156
157
157
MaterialAttributesInfoChunk::MaterialAttributesInfoChunk (Container list) noexcept
158
- : Chunk(ChunkType:: MaterialAttributeInfo),
158
+ : Chunk(MaterialAttributeInfo),
159
159
mAttributeInfo(std::move(list))
160
160
{
161
161
}
@@ -170,11 +170,9 @@ void MaterialAttributesInfoChunk::flatten(Flattener& f) {
170
170
171
171
// ------------------------------------------------------------------------------------------------
172
172
173
- MaterialDescriptorBindingsChuck::MaterialDescriptorBindingsChuck (Container const & sib,
174
- backend::DescriptorSetLayout const & perViewLayout) noexcept
175
- : Chunk(ChunkType::MaterialDescriptorBindingsInfo),
176
- mSamplerInterfaceBlock(sib),
177
- mPerViewLayout(perViewLayout) {
173
+ MaterialDescriptorBindingsChuck::MaterialDescriptorBindingsChuck (Container const & sib) noexcept
174
+ : Chunk(MaterialDescriptorBindingsInfo),
175
+ mSamplerInterfaceBlock(sib) {
178
176
}
179
177
180
178
void MaterialDescriptorBindingsChuck::flatten (Flattener& f) {
@@ -183,13 +181,6 @@ void MaterialDescriptorBindingsChuck::flatten(Flattener& f) {
183
181
184
182
using namespace backend ;
185
183
186
-
187
- // number of descriptor-sets
188
- f.writeUint8 (3 );
189
-
190
- // set
191
- f.writeUint8 (+DescriptorSetBindingPoints::PER_MATERIAL);
192
-
193
184
// samplers + 1 descriptor for the UBO
194
185
f.writeUint8 (mSamplerInterfaceBlock .getSize () + 1 );
195
186
@@ -210,37 +201,13 @@ void MaterialDescriptorBindingsChuck::flatten(Flattener& f) {
210
201
}
211
202
f.writeUint8 (entry.binding );
212
203
}
213
-
214
- // set
215
- f.writeUint8 (+DescriptorSetBindingPoints::PER_RENDERABLE);
216
- f.writeUint8 (descriptor_sets::getPerRenderableLayout ().bindings .size ());
217
- for (auto const & entry: descriptor_sets::getPerRenderableLayout ().bindings ) {
218
- auto const & name = descriptor_sets::getDescriptorName (
219
- DescriptorSetBindingPoints::PER_RENDERABLE, entry.binding );
220
- f.writeString ({ name.data (), name.size () });
221
- f.writeUint8 (uint8_t (entry.type ));
222
- f.writeUint8 (entry.binding );
223
- }
224
-
225
- // set
226
- f.writeUint8 (+DescriptorSetBindingPoints::PER_VIEW);
227
- f.writeUint8 (mPerViewLayout .bindings .size ());
228
- for (auto const & entry: mPerViewLayout .bindings ) {
229
- auto const & name = descriptor_sets::getDescriptorName (
230
- DescriptorSetBindingPoints::PER_VIEW, entry.binding );
231
- f.writeString ({ name.data (), name.size () });
232
- f.writeUint8 (uint8_t (entry.type ));
233
- f.writeUint8 (entry.binding );
234
- }
235
204
}
236
205
237
206
// ------------------------------------------------------------------------------------------------
238
207
239
- MaterialDescriptorSetLayoutChunk::MaterialDescriptorSetLayoutChunk (Container const & sib,
240
- backend::DescriptorSetLayout const & perViewLayout) noexcept
241
- : Chunk(ChunkType::MaterialDescriptorSetLayoutInfo),
242
- mSamplerInterfaceBlock(sib),
243
- mPerViewLayout(perViewLayout) {
208
+ MaterialDescriptorSetLayoutChunk::MaterialDescriptorSetLayoutChunk (Container const & sib) noexcept
209
+ : Chunk(MaterialDescriptorSetLayoutInfo),
210
+ mSamplerInterfaceBlock(sib) {
244
211
}
245
212
246
213
void MaterialDescriptorSetLayoutChunk::flatten (Flattener& f) {
@@ -271,18 +238,6 @@ void MaterialDescriptorSetLayoutChunk::flatten(Flattener& f) {
271
238
f.writeUint8 (uint8_t (DescriptorFlags::NONE));
272
239
f.writeUint16 (0 );
273
240
}
274
-
275
- // samplers + 1 descriptor for the UBO
276
- f.writeUint8 (mPerViewLayout .bindings .size ());
277
-
278
- // all the material's sampler descriptors
279
- for (auto const & entry: mPerViewLayout .bindings ) {
280
- f.writeUint8 (uint8_t (entry.type ));
281
- f.writeUint8 (uint8_t (entry.stageFlags ));
282
- f.writeUint8 (entry.binding );
283
- f.writeUint8 (uint8_t (entry.flags ));
284
- f.writeUint16 (entry.count );
285
- }
286
241
}
287
242
288
243
} // namespace filamat
0 commit comments