Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HansKristian-Work/dxil-spirv.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2022-09-02 13:08:48 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2022-09-02 13:08:48 +0300
commit9a8bf01e95c1720d0f85d711bfaaa537609e8f5c (patch)
tree02a6c9b320dccd915a53d9bc5096ca2757b8c00f
parent75dc0f28a404db741cc2d4b7947fc52bd8e6e6c1 (diff)
Minor style nits from review.
-rw-r--r--CMakeLists.txt2
-rw-r--r--dxil.hpp6
-rw-r--r--dxil_converter.cpp37
-rw-r--r--dxil_spirv_c.cpp4
-rw-r--r--dxil_spirv_c.h2
-rw-r--r--opcodes/dxil/dxil_mesh.cpp6
-rw-r--r--spirv_module.cpp4
7 files changed, 33 insertions, 28 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4493a2f..fd028c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -138,7 +138,7 @@ if (DXIL_SPIRV_CLI)
endif()
set(DXIL_SPV_VERSION_MAJOR 2)
-set(DXIL_SPV_VERSION_MINOR 19)
+set(DXIL_SPV_VERSION_MINOR 20)
set(DXIL_SPV_VERSION_PATCH 0)
set(DXIL_SPV_VERSION ${DXIL_SPV_VERSION_MAJOR}.${DXIL_SPV_VERSION_MINOR}.${DXIL_SPV_VERSION_PATCH})
set_target_properties(dxil-spirv-c-shared PROPERTIES
diff --git a/dxil.hpp b/dxil.hpp
index 413a4f5..92f699f 100644
--- a/dxil.hpp
+++ b/dxil.hpp
@@ -556,9 +556,9 @@ enum class TessellatorPartitioning : uint8_t
enum class MeshOutputTopology
{
- Undefined = 0,
- Line = 1,
- Triangle = 2
+ Undefined = 0,
+ Line = 1,
+ Triangle = 2
};
enum ShaderFlag
diff --git a/dxil_converter.cpp b/dxil_converter.cpp
index 4df96ab..ef57834 100644
--- a/dxil_converter.cpp
+++ b/dxil_converter.cpp
@@ -3510,7 +3510,7 @@ bool Converter::Impl::emit_patch_variables()
if (execution_model == spv::ExecutionModelMeshEXT)
{
type_id = builder.makeArrayType(
- type_id, builder.makeUintConstant(execution_mode_meta.stage_output_num_primitive, false), 0);
+ type_id, builder.makeUintConstant(execution_mode_meta.stage_output_num_primitive, false), 0);
}
auto variable_name = semantic_name;
@@ -3555,7 +3555,7 @@ bool Converter::Impl::emit_patch_variables()
}
builder.addDecoration(variable_id, execution_model == spv::ExecutionModelMeshEXT
- ? spv::DecorationPerPrimitiveEXT : spv::DecorationPatch);
+ ? spv::DecorationPerPrimitiveEXT : spv::DecorationPatch);
}
return true;
@@ -3571,12 +3571,13 @@ bool Converter::Impl::emit_other_variables()
if (index_dim)
{
- spv::Id type_id = builder.makeArrayType(get_type_id(DXIL::ComponentType::U32, 1, index_dim),
- builder.makeUintConstant(execution_mode_meta.stage_output_num_primitive, false), 0);
+ spv::Id type_id = builder.makeArrayType(
+ get_type_id(DXIL::ComponentType::U32, 1, index_dim),
+ builder.makeUintConstant(execution_mode_meta.stage_output_num_primitive, false), 0);
primitive_index_array_id = create_variable(spv::StorageClassOutput, type_id, "indices");
- spv::BuiltIn builtin_id = index_dim == 3
- ? spv::BuiltInPrimitiveTriangleIndicesEXT : spv::BuiltInPrimitiveLineIndicesEXT;
+ spv::BuiltIn builtin_id =
+ index_dim == 3 ? spv::BuiltInPrimitiveTriangleIndicesEXT : spv::BuiltInPrimitiveLineIndicesEXT;
builder.addDecoration(primitive_index_array_id, spv::DecorationBuiltIn, builtin_id);
spirv_module.register_builtin_shader_output(primitive_index_array_id, builtin_id);
}
@@ -3793,7 +3794,7 @@ bool Converter::Impl::emit_stage_output_variables()
if (execution_model == spv::ExecutionModelVertex ||
execution_model == spv::ExecutionModelTessellationEvaluation ||
execution_model == spv::ExecutionModelGeometry ||
- execution_model == spv::ExecutionModelMeshEXT)
+ execution_model == spv::ExecutionModelMeshEXT)
{
emit_interpolation_decorations(variable_id, interpolation);
}
@@ -4248,11 +4249,11 @@ bool Converter::Impl::emit_global_variables()
if (initializer)
initializer_id = get_id_for_constant(initializer, 0);
- spv::StorageClass storage_class = address_space == DXIL::AddressSpace::GroupShared
- ? spv::StorageClassWorkgroup : spv::StorageClassPrivate;
+ spv::StorageClass storage_class = address_space == DXIL::AddressSpace::GroupShared
+ ? spv::StorageClassWorkgroup : spv::StorageClassPrivate;
spv::Id var_id = create_variable_with_initializer(
- get_effective_storage_class(&global, storage_class),
- pointee_type_id, initializer_id);
+ get_effective_storage_class(&global, storage_class),
+ pointee_type_id, initializer_id);
decorate_relaxed_precision(global.getType()->getPointerElementType(), var_id, false);
rewrite_value(&global, var_id);
@@ -5302,7 +5303,7 @@ bool Converter::Impl::emit_execution_modes_thread_wave_properties(const llvm::MD
execution_mode_meta.workgroup_threads[dim] = threads[dim];
builder.addExecutionMode(spirv_module.get_entry_function(),
- spv::ExecutionModeLocalSize, threads[0], threads[1], threads[2]);
+ spv::ExecutionModeLocalSize, threads[0], threads[1], threads[2]);
return true;
}
@@ -5316,11 +5317,13 @@ bool Converter::Impl::emit_execution_modes_amplification()
auto *as_state_node = get_shader_property_tag(entry_point_meta, DXIL::ShaderPropertyTag::ASState);
- if (as_state_node) {
+ if (as_state_node)
+ {
auto *arguments = llvm::cast<llvm::MDNode>(*as_state_node);
auto *num_threads = llvm::cast<llvm::MDNode>(arguments->getOperand(0));
return emit_execution_modes_thread_wave_properties(num_threads);
- } else
+ }
+ else
return false;
}
@@ -5334,7 +5337,8 @@ bool Converter::Impl::emit_execution_modes_mesh()
auto *ms_state_node = get_shader_property_tag(entry_point_meta, DXIL::ShaderPropertyTag::MSState);
- if (ms_state_node) {
+ if (ms_state_node)
+ {
auto *arguments = llvm::cast<llvm::MDNode>(*ms_state_node);
unsigned max_vertex_count = get_constant_metadata(arguments, 1);
unsigned max_primitive_count = get_constant_metadata(arguments, 2);
@@ -5371,7 +5375,8 @@ bool Converter::Impl::emit_execution_modes_mesh()
auto *num_threads = llvm::cast<llvm::MDNode>(arguments->getOperand(0));
return emit_execution_modes_thread_wave_properties(num_threads);
- } else
+ }
+ else
return false;
}
diff --git a/dxil_spirv_c.cpp b/dxil_spirv_c.cpp
index fc0e150..a8247da 100644
--- a/dxil_spirv_c.cpp
+++ b/dxil_spirv_c.cpp
@@ -712,14 +712,14 @@ void dxil_spv_converter_set_cbv_remapper(dxil_spv_converter converter, dxil_spv_
}
void dxil_spv_converter_set_stage_input_remapper(dxil_spv_converter converter,
- dxil_spv_shader_stage_io_remapper_cb remapper, void *userdata)
+ dxil_spv_shader_stage_io_remapper_cb remapper, void *userdata)
{
converter->remapper.stage_input_remapper = remapper;
converter->remapper.stage_input_userdata = userdata;
}
void dxil_spv_converter_set_stage_output_remapper(dxil_spv_converter converter,
- dxil_spv_shader_stage_io_remapper_cb remapper, void *userdata)
+ dxil_spv_shader_stage_io_remapper_cb remapper, void *userdata)
{
converter->remapper.stage_output_remapper = remapper;
converter->remapper.stage_output_userdata = userdata;
diff --git a/dxil_spirv_c.h b/dxil_spirv_c.h
index 2f51c9c..84686f9 100644
--- a/dxil_spirv_c.h
+++ b/dxil_spirv_c.h
@@ -34,7 +34,7 @@ extern "C" {
#endif
#define DXIL_SPV_API_VERSION_MAJOR 2
-#define DXIL_SPV_API_VERSION_MINOR 19
+#define DXIL_SPV_API_VERSION_MINOR 20
#define DXIL_SPV_API_VERSION_PATCH 0
#define DXIL_SPV_DESCRIPTOR_QA_INTERFACE_VERSION 1
diff --git a/opcodes/dxil/dxil_mesh.cpp b/opcodes/dxil/dxil_mesh.cpp
index f925cdf..d81d5d7 100644
--- a/opcodes/dxil/dxil_mesh.cpp
+++ b/opcodes/dxil/dxil_mesh.cpp
@@ -55,7 +55,7 @@ bool emit_emit_indices_instruction(Converter::Impl &impl, const llvm::CallInst *
spv::Id index_id = impl.build_vector(index_scalar_type_id, components, index_dim);
Operation *op = impl.allocate(spv::OpAccessChain,
- builder.makePointer(spv::StorageClassOutput, index_type_id));
+ builder.makePointer(spv::StorageClassOutput, index_type_id));
spv::Id ptr_id = op->id;
op->add_id(impl.primitive_index_array_id);
@@ -133,7 +133,7 @@ bool emit_store_primitive_output_instruction(Converter::Impl &impl, const llvm::
uint32_t num_cols = builder.getNumTypeComponents(output_type_id);
spv::Id store_value = impl.fixup_store_type_io(meta.component_type, 1,
- impl.get_id_for_value(instruction->getOperand(4)));
+ impl.get_id_for_value(instruction->getOperand(4)));
Operation *op;
spv::BuiltIn builtin;
@@ -148,7 +148,7 @@ bool emit_store_primitive_output_instruction(Converter::Impl &impl, const llvm::
}
op = impl.allocate(spv::OpAccessChain,
- builder.makePointer(spv::StorageClassOutput, builder.getScalarTypeId(output_type_id)));
+ builder.makePointer(spv::StorageClassOutput, builder.getScalarTypeId(output_type_id)));
ptr_id = op->id;
op->add_id(var_id);
op->add_id(impl.get_id_for_value(instruction->getOperand(5)));
diff --git a/spirv_module.cpp b/spirv_module.cpp
index 590fde6..a37ecd4 100644
--- a/spirv_module.cpp
+++ b/spirv_module.cpp
@@ -907,8 +907,8 @@ bool SPIRVModule::Impl::execution_model_is_ray_tracing() const
bool SPIRVModule::Impl::spirv_requires_14() const
{
return execution_model_is_ray_tracing() ||
- execution_model == spv::ExecutionModelMeshEXT ||
- execution_model == spv::ExecutionModelTaskEXT;
+ execution_model == spv::ExecutionModelMeshEXT ||
+ execution_model == spv::ExecutionModelTaskEXT;
}
bool SPIRVModule::Impl::finalize_spirv(Vector<uint32_t> &spirv)