Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/output_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ std::string ToStringShaderStage(SpvReflectShaderStageFlagBits stage) {
return "???";
}

std::string ToStringSpvStorageClass(SpvStorageClass storage_class) {
std::string ToStringSpvStorageClass(int storage_class) {
switch (storage_class) {
case SpvStorageClassUniformConstant:
return "UniformConstant";
Expand Down Expand Up @@ -343,7 +343,7 @@ std::string ToStringDescriptorType(SpvReflectDescriptorType value) {
return "VK_DESCRIPTOR_TYPE_???";
}

static std::string ToStringSpvBuiltIn(SpvBuiltIn built_in) {
static std::string ToStringSpvBuiltIn(int built_in) {
switch (built_in) {
case SpvBuiltInPosition:
return "Position";
Expand Down
4 changes: 2 additions & 2 deletions common/output_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

std::string ToStringSpvSourceLanguage(SpvSourceLanguage lang);
std::string ToStringSpvExecutionModel(SpvExecutionModel model);
std::string ToStringSpvStorageClass(SpvStorageClass storage_class);
std::string ToStringSpvStorageClass(int storage_class);
std::string ToStringSpvDim(SpvDim dim);
std::string ToStringSpvBuiltIn(const SpvReflectInterfaceVariable& variable, bool preface);
std::string ToStringSpvImageFormat(SpvImageFormat fmt);
Expand Down Expand Up @@ -66,4 +66,4 @@ class SpvReflectToYaml {
std::map<const SpvReflectInterfaceVariable*, uint32_t> interface_variable_to_index_;
};

#endif
#endif
3 changes: 2 additions & 1 deletion spirv_reflect.c
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,8 @@ static SpvReflectResult ParseDescriptorBindings(SpvReflectPrvParser* p_parser, S
// from the pointer so that we can use it to deduce deescriptor types.
SpvStorageClass pointer_storage_class = SpvStorageClassMax;
if (p_type->op == SpvOpTypePointer) {
pointer_storage_class = p_type->storage_class;
assert(p_type->storage_class != -1 && "Pointer types must have a valid storage class.");
pointer_storage_class = (SpvStorageClass)p_type->storage_class;
// Find the type's node
SpvReflectPrvNode* p_type_node = FindNode(p_parser, p_type->id);
if (IsNull(p_type_node)) {
Expand Down
8 changes: 6 additions & 2 deletions spirv_reflect.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ typedef struct SpvReflectTypeDescription {
const char* type_name;
// Non-NULL if type is member of a struct
const char* struct_member_name;
SpvStorageClass storage_class;

// The storage class (SpvStorageClass) if the type, and -1 if it does not have a storage class.
int storage_class;
SpvReflectTypeFlags type_flags;
SpvReflectDecorationFlags decoration_flags;

Expand Down Expand Up @@ -429,7 +431,9 @@ typedef struct SpvReflectInterfaceVariable {
SpvStorageClass storage_class;
const char* semantic;
SpvReflectDecorationFlags decoration_flags;
SpvBuiltIn built_in;

// The builtin id (SpvBuiltIn) if the variable is a builtin, and -1 otherwise.
int built_in;
SpvReflectNumericTraits numeric;
SpvReflectArrayTraits array;

Expand Down
Loading