Skip to content

Commit

Permalink
[SPIR-V] Remove more vec2-4 reserve calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Triang3l committed Apr 18, 2023
1 parent 887fda5 commit eede38f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
9 changes: 0 additions & 9 deletions src/xenia/gpu/spirv_shader_translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,6 @@ spv::Id SpirvShaderTranslator::SpirvSmearScalarResultOrConstant(
}
int num_components = builder_->getNumTypeComponents(vector_type);
id_vector_temp_util_.clear();
id_vector_temp_util_.reserve(size_t(num_components));
for (int i = 0; i < num_components; ++i) {
id_vector_temp_util_.push_back(scalar);
}
Expand Down Expand Up @@ -2386,7 +2385,6 @@ spv::Id SpirvShaderTranslator::LoadOperandStorage(
case InstructionStorageSource::kConstantFloat:
assert_true(uniform_float_constants_ != spv::NoResult);
id_vector_temp_util_.clear();
id_vector_temp_util_.reserve(2);
// The first and the only structure member.
id_vector_temp_util_.push_back(const_int_0_);
// Array element.
Expand Down Expand Up @@ -2448,7 +2446,6 @@ spv::Id SpirvShaderTranslator::GetUnmodifiedOperandComponents(
static_cast<unsigned int>(SwizzleSource::kX));
}
uint_vector_temp_util_.clear();
uint_vector_temp_util_.reserve(component_count);
uint32_t components_remaining = components;
uint32_t component_index;
while (xe::bit_scan_forward(components_remaining, &component_index)) {
Expand Down Expand Up @@ -2575,7 +2572,6 @@ void SpirvShaderTranslator::StoreResult(const InstructionResult& result,
if (result.is_clamped && non_constant_components) {
// Apply the saturation modifier to the result.
id_vector_temp_util_.clear();
id_vector_temp_util_.reserve(3);
id_vector_temp_util_.push_back(value);
id_vector_temp_util_.push_back(
const_float_vectors_0_[value_num_components - 1]);
Expand Down Expand Up @@ -2660,7 +2656,6 @@ void SpirvShaderTranslator::StoreResult(const InstructionResult& result,
value_to_store = value;
} else {
uint_vector_temp_util_.clear();
uint_vector_temp_util_.reserve(target_num_components);
uint_vector_temp_util_.insert(
uint_vector_temp_util_.cend(), result_swizzled_value_components,
result_swizzled_value_components + target_num_components);
Expand All @@ -2686,7 +2681,6 @@ void SpirvShaderTranslator::StoreResult(const InstructionResult& result,
if (target_num_components > 1) {
// Constants only - vector target.
id_vector_temp_util_.clear();
id_vector_temp_util_.reserve(target_num_components);
for (uint32_t i = 0; i < target_num_components; ++i) {
id_vector_temp_util_.push_back(
(constant_values & (1 << i)) ? const_float_1_ : const_float_0_);
Expand Down Expand Up @@ -2718,7 +2712,6 @@ void SpirvShaderTranslator::StoreResult(const InstructionResult& result,
} else {
// Mixed non-constants and constants - scalar source.
id_vector_temp_util_.clear();
id_vector_temp_util_.reserve(target_num_components);
for (uint32_t i = 0; i < target_num_components; ++i) {
if (constant_components & (1 << i)) {
id_vector_temp_util_.push_back(
Expand Down Expand Up @@ -2805,7 +2798,6 @@ void SpirvShaderTranslator::StoreResult(const InstructionResult& result,
id_vector_temp_util_),
spv::NoPrecision));
id_vector_temp_util_.clear();
id_vector_temp_util_.reserve(2);
id_vector_temp_util_.push_back(point_vertex_diameter_min);
id_vector_temp_util_.push_back(point_size);
point_size =
Expand All @@ -2822,7 +2814,6 @@ void SpirvShaderTranslator::StoreResult(const InstructionResult& result,
id_vector_temp_util_),
spv::NoPrecision));
id_vector_temp_util_.clear();
id_vector_temp_util_.reserve(2);
id_vector_temp_util_.push_back(point_vertex_diameter_max);
id_vector_temp_util_.push_back(point_size);
point_size =
Expand Down
1 change: 0 additions & 1 deletion src/xenia/gpu/spirv_shader_translator_alu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ spv::Id SpirvShaderTranslator::ZeroIfAnyOperandIsZero(spv::Id value,
assert_true(builder_->getNumComponents(operand_0_abs) == num_components);
assert_true(builder_->getNumComponents(operand_1_abs) == num_components);
id_vector_temp_util_.clear();
id_vector_temp_util_.reserve(2);
id_vector_temp_util_.push_back(operand_0_abs);
id_vector_temp_util_.push_back(operand_1_abs);
return builder_->createTriOp(
Expand Down

0 comments on commit eede38f

Please sign in to comment.