Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-baker committed Jul 17, 2024
1 parent 158c63c commit 1e4efcc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion source/val/validate_decorations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,6 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) {
: (sc == spv::StorageClass::Workgroup ? "Workgroup"
: "StorageBuffer"));

//const auto data_type_id = inst.GetOperandAs<uint32_t>(2);
const auto data_type = vstate.FindDef(data_type_id);
scalar_block_layout =
sc == spv::StorageClass::Workgroup
Expand Down
3 changes: 2 additions & 1 deletion source/val/validate_interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ spv_result_t ValidateLocations(ValidationState_t& _,
auto interface_id = entry_point->GetOperandAs<uint32_t>(i);
auto interface_var = _.FindDef(interface_id);
const auto sc_index = 2u;
auto storage_class = interface_var->GetOperandAs<spv::StorageClass>(sc_index);
auto storage_class =
interface_var->GetOperandAs<spv::StorageClass>(sc_index);
if (storage_class != spv::StorageClass::Input &&
storage_class != spv::StorageClass::Output) {
continue;
Expand Down
6 changes: 4 additions & 2 deletions source/val/validate_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
(!_.HasCapability(spv::Capability::Float16) &&
_.ContainsSizedIntOrFloatType(value_id, spv::Op::OpTypeFloat, 16))) {
auto underlying_type = value_type;
while (underlying_type && underlying_type->opcode() == spv::Op::OpTypePointer) {
while (underlying_type &&
underlying_type->opcode() == spv::Op::OpTypePointer) {
storage_class = underlying_type->GetOperandAs<spv::StorageClass>(1u);
underlying_type =
_.FindDef(underlying_type->GetOperandAs<uint32_t>(2u));
Expand Down Expand Up @@ -894,7 +895,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
if (!_.HasCapability(spv::Capability::Int8) &&
_.ContainsSizedIntOrFloatType(value_id, spv::Op::OpTypeInt, 8)) {
auto underlying_type = value_type;
while (underlying_type && underlying_type->opcode() == spv::Op::OpTypePointer) {
while (underlying_type &&
underlying_type->opcode() == spv::Op::OpTypePointer) {
storage_class = underlying_type->GetOperandAs<spv::StorageClass>(1u);
underlying_type =
_.FindDef(underlying_type->GetOperandAs<uint32_t>(2u));
Expand Down
3 changes: 2 additions & 1 deletion test/val/val_decoration_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10210,7 +10210,8 @@ INSTANTIATE_TEST_SUITE_P(ValidateUntypedVariableSetAndBinding,
UntypedVariableSetAndBinding,
Values("StorageBuffer", "Uniform"));

using UntypedPointerLayout = spvtest::ValidateBase<std::tuple<std::string, std::string>>;
using UntypedPointerLayout =
spvtest::ValidateBase<std::tuple<std::string, std::string>>;

TEST_P(UntypedPointerLayout, BadOffset) {
const auto sc = std::get<0>(GetParam());
Expand Down

0 comments on commit 1e4efcc

Please sign in to comment.