@@ -197,22 +197,19 @@ void SpirvShaderTranslator::StartTranslation() {
197
197
198
198
const_int_0_ = builder_->makeIntConstant (0 );
199
199
id_vector_temp_.clear ();
200
- id_vector_temp_.reserve (4 );
201
200
for (uint32_t i = 0 ; i < 4 ; ++i) {
202
201
id_vector_temp_.push_back (const_int_0_);
203
202
}
204
203
const_int4_0_ = builder_->makeCompositeConstant (type_int4_, id_vector_temp_);
205
204
const_uint_0_ = builder_->makeUintConstant (0 );
206
205
id_vector_temp_.clear ();
207
- id_vector_temp_.reserve (4 );
208
206
for (uint32_t i = 0 ; i < 4 ; ++i) {
209
207
id_vector_temp_.push_back (const_uint_0_);
210
208
}
211
209
const_uint4_0_ =
212
210
builder_->makeCompositeConstant (type_uint4_, id_vector_temp_);
213
211
const_float_0_ = builder_->makeFloatConstant (0 .0f );
214
212
id_vector_temp_.clear ();
215
- id_vector_temp_.reserve (4 );
216
213
id_vector_temp_.push_back (const_float_0_);
217
214
for (uint32_t i = 1 ; i < 4 ; ++i) {
218
215
id_vector_temp_.push_back (const_float_0_);
@@ -221,15 +218,13 @@ void SpirvShaderTranslator::StartTranslation() {
221
218
}
222
219
const_float_1_ = builder_->makeFloatConstant (1 .0f );
223
220
id_vector_temp_.clear ();
224
- id_vector_temp_.reserve (4 );
225
221
id_vector_temp_.push_back (const_float_1_);
226
222
for (uint32_t i = 1 ; i < 4 ; ++i) {
227
223
id_vector_temp_.push_back (const_float_1_);
228
224
const_float_vectors_1_[i] = builder_->makeCompositeConstant (
229
225
type_float_vectors_[i], id_vector_temp_);
230
226
}
231
227
id_vector_temp_.clear ();
232
- id_vector_temp_.reserve (2 );
233
228
id_vector_temp_.push_back (const_float_0_);
234
229
id_vector_temp_.push_back (const_float_1_);
235
230
const_float2_0_1_ =
@@ -378,7 +373,6 @@ void SpirvShaderTranslator::StartTranslation() {
378
373
// vectors instead of scalar arrays because the latter would have padding to
379
374
// 16 bytes in each element.
380
375
id_vector_temp_.clear ();
381
- id_vector_temp_.reserve (2 );
382
376
// 256 bool constants.
383
377
id_vector_temp_.push_back (builder_->makeArrayType (
384
378
type_uint4_, builder_->makeUintConstant (2 ), sizeof (uint32_t ) * 4 ));
@@ -576,7 +570,6 @@ void SpirvShaderTranslator::StartTranslation() {
576
570
if (has_main_switch) {
577
571
// OpPhi must be the first in the block.
578
572
id_vector_temp_.clear ();
579
- id_vector_temp_.reserve (4 );
580
573
id_vector_temp_.push_back (const_int_0_);
581
574
id_vector_temp_.push_back (main_loop_pre_header.getId ());
582
575
main_loop_pc_next_ = builder_->getUniqueId ();
@@ -855,7 +848,6 @@ void SpirvShaderTranslator::ProcessLoopStartInstruction(
855
848
EnsureBuildPointAvailable ();
856
849
857
850
id_vector_temp_.clear ();
858
- id_vector_temp_.reserve (3 );
859
851
// Loop constants (member 1).
860
852
id_vector_temp_.push_back (builder_->makeIntConstant (1 ));
861
853
// 4-component vector.
@@ -882,7 +874,6 @@ void SpirvShaderTranslator::ProcessLoopStartInstruction(
882
874
builder_->createTriOp (spv::OpBitFieldUExtract, type_uint_, loop_constant,
883
875
const_int_0_, const_int_8);
884
876
id_vector_temp_.clear ();
885
- id_vector_temp_.reserve (4 );
886
877
id_vector_temp_.push_back (loop_count_new);
887
878
for (unsigned int i = 0 ; i < 3 ; ++i) {
888
879
id_vector_temp_.push_back (
@@ -897,7 +888,6 @@ void SpirvShaderTranslator::ProcessLoopStartInstruction(
897
888
spv::Id address_relative_stack_old =
898
889
builder_->createLoad (var_main_loop_address_, spv::NoPrecision);
899
890
id_vector_temp_.clear ();
900
- id_vector_temp_.reserve (4 );
901
891
if (instr.is_repeat ) {
902
892
id_vector_temp_.emplace_back ();
903
893
} else {
@@ -1017,7 +1007,6 @@ void SpirvShaderTranslator::ProcessLoopEndInstruction(
1017
1007
// Extract the value to add to aL (signed, in bits 16:23 of the loop
1018
1008
// constant).
1019
1009
id_vector_temp_.clear ();
1020
- id_vector_temp_.reserve (3 );
1021
1010
// Loop constants (member 1).
1022
1011
id_vector_temp_.push_back (builder_->makeIntConstant (1 ));
1023
1012
// 4-component vector.
@@ -1056,7 +1045,6 @@ void SpirvShaderTranslator::ProcessLoopEndInstruction(
1056
1045
// Pop the current loop off the loop counter and the relative address stacks -
1057
1046
// move YZW to XYZ and set W to 0.
1058
1047
id_vector_temp_.clear ();
1059
- id_vector_temp_.reserve (4 );
1060
1048
for (unsigned int i = 1 ; i < 4 ; ++i) {
1061
1049
id_vector_temp_.push_back (
1062
1050
builder_->createCompositeExtract (loop_count_stack_old, type_uint_, i));
@@ -1066,7 +1054,6 @@ void SpirvShaderTranslator::ProcessLoopEndInstruction(
1066
1054
builder_->createCompositeConstruct (type_uint4_, id_vector_temp_),
1067
1055
var_main_loop_count_);
1068
1056
id_vector_temp_.clear ();
1069
- id_vector_temp_.reserve (4 );
1070
1057
for (unsigned int i = 1 ; i < 4 ; ++i) {
1071
1058
id_vector_temp_.push_back (builder_->createCompositeExtract (
1072
1059
address_relative_stack_old, type_int_, i));
@@ -1240,7 +1227,6 @@ void SpirvShaderTranslator::StartVertexOrTessEvalShaderInMain() {
1240
1227
// The edge flag isn't used for any purpose by the translator.
1241
1228
if (current_shader ().writes_point_size_edge_flag_kill_vertex () & 0b101 ) {
1242
1229
id_vector_temp_.clear ();
1243
- id_vector_temp_.reserve (3 );
1244
1230
// Set the point size to a negative value to tell the point sprite expansion
1245
1231
// that it should use the default point size if the vertex shader does not
1246
1232
// override it.
@@ -1475,7 +1461,6 @@ void SpirvShaderTranslator::StartVertexOrTessEvalShaderInMain() {
1475
1461
spv::NoPrecision));
1476
1462
// Write the index to r0.x as float.
1477
1463
id_vector_temp_.clear ();
1478
- id_vector_temp_.reserve (2 );
1479
1464
id_vector_temp_.push_back (const_int_0_);
1480
1465
id_vector_temp_.push_back (const_int_0_);
1481
1466
builder_->createStore (
@@ -1521,7 +1506,6 @@ void SpirvShaderTranslator::CompleteVertexOrTessEvalShaderInMain() {
1521
1506
// Check if the shader returns XY/W rather than XY, and if it does, revert
1522
1507
// that.
1523
1508
uint_vector_temp_.clear ();
1524
- uint_vector_temp_.reserve (2 );
1525
1509
uint_vector_temp_.push_back (0 );
1526
1510
uint_vector_temp_.push_back (1 );
1527
1511
spv::Id position_xy = builder_->createRvalueSwizzle (
@@ -1629,7 +1613,6 @@ void SpirvShaderTranslator::CompleteVertexOrTessEvalShaderInMain() {
1629
1613
// frontFace = VkFrontFace(0), but faceness is ignored for non-polygon
1630
1614
// primitive types).
1631
1615
id_vector_temp_.clear ();
1632
- id_vector_temp_.reserve (2 );
1633
1616
id_vector_temp_.push_back (builder_->makeUintConstant (0b10 ));
1634
1617
id_vector_temp_.push_back (builder_->makeUintConstant (0b01 ));
1635
1618
spv::Id point_vertex_positive = builder_->createBinOp (
@@ -1704,7 +1687,6 @@ void SpirvShaderTranslator::CompleteVertexOrTessEvalShaderInMain() {
1704
1687
spv::DecorationNoContraction);
1705
1688
// Expand the point sprite.
1706
1689
uint_vector_temp_.clear ();
1707
- uint_vector_temp_.reserve (2 );
1708
1690
uint_vector_temp_.push_back (0 );
1709
1691
uint_vector_temp_.push_back (1 );
1710
1692
spv::Id point_position_xy = builder_->createBinOp (
@@ -2139,7 +2121,6 @@ void SpirvShaderTranslator::StartFragmentShaderInMain() {
2139
2121
// Saturate to avoid negative point coordinates if the center of the pixel
2140
2122
// is not covered, and extrapolation is done.
2141
2123
id_vector_temp_.clear ();
2142
- id_vector_temp_.reserve (3 );
2143
2124
id_vector_temp_.push_back (
2144
2125
builder_->createLoad (input_point_coordinates_, spv::NoPrecision));
2145
2126
id_vector_temp_.push_back (const_float2_0_);
@@ -2168,7 +2149,6 @@ void SpirvShaderTranslator::StartFragmentShaderInMain() {
2168
2149
}
2169
2150
// Store the pixel parameters.
2170
2151
id_vector_temp_.clear ();
2171
- id_vector_temp_.reserve (4 );
2172
2152
id_vector_temp_.push_back (param_gen_x);
2173
2153
id_vector_temp_.push_back (param_gen_y);
2174
2154
id_vector_temp_.push_back (param_gen_z);
@@ -2234,7 +2214,6 @@ void SpirvShaderTranslator::UpdateExecConditionals(
2234
2214
spv::Id condition_id;
2235
2215
if (type == ParsedExecInstruction::Type::kConditional ) {
2236
2216
id_vector_temp_.clear ();
2237
- id_vector_temp_.reserve (3 );
2238
2217
// Bool constants (member 0).
2239
2218
id_vector_temp_.push_back (const_int_0_);
2240
2219
// 128-bit vector.
@@ -2865,7 +2844,6 @@ spv::Id SpirvShaderTranslator::EndianSwap32Uint(spv::Id value, spv::Id endian) {
2865
2844
spv::Id const_uint_8_typed, const_uint_00ff00ff_typed, const_uint_16_typed;
2866
2845
int num_components = builder_->getNumTypeComponents (type);
2867
2846
if (num_components > 1 ) {
2868
- id_vector_temp_.reserve (num_components);
2869
2847
id_vector_temp_.clear ();
2870
2848
id_vector_temp_.insert (id_vector_temp_.cend (), num_components,
2871
2849
const_uint_8_scalar);
@@ -2946,7 +2924,6 @@ spv::Id SpirvShaderTranslator::EndianSwap32Uint(spv::Id value, spv::Id endian) {
2946
2924
&block_16in32_merge);
2947
2925
builder_->setBuildPoint (&block_16in32);
2948
2926
id_vector_temp_.clear ();
2949
- id_vector_temp_.reserve (4 );
2950
2927
id_vector_temp_.push_back (builder_->createBinOp (
2951
2928
spv::OpShiftRightLogical, type, value, const_uint_16_typed));
2952
2929
id_vector_temp_.push_back (value);
@@ -2983,7 +2960,6 @@ spv::Id SpirvShaderTranslator::LoadUint32FromSharedMemory(
2983
2960
if (!buffer_count_log2) {
2984
2961
// Single binding - load directly.
2985
2962
id_vector_temp_.clear ();
2986
- id_vector_temp_.reserve (2 );
2987
2963
// The only SSBO struct member.
2988
2964
id_vector_temp_.push_back (const_int_0_);
2989
2965
id_vector_temp_.push_back (address_dwords_int);
@@ -3034,7 +3010,6 @@ spv::Id SpirvShaderTranslator::LoadUint32FromSharedMemory(
3034
3010
for (uint32_t i = 0 ; i < buffer_count; ++i) {
3035
3011
builder_->setBuildPoint (switch_case_blocks[i]);
3036
3012
id_vector_temp_.clear ();
3037
- id_vector_temp_.reserve (3 );
3038
3013
id_vector_temp_.push_back (builder_->makeIntConstant (int (i)));
3039
3014
// The only SSBO struct member.
3040
3015
id_vector_temp_.push_back (const_int_0_);
@@ -3068,7 +3043,6 @@ spv::Id SpirvShaderTranslator::PWLGammaToLinear(spv::Id gamma,
3068
3043
if (!gamma_pre_saturated) {
3069
3044
// Saturate, flushing NaN to 0.
3070
3045
id_vector_temp_.clear ();
3071
- id_vector_temp_.reserve (3 );
3072
3046
id_vector_temp_.push_back (gamma );
3073
3047
id_vector_temp_.push_back (const_vector_0);
3074
3048
id_vector_temp_.push_back (const_vector_1);
@@ -3166,7 +3140,6 @@ spv::Id SpirvShaderTranslator::LinearToPWLGamma(spv::Id linear,
3166
3140
if (!linear_pre_saturated) {
3167
3141
// Saturate, flushing NaN to 0.
3168
3142
id_vector_temp_.clear ();
3169
- id_vector_temp_.reserve (3 );
3170
3143
id_vector_temp_.push_back (linear);
3171
3144
id_vector_temp_.push_back (const_vector_0);
3172
3145
id_vector_temp_.push_back (const_vector_1);
0 commit comments