Skip to content

Commit

Permalink
Fix generating invalid YAML files (#282)
Browse files Browse the repository at this point in the history
YAML 1.0 demands that the separator between a YAML directive and its
value is a colon. This wasn't the case for the YAML files generated by
spirv-reflect, as it used a space as separator instead. This resulted in
tools parsing YAML stricly not being able to process the YAML files
generated by spirv-reflect.

Newer YAML versions demand a space as separator between YAML directive
and its value instead.

To fix this, this commit increases the YAML version to 1.1. This is done
instead of replacing the separator to improve compatibility with
tooling, as many tools don't support YAML 1.0 and require YAML 1.1 as
minimal version.
  • Loading branch information
Dunedan authored Oct 11, 2024
1 parent 416f444 commit f7b977a
Show file tree
Hide file tree
Showing 97 changed files with 97 additions and 97 deletions.
2 changes: 1 addition & 1 deletion common/output_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@ void SpvReflectToYaml::Write(std::ostream& os) {
const std::string t2 = Indent(indent_level + 2);
const std::string t3 = Indent(indent_level + 3);

os << "%YAML 1.0" << std::endl;
os << "%YAML 1.1" << std::endl;
os << "---" << std::endl;

type_description_to_index_.clear();
Expand Down
2 changes: 1 addition & 1 deletion tests/16bit/vert_in_out_16.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/cbuffer_unused/cbuffer_unused_001.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/entry_exec_mode/comp_local_size.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/entry_exec_mode/geom_inv_out_vert.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/execution_mode/local_size_id.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
all_block_variables:
Expand Down
2 changes: 1 addition & 1 deletion tests/execution_mode/local_size_id_spec.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
all_block_variables:
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_0.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_1.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_2.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_3.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_4.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_5.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_6.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_7.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_8.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_9.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_uvec2_pc.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_handle_uvec2_ssbo.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/buffer_pointer.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/built_in_format.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/fn_struct_param.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/frag_array_input.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/frag_barycentric.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/input_attachment.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/io_vars_vs.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/matrix_major_order_glsl.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/non_writable_image.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/readonly_writeonly.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/runtime_array_of_array_of_struct.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/storage_buffer.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/struct_offset_order.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/glsl/texel_buffer.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/append_consume.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/array_of_structured_buffer.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/binding_array.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/binding_types.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/cbuffer.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/constantbuffer.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/constantbuffer_nested_structs.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/counter_buffers.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/localsize.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
all_block_variables:
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/matrix_major_order_hlsl.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/pushconstant.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/semantics.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/structuredbuffer.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/hlsl/user_type.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/interface/geom_input_builtin_array.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/interface/vertex_input_builtin_block.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/interface/vertex_input_builtin_non_block.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/issues/102/function_parameter_access.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/issues/178/vertex_input_struct.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/issues/178/vertex_input_struct2.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/issues/227/null_node.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/issues/77/hlsl/array_from_ubo.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/issues/77/hlsl/array_from_ubo_with_O0.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/issues/77/hlsl/rocketz.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/mesh_shader_ext/mesh_shader_ext.mesh.hlsl.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/mesh_shader_ext/mesh_shader_ext.task.hlsl.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_entrypoint/multi_entrypoint.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/push_constants/non_zero_block_offset.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/raytrace/rayquery_equal.cs.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/raytrace/rayquery_init_ds.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/raytrace/rayquery_init_gs.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
2 changes: 1 addition & 1 deletion tests/raytrace/rayquery_init_hs.spv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%YAML 1.0
%YAML 1.1
---
all_type_descriptions:
- &td0
Expand Down
Loading

0 comments on commit f7b977a

Please sign in to comment.