Updated spirv-tools.

This commit is contained in:
Бранимир Караџић 2023-03-31 19:03:03 -07:00
parent 379300facd
commit b3cfedc79e
86 changed files with 182 additions and 373 deletions

View File

@ -1 +1 @@
"v2023.2", "SPIRV-Tools v2023.2 v2022.4-143-g3a7146da" "v2023.2", "SPIRV-Tools v2023.2 v2022.4-165-g574d9da4"

View File

@ -95,17 +95,12 @@ static const spv::Capability pygen_variable_caps_SampleMaskOverrideCoverageNV[]
static const spv::Capability pygen_variable_caps_SampleMaskPostDepthCoverage[] = {spv::Capability::SampleMaskPostDepthCoverage}; static const spv::Capability pygen_variable_caps_SampleMaskPostDepthCoverage[] = {spv::Capability::SampleMaskPostDepthCoverage};
static const spv::Capability pygen_variable_caps_SampleRateShading[] = {spv::Capability::SampleRateShading}; static const spv::Capability pygen_variable_caps_SampleRateShading[] = {spv::Capability::SampleRateShading};
static const spv::Capability pygen_variable_caps_Sampled1D[] = {spv::Capability::Sampled1D}; static const spv::Capability pygen_variable_caps_Sampled1D[] = {spv::Capability::Sampled1D};
static const spv::Capability pygen_variable_caps_Sampled1DImage1D[] = {spv::Capability::Sampled1D, spv::Capability::Image1D};
static const spv::Capability pygen_variable_caps_SampledBuffer[] = {spv::Capability::SampledBuffer}; static const spv::Capability pygen_variable_caps_SampledBuffer[] = {spv::Capability::SampledBuffer};
static const spv::Capability pygen_variable_caps_SampledBufferImageBuffer[] = {spv::Capability::SampledBuffer, spv::Capability::ImageBuffer};
static const spv::Capability pygen_variable_caps_SampledBufferShaderNonUniform[] = {spv::Capability::SampledBuffer, spv::Capability::ShaderNonUniform}; static const spv::Capability pygen_variable_caps_SampledBufferShaderNonUniform[] = {spv::Capability::SampledBuffer, spv::Capability::ShaderNonUniform};
static const spv::Capability pygen_variable_caps_SampledCubeArray[] = {spv::Capability::SampledCubeArray}; static const spv::Capability pygen_variable_caps_SampledCubeArray[] = {spv::Capability::SampledCubeArray};
static const spv::Capability pygen_variable_caps_SampledRect[] = {spv::Capability::SampledRect}; static const spv::Capability pygen_variable_caps_SampledRect[] = {spv::Capability::SampledRect};
static const spv::Capability pygen_variable_caps_SampledRectImageRect[] = {spv::Capability::SampledRect, spv::Capability::ImageRect};
static const spv::Capability pygen_variable_caps_Shader[] = {spv::Capability::Shader}; static const spv::Capability pygen_variable_caps_Shader[] = {spv::Capability::Shader};
static const spv::Capability pygen_variable_caps_ShaderImageCubeArray[] = {spv::Capability::Shader, spv::Capability::ImageCubeArray};
static const spv::Capability pygen_variable_caps_ShaderKernel[] = {spv::Capability::Shader, spv::Capability::Kernel}; static const spv::Capability pygen_variable_caps_ShaderKernel[] = {spv::Capability::Shader, spv::Capability::Kernel};
static const spv::Capability pygen_variable_caps_ShaderKernelImageMSArray[] = {spv::Capability::Shader, spv::Capability::Kernel, spv::Capability::ImageMSArray};
static const spv::Capability pygen_variable_caps_ShaderUniformDecoration[] = {spv::Capability::Shader, spv::Capability::UniformDecoration}; static const spv::Capability pygen_variable_caps_ShaderUniformDecoration[] = {spv::Capability::Shader, spv::Capability::UniformDecoration};
static const spv::Capability pygen_variable_caps_ShaderVectorComputeINTEL[] = {spv::Capability::Shader, spv::Capability::VectorComputeINTEL}; static const spv::Capability pygen_variable_caps_ShaderVectorComputeINTEL[] = {spv::Capability::Shader, spv::Capability::VectorComputeINTEL};
static const spv::Capability pygen_variable_caps_ShaderInvocationReorderNV[] = {spv::Capability::ShaderInvocationReorderNV}; static const spv::Capability pygen_variable_caps_ShaderInvocationReorderNV[] = {spv::Capability::ShaderInvocationReorderNV};
@ -553,12 +548,12 @@ static const spv_operand_desc_t pygen_variable_StorageClassEntries[] = {
}; };
static const spv_operand_desc_t pygen_variable_DimEntries[] = { static const spv_operand_desc_t pygen_variable_DimEntries[] = {
{"1D", 0, 2, pygen_variable_caps_Sampled1DImage1D, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"1D", 0, 1, pygen_variable_caps_Sampled1D, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"2D", 1, 3, pygen_variable_caps_ShaderKernelImageMSArray, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"2D", 1, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"3D", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"3D", 2, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"Cube", 3, 2, pygen_variable_caps_ShaderImageCubeArray, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"Cube", 3, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"Rect", 4, 2, pygen_variable_caps_SampledRectImageRect, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"Rect", 4, 1, pygen_variable_caps_SampledRect, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"Buffer", 5, 2, pygen_variable_caps_SampledBufferImageBuffer, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}, {"Buffer", 5, 1, pygen_variable_caps_SampledBuffer, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"SubpassData", 6, 1, pygen_variable_caps_InputAttachment, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu} {"SubpassData", 6, 1, pygen_variable_caps_InputAttachment, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}
}; };

View File

@ -21,10 +21,8 @@
#include <stack> #include <stack>
#include "source/cfa.h" #include "source/cfa.h"
#include "source/latest_version_glsl_std_450_header.h"
#include "source/opt/eliminate_dead_functions_util.h" #include "source/opt/eliminate_dead_functions_util.h"
#include "source/opt/ir_builder.h" #include "source/opt/ir_builder.h"
#include "source/opt/iterator.h"
#include "source/opt/reflect.h" #include "source/opt/reflect.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
#include "source/util/string_utils.h" #include "source/util/string_utils.h"

View File

@ -16,9 +16,7 @@
#include <ostream> #include <ostream>
#include "source/opt/function.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
#include "source/opt/module.h"
#include "source/opt/reflect.h" #include "source/opt/reflect.h"
#include "source/util/make_unique.h" #include "source/util/make_unique.h"

View File

@ -16,11 +16,8 @@
#include "source/opt/block_merge_pass.h" #include "source/opt/block_merge_pass.h"
#include <vector>
#include "source/opt/block_merge_util.h" #include "source/opt/block_merge_util.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
#include "source/opt/iterator.h"
namespace spvtools { namespace spvtools {
namespace opt { namespace opt {

View File

@ -24,7 +24,6 @@
#include "source/opt/fold.h" #include "source/opt/fold.h"
#include "source/opt/function.h" #include "source/opt/function.h"
#include "source/opt/module.h"
#include "source/opt/propagator.h" #include "source/opt/propagator.h"
namespace spvtools { namespace spvtools {

View File

@ -16,13 +16,9 @@
// constructs (e.g., unreachable basic blocks, empty control flow structures, // constructs (e.g., unreachable basic blocks, empty control flow structures,
// etc) // etc)
#include <queue>
#include <unordered_set>
#include "source/opt/cfg_cleanup_pass.h" #include "source/opt/cfg_cleanup_pass.h"
#include "source/opt/function.h" #include "source/opt/function.h"
#include "source/opt/module.h"
namespace spvtools { namespace spvtools {
namespace opt { namespace opt {

View File

@ -14,11 +14,9 @@
#include "code_sink.h" #include "code_sink.h"
#include <set>
#include <vector> #include <vector>
#include "source/opt/instruction.h" #include "source/opt/instruction.h"
#include "source/opt/ir_builder.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
#include "source/util/bit_vector.h" #include "source/util/bit_vector.h"

View File

@ -14,7 +14,6 @@
#include "source/opt/constants.h" #include "source/opt/constants.h"
#include <unordered_map>
#include <vector> #include <vector>
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"

View File

@ -16,8 +16,6 @@
#include <cassert> #include <cassert>
#include <tuple> #include <tuple>
#include <utility>
#include <vector>
#include "source/opt/basic_block.h" #include "source/opt/basic_block.h"
#include "source/opt/cfg.h" #include "source/opt/cfg.h"

View File

@ -16,7 +16,6 @@
#include <cctype> #include <cctype>
#include <cstring> #include <cstring>
#include <tuple>
#include "source/opt/ir_builder.h" #include "source/opt/ir_builder.h"
#include "source/util/make_unique.h" #include "source/util/make_unique.h"

View File

@ -14,7 +14,6 @@
#include "source/opt/dataflow.h" #include "source/opt/dataflow.h"
#include <algorithm>
#include <cstdint> #include <cstdint>
namespace spvtools { namespace spvtools {

View File

@ -23,7 +23,6 @@
#include "source/cfa.h" #include "source/cfa.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
#include "source/opt/iterator.h"
#include "source/opt/struct_cfg_analysis.h" #include "source/opt/struct_cfg_analysis.h"
#include "source/util/make_unique.h" #include "source/util/make_unique.h"

View File

@ -20,7 +20,6 @@
#include <vector> #include <vector>
#include "source/opt/def_use_manager.h" #include "source/opt/def_use_manager.h"
#include "source/opt/ir_context.h"
#include "source/opt/log.h" #include "source/opt/log.h"
#include "source/opt/reflect.h" #include "source/opt/reflect.h"

View File

@ -15,11 +15,9 @@
#include "source/opt/eliminate_dead_io_components_pass.h" #include "source/opt/eliminate_dead_io_components_pass.h"
#include <set>
#include <vector> #include <vector>
#include "source/opt/instruction.h" #include "source/opt/instruction.h"
#include "source/opt/ir_builder.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
#include "source/util/bit_vector.h" #include "source/util/bit_vector.h"

View File

@ -219,7 +219,7 @@ Pass::Status EliminateDeadOutputStoresPass::DoDeadOutputStoreElimination() {
var_id, [this, &var, is_builtin](Instruction* user) { var_id, [this, &var, is_builtin](Instruction* user) {
auto op = user->opcode(); auto op = user->opcode();
if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName || if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName ||
op == spv::Op::OpDecorate) op == spv::Op::OpDecorate || user->IsNonSemanticInstruction())
return; return;
if (is_builtin) if (is_builtin)
KillAllDeadStoresOfBuiltinRef(user, &var); KillAllDeadStoresOfBuiltinRef(user, &var);

View File

@ -50,15 +50,9 @@ class EliminateDeadOutputStoresPass : public Pass {
// Initialize elimination // Initialize elimination
void InitializeElimination(); void InitializeElimination();
// Do dead output store analysis
Status DoDeadOutputStoreAnalysis();
// Do dead output store analysis // Do dead output store analysis
Status DoDeadOutputStoreElimination(); Status DoDeadOutputStoreElimination();
// Mark all locations live
void MarkAllLocsLive();
// Kill all stores resulting from |ref|. // Kill all stores resulting from |ref|.
void KillAllStoresOfRef(Instruction* ref); void KillAllStoresOfRef(Instruction* ref);

View File

@ -14,8 +14,6 @@
#include "source/opt/feature_manager.h" #include "source/opt/feature_manager.h"
#include <queue>
#include <stack>
#include <string> #include <string>
#include "source/enum_string_mapping.h" #include "source/enum_string_mapping.h"

View File

@ -21,7 +21,6 @@
#include "source/opt/const_folding_rules.h" #include "source/opt/const_folding_rules.h"
#include "source/opt/def_use_manager.h" #include "source/opt/def_use_manager.h"
#include "source/opt/folding_rules.h" #include "source/opt/folding_rules.h"
#include "source/opt/ir_builder.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
namespace spvtools { namespace spvtools {

View File

@ -15,12 +15,9 @@
#include "source/opt/fold_spec_constant_op_and_composite_pass.h" #include "source/opt/fold_spec_constant_op_and_composite_pass.h"
#include <algorithm> #include <algorithm>
#include <initializer_list>
#include <tuple> #include <tuple>
#include "source/opt/constants.h" #include "source/opt/constants.h"
#include "source/opt/fold.h"
#include "source/opt/ir_context.h"
#include "source/util/make_unique.h" #include "source/util/make_unique.h"
namespace spvtools { namespace spvtools {

View File

@ -14,7 +14,6 @@
#include "source/opt/folding_rules.h" #include "source/opt/folding_rules.h"
#include <climits>
#include <limits> #include <limits>
#include <memory> #include <memory>
#include <utility> #include <utility>

View File

@ -15,9 +15,7 @@
#include "source/opt/function.h" #include "source/opt/function.h"
#include <ostream> #include <ostream>
#include <sstream>
#include "function.h"
#include "ir_context.h" #include "ir_context.h"
#include "source/util/bit_vector.h" #include "source/util/bit_vector.h"

View File

@ -141,18 +141,12 @@
#include "graphics_robust_access_pass.h" #include "graphics_robust_access_pass.h"
#include <algorithm>
#include <cstring>
#include <functional> #include <functional>
#include <initializer_list> #include <initializer_list>
#include <limits>
#include <utility> #include <utility>
#include "constants.h"
#include "def_use_manager.h"
#include "function.h" #include "function.h"
#include "ir_context.h" #include "ir_context.h"
#include "module.h"
#include "pass.h" #include "pass.h"
#include "source/diagnostic.h" #include "source/diagnostic.h"
#include "source/util/make_unique.h" #include "source/util/make_unique.h"

View File

@ -90,10 +90,6 @@ class InterfaceVariableScalarReplacement : public Pass {
// |component|. Returns true whether the component exists or not. // |component|. Returns true whether the component exists or not.
bool GetVariableComponent(Instruction* var, uint32_t* component); bool GetVariableComponent(Instruction* var, uint32_t* component);
// Returns the interface variable instruction whose result id is
// |interface_var_id|.
Instruction* GetInterfaceVariable(uint32_t interface_var_id);
// Returns the type of |var| as an instruction. // Returns the type of |var| as an instruction.
Instruction* GetTypeOfVariable(Instruction* var); Instruction* GetTypeOfVariable(Instruction* var);

View File

@ -19,7 +19,6 @@
#include <set> #include <set>
#include <string> #include <string>
#include "ir_builder.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
#include "type_manager.h" #include "type_manager.h"

View File

@ -19,7 +19,6 @@
#include "OpenCLDebugInfo100.h" #include "OpenCLDebugInfo100.h"
#include "source/latest_version_glsl_std_450_header.h" #include "source/latest_version_glsl_std_450_header.h"
#include "source/opt/log.h" #include "source/opt/log.h"
#include "source/opt/mem_pass.h"
#include "source/opt/reflect.h" #include "source/opt/reflect.h"
namespace spvtools { namespace spvtools {

View File

@ -645,6 +645,17 @@ class IRContext {
// all have the same stage. // all have the same stage.
spv::ExecutionModel GetStage(); spv::ExecutionModel GetStage();
// Returns true of the current target environment is at least that of the
// given environment.
bool IsTargetEnvAtLeast(spv_target_env env) {
// A bit of a hack. We assume that the target environments are appended to
// the enum, so that there is an appropriate order.
return syntax_context_->target_env >= env;
}
// Return the target environment for the current context.
spv_target_env GetTargetEnv() const { return syntax_context_->target_env; }
private: private:
// Builds the def-use manager from scratch, even if it was already valid. // Builds the def-use manager from scratch, even if it was already valid.
void BuildDefUseManager() { void BuildDefUseManager() {

View File

@ -15,7 +15,6 @@
#include "source/opt/licm_pass.h" #include "source/opt/licm_pass.h"
#include <queue> #include <queue>
#include <utility>
#include "source/opt/module.h" #include "source/opt/module.h"
#include "source/opt/pass.h" #include "source/opt/pass.h"

View File

@ -309,7 +309,7 @@ void LivenessManager::ComputeLiveness() {
def_use_mgr->ForEachUser(var_id, [this, &var](Instruction* user) { def_use_mgr->ForEachUser(var_id, [this, &var](Instruction* user) {
auto op = user->opcode(); auto op = user->opcode();
if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName || if (op == spv::Op::OpEntryPoint || op == spv::Op::OpName ||
op == spv::Op::OpDecorate) { op == spv::Op::OpDecorate || user->IsNonSemanticInstruction()) {
return; return;
} }
MarkRefLive(user, &var); MarkRefLive(user, &var);

View File

@ -16,7 +16,6 @@
#include "source/opt/local_access_chain_convert_pass.h" #include "source/opt/local_access_chain_convert_pass.h"
#include "ir_builder.h"
#include "ir_context.h" #include "ir_context.h"
#include "iterator.h" #include "iterator.h"
#include "source/util/string_utils.h" #include "source/util/string_utils.h"
@ -398,60 +397,36 @@ Pass::Status LocalAccessChainConvertPass::Process() {
void LocalAccessChainConvertPass::InitExtensions() { void LocalAccessChainConvertPass::InitExtensions() {
extensions_allowlist_.clear(); extensions_allowlist_.clear();
extensions_allowlist_.insert({ extensions_allowlist_.insert(
"SPV_AMD_shader_explicit_vertex_parameter", {"SPV_AMD_shader_explicit_vertex_parameter",
"SPV_AMD_shader_trinary_minmax", "SPV_AMD_shader_trinary_minmax", "SPV_AMD_gcn_shader",
"SPV_AMD_gcn_shader", "SPV_KHR_shader_ballot", "SPV_AMD_shader_ballot",
"SPV_KHR_shader_ballot", "SPV_AMD_gpu_shader_half_float", "SPV_KHR_shader_draw_parameters",
"SPV_AMD_shader_ballot", "SPV_KHR_subgroup_vote", "SPV_KHR_8bit_storage", "SPV_KHR_16bit_storage",
"SPV_AMD_gpu_shader_half_float", "SPV_KHR_device_group", "SPV_KHR_multiview",
"SPV_KHR_shader_draw_parameters", "SPV_NVX_multiview_per_view_attributes", "SPV_NV_viewport_array2",
"SPV_KHR_subgroup_vote", "SPV_NV_stereo_view_rendering", "SPV_NV_sample_mask_override_coverage",
"SPV_KHR_8bit_storage", "SPV_NV_geometry_shader_passthrough", "SPV_AMD_texture_gather_bias_lod",
"SPV_KHR_16bit_storage", "SPV_KHR_storage_buffer_storage_class",
"SPV_KHR_device_group", // SPV_KHR_variable_pointers
"SPV_KHR_multiview", // Currently do not support extended pointer expressions
"SPV_NVX_multiview_per_view_attributes", "SPV_AMD_gpu_shader_int16", "SPV_KHR_post_depth_coverage",
"SPV_NV_viewport_array2", "SPV_KHR_shader_atomic_counter_ops", "SPV_EXT_shader_stencil_export",
"SPV_NV_stereo_view_rendering", "SPV_EXT_shader_viewport_index_layer",
"SPV_NV_sample_mask_override_coverage", "SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_fragment_mask",
"SPV_NV_geometry_shader_passthrough", "SPV_EXT_fragment_fully_covered", "SPV_AMD_gpu_shader_half_float_fetch",
"SPV_AMD_texture_gather_bias_lod", "SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1",
"SPV_KHR_storage_buffer_storage_class", "SPV_GOOGLE_user_type", "SPV_NV_shader_subgroup_partitioned",
// SPV_KHR_variable_pointers "SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing",
// Currently do not support extended pointer expressions "SPV_NV_fragment_shader_barycentric",
"SPV_AMD_gpu_shader_int16", "SPV_NV_compute_shader_derivatives", "SPV_NV_shader_image_footprint",
"SPV_KHR_post_depth_coverage", "SPV_NV_shading_rate", "SPV_NV_mesh_shader", "SPV_NV_ray_tracing",
"SPV_KHR_shader_atomic_counter_ops", "SPV_KHR_ray_tracing", "SPV_KHR_ray_query",
"SPV_EXT_shader_stencil_export", "SPV_EXT_fragment_invocation_density", "SPV_KHR_terminate_invocation",
"SPV_EXT_shader_viewport_index_layer", "SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_integer_dot_product",
"SPV_AMD_shader_image_load_store_lod", "SPV_EXT_shader_image_int64", "SPV_KHR_non_semantic_info",
"SPV_AMD_shader_fragment_mask", "SPV_KHR_uniform_group_instructions",
"SPV_EXT_fragment_fully_covered", "SPV_KHR_fragment_shader_barycentric", "SPV_KHR_vulkan_memory_model"});
"SPV_AMD_gpu_shader_half_float_fetch",
"SPV_GOOGLE_decorate_string",
"SPV_GOOGLE_hlsl_functionality1",
"SPV_GOOGLE_user_type",
"SPV_NV_shader_subgroup_partitioned",
"SPV_EXT_demote_to_helper_invocation",
"SPV_EXT_descriptor_indexing",
"SPV_NV_fragment_shader_barycentric",
"SPV_NV_compute_shader_derivatives",
"SPV_NV_shader_image_footprint",
"SPV_NV_shading_rate",
"SPV_NV_mesh_shader",
"SPV_NV_ray_tracing",
"SPV_KHR_ray_tracing",
"SPV_KHR_ray_query",
"SPV_EXT_fragment_invocation_density",
"SPV_KHR_terminate_invocation",
"SPV_KHR_subgroup_uniform_control_flow",
"SPV_KHR_integer_dot_product",
"SPV_EXT_shader_image_int64",
"SPV_KHR_non_semantic_info",
"SPV_KHR_uniform_group_instructions",
"SPV_KHR_fragment_shader_barycentric",
});
} }
bool LocalAccessChainConvertPass::AnyIndexIsOutOfBounds( bool LocalAccessChainConvertPass::AnyIndexIsOutOfBounds(

View File

@ -18,7 +18,6 @@
#include <vector> #include <vector>
#include "source/opt/iterator.h"
#include "source/util/string_utils.h" #include "source/util/string_utils.h"
namespace spvtools { namespace spvtools {
@ -234,60 +233,59 @@ Pass::Status LocalSingleBlockLoadStoreElimPass::Process() {
void LocalSingleBlockLoadStoreElimPass::InitExtensions() { void LocalSingleBlockLoadStoreElimPass::InitExtensions() {
extensions_allowlist_.clear(); extensions_allowlist_.clear();
extensions_allowlist_.insert({ extensions_allowlist_.insert({"SPV_AMD_shader_explicit_vertex_parameter",
"SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_trinary_minmax",
"SPV_AMD_shader_trinary_minmax", "SPV_AMD_gcn_shader",
"SPV_AMD_gcn_shader", "SPV_KHR_shader_ballot",
"SPV_KHR_shader_ballot", "SPV_AMD_shader_ballot",
"SPV_AMD_shader_ballot", "SPV_AMD_gpu_shader_half_float",
"SPV_AMD_gpu_shader_half_float", "SPV_KHR_shader_draw_parameters",
"SPV_KHR_shader_draw_parameters", "SPV_KHR_subgroup_vote",
"SPV_KHR_subgroup_vote", "SPV_KHR_8bit_storage",
"SPV_KHR_8bit_storage", "SPV_KHR_16bit_storage",
"SPV_KHR_16bit_storage", "SPV_KHR_device_group",
"SPV_KHR_device_group", "SPV_KHR_multiview",
"SPV_KHR_multiview", "SPV_NVX_multiview_per_view_attributes",
"SPV_NVX_multiview_per_view_attributes", "SPV_NV_viewport_array2",
"SPV_NV_viewport_array2", "SPV_NV_stereo_view_rendering",
"SPV_NV_stereo_view_rendering", "SPV_NV_sample_mask_override_coverage",
"SPV_NV_sample_mask_override_coverage", "SPV_NV_geometry_shader_passthrough",
"SPV_NV_geometry_shader_passthrough", "SPV_AMD_texture_gather_bias_lod",
"SPV_AMD_texture_gather_bias_lod", "SPV_KHR_storage_buffer_storage_class",
"SPV_KHR_storage_buffer_storage_class", "SPV_KHR_variable_pointers",
"SPV_KHR_variable_pointers", "SPV_AMD_gpu_shader_int16",
"SPV_AMD_gpu_shader_int16", "SPV_KHR_post_depth_coverage",
"SPV_KHR_post_depth_coverage", "SPV_KHR_shader_atomic_counter_ops",
"SPV_KHR_shader_atomic_counter_ops", "SPV_EXT_shader_stencil_export",
"SPV_EXT_shader_stencil_export", "SPV_EXT_shader_viewport_index_layer",
"SPV_EXT_shader_viewport_index_layer", "SPV_AMD_shader_image_load_store_lod",
"SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_fragment_mask",
"SPV_AMD_shader_fragment_mask", "SPV_EXT_fragment_fully_covered",
"SPV_EXT_fragment_fully_covered", "SPV_AMD_gpu_shader_half_float_fetch",
"SPV_AMD_gpu_shader_half_float_fetch", "SPV_GOOGLE_decorate_string",
"SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1",
"SPV_GOOGLE_hlsl_functionality1", "SPV_GOOGLE_user_type",
"SPV_GOOGLE_user_type", "SPV_NV_shader_subgroup_partitioned",
"SPV_NV_shader_subgroup_partitioned", "SPV_EXT_demote_to_helper_invocation",
"SPV_EXT_demote_to_helper_invocation", "SPV_EXT_descriptor_indexing",
"SPV_EXT_descriptor_indexing", "SPV_NV_fragment_shader_barycentric",
"SPV_NV_fragment_shader_barycentric", "SPV_NV_compute_shader_derivatives",
"SPV_NV_compute_shader_derivatives", "SPV_NV_shader_image_footprint",
"SPV_NV_shader_image_footprint", "SPV_NV_shading_rate",
"SPV_NV_shading_rate", "SPV_NV_mesh_shader",
"SPV_NV_mesh_shader", "SPV_NV_ray_tracing",
"SPV_NV_ray_tracing", "SPV_KHR_ray_tracing",
"SPV_KHR_ray_tracing", "SPV_KHR_ray_query",
"SPV_KHR_ray_query", "SPV_EXT_fragment_invocation_density",
"SPV_EXT_fragment_invocation_density", "SPV_EXT_physical_storage_buffer",
"SPV_EXT_physical_storage_buffer", "SPV_KHR_terminate_invocation",
"SPV_KHR_terminate_invocation", "SPV_KHR_subgroup_uniform_control_flow",
"SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_integer_dot_product",
"SPV_KHR_integer_dot_product", "SPV_EXT_shader_image_int64",
"SPV_EXT_shader_image_int64", "SPV_KHR_non_semantic_info",
"SPV_KHR_non_semantic_info", "SPV_KHR_uniform_group_instructions",
"SPV_KHR_uniform_group_instructions", "SPV_KHR_fragment_shader_barycentric",
"SPV_KHR_fragment_shader_barycentric", "SPV_KHR_vulkan_memory_model"});
});
} }
} // namespace opt } // namespace opt

View File

@ -17,8 +17,6 @@
#include "source/opt/local_single_store_elim_pass.h" #include "source/opt/local_single_store_elim_pass.h"
#include "source/cfa.h" #include "source/cfa.h"
#include "source/latest_version_glsl_std_450_header.h"
#include "source/opt/iterator.h"
#include "source/util/string_utils.h" #include "source/util/string_utils.h"
namespace spvtools { namespace spvtools {
@ -88,57 +86,56 @@ Pass::Status LocalSingleStoreElimPass::Process() {
} }
void LocalSingleStoreElimPass::InitExtensionAllowList() { void LocalSingleStoreElimPass::InitExtensionAllowList() {
extensions_allowlist_.insert({ extensions_allowlist_.insert({"SPV_AMD_shader_explicit_vertex_parameter",
"SPV_AMD_shader_explicit_vertex_parameter", "SPV_AMD_shader_trinary_minmax",
"SPV_AMD_shader_trinary_minmax", "SPV_AMD_gcn_shader",
"SPV_AMD_gcn_shader", "SPV_KHR_shader_ballot",
"SPV_KHR_shader_ballot", "SPV_AMD_shader_ballot",
"SPV_AMD_shader_ballot", "SPV_AMD_gpu_shader_half_float",
"SPV_AMD_gpu_shader_half_float", "SPV_KHR_shader_draw_parameters",
"SPV_KHR_shader_draw_parameters", "SPV_KHR_subgroup_vote",
"SPV_KHR_subgroup_vote", "SPV_KHR_8bit_storage",
"SPV_KHR_8bit_storage", "SPV_KHR_16bit_storage",
"SPV_KHR_16bit_storage", "SPV_KHR_device_group",
"SPV_KHR_device_group", "SPV_KHR_multiview",
"SPV_KHR_multiview", "SPV_NVX_multiview_per_view_attributes",
"SPV_NVX_multiview_per_view_attributes", "SPV_NV_viewport_array2",
"SPV_NV_viewport_array2", "SPV_NV_stereo_view_rendering",
"SPV_NV_stereo_view_rendering", "SPV_NV_sample_mask_override_coverage",
"SPV_NV_sample_mask_override_coverage", "SPV_NV_geometry_shader_passthrough",
"SPV_NV_geometry_shader_passthrough", "SPV_AMD_texture_gather_bias_lod",
"SPV_AMD_texture_gather_bias_lod", "SPV_KHR_storage_buffer_storage_class",
"SPV_KHR_storage_buffer_storage_class", "SPV_KHR_variable_pointers",
"SPV_KHR_variable_pointers", "SPV_AMD_gpu_shader_int16",
"SPV_AMD_gpu_shader_int16", "SPV_KHR_post_depth_coverage",
"SPV_KHR_post_depth_coverage", "SPV_KHR_shader_atomic_counter_ops",
"SPV_KHR_shader_atomic_counter_ops", "SPV_EXT_shader_stencil_export",
"SPV_EXT_shader_stencil_export", "SPV_EXT_shader_viewport_index_layer",
"SPV_EXT_shader_viewport_index_layer", "SPV_AMD_shader_image_load_store_lod",
"SPV_AMD_shader_image_load_store_lod", "SPV_AMD_shader_fragment_mask",
"SPV_AMD_shader_fragment_mask", "SPV_EXT_fragment_fully_covered",
"SPV_EXT_fragment_fully_covered", "SPV_AMD_gpu_shader_half_float_fetch",
"SPV_AMD_gpu_shader_half_float_fetch", "SPV_GOOGLE_decorate_string",
"SPV_GOOGLE_decorate_string", "SPV_GOOGLE_hlsl_functionality1",
"SPV_GOOGLE_hlsl_functionality1", "SPV_NV_shader_subgroup_partitioned",
"SPV_NV_shader_subgroup_partitioned", "SPV_EXT_descriptor_indexing",
"SPV_EXT_descriptor_indexing", "SPV_NV_fragment_shader_barycentric",
"SPV_NV_fragment_shader_barycentric", "SPV_NV_compute_shader_derivatives",
"SPV_NV_compute_shader_derivatives", "SPV_NV_shader_image_footprint",
"SPV_NV_shader_image_footprint", "SPV_NV_shading_rate",
"SPV_NV_shading_rate", "SPV_NV_mesh_shader",
"SPV_NV_mesh_shader", "SPV_NV_ray_tracing",
"SPV_NV_ray_tracing", "SPV_KHR_ray_query",
"SPV_KHR_ray_query", "SPV_EXT_fragment_invocation_density",
"SPV_EXT_fragment_invocation_density", "SPV_EXT_physical_storage_buffer",
"SPV_EXT_physical_storage_buffer", "SPV_KHR_terminate_invocation",
"SPV_KHR_terminate_invocation", "SPV_KHR_subgroup_uniform_control_flow",
"SPV_KHR_subgroup_uniform_control_flow", "SPV_KHR_integer_dot_product",
"SPV_KHR_integer_dot_product", "SPV_EXT_shader_image_int64",
"SPV_EXT_shader_image_int64", "SPV_KHR_non_semantic_info",
"SPV_KHR_non_semantic_info", "SPV_KHR_uniform_group_instructions",
"SPV_KHR_uniform_group_instructions", "SPV_KHR_fragment_shader_barycentric",
"SPV_KHR_fragment_shader_barycentric", "SPV_KHR_vulkan_memory_model"});
});
} }
bool LocalSingleStoreElimPass::ProcessVariable(Instruction* var_inst) { bool LocalSingleStoreElimPass::ProcessVariable(Instruction* var_inst) {
std::vector<Instruction*> users; std::vector<Instruction*> users;

View File

@ -15,14 +15,12 @@
#include "source/opt/loop_dependence.h" #include "source/opt/loop_dependence.h"
#include <functional> #include <functional>
#include <memory>
#include <numeric> #include <numeric>
#include <string> #include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "source/opt/instruction.h" #include "source/opt/instruction.h"
#include "source/opt/scalar_analysis.h"
#include "source/opt/scalar_analysis_nodes.h" #include "source/opt/scalar_analysis_nodes.h"
namespace spvtools { namespace spvtools {

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "source/opt/loop_dependence.h"
#include <ostream> #include <ostream>
#include <set> #include <set>
#include <string> #include <string>
@ -23,7 +21,7 @@
#include "source/opt/basic_block.h" #include "source/opt/basic_block.h"
#include "source/opt/instruction.h" #include "source/opt/instruction.h"
#include "source/opt/scalar_analysis.h" #include "source/opt/loop_dependence.h"
#include "source/opt/scalar_analysis_nodes.h" #include "source/opt/scalar_analysis_nodes.h"
namespace spvtools { namespace spvtools {

View File

@ -15,17 +15,14 @@
#include "source/opt/loop_descriptor.h" #include "source/opt/loop_descriptor.h"
#include <algorithm> #include <algorithm>
#include <iostream>
#include <limits> #include <limits>
#include <stack> #include <stack>
#include <type_traits>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "source/opt/cfg.h" #include "source/opt/cfg.h"
#include "source/opt/constants.h" #include "source/opt/constants.h"
#include "source/opt/dominator_tree.h" #include "source/opt/dominator_tree.h"
#include "source/opt/ir_builder.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
#include "source/opt/iterator.h" #include "source/opt/iterator.h"
#include "source/opt/tree_iterator.h" #include "source/opt/tree_iterator.h"

View File

@ -14,7 +14,6 @@
#include "source/opt/loop_fusion_pass.h" #include "source/opt/loop_fusion_pass.h"
#include "source/opt/ir_context.h"
#include "source/opt/loop_descriptor.h" #include "source/opt/loop_descriptor.h"
#include "source/opt/loop_fusion.h" #include "source/opt/loop_fusion.h"
#include "source/opt/register_pressure.h" #include "source/opt/register_pressure.h"

View File

@ -12,17 +12,16 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include <algorithm> #include "source/opt/loop_peeling.h"
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <unordered_map>
#include <unordered_set> #include <unordered_set>
#include <vector> #include <vector>
#include "source/opt/ir_builder.h" #include "source/opt/ir_builder.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
#include "source/opt/loop_descriptor.h" #include "source/opt/loop_descriptor.h"
#include "source/opt/loop_peeling.h"
#include "source/opt/loop_utils.h" #include "source/opt/loop_utils.h"
#include "source/opt/scalar_analysis.h" #include "source/opt/scalar_analysis.h"
#include "source/opt/scalar_analysis_nodes.h" #include "source/opt/scalar_analysis_nodes.h"

View File

@ -15,7 +15,6 @@
#include "source/opt/loop_unroller.h" #include "source/opt/loop_unroller.h"
#include <limits> #include <limits>
#include <map>
#include <memory> #include <memory>
#include <unordered_map> #include <unordered_map>
#include <utility> #include <utility>

View File

@ -17,7 +17,6 @@
#include <functional> #include <functional>
#include <list> #include <list>
#include <memory> #include <memory>
#include <type_traits>
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
#include <utility> #include <utility>
@ -31,7 +30,6 @@
#include "source/opt/ir_builder.h" #include "source/opt/ir_builder.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
#include "source/opt/loop_descriptor.h" #include "source/opt/loop_descriptor.h"
#include "source/opt/loop_utils.h" #include "source/opt/loop_utils.h"
namespace spvtools { namespace spvtools {

View File

@ -22,9 +22,7 @@
#include "source/cfa.h" #include "source/cfa.h"
#include "source/opt/basic_block.h" #include "source/opt/basic_block.h"
#include "source/opt/dominator_analysis.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
#include "source/opt/iterator.h"
namespace spvtools { namespace spvtools {
namespace opt { namespace opt {

View File

@ -15,8 +15,6 @@
#include "source/opt/remove_duplicates_pass.h" #include "source/opt/remove_duplicates_pass.h"
#include <algorithm> #include <algorithm>
#include <cstring>
#include <limits>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
@ -25,7 +23,6 @@
#include "source/opcode.h" #include "source/opcode.h"
#include "source/opt/decoration_manager.h" #include "source/opt/decoration_manager.h"
#include "source/opt/ir_context.h" #include "source/opt/ir_context.h"
#include "source/opt/reflect.h"
namespace spvtools { namespace spvtools {
namespace opt { namespace opt {

View File

@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#ifndef SOURCE_OPT_REMOVE_UNUSED_INTERFACE_VARIABLES_PASS_H_
#define SOURCE_OPT_REMOVE_UNUSED_INTERFACE_VARIABLES_PASS_H_
#include "source/opt/pass.h" #include "source/opt/pass.h"
namespace spvtools { namespace spvtools {
namespace opt { namespace opt {
@ -23,4 +26,6 @@ class RemoveUnusedInterfaceVariablesPass : public Pass {
Status Process() override; Status Process() override;
}; };
} // namespace opt } // namespace opt
} // namespace spvtools } // namespace spvtools
#endif // SOURCE_OPT_REMOVE_UNUSED_INTERFACE_VARIABLES_PASS_H_

View File

@ -86,7 +86,8 @@ bool ReplaceInvalidOpcodePass::RewriteFunction(Function* function,
} }
if (model != spv::ExecutionModel::TessellationControl && if (model != spv::ExecutionModel::TessellationControl &&
model != spv::ExecutionModel::GLCompute) { model != spv::ExecutionModel::GLCompute &&
!context()->IsTargetEnvAtLeast(SPV_ENV_UNIVERSAL_1_3)) {
if (inst->opcode() == spv::Op::OpControlBarrier) { if (inst->opcode() == spv::Op::OpControlBarrier) {
assert(model != spv::ExecutionModel::Kernel && assert(model != spv::ExecutionModel::Kernel &&
"Expecting to be working on a shader module."); "Expecting to be working on a shader module.");

View File

@ -14,7 +14,6 @@
#include "source/opt/scalar_analysis.h" #include "source/opt/scalar_analysis.h"
#include <algorithm>
#include <functional> #include <functional>
#include <string> #include <string>
#include <utility> #include <utility>

View File

@ -12,16 +12,15 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "source/opt/scalar_analysis.h"
#include <functional> #include <functional>
#include <map> #include <map>
#include <memory> #include <memory>
#include <set> #include <set>
#include <unordered_set>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "source/opt/scalar_analysis.h"
// Simplifies scalar analysis DAGs. // Simplifies scalar analysis DAGs.
// //
// 1. Given a node passed to SimplifyExpression we first simplify the graph by // 1. Given a node passed to SimplifyExpression we first simplify the graph by

View File

@ -19,12 +19,10 @@
#include <tuple> #include <tuple>
#include <utility> #include <utility>
#include "source/enum_string_mapping.h"
#include "source/extensions.h" #include "source/extensions.h"
#include "source/opt/reflect.h" #include "source/opt/reflect.h"
#include "source/opt/types.h" #include "source/opt/types.h"
#include "source/util/make_unique.h" #include "source/util/make_unique.h"
#include "types.h"
namespace spvtools { namespace spvtools {
namespace opt { namespace opt {

View File

@ -21,8 +21,6 @@
#include <vector> #include <vector>
#include "source/opt/def_use_manager.h" #include "source/opt/def_use_manager.h"
#include "source/opt/ir_context.h"
#include "source/opt/type_manager.h"
#include "source/opt/types.h" #include "source/opt/types.h"
#include "source/util/make_unique.h" #include "source/util/make_unique.h"
#include "source/util/parse_number.h" #include "source/util/parse_number.h"

View File

@ -14,7 +14,6 @@
#include "source/opt/simplification_pass.h" #include "source/opt/simplification_pass.h"
#include <set>
#include <unordered_set> #include <unordered_set>
#include <vector> #include <vector>

View File

@ -15,7 +15,6 @@
#include "source/opt/spread_volatile_semantics.h" #include "source/opt/spread_volatile_semantics.h"
#include "source/opt/decoration_manager.h" #include "source/opt/decoration_manager.h"
#include "source/opt/ir_builder.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
namespace spvtools { namespace spvtools {

View File

@ -48,7 +48,6 @@
#include "source/opt/cfg.h" #include "source/opt/cfg.h"
#include "source/opt/mem_pass.h" #include "source/opt/mem_pass.h"
#include "source/opt/types.h" #include "source/opt/types.h"
#include "source/util/make_unique.h"
// Debug logging (0: Off, 1-N: Verbosity level). Replace this with the // Debug logging (0: Off, 1-N: Verbosity level). Replace this with the
// implementation done for // implementation done for

View File

@ -14,12 +14,8 @@
#include "source/opt/strength_reduction_pass.h" #include "source/opt/strength_reduction_pass.h"
#include <algorithm>
#include <cstdio>
#include <cstring> #include <cstring>
#include <memory> #include <memory>
#include <unordered_map>
#include <unordered_set>
#include <utility> #include <utility>
#include <vector> #include <vector>

View File

@ -14,7 +14,6 @@
#include "source/opt/strip_nonsemantic_info_pass.h" #include "source/opt/strip_nonsemantic_info_pass.h"
#include <cstring>
#include <vector> #include <vector>
#include "source/opt/instruction.h" #include "source/opt/instruction.h"

View File

@ -16,7 +16,6 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <climits>
#include <cstdint> #include <cstdint>
#include <sstream> #include <sstream>
#include <string> #include <string>

View File

@ -20,7 +20,6 @@
#include <vector> #include <vector>
#include "source/opt/def_use_manager.h" #include "source/opt/def_use_manager.h"
#include "source/opt/ir_context.h"
#include "source/util/make_unique.h" #include "source/util/make_unique.h"
namespace spvtools { namespace spvtools {

View File

@ -15,7 +15,6 @@
#include "source/val/basic_block.h" #include "source/val/basic_block.h"
#include <algorithm> #include <algorithm>
#include <utility>
#include <vector> #include <vector>
namespace spvtools { namespace spvtools {

View File

@ -16,7 +16,6 @@
#include <cassert> #include <cassert>
#include <cstddef> #include <cstddef>
#include <unordered_set>
#include "source/val/function.h" #include "source/val/function.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"

View File

@ -18,7 +18,6 @@
#include <cassert> #include <cassert>
#include <sstream> #include <sstream>
#include <unordered_map> #include <unordered_map>
#include <unordered_set>
#include <utility> #include <utility>
#include "source/cfa.h" #include "source/cfa.h"

View File

@ -14,13 +14,9 @@
#include "source/val/validate.h" #include "source/val/validate.h"
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <functional> #include <functional>
#include <iterator> #include <iterator>
#include <memory> #include <memory>
#include <sstream>
#include <string> #include <string>
#include <vector> #include <vector>
@ -28,15 +24,11 @@
#include "source/diagnostic.h" #include "source/diagnostic.h"
#include "source/enum_string_mapping.h" #include "source/enum_string_mapping.h"
#include "source/extensions.h" #include "source/extensions.h"
#include "source/instruction.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/operand.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
#include "source/spirv_endian.h" #include "source/spirv_endian.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include "source/spirv_validator_options.h"
#include "source/val/construct.h" #include "source/val/construct.h"
#include "source/val/function.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
#include "spirv-tools/libspirv.h" #include "spirv-tools/libspirv.h"

View File

@ -31,11 +31,6 @@ class ValidationState_t;
class BasicBlock; class BasicBlock;
class Instruction; class Instruction;
/// A function that returns a vector of BasicBlocks given a BasicBlock. Used to
/// get the successor and predecessor nodes of a CFG block
using get_blocks_func =
std::function<const std::vector<BasicBlock*>*(const BasicBlock*)>;
/// @brief Performs the Control Flow Graph checks /// @brief Performs the Control Flow Graph checks
/// ///
/// @param[in] _ the validation state of the module /// @param[in] _ the validation state of the module

View File

@ -15,13 +15,10 @@
// Validates correctness of the intra-block preconditions of SPIR-V // Validates correctness of the intra-block preconditions of SPIR-V
// instructions. // instructions.
#include "source/val/validate.h"
#include <string> #include <string>
#include "source/diagnostic.h"
#include "source/opcode.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
namespace spvtools { namespace spvtools {

View File

@ -14,13 +14,11 @@
// Performs validation of arithmetic instructions. // Performs validation of arithmetic instructions.
#include "source/val/validate.h"
#include <vector> #include <vector>
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
namespace spvtools { namespace spvtools {

View File

@ -16,13 +16,11 @@
// Validates correctness of atomic SPIR-V instructions. // Validates correctness of atomic SPIR-V instructions.
#include "source/val/validate.h"
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include "source/util/bitutils.h" #include "source/util/bitutils.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validate_memory_semantics.h" #include "source/val/validate_memory_semantics.h"
#include "source/val/validate_scopes.h" #include "source/val/validate_scopes.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"

View File

@ -16,11 +16,8 @@
#include <string> #include <string>
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
#include "source/util/bitutils.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h" #include "source/val/validate.h"
#include "source/val/validate_memory_semantics.h" #include "source/val/validate_memory_semantics.h"

View File

@ -14,7 +14,6 @@
// Validates correctness of bitwise instructions. // Validates correctness of bitwise instructions.
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"

View File

@ -24,10 +24,8 @@
#include <sstream> #include <sstream>
#include <stack> #include <stack>
#include <string> #include <string>
#include <unordered_map>
#include <vector> #include <vector>
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include "source/util/bitutils.h" #include "source/util/bitutils.h"

View File

@ -16,9 +16,7 @@
#include <cassert> #include <cassert>
#include <string> #include <string>
#include <unordered_set>
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h" #include "source/val/validate.h"

View File

@ -12,11 +12,9 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include <algorithm>
#include <cassert> #include <cassert>
#include <functional> #include <functional>
#include <iostream> #include <iostream>
#include <iterator>
#include <map> #include <map>
#include <string> #include <string>
#include <tuple> #include <tuple>
@ -28,7 +26,6 @@
#include "source/cfa.h" #include "source/cfa.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
#include "source/spirv_validator_options.h" #include "source/spirv_validator_options.h"
#include "source/val/basic_block.h" #include "source/val/basic_block.h"
#include "source/val/construct.h" #include "source/val/construct.h"

View File

@ -14,12 +14,10 @@
// Validates correctness of composite SPIR-V instructions. // Validates correctness of composite SPIR-V instructions.
#include "source/val/validate.h"
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
namespace spvtools { namespace spvtools {

View File

@ -14,7 +14,6 @@
// Validates correctness of conversion instructions. // Validates correctness of conversion instructions.
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"

View File

@ -12,11 +12,9 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "source/val/validate.h"
#include "source/opcode.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
namespace spvtools { namespace spvtools {

View File

@ -21,7 +21,6 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "source/binary.h"
#include "source/diagnostic.h" #include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
@ -48,13 +47,6 @@ struct PairHash {
} }
}; };
// A functor for hashing decoration types.
struct SpvDecorationHash {
std::size_t operator()(spv::Decoration dec) const {
return static_cast<std::size_t>(dec);
}
};
// Struct member layout attributes that are inherited through arrays. // Struct member layout attributes that are inherited through arrays.
struct LayoutConstraints { struct LayoutConstraints {
explicit LayoutConstraints( explicit LayoutConstraints(

View File

@ -14,13 +14,11 @@
// Validates correctness of derivative SPIR-V instructions. // Validates correctness of derivative SPIR-V instructions.
#include "source/val/validate.h"
#include <string> #include <string>
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
namespace spvtools { namespace spvtools {

View File

@ -13,8 +13,6 @@
// limitations under the License. // limitations under the License.
#include "source/val/validate.h" #include "source/val/validate.h"
#include "source/val/function.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
namespace spvtools { namespace spvtools {

View File

@ -18,22 +18,18 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "spirv/unified1/NonSemanticClspvReflection.h"
#include "NonSemanticShaderDebugInfo100.h" #include "NonSemanticShaderDebugInfo100.h"
#include "OpenCLDebugInfo100.h" #include "OpenCLDebugInfo100.h"
#include "source/common_debug_info.h" #include "source/common_debug_info.h"
#include "source/diagnostic.h"
#include "source/enum_string_mapping.h" #include "source/enum_string_mapping.h"
#include "source/extensions.h" #include "source/extensions.h"
#include "source/latest_version_glsl_std_450_header.h" #include "source/latest_version_glsl_std_450_header.h"
#include "source/latest_version_opencl_std_header.h" #include "source/latest_version_opencl_std_header.h"
#include "source/opcode.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h" #include "source/val/validate.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
#include "spirv/unified1/NonSemanticClspvReflection.h"
namespace spvtools { namespace spvtools {
namespace val { namespace val {

View File

@ -12,25 +12,14 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "source/val/validate.h"
#include <cassert>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <stack>
#include <string>
#include <unordered_set> #include <unordered_set>
#include <utility>
#include <vector> #include <vector>
#include "source/diagnostic.h"
#include "source/instruction.h" #include "source/instruction.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/operand.h" #include "source/operand.h"
#include "source/spirv_validator_options.h"
#include "source/val/function.h" #include "source/val/function.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
#include "spirv-tools/libspirv.h" #include "spirv-tools/libspirv.h"

View File

@ -18,7 +18,6 @@
#include <string> #include <string>
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
@ -1996,11 +1995,11 @@ spv_result_t ValidateImageQueryLod(ValidationState_t& _,
<< " components, but given only " << actual_coord_size; << " components, but given only " << actual_coord_size;
} }
// The operad is a sampled image. // The operand is a sampled image.
// The sampled image type is already checked to be parameterized by an image // The sampled image type is already checked to be parameterized by an image
// type with Sampled=0 or Sampled=1. Vulkan bans Sampled=0, and so we have // type with Sampled=0 or Sampled=1. Vulkan bans Sampled=0, and so we have
// Sampled=1. So the validator already enforces Vulkan VUID 4659: // Sampled=1. So the validator already enforces Vulkan VUID 4659:
// OpImageQuerySizeLod must only consume an “Image” operand whose type has // OpImageQuerySizeLod must only consume an "Image" operand whose type has
// its "Sampled" operand set to 1 // its "Sampled" operand set to 1
return SPV_SUCCESS; return SPV_SUCCESS;
} }

View File

@ -14,26 +14,20 @@
// Performs validation on instructions that appear inside of a SPIR-V block. // Performs validation on instructions that appear inside of a SPIR-V block.
#include <algorithm>
#include <cassert> #include <cassert>
#include <iomanip>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <vector> #include <vector>
#include "source/binary.h"
#include "source/diagnostic.h"
#include "source/enum_set.h" #include "source/enum_set.h"
#include "source/enum_string_mapping.h" #include "source/enum_string_mapping.h"
#include "source/extensions.h" #include "source/extensions.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/operand.h" #include "source/operand.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
#include "source/spirv_definition.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include "source/spirv_validator_options.h" #include "source/spirv_validator_options.h"
#include "source/util/string_utils.h" #include "source/util/string_utils.h"
#include "source/val/function.h"
#include "source/val/validate.h" #include "source/val/validate.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"

View File

@ -15,7 +15,6 @@
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
#include "source/diagnostic.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include "source/val/function.h" #include "source/val/function.h"

View File

@ -14,12 +14,9 @@
// Source code for logical layout validation as described in section 2.4 // Source code for logical layout validation as described in section 2.4
#include <cassert>
#include "DebugInfo.h" #include "DebugInfo.h"
#include "NonSemanticShaderDebugInfo100.h" #include "NonSemanticShaderDebugInfo100.h"
#include "OpenCLDebugInfo100.h" #include "OpenCLDebugInfo100.h"
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/operand.h" #include "source/operand.h"
#include "source/val/function.h" #include "source/val/function.h"

View File

@ -14,13 +14,10 @@
// Validates literal numbers. // Validates literal numbers.
#include "source/val/validate.h"
#include <cassert> #include <cassert>
#include "source/diagnostic.h"
#include "source/opcode.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
namespace spvtools { namespace spvtools {

View File

@ -14,11 +14,9 @@
// Validates correctness of logical SPIR-V instructions. // Validates correctness of logical SPIR-V instructions.
#include "source/val/validate.h"
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
namespace spvtools { namespace spvtools {

View File

@ -14,7 +14,6 @@
#include "source/val/validate_memory_semantics.h" #include "source/val/validate_memory_semantics.h"
#include "source/diagnostic.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include "source/util/bitutils.h" #include "source/util/bitutils.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"

View File

@ -14,14 +14,11 @@
// Validates correctness of barrier SPIR-V instructions. // Validates correctness of barrier SPIR-V instructions.
#include "source/val/validate.h"
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/spirv_constant.h" #include "source/spirv_constant.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include "source/util/bitutils.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validate_scopes.h" #include "source/val/validate_scopes.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"

View File

@ -14,13 +14,11 @@
// Validates correctness of primitive SPIR-V instructions. // Validates correctness of primitive SPIR-V instructions.
#include "source/val/validate.h"
#include <string> #include <string>
#include "source/diagnostic.h"
#include "source/opcode.h" #include "source/opcode.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
namespace spvtools { namespace spvtools {

View File

@ -14,7 +14,6 @@
#include "source/val/validate_scopes.h" #include "source/val/validate_scopes.h"
#include "source/diagnostic.h"
#include "source/spirv_target_env.h" #include "source/spirv_target_env.h"
#include "source/val/instruction.h" #include "source/val/instruction.h"
#include "source/val/validation_state.h" #include "source/val/validation_state.h"
@ -240,7 +239,7 @@ spv_result_t ValidateMemoryScope(ValidationState_t& _, const Instruction* inst,
!_.HasCapability(spv::Capability::SubgroupBallotKHR) && !_.HasCapability(spv::Capability::SubgroupBallotKHR) &&
!_.HasCapability(spv::Capability::SubgroupVoteKHR)) { !_.HasCapability(spv::Capability::SubgroupVoteKHR)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst) return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(6997) << spvOpcodeString(opcode) << _.VkErrorID(7951) << spvOpcodeString(opcode)
<< ": in Vulkan 1.0 environment Memory Scope is can not be " << ": in Vulkan 1.0 environment Memory Scope is can not be "
"Subgroup without SubgroupBallotKHR or SubgroupVoteKHR " "Subgroup without SubgroupBallotKHR or SubgroupVoteKHR "
"declared"; "declared";

View File

@ -2163,8 +2163,6 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
return VUID_WRAP(VUID-StandaloneSpirv-PushConstant-06808); return VUID_WRAP(VUID-StandaloneSpirv-PushConstant-06808);
case 6925: case 6925:
return VUID_WRAP(VUID-StandaloneSpirv-Uniform-06925); return VUID_WRAP(VUID-StandaloneSpirv-Uniform-06925);
case 6997:
return VUID_WRAP(VUID-StandaloneSpirv-SubgroupVoteKHR-06997);
case 7102: case 7102:
return VUID_WRAP(VUID-StandaloneSpirv-MeshEXT-07102); return VUID_WRAP(VUID-StandaloneSpirv-MeshEXT-07102);
case 7320: case 7320:
@ -2179,6 +2177,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
return VUID_WRAP(VUID-StandaloneSpirv-Base-07652); return VUID_WRAP(VUID-StandaloneSpirv-Base-07652);
case 7703: case 7703:
return VUID_WRAP(VUID-StandaloneSpirv-Component-07703); return VUID_WRAP(VUID-StandaloneSpirv-Component-07703);
case 7951:
return VUID_WRAP(VUID-StandaloneSpirv-SubgroupVoteKHR-07951);
default: default:
return ""; // unknown id return ""; // unknown id
} }