Skip to content

Commit

Permalink
Add the SPV_QCOM_image_processing support (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
wooyoungqcom authored Dec 16, 2023
1 parent 62640fd commit d77e211
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
18 changes: 18 additions & 0 deletions spirv_reflect.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ typedef struct SpvReflectPrvDecorations {
bool is_patch;
bool is_per_vertex;
bool is_per_task;
bool is_weight_texture;
bool is_block_match_texture;
SpvReflectPrvNumberDecoration set;
SpvReflectPrvNumberDecoration binding;
SpvReflectPrvNumberDecoration input_attachment_index;
Expand Down Expand Up @@ -453,6 +455,12 @@ static SpvReflectDecorationFlags ApplyDecorations(const SpvReflectPrvDecorations
if (p_decoration_fields->is_per_task) {
decorations |= SPV_REFLECT_DECORATION_PER_TASK;
}
if (p_decoration_fields->is_weight_texture) {
decorations |= SPV_REFLECT_DECORATION_WEIGHT_TEXTURE;
}
if (p_decoration_fields->is_block_match_texture) {
decorations |= SPV_REFLECT_DECORATION_BLOCK_MATCH_TEXTURE;
}
return decorations;
}

Expand Down Expand Up @@ -1348,6 +1356,8 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser) {
case SpvDecorationDescriptorSet:
case SpvDecorationOffset:
case SpvDecorationInputAttachmentIndex:
case SpvDecorationWeightTextureQCOM:
case SpvDecorationBlockMatchTextureQCOM:
case SpvReflectDecorationHlslCounterBufferGOOGLE:
case SpvReflectDecorationHlslSemanticGOOGLE: {
skip = false;
Expand Down Expand Up @@ -1493,6 +1503,14 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser) {
p_target_decorations->semantic.value = (const char*)(p_parser->spirv_code + word_offset);
p_target_decorations->semantic.word_offset = word_offset;
} break;

case SpvDecorationWeightTextureQCOM: {
p_target_decorations->is_weight_texture = true;
} break;

case SpvDecorationBlockMatchTextureQCOM: {
p_target_decorations->is_block_match_texture = true;
} break;
}
}
return SPV_REFLECT_RESULT_SUCCESS;
Expand Down
4 changes: 3 additions & 1 deletion spirv_reflect.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ typedef enum SpvReflectDecorationFlagBits {
SPV_REFLECT_DECORATION_PATCH = 0x00000400,
SPV_REFLECT_DECORATION_PER_VERTEX = 0x00000800,
SPV_REFLECT_DECORATION_PER_TASK = 0x00001000,
SPV_REFLECT_DECORATION_WEIGHT_TEXTURE = 0x00002000,
SPV_REFLECT_DECORATION_BLOCK_MATCH_TEXTURE = 0x00004000,
} SpvReflectDecorationFlagBits;

typedef uint32_t SpvReflectDecorationFlags;
Expand Down Expand Up @@ -2339,4 +2341,4 @@ inline SpvReflectResult ShaderModule::ChangeOutputVariableLocation(
#endif // defined(__cplusplus) && !defined(SPIRV_REFLECT_DISABLE_CPP_WRAPPER)
#endif // SPIRV_REFLECT_H

// clang-format on
// clang-format on

0 comments on commit d77e211

Please sign in to comment.