cli: display missing memory qualifiers for reflect and dump-resources
This commit is contained in:
parent
d7cae5e7cd
commit
05c9a14422
6
main.cpp
6
main.cpp
@ -400,6 +400,12 @@ static void print_resources(const Compiler &compiler, const char *tag, const Sma
|
||||
fprintf(stderr, " writeonly");
|
||||
if (mask.get(DecorationNonWritable))
|
||||
fprintf(stderr, " readonly");
|
||||
if (mask.get(DecorationRestrict))
|
||||
fprintf(stderr, " restrict");
|
||||
if (mask.get(DecorationCoherent))
|
||||
fprintf(stderr, " coherent");
|
||||
if (mask.get(DecorationVolatile))
|
||||
fprintf(stderr, " volatile");
|
||||
if (is_sized_block)
|
||||
{
|
||||
fprintf(stderr, " (BlockSize : %u bytes)", block_size);
|
||||
|
@ -587,18 +587,18 @@ void CompilerReflection::emit_resources(const char *tag, const SmallVector<Resou
|
||||
{
|
||||
bool ssbo_block = type.storage == StorageClassStorageBuffer ||
|
||||
(type.storage == StorageClassUniform && typeflags.get(DecorationBufferBlock));
|
||||
if (ssbo_block)
|
||||
{
|
||||
auto buffer_flags = get_buffer_block_flags(res.id);
|
||||
if (buffer_flags.get(DecorationNonReadable))
|
||||
json_stream->emit_json_key_value("writeonly", true);
|
||||
if (buffer_flags.get(DecorationNonWritable))
|
||||
json_stream->emit_json_key_value("readonly", true);
|
||||
if (buffer_flags.get(DecorationRestrict))
|
||||
json_stream->emit_json_key_value("restrict", true);
|
||||
if (buffer_flags.get(DecorationCoherent))
|
||||
json_stream->emit_json_key_value("coherent", true);
|
||||
}
|
||||
Bitset qualifier_mask = ssbo_block ? get_buffer_block_flags(res.id) : mask;
|
||||
|
||||
if (qualifier_mask.get(DecorationNonReadable))
|
||||
json_stream->emit_json_key_value("writeonly", true);
|
||||
if (qualifier_mask.get(DecorationNonWritable))
|
||||
json_stream->emit_json_key_value("readonly", true);
|
||||
if (qualifier_mask.get(DecorationRestrict))
|
||||
json_stream->emit_json_key_value("restrict", true);
|
||||
if (qualifier_mask.get(DecorationCoherent))
|
||||
json_stream->emit_json_key_value("coherent", true);
|
||||
if (qualifier_mask.get(DecorationVolatile))
|
||||
json_stream->emit_json_key_value("volatile", true);
|
||||
}
|
||||
|
||||
emit_type_array(type);
|
||||
|
Loading…
Reference in New Issue
Block a user