mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-12 14:46:08 +00:00
tint/ast: Generate access.[h|cc]
Emits all the enum info from the single-source-of-truth `intrinsics.def` file Change-Id: Ib9170a2337597d4d81983c446d50582b518c6d71 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105329 Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
47b7fe5785
commit
bccd87c37a
@@ -4854,7 +4854,7 @@ DefInfo::Pointer FunctionEmitter::GetPointerInfo(uint32_t id) {
|
||||
}
|
||||
// Local variables are always Function storage class, with default
|
||||
// access mode.
|
||||
return DefInfo::Pointer{ast::AddressSpace::kFunction, ast::Access::kUndefined};
|
||||
return DefInfo::Pointer{ast::AddressSpace::kFunction, ast::Access::kInvalid};
|
||||
}
|
||||
case SpvOpFunctionParameter: {
|
||||
const auto* type = As<Pointer>(parser_impl_.ConvertType(inst.type_id()));
|
||||
@@ -4862,7 +4862,7 @@ DefInfo::Pointer FunctionEmitter::GetPointerInfo(uint32_t id) {
|
||||
// Using kUndefined is ok for now, since the only non-default access mode
|
||||
// on a pointer would be for a storage buffer, and baseline SPIR-V doesn't
|
||||
// allow passing pointers to buffers as function parameters.
|
||||
return DefInfo::Pointer{type->address_space, ast::Access::kUndefined};
|
||||
return DefInfo::Pointer{type->address_space, ast::Access::kInvalid};
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -335,7 +335,7 @@ struct DefInfo {
|
||||
ast::AddressSpace address_space = ast::AddressSpace::kInvalid;
|
||||
|
||||
/// The declared access mode.
|
||||
ast::Access access = ast::kUndefined;
|
||||
ast::Access access = ast::Access::kInvalid;
|
||||
};
|
||||
|
||||
/// The expression to use when sinking pointers into their use.
|
||||
|
||||
@@ -1567,7 +1567,7 @@ ast::Var* ParserImpl::MakeVar(uint32_t id,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ast::Access access = ast::Access::kUndefined;
|
||||
ast::Access access = ast::Access::kInvalid;
|
||||
if (address_space == ast::AddressSpace::kStorage) {
|
||||
bool read_only = false;
|
||||
if (auto* tn = storage_type->As<Named>()) {
|
||||
|
||||
@@ -1006,7 +1006,7 @@ Maybe<ParserImpl::VariableQualifier> ParserImpl::variable_qualifier() {
|
||||
}
|
||||
return VariableQualifier{sc.value, ac.value};
|
||||
}
|
||||
return Expect<VariableQualifier>{VariableQualifier{sc.value, ast::Access::kUndefined},
|
||||
return Expect<VariableQualifier>{VariableQualifier{sc.value, ast::Access::kInvalid},
|
||||
source};
|
||||
});
|
||||
|
||||
@@ -1262,7 +1262,7 @@ Expect<const ast::Type*> ParserImpl::expect_type_specifier_pointer(const Source&
|
||||
const char* use = "ptr declaration";
|
||||
|
||||
auto address_space = ast::AddressSpace::kNone;
|
||||
auto access = ast::Access::kUndefined;
|
||||
auto access = ast::Access::kInvalid;
|
||||
|
||||
auto subtype = expect_lt_gt_block(use, [&]() -> Expect<const ast::Type*> {
|
||||
auto sc = expect_address_space(use);
|
||||
|
||||
@@ -296,7 +296,7 @@ class ParserImpl {
|
||||
/// Variable address space
|
||||
ast::AddressSpace address_space = ast::AddressSpace::kNone;
|
||||
/// Variable access control
|
||||
ast::Access access = ast::Access::kUndefined;
|
||||
ast::Access access = ast::Access::kInvalid;
|
||||
/// Variable type
|
||||
const ast::Type* type = nullptr;
|
||||
};
|
||||
@@ -306,7 +306,7 @@ class ParserImpl {
|
||||
/// The variable's address space
|
||||
ast::AddressSpace address_space = ast::AddressSpace::kNone;
|
||||
/// The variable's access control
|
||||
ast::Access access = ast::Access::kUndefined;
|
||||
ast::Access access = ast::Access::kInvalid;
|
||||
};
|
||||
|
||||
/// MatrixDimensions contains the column and row information for a matrix
|
||||
|
||||
@@ -47,11 +47,11 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
ParserImplTest,
|
||||
VariableQualifierTest,
|
||||
testing::Values(
|
||||
VariableStorageData{"uniform", ast::AddressSpace::kUniform, ast::Access::kUndefined},
|
||||
VariableStorageData{"workgroup", ast::AddressSpace::kWorkgroup, ast::Access::kUndefined},
|
||||
VariableStorageData{"storage", ast::AddressSpace::kStorage, ast::Access::kUndefined},
|
||||
VariableStorageData{"private", ast::AddressSpace::kPrivate, ast::Access::kUndefined},
|
||||
VariableStorageData{"function", ast::AddressSpace::kFunction, ast::Access::kUndefined},
|
||||
VariableStorageData{"uniform", ast::AddressSpace::kUniform, ast::Access::kInvalid},
|
||||
VariableStorageData{"workgroup", ast::AddressSpace::kWorkgroup, ast::Access::kInvalid},
|
||||
VariableStorageData{"storage", ast::AddressSpace::kStorage, ast::Access::kInvalid},
|
||||
VariableStorageData{"private", ast::AddressSpace::kPrivate, ast::Access::kInvalid},
|
||||
VariableStorageData{"function", ast::AddressSpace::kFunction, ast::Access::kInvalid},
|
||||
VariableStorageData{"storage, read", ast::AddressSpace::kStorage, ast::Access::kRead},
|
||||
VariableStorageData{"storage, write", ast::AddressSpace::kStorage, ast::Access::kWrite},
|
||||
VariableStorageData{"storage, read_write", ast::AddressSpace::kStorage,
|
||||
|
||||
Reference in New Issue
Block a user