From 20b226dbdfeed5f77f0972e17d7bc9f03b9f5115 Mon Sep 17 00:00:00 2001 From: "Herman S." <429230+has207@users.noreply.github.com> Date: Sat, 11 Oct 2025 23:09:37 +0900 Subject: [PATCH] [Vulkan] Update glslang to 16.0.0 and introduce compat layer --- src/xenia/gpu/premake5.lua | 69 +-- src/xenia/gpu/spirv_builder.cc | 10 +- src/xenia/gpu/spirv_builder.h | 11 +- src/xenia/gpu/spirv_compatibility.h | 461 ++++++++++++++++++ src/xenia/gpu/spirv_shader_translator.cc | 17 +- src/xenia/gpu/spirv_shader_translator_alu.cc | 1 + .../gpu/spirv_shader_translator_fetch.cc | 1 + .../gpu/spirv_shader_translator_memexport.cc | 1 + src/xenia/gpu/spirv_shader_translator_rb.cc | 1 + src/xenia/gpu/vulkan/premake5.lua | 5 +- src/xenia/gpu/vulkan/vulkan_pipeline_cache.cc | 21 +- .../gpu/vulkan/vulkan_render_target_cache.cc | 20 +- src/xenia/ui/vulkan/premake5.lua | 1 + third_party/glslang | 2 +- third_party/glslang-spirv.lua | 43 +- 15 files changed, 563 insertions(+), 101 deletions(-) create mode 100644 src/xenia/gpu/spirv_compatibility.h diff --git a/src/xenia/gpu/premake5.lua b/src/xenia/gpu/premake5.lua index 971d6ef70..ecf070220 100644 --- a/src/xenia/gpu/premake5.lua +++ b/src/xenia/gpu/premake5.lua @@ -17,39 +17,44 @@ project("xenia-gpu") }) includedirs({ project_root.."/third_party/Vulkan-Headers/include", + project_root.."/third_party/glslang", -- For glslang SPIRV headers }) local_platform_files() -group("src") -project("xenia-gpu-shader-compiler") - uuid("ad76d3e4-4c62-439b-a0f6-f83fcf0e83c5") - kind("ConsoleApp") - language("C++") - links({ - "dxbc", - "fmt", - "glslang-spirv", - "snappy", - "xenia-base", - "xenia-gpu", - "xenia-ui", - "xenia-ui-vulkan", - }) - includedirs({ - project_root.."/third_party/Vulkan-Headers/include", - }) - files({ - "shader_compiler_main.cc", - "../base/console_app_main_"..platform_suffix..".cc", - }) +if enableMiscSubprojects then + group("src") + project("xenia-gpu-shader-compiler") + uuid("ad76d3e4-4c62-439b-a0f6-f83fcf0e83c5") + kind("ConsoleApp") + language("C++") + links({ + "dxbc", + "fmt", + "glslang-spirv", + "snappy", + "xenia-base", + "xenia-gpu", + "xenia-ui", + "xenia-ui-vulkan", + }) + includedirs({ + project_root.."/third_party/Vulkan-Headers/include", + project_root.."/third_party/glslang", -- For glslang SPIRV headers + }) + files({ + "shader_compiler_main.cc", + "../base/console_app_main_"..platform_suffix..".cc", + }) - filter("platforms:Windows") - -- Only create the .user file if it doesn't already exist. - local user_file = project_root.."/build/xenia-gpu-shader-compiler.vcxproj.user" - if not os.isfile(user_file) then - debugdir(project_root) - debugargs({ - "2>&1", - "1>scratch/stdout-shader-compiler.txt", - }) - end + filter("platforms:Windows") + -- Only create the .user file if it doesn't already exist. + local user_file = project_root.."/build/xenia-gpu-shader-compiler.vcxproj.user" + if not os.isfile(user_file) then + debugdir(project_root) + debugargs({ + "2>&1", + "1>scratch/stdout-shader-compiler.txt", + }) + end + filter({}) +end diff --git a/src/xenia/gpu/spirv_builder.cc b/src/xenia/gpu/spirv_builder.cc index 4da6ff81f..9cc250ddb 100644 --- a/src/xenia/gpu/spirv_builder.cc +++ b/src/xenia/gpu/spirv_builder.cc @@ -10,6 +10,7 @@ #include "xenia/gpu/spirv_builder.h" #include "xenia/base/assert.h" +#include "xenia/gpu/spirv_compatibility.h" namespace xe { namespace gpu { @@ -99,7 +100,8 @@ spv::Id SpirvBuilder::createTriBuiltinCall(spv::Id result_type, return result; } -SpirvBuilder::IfBuilder::IfBuilder(spv::Id condition, unsigned int control, +SpirvBuilder::IfBuilder::IfBuilder(spv::Id condition, + spv::SelectionControlMask control, SpirvBuilder& builder, unsigned int thenWeight, unsigned int elseWeight) @@ -199,9 +201,9 @@ spv::Id SpirvBuilder::IfBuilder::createMergePhi(spv::Id then_variable, getElsePhiParent()); } -SpirvBuilder::SwitchBuilder::SwitchBuilder(spv::Id selector, - unsigned int selection_control, - SpirvBuilder& builder) +SpirvBuilder::SwitchBuilder::SwitchBuilder( + spv::Id selector, spv::SelectionControlMask selection_control, + SpirvBuilder& builder) : builder_(builder), selector_(selector), selection_control_(selection_control), diff --git a/src/xenia/gpu/spirv_builder.h b/src/xenia/gpu/spirv_builder.h index a15010277..e85b8f892 100644 --- a/src/xenia/gpu/spirv_builder.h +++ b/src/xenia/gpu/spirv_builder.h @@ -94,8 +94,9 @@ class SpirvBuilder : public spv::Builder { // additions over SpvBuilder::If. class IfBuilder { public: - IfBuilder(spv::Id condition, unsigned int control, SpirvBuilder& builder, - unsigned int thenWeight = 0, unsigned int elseWeight = 0); + IfBuilder(spv::Id condition, spv::SelectionControlMask control, + SpirvBuilder& builder, unsigned int thenWeight = 0, + unsigned int elseWeight = 0); ~IfBuilder() { #ifndef NDEBUG @@ -125,7 +126,7 @@ class SpirvBuilder : public spv::Builder { SpirvBuilder& builder; spv::Id condition; - unsigned int control; + spv::SelectionControlMask control; unsigned int thenWeight; unsigned int elseWeight; @@ -148,7 +149,7 @@ class SpirvBuilder : public spv::Builder { // block) compared to makeSwitch. class SwitchBuilder { public: - SwitchBuilder(spv::Id selector, unsigned int selection_control, + SwitchBuilder(spv::Id selector, spv::SelectionControlMask selection_control, SpirvBuilder& builder); ~SwitchBuilder() { assert_true(current_branch_ == Branch::kMerge); } @@ -173,7 +174,7 @@ class SpirvBuilder : public spv::Builder { SpirvBuilder& builder_; spv::Id selector_; - unsigned int selection_control_; + spv::SelectionControlMask selection_control_; spv::Function& function_; diff --git a/src/xenia/gpu/spirv_compatibility.h b/src/xenia/gpu/spirv_compatibility.h new file mode 100644 index 000000000..94e703141 --- /dev/null +++ b/src/xenia/gpu/spirv_compatibility.h @@ -0,0 +1,461 @@ +/** + * ****************************************************************************** + * Xenia : Xbox 360 Emulator Research Project * + * ****************************************************************************** + * Copyright 2023 Ben Vanik. All rights reserved. * + * Released under the BSD license - see LICENSE in the root for more details. * + * ****************************************************************************** + * + * Compatibility layer for glslang spirv.hpp11 migration + * This header provides backward compatibility for code written against the old + * spirv.hpp + */ + +#pragma once + +#include "third_party/glslang/SPIRV/spirv.hpp11" +#include "third_party/glslang/SPIRV/spvUtil.h" + +namespace spv { + +// Backward compatibility for Op codes - old style was spv::OpXXX, new is +// spv::Op::OpXXX We provide the old style as direct aliases in the spv +// namespace +// Op code compatibility macros +#define OpNop Op::OpNop +#define OpUndef Op::OpUndef +#define OpSourceContinued Op::OpSourceContinued +#define OpSource Op::OpSource +#define OpSourceExtension Op::OpSourceExtension +#define OpName Op::OpName +#define OpMemberName Op::OpMemberName +#define OpString Op::OpString +#define OpExtension Op::OpExtension +#define OpExtInstImport Op::OpExtInstImport +#define OpExtInst Op::OpExtInst +#define OpMemoryModel Op::OpMemoryModel +#define OpEntryPoint Op::OpEntryPoint +#define OpExecutionMode Op::OpExecutionMode +#define OpCapability Op::OpCapability +#define OpTypeVoid Op::OpTypeVoid +#define OpTypeBool Op::OpTypeBool +#define OpTypeInt Op::OpTypeInt +#define OpTypeFloat Op::OpTypeFloat +#define OpTypeVector Op::OpTypeVector +#define OpTypeMatrix Op::OpTypeMatrix +#define OpTypeImage Op::OpTypeImage +#define OpTypeSampler Op::OpTypeSampler +#define OpTypeSampledImage Op::OpTypeSampledImage +#define OpTypeArray Op::OpTypeArray +#define OpTypeRuntimeArray Op::OpTypeRuntimeArray +#define OpTypeStruct Op::OpTypeStruct +#define OpTypeOpaque Op::OpTypeOpaque +#define OpTypePointer Op::OpTypePointer +#define OpTypeFunction Op::OpTypeFunction +#define OpTypeEvent Op::OpTypeEvent +#define OpTypeDeviceEvent Op::OpTypeDeviceEvent +#define OpTypeReserveId Op::OpTypeReserveId +#define OpTypeQueue Op::OpTypeQueue +#define OpTypePipe Op::OpTypePipe +#define OpTypeForwardPointer Op::OpTypeForwardPointer +#define OpConstantTrue Op::OpConstantTrue +#define OpConstantFalse Op::OpConstantFalse +#define OpConstant Op::OpConstant +#define OpConstantComposite Op::OpConstantComposite +#define OpConstantSampler Op::OpConstantSampler +#define OpConstantNull Op::OpConstantNull +#define OpSpecConstantTrue Op::OpSpecConstantTrue +#define OpSpecConstantFalse Op::OpSpecConstantFalse +#define OpSpecConstant Op::OpSpecConstant +#define OpSpecConstantComposite Op::OpSpecConstantComposite +#define OpSpecConstantOp Op::OpSpecConstantOp +#define OpVariable Op::OpVariable +#define OpImageTexelPointer Op::OpImageTexelPointer +#define OpLoad Op::OpLoad +#define OpStore Op::OpStore +#define OpCopyMemory Op::OpCopyMemory +#define OpCopyMemorySized Op::OpCopyMemorySized +#define OpAccessChain Op::OpAccessChain +#define OpInBoundsAccessChain Op::OpInBoundsAccessChain +#define OpPtrAccessChain Op::OpPtrAccessChain +#define OpArrayLength Op::OpArrayLength +#define OpGenericPtrMemSemantics Op::OpGenericPtrMemSemantics +#define OpInBoundsPtrAccessChain Op::OpInBoundsPtrAccessChain +#define OpDecorate Op::OpDecorate +#define OpMemberDecorate Op::OpMemberDecorate +#define OpDecorationGroup Op::OpDecorationGroup +#define OpGroupDecorate Op::OpGroupDecorate +#define OpGroupMemberDecorate Op::OpGroupMemberDecorate +#define OpVectorExtractDynamic Op::OpVectorExtractDynamic +#define OpVectorInsertDynamic Op::OpVectorInsertDynamic +#define OpVectorShuffle Op::OpVectorShuffle +#define OpCompositeConstruct Op::OpCompositeConstruct +#define OpCompositeExtract Op::OpCompositeExtract +#define OpCompositeInsert Op::OpCompositeInsert +#define OpCopyObject Op::OpCopyObject +#define OpTranspose Op::OpTranspose +#define OpSampledImage Op::OpSampledImage +#define OpImageSampleImplicitLod Op::OpImageSampleImplicitLod +#define OpImageSampleExplicitLod Op::OpImageSampleExplicitLod +#define OpImageSampleDrefImplicitLod Op::OpImageSampleDrefImplicitLod +#define OpImageSampleDrefExplicitLod Op::OpImageSampleDrefExplicitLod +#define OpImageSampleProjImplicitLod Op::OpImageSampleProjImplicitLod +#define OpImageSampleProjExplicitLod Op::OpImageSampleProjExplicitLod +#define OpImageSampleProjDrefImplicitLod Op::OpImageSampleProjDrefImplicitLod +#define OpImageSampleProjDrefExplicitLod Op::OpImageSampleProjDrefExplicitLod +#define OpImageFetch Op::OpImageFetch +#define OpImageGather Op::OpImageGather +#define OpImageDrefGather Op::OpImageDrefGather +#define OpImageRead Op::OpImageRead +#define OpImageWrite Op::OpImageWrite +#define OpImage Op::OpImage +#define OpImageQueryFormat Op::OpImageQueryFormat +#define OpImageQueryOrder Op::OpImageQueryOrder +#define OpImageQuerySizeLod Op::OpImageQuerySizeLod +#define OpImageQuerySize Op::OpImageQuerySize +#define OpImageQueryLod Op::OpImageQueryLod +#define OpImageQueryLevels Op::OpImageQueryLevels +#define OpImageQuerySamples Op::OpImageQuerySamples +#define OpConvertFToU Op::OpConvertFToU +#define OpConvertFToS Op::OpConvertFToS +#define OpFConvertSTo Op::OpFConvertSTo +#define OpConvertSToF Op::OpConvertSToF +#define OpConvertUToF Op::OpConvertUToF +#define OpUConvert Op::OpUConvert +#define OpSConvert Op::OpSConvert +#define OpFConvert Op::OpFConvert +#define OpQuantizeToF16 Op::OpQuantizeToF16 +#define OpConvertPtrToU Op::OpConvertPtrToU +#define OpConvertUToPtr Op::OpConvertUToPtr +#define OpPtrCastToGeneric Op::OpPtrCastToGeneric +#define OpGenericCastToPtr Op::OpGenericCastToPtr +#define OpGenericCastToPtrExplicit Op::OpGenericCastToPtrExplicit +#define OpBitcast Op::OpBitcast +#define OpSNegate Op::OpSNegate +#define OpFNegate Op::OpFNegate +#define OpIAdd Op::OpIAdd +#define OpFAdd Op::OpFAdd +#define OpISub Op::OpISub +#define OpFSub Op::OpFSub +#define OpIMul Op::OpIMul +#define OpFMul Op::OpFMul +#define OpUDiv Op::OpUDiv +#define OpSDiv Op::OpSDiv +#define OpFDiv Op::OpFDiv +#define OpUMod Op::OpUMod +#define OpSRem Op::OpSRem +#define OpSMod Op::OpSMod +#define OpFRem Op::OpFRem +#define OpFMod Op::OpFMod +#define OpVectorTimesScalar Op::OpVectorTimesScalar +#define OpMatrixTimesScalar Op::OpMatrixTimesScalar +#define OpVectorTimesMatrix Op::OpVectorTimesMatrix +#define OpMatrixTimesVector Op::OpMatrixTimesVector +#define OpMatrixTimesMatrix Op::OpMatrixTimesMatrix +#define OpOuterProduct Op::OpOuterProduct +#define OpDot Op::OpDot +#define OpIAddCarry Op::OpIAddCarry +#define OpISubBorrow Op::OpISubBorrow +#define OpUMulExtended Op::OpUMulExtended +#define OpSMulExtended Op::OpSMulExtended +#define OpShiftRightLogical Op::OpShiftRightLogical +#define OpShiftRightArithmetic Op::OpShiftRightArithmetic +#define OpShiftLeftLogical Op::OpShiftLeftLogical +#define OpBitwiseOr Op::OpBitwiseOr +#define OpBitwiseXor Op::OpBitwiseXor +#define OpBitwiseAnd Op::OpBitwiseAnd +#define OpNot Op::OpNot +#define OpBitFieldInsert Op::OpBitFieldInsert +#define OpBitFieldSExtract Op::OpBitFieldSExtract +#define OpBitFieldUExtract Op::OpBitFieldUExtract +#define OpBitReverse Op::OpBitReverse +#define OpBitCount Op::OpBitCount +#define OpAny Op::OpAny +#define OpAll Op::OpAll +#define OpIsNan Op::OpIsNan +#define OpIsInf Op::OpIsInf +#define OpIsFinite Op::OpIsFinite +#define OpIsNormal Op::OpIsNormal +#define OpSignBitSet Op::OpSignBitSet +#define OpLessOrGreater Op::OpLessOrGreater +#define OpOrdered Op::OpOrdered +#define OpUnordered Op::OpUnordered +#define OpLogicalEqual Op::OpLogicalEqual +#define OpLogicalNotEqual Op::OpLogicalNotEqual +#define OpLogicalOr Op::OpLogicalOr +#define OpLogicalAnd Op::OpLogicalAnd +#define OpLogicalNot Op::OpLogicalNot +#define OpSelect Op::OpSelect +#define OpIEqual Op::OpIEqual +#define OpINotEqual Op::OpINotEqual +#define OpUGreaterThan Op::OpUGreaterThan +#define OpUGreaterThanEqual Op::OpUGreaterThanEqual +#define OpULessThan Op::OpULessThan +#define OpULessThanEqual Op::OpULessThanEqual +#define OpSGreaterThan Op::OpSGreaterThan +#define OpSGreaterThanEqual Op::OpSGreaterThanEqual +#define OpSLessThan Op::OpSLessThan +#define OpSLessThanEqual Op::OpSLessThanEqual +#define OpFOrdEqual Op::OpFOrdEqual +#define OpFOrdNotEqual Op::OpFOrdNotEqual +#define OpFOrdLessThan Op::OpFOrdLessThan +#define OpFOrdGreaterThan Op::OpFOrdGreaterThan +#define OpFOrdLessThanEqual Op::OpFOrdLessThanEqual +#define OpFOrdGreaterThanEqual Op::OpFOrdGreaterThanEqual +#define OpFUnordEqual Op::OpFUnordEqual +#define OpFUnordNotEqual Op::OpFUnordNotEqual +#define OpFUnordLessThan Op::OpFUnordLessThan +#define OpFUnordGreaterThan Op::OpFUnordGreaterThan +#define OpFUnordLessThanEqual Op::OpFUnordLessThanEqual +#define OpFUnordGreaterThanEqual Op::OpFUnordGreaterThanEqual +#define OpDPdx Op::OpDPdx +#define OpDPdy Op::OpDPdy +#define OpFwidth Op::OpFwidth +#define OpDPdxFine Op::OpDPdxFine +#define OpDPdyFine Op::OpDPdyFine +#define OpFwidthFine Op::OpFwidthFine +#define OpDPdxCoarse Op::OpDPdxCoarse +#define OpDPdyCoarse Op::OpDPdyCoarse +#define OpFwidthCoarse Op::OpFwidthCoarse +#define OpEmitVertex Op::OpEmitVertex +#define OpEndPrimitive Op::OpEndPrimitive +#define OpEmitStreamVertex Op::OpEmitStreamVertex +#define OpEndStreamPrimitive Op::OpEndStreamPrimitive +#define OpControlBarrier Op::OpControlBarrier +#define OpMemoryBarrier Op::OpMemoryBarrier +#define OpAtomicLoad Op::OpAtomicLoad +#define OpAtomicStore Op::OpAtomicStore +#define OpAtomicExchange Op::OpAtomicExchange +#define OpAtomicCompareExchange Op::OpAtomicCompareExchange +#define OpAtomicCompareExchangeWeak Op::OpAtomicCompareExchangeWeak +#define OpAtomicIIncrement Op::OpAtomicIIncrement +#define OpAtomicIDecrement Op::OpAtomicIDecrement +#define OpAtomicIAdd Op::OpAtomicIAdd +#define OpAtomicISub Op::OpAtomicISub +#define OpAtomicSMin Op::OpAtomicSMin +#define OpAtomicUMin Op::OpAtomicUMin +#define OpAtomicSMax Op::OpAtomicSMax +#define OpAtomicUMax Op::OpAtomicUMax +#define OpAtomicAnd Op::OpAtomicAnd +#define OpAtomicOr Op::OpAtomicOr +#define OpAtomicXor Op::OpAtomicXor +#define OpPhi Op::OpPhi +#define OpLoopMerge Op::OpLoopMerge +#define OpSelectionMerge Op::OpSelectionMerge +#define OpLabel Op::OpLabel +#define OpBranch Op::OpBranch +#define OpBranchConditional Op::OpBranchConditional +#define OpSwitch Op::OpSwitch +#define OpKill Op::OpKill +#define OpReturn Op::OpReturn +#define OpReturnValue Op::OpReturnValue +#define OpUnreachable Op::OpUnreachable +#define OpLifetimeStart Op::OpLifetimeStart +#define OpLifetimeStop Op::OpLifetimeStop +#define OpGroupAsyncCopy Op::OpGroupAsyncCopy +#define OpGroupWaitEvents Op::OpGroupWaitEvents +#define OpGroupAll Op::OpGroupAll +#define OpGroupAny Op::OpGroupAny +#define OpGroupBroadcast Op::OpGroupBroadcast +#define OpGroupIAdd Op::OpGroupIAdd +#define OpGroupFAdd Op::OpGroupFAdd +#define OpGroupFMin Op::OpGroupFMin +#define OpGroupUMin Op::OpGroupUMin +#define OpGroupSMin Op::OpGroupSMin +#define OpGroupFMax Op::OpGroupFMax +#define OpGroupUMax Op::OpGroupUMax +#define OpGroupSMax Op::OpGroupSMax +#define OpReadPipe Op::OpReadPipe +#define OpWritePipe Op::OpWritePipe +#define OpReservedReadPipe Op::OpReservedReadPipe +#define OpReservedWritePipe Op::OpReservedWritePipe +#define OpReserveReadPipePackets Op::OpReserveReadPipePackets +#define OpReserveWritePipePackets Op::OpReserveWritePipePackets +#define OpCommitReadPipe Op::OpCommitReadPipe +#define OpCommitWritePipe Op::OpCommitWritePipe +#define OpIsValidReserveId Op::OpIsValidReserveId +#define OpGetNumPipePackets Op::OpGetNumPipePackets +#define OpGetMaxPipePackets Op::OpGetMaxPipePackets +#define OpGroupReserveReadPipePackets Op::OpGroupReserveReadPipePackets +#define OpGroupReserveWritePipePackets Op::OpGroupReserveWritePipePackets +#define OpGroupCommitReadPipe Op::OpGroupCommitReadPipe +#define OpGroupCommitWritePipe Op::OpGroupCommitWritePipe +#define OpEnqueueMarker Op::OpEnqueueMarker +#define OpEnqueueKernel Op::OpEnqueueKernel +#define OpGetKernelNDrangeSubGroupCount Op::OpGetKernelNDrangeSubGroupCount +#define OpGetKernelNDrangeMaxSubGroupSize Op::OpGetKernelNDrangeMaxSubGroupSize +#define OpGetKernelWorkGroupSize Op::OpGetKernelWorkGroupSize +#define OpGetKernelPreferredWorkGroupSizeMultiple \ + Op::OpGetKernelPreferredWorkGroupSizeMultiple +#define OpRetainEvent Op::OpRetainEvent +#define OpReleaseEvent Op::OpReleaseEvent +#define OpCreateUserEvent Op::OpCreateUserEvent +#define OpIsValidEvent Op::OpIsValidEvent +#define OpSetUserEventStatus Op::OpSetUserEventStatus +#define OpCaptureEventProfilingInfo Op::OpCaptureEventProfilingInfo +#define OpGetDefaultQueue Op::OpGetDefaultQueue +#define OpBuildNDRange Op::OpBuildNDRange +#define OpImageSparseSampleImplicitLod Op::OpImageSparseSampleImplicitLod +#define OpImageSparseSampleExplicitLod Op::OpImageSparseSampleExplicitLod +#define OpImageSparseSampleDrefImplicitLod \ + Op::OpImageSparseSampleDrefImplicitLod +#define OpImageSparseSampleDrefExplicitLod \ + Op::OpImageSparseSampleDrefExplicitLod +#define OpImageSparseSampleProjImplicitLod \ + Op::OpImageSparseSampleProjImplicitLod +#define OpImageSparseSampleProjExplicitLod \ + Op::OpImageSparseSampleProjExplicitLod +#define OpImageSparseSampleProjDrefImplicitLod \ + Op::OpImageSparseSampleProjDrefImplicitLod +#define OpImageSparseSampleProjDrefExplicitLod \ + Op::OpImageSparseSampleProjDrefExplicitLod +#define OpImageSparseFetch Op::OpImageSparseFetch +#define OpImageSparseGather Op::OpImageSparseGather +#define OpImageSparseDrefGather Op::OpImageSparseDrefGather +#define OpImageSparseTexelsResident Op::OpImageSparseTexelsResident +#define OpNoLine Op::OpNoLine +#define OpAtomicFlagTestAndSet Op::OpAtomicFlagTestAndSet +#define OpAtomicFlagClear Op::OpAtomicFlagClear +#define OpImageSampleFootprintNV Op::OpImageSampleFootprintNV + +// Direct aliases for Op codes in the main spv namespace +// This allows code like spv::OpFAdd to work without qualification + +// Inject old-style OpXXX names into spv namespace + +// Backward compatibility for Decoration names +// Only include decorations that actually exist +#define DecorationArrayStride Decoration::ArrayStride +#define DecorationBlock Decoration::Block +#define DecorationOffset Decoration::Offset +#define DecorationDescriptorSet Decoration::DescriptorSet +#define DecorationBinding Decoration::Binding +#define DecorationBuiltIn Decoration::BuiltIn +#define DecorationFlat Decoration::Flat +#define DecorationInvariant Decoration::Invariant +#define DecorationUniform Decoration::Uniform +#define DecorationSaturatedConversion Decoration::SaturatedConversion +#define DecorationStream Decoration::Stream +#define DecorationLocation Decoration::Location +#define DecorationComponent Decoration::Component +#define DecorationIndex Decoration::Index +#define DecorationAlignment Decoration::Alignment +#define DecorationXfbBuffer Decoration::XfbBuffer +#define DecorationXfbStride Decoration::XfbStride +#define DecorationFuncParamAttr Decoration::FuncParamAttr +#define DecorationFPRoundingMode Decoration::FPRoundingMode +#define DecorationFPFastMathMode Decoration::FPFastMathMode +#define DecorationLinkageAttributes Decoration::LinkageAttributes +#define DecorationNoContraction Decoration::NoContraction +#define DecorationInputAttachmentIndex Decoration::InputAttachmentIndex +#define DecorationAlignmentId Decoration::AlignmentId +#define DecorationMaxByteOffsetId Decoration::MaxByteOffsetId + +// Backward compatibility for ImageOperands +#define ImageOperandsGradMask ImageOperandsMask::Grad +#define ImageOperandsLodMask ImageOperandsMask::Lod +#define ImageOperandsMaskNone ImageOperandsMask::MaskNone + +// Backward compatibility for StorageClass +#define StorageClassUniformConstant StorageClass::UniformConstant +#define StorageClassInput StorageClass::Input +#define StorageClassUniform StorageClass::Uniform +#define StorageClassOutput StorageClass::Output +#define StorageClassFunction StorageClass::Function + +// Backward compatibility for SelectionControl +#define SelectionControlMaskNone SelectionControlMask::MaskNone +#define SelectionControlDontFlattenMask SelectionControlMask::DontFlatten + +// Backward compatibility for Capability +#define CapabilityShader Capability::Shader +#define CapabilityGeometry Capability::Geometry +#define CapabilityTessellation Capability::Tessellation +#define CapabilityClipDistance Capability::ClipDistance +#define CapabilityCullDistance Capability::CullDistance +#define CapabilityDerivativeControl Capability::DerivativeControl +#define CapabilityDenormFlushToZero Capability::DenormFlushToZero +#define CapabilitySignedZeroInfNanPreserve Capability::SignedZeroInfNanPreserve +#define CapabilityRoundingModeRTE Capability::RoundingModeRTE +#define CapabilityFragmentShaderSampleInterlockEXT \ + Capability::FragmentShaderSampleInterlockEXT +#define CapabilityFragmentShaderPixelInterlockEXT \ + Capability::FragmentShaderPixelInterlockEXT +#define CapabilitySampleRateShading Capability::SampleRateShading +#define CapabilityDemoteToHelperInvocationEXT \ + Capability::DemoteToHelperInvocationEXT +#define CapabilityStencilExportEXT Capability::StencilExportEXT + +// Backward compatibility for AddressingModel +#define AddressingModelLogical AddressingModel::Logical + +// Backward compatibility for MemoryModel +#define MemoryModelGLSL450 MemoryModel::GLSL450 + +// Backward compatibility for SourceLanguage +#define SourceLanguageUnknown SourceLanguage::Unknown + +// Backward compatibility for ExecutionModel +#define ExecutionModelVertex ExecutionModel::Vertex +#define ExecutionModelTessellationEvaluation \ + ExecutionModel::TessellationEvaluation +#define ExecutionModelGeometry ExecutionModel::Geometry +#define ExecutionModelFragment ExecutionModel::Fragment +#define ExecutionModelGLCompute ExecutionModel::GLCompute + +// Backward compatibility for ExecutionMode +#define ExecutionModeOriginUpperLeft ExecutionMode::OriginUpperLeft +#define ExecutionModeEarlyFragmentTests ExecutionMode::EarlyFragmentTests +#define ExecutionModeDenormFlushToZero ExecutionMode::DenormFlushToZero +#define ExecutionModeSignedZeroInfNanPreserve \ + ExecutionMode::SignedZeroInfNanPreserve +#define ExecutionModeRoundingModeRTE ExecutionMode::RoundingModeRTE +#define ExecutionModePixelInterlockOrderedEXT \ + ExecutionMode::PixelInterlockOrderedEXT +#define ExecutionModeSampleInterlockOrderedEXT \ + ExecutionMode::SampleInterlockOrderedEXT +#define ExecutionModeInputPoints ExecutionMode::InputPoints +#define ExecutionModeTriangles ExecutionMode::Triangles +#define ExecutionModeInputLinesAdjacency ExecutionMode::InputLinesAdjacency +#define ExecutionModeOutputTriangleStrip ExecutionMode::OutputTriangleStrip +#define ExecutionModeInvocations ExecutionMode::Invocations +#define ExecutionModeOutputVertices ExecutionMode::OutputVertices +#define ExecutionModeDepthReplacing ExecutionMode::DepthReplacing +#define ExecutionModeStencilRefReplacingEXT \ + ExecutionMode::StencilRefReplacingEXT +#define ExecutionModeLocalSize ExecutionMode::LocalSize + +// Backward compatibility for Decoration +#define DecorationRestrict Decoration::Restrict +#define DecorationNonWritable Decoration::NonWritable +#define DecorationBufferBlock Decoration::BufferBlock +#define DecorationCoherent Decoration::Coherent +#define DecorationCentroid Decoration::Centroid +#define DecorationSpecId Decoration::SpecId +#define DecorationNonReadable Decoration::NonReadable + +// Backward compatibility for LoopControl +#define LoopControlDontUnrollMask LoopControlMask::DontUnroll + +// Backward compatibility for StorageClass (additional) +#define StorageClassStorageBuffer StorageClass::StorageBuffer +#define StorageClassPushConstant StorageClass::PushConstant + +// Backward compatibility for Dim +#define Dim2D Dim::Dim2D +#define Dim3D Dim::Dim3D +#define DimCube Dim::Cube + +// Backward compatibility for ImageFormat +#define ImageFormatUnknown ImageFormat::Unknown + +// Backward compatibility for OpDemoteToHelperInvocationEXT +#define OpDemoteToHelperInvocationEXT Op::OpDemoteToHelperInvocationEXT +#define OpBeginInvocationInterlockEXT Op::OpBeginInvocationInterlockEXT +#define OpEndInvocationInterlockEXT Op::OpEndInvocationInterlockEXT +#define OpIsHelperInvocationEXT Op::OpIsHelperInvocationEXT + +// Backward compatibility for Scope +#define ScopeDevice Scope::Device + +} // namespace spv diff --git a/src/xenia/gpu/spirv_shader_translator.cc b/src/xenia/gpu/spirv_shader_translator.cc index 9046adb2a..810c7afd1 100644 --- a/src/xenia/gpu/spirv_shader_translator.cc +++ b/src/xenia/gpu/spirv_shader_translator.cc @@ -17,6 +17,7 @@ #include "xenia/base/assert.h" #include "xenia/base/math.h" #include "xenia/base/string_buffer.h" +#include "xenia/gpu/spirv_compatibility.h" #include "xenia/gpu/spirv_shader.h" namespace xe { @@ -1193,13 +1194,13 @@ void SpirvShaderTranslator::StartVertexOrTessEvalShaderBeforeMain() { input_primitive_id_ = builder_->createVariable( spv::NoPrecision, spv::StorageClassInput, type_int_, "gl_PrimitiveID"); builder_->addDecoration(input_primitive_id_, spv::DecorationBuiltIn, - spv::BuiltInPrimitiveId); + static_cast(spv::BuiltIn::PrimitiveId)); main_interface_.push_back(input_primitive_id_); } else { input_vertex_index_ = builder_->createVariable( spv::NoPrecision, spv::StorageClassInput, type_int_, "gl_VertexIndex"); builder_->addDecoration(input_vertex_index_, spv::DecorationBuiltIn, - spv::BuiltInVertexIndex); + static_cast(spv::BuiltIn::VertexIndex)); main_interface_.push_back(input_vertex_index_); } @@ -1262,9 +1263,9 @@ void SpirvShaderTranslator::StartVertexOrTessEvalShaderBeforeMain() { builder_->makeStructType(struct_per_vertex_members, "gl_PerVertex"); builder_->addMemberName(type_struct_per_vertex, kOutputPerVertexMemberPosition, "gl_Position"); - builder_->addMemberDecoration(type_struct_per_vertex, - kOutputPerVertexMemberPosition, - spv::DecorationBuiltIn, spv::BuiltInPosition); + builder_->addMemberDecoration( + type_struct_per_vertex, kOutputPerVertexMemberPosition, + spv::DecorationBuiltIn, static_cast(spv::BuiltIn::Position)); builder_->addDecoration(type_struct_per_vertex, spv::DecorationBlock); output_per_vertex_ = builder_->createVariable( spv::NoPrecision, spv::StorageClassOutput, type_struct_per_vertex, ""); @@ -1861,7 +1862,7 @@ void SpirvShaderTranslator::StartFragmentShaderBeforeMain() { input_fragment_coordinates_ = builder_->createVariable( spv::NoPrecision, spv::StorageClassInput, type_float4_, "gl_FragCoord"); builder_->addDecoration(input_fragment_coordinates_, spv::DecorationBuiltIn, - spv::BuiltInFragCoord); + static_cast(spv::BuiltIn::FragCoord)); main_interface_.push_back(input_fragment_coordinates_); } @@ -1872,7 +1873,7 @@ void SpirvShaderTranslator::StartFragmentShaderBeforeMain() { input_front_facing_ = builder_->createVariable( spv::NoPrecision, spv::StorageClassInput, type_bool_, "gl_FrontFacing"); builder_->addDecoration(input_front_facing_, spv::DecorationBuiltIn, - spv::BuiltInFrontFacing); + static_cast(spv::BuiltIn::FrontFacing)); main_interface_.push_back(input_front_facing_); } @@ -1886,7 +1887,7 @@ void SpirvShaderTranslator::StartFragmentShaderBeforeMain() { "gl_SampleMaskIn"); builder_->addDecoration(input_sample_mask_, spv::DecorationFlat); builder_->addDecoration(input_sample_mask_, spv::DecorationBuiltIn, - spv::BuiltInSampleMask); + static_cast(spv::BuiltIn::SampleMask)); main_interface_.push_back(input_sample_mask_); } diff --git a/src/xenia/gpu/spirv_shader_translator_alu.cc b/src/xenia/gpu/spirv_shader_translator_alu.cc index 701a9aeea..ad8414e0f 100644 --- a/src/xenia/gpu/spirv_shader_translator_alu.cc +++ b/src/xenia/gpu/spirv_shader_translator_alu.cc @@ -16,6 +16,7 @@ #include "third_party/glslang/SPIRV/GLSL.std.450.h" #include "xenia/base/assert.h" #include "xenia/base/math.h" +#include "xenia/gpu/spirv_compatibility.h" namespace xe { namespace gpu { diff --git a/src/xenia/gpu/spirv_shader_translator_fetch.cc b/src/xenia/gpu/spirv_shader_translator_fetch.cc index 764bde94d..618631c06 100644 --- a/src/xenia/gpu/spirv_shader_translator_fetch.cc +++ b/src/xenia/gpu/spirv_shader_translator_fetch.cc @@ -16,6 +16,7 @@ #include "third_party/glslang/SPIRV/GLSL.std.450.h" #include "xenia/base/assert.h" #include "xenia/base/math.h" +#include "xenia/gpu/spirv_compatibility.h" namespace xe { namespace gpu { diff --git a/src/xenia/gpu/spirv_shader_translator_memexport.cc b/src/xenia/gpu/spirv_shader_translator_memexport.cc index b9f9f91ed..ccfad00cd 100644 --- a/src/xenia/gpu/spirv_shader_translator_memexport.cc +++ b/src/xenia/gpu/spirv_shader_translator_memexport.cc @@ -12,6 +12,7 @@ #include "third_party/glslang/SPIRV/GLSL.std.450.h" #include "xenia/base/assert.h" #include "xenia/base/math.h" +#include "xenia/gpu/spirv_compatibility.h" #include "xenia/gpu/ucode.h" namespace xe { diff --git a/src/xenia/gpu/spirv_shader_translator_rb.cc b/src/xenia/gpu/spirv_shader_translator_rb.cc index fa98fe974..925eed28e 100644 --- a/src/xenia/gpu/spirv_shader_translator_rb.cc +++ b/src/xenia/gpu/spirv_shader_translator_rb.cc @@ -16,6 +16,7 @@ #include "xenia/base/math.h" #include "xenia/gpu/draw_util.h" #include "xenia/gpu/render_target_cache.h" +#include "xenia/gpu/spirv_compatibility.h" namespace xe { namespace gpu { diff --git a/src/xenia/gpu/vulkan/premake5.lua b/src/xenia/gpu/vulkan/premake5.lua index bb37a61f1..5e4a4dcbb 100644 --- a/src/xenia/gpu/vulkan/premake5.lua +++ b/src/xenia/gpu/vulkan/premake5.lua @@ -17,6 +17,7 @@ project("xenia-gpu-vulkan") }) includedirs({ project_root.."/third_party/Vulkan-Headers/include", + project_root.."/third_party/glslang", -- For glslang SPIRV headers }) local_platform_files() files({ @@ -60,6 +61,7 @@ if enableMiscSubprojects then }) includedirs({ project_root.."/third_party/Vulkan-Headers/include", + project_root.."/third_party/glslang", -- For glslang SPIRV headers }) files({ "vulkan_trace_viewer_main.cc", @@ -125,6 +127,7 @@ if enableMiscSubprojects then }) includedirs({ project_root.."/third_party/Vulkan-Headers/include", + project_root.."/third_party/glslang", -- For glslang SPIRV headers }) files({ "vulkan_trace_dump_main.cc", @@ -153,4 +156,4 @@ if enableMiscSubprojects then "1>scratch/stdout-trace-dump.txt", }) end -end \ No newline at end of file +end diff --git a/src/xenia/gpu/vulkan/vulkan_pipeline_cache.cc b/src/xenia/gpu/vulkan/vulkan_pipeline_cache.cc index 79ed348ba..398a8d56a 100644 --- a/src/xenia/gpu/vulkan/vulkan_pipeline_cache.cc +++ b/src/xenia/gpu/vulkan/vulkan_pipeline_cache.cc @@ -23,6 +23,7 @@ #include "xenia/gpu/register_file.h" #include "xenia/gpu/registers.h" #include "xenia/gpu/spirv_builder.h" +#include "xenia/gpu/spirv_compatibility.h" #include "xenia/gpu/spirv_shader_translator.h" #include "xenia/gpu/vulkan/vulkan_command_processor.h" #include "xenia/gpu/vulkan/vulkan_shader.h" @@ -837,7 +838,7 @@ VkShaderModule VulkanPipelineCache::GetGeometryShader(GeometryShaderKey key) { (key.user_clip_plane_cull ? key.user_clip_plane_count : 0) + key.has_vertex_kill_and; - SpirvBuilder builder(spv::Spv_1_0, + SpirvBuilder builder(spv::Spv_1_5, (SpirvShaderTranslator::kSpirvMagicToolId << 16) | 1, nullptr); spv::Id ext_inst_glsl_std_450 = builder.import("GLSL.std.450"); @@ -955,16 +956,16 @@ VkShaderModule VulkanPipelineCache::GetGeometryShader(GeometryShaderKey key) { builder.makeStructType(id_vector_temp, "gl_PerVertex"); builder.addMemberName(type_struct_in_gl_per_vertex, member_in_gl_per_vertex_position, "gl_Position"); - builder.addMemberDecoration(type_struct_in_gl_per_vertex, - member_in_gl_per_vertex_position, - spv::DecorationBuiltIn, spv::BuiltInPosition); + builder.addMemberDecoration( + type_struct_in_gl_per_vertex, member_in_gl_per_vertex_position, + spv::DecorationBuiltIn, static_cast(spv::BuiltIn::Position)); if (clip_distance_count) { builder.addMemberName(type_struct_in_gl_per_vertex, member_in_gl_per_vertex_clip_distance, "gl_ClipDistance"); builder.addMemberDecoration( type_struct_in_gl_per_vertex, member_in_gl_per_vertex_clip_distance, - spv::DecorationBuiltIn, spv::BuiltInClipDistance); + spv::DecorationBuiltIn, static_cast(spv::BuiltIn::ClipDistance)); } if (cull_distance_count) { builder.addMemberName(type_struct_in_gl_per_vertex, @@ -972,7 +973,7 @@ VkShaderModule VulkanPipelineCache::GetGeometryShader(GeometryShaderKey key) { "gl_CullDistance"); builder.addMemberDecoration( type_struct_in_gl_per_vertex, member_in_gl_per_vertex_cull_distance, - spv::DecorationBuiltIn, spv::BuiltInCullDistance); + spv::DecorationBuiltIn, static_cast(spv::BuiltIn::CullDistance)); } builder.addDecoration(type_struct_in_gl_per_vertex, spv::DecorationBlock); spv::Id type_array_in_gl_per_vertex = builder.makeArrayType( @@ -1063,16 +1064,16 @@ VkShaderModule VulkanPipelineCache::GetGeometryShader(GeometryShaderKey key) { builder.makeStructType(id_vector_temp, "gl_PerVertex"); builder.addMemberName(type_struct_out_gl_per_vertex, member_out_gl_per_vertex_position, "gl_Position"); - builder.addMemberDecoration(type_struct_out_gl_per_vertex, - member_out_gl_per_vertex_position, - spv::DecorationBuiltIn, spv::BuiltInPosition); + builder.addMemberDecoration( + type_struct_out_gl_per_vertex, member_out_gl_per_vertex_position, + spv::DecorationBuiltIn, static_cast(spv::BuiltIn::Position)); if (clip_distance_count) { builder.addMemberName(type_struct_out_gl_per_vertex, member_out_gl_per_vertex_clip_distance, "gl_ClipDistance"); builder.addMemberDecoration( type_struct_out_gl_per_vertex, member_out_gl_per_vertex_clip_distance, - spv::DecorationBuiltIn, spv::BuiltInClipDistance); + spv::DecorationBuiltIn, static_cast(spv::BuiltIn::ClipDistance)); } builder.addDecoration(type_struct_out_gl_per_vertex, spv::DecorationBlock); spv::Id out_gl_per_vertex = diff --git a/src/xenia/gpu/vulkan/vulkan_render_target_cache.cc b/src/xenia/gpu/vulkan/vulkan_render_target_cache.cc index adc33082c..0d0da27a2 100644 --- a/src/xenia/gpu/vulkan/vulkan_render_target_cache.cc +++ b/src/xenia/gpu/vulkan/vulkan_render_target_cache.cc @@ -21,6 +21,7 @@ #include "xenia/gpu/draw_util.h" #include "xenia/gpu/registers.h" #include "xenia/gpu/spirv_builder.h" +#include "xenia/gpu/spirv_compatibility.h" #include "xenia/gpu/spirv_shader_translator.h" #include "xenia/gpu/texture_cache.h" #include "xenia/gpu/vulkan/deferred_command_buffer.h" @@ -2288,8 +2289,7 @@ VkShaderModule VulkanRenderTargetCache::GetTransferShader( std::vector id_vector_temp; std::vector uint_vector_temp; - - SpirvBuilder builder(spv::Spv_1_0, + SpirvBuilder builder(spv::Spv_1_5, (SpirvShaderTranslator::kSpirvMagicToolId << 16) | 1, nullptr); spv::Id ext_inst_glsl_std_450 = builder.import("GLSL.std.450"); @@ -2405,7 +2405,7 @@ VkShaderModule VulkanRenderTargetCache::GetTransferShader( builder.createVariable(spv::NoPrecision, spv::StorageClassOutput, type_float, "gl_FragDepth"); builder.addDecoration(output_fragment_depth, spv::DecorationBuiltIn, - spv::BuiltInFragDepth); + static_cast(spv::BuiltIn::FragDepth)); main_interface.push_back(output_fragment_depth); if (shader_uses_stencil_reference_output) { builder.addExtension("SPV_EXT_shader_stencil_export"); @@ -2413,9 +2413,9 @@ VkShaderModule VulkanRenderTargetCache::GetTransferShader( output_fragment_stencil_ref = builder.createVariable(spv::NoPrecision, spv::StorageClassOutput, type_int, "gl_FragStencilRefARB"); - builder.addDecoration(output_fragment_stencil_ref, - spv::DecorationBuiltIn, - spv::BuiltInFragStencilRefEXT); + builder.addDecoration( + output_fragment_stencil_ref, spv::DecorationBuiltIn, + static_cast(spv::BuiltIn::FragStencilRefEXT)); main_interface.push_back(output_fragment_stencil_ref); } break; @@ -2603,7 +2603,7 @@ VkShaderModule VulkanRenderTargetCache::GetTransferShader( spv::Id input_fragment_coord = builder.createVariable( spv::NoPrecision, spv::StorageClassInput, type_float4, "gl_FragCoord"); builder.addDecoration(input_fragment_coord, spv::DecorationBuiltIn, - spv::BuiltInFragCoord); + static_cast(spv::BuiltIn::FragCoord)); main_interface.push_back(input_fragment_coord); spv::Id input_sample_id = spv::NoResult; spv::Id spec_const_sample_id = spv::NoResult; @@ -2615,7 +2615,7 @@ VkShaderModule VulkanRenderTargetCache::GetTransferShader( spv::NoPrecision, spv::StorageClassInput, type_int, "gl_SampleID"); builder.addDecoration(input_sample_id, spv::DecorationFlat); builder.addDecoration(input_sample_id, spv::DecorationBuiltIn, - spv::BuiltInSampleId); + static_cast(spv::BuiltIn::SampleId)); main_interface.push_back(input_sample_id); } else { // One sample per draw, with different sample masks. @@ -5550,7 +5550,7 @@ VkPipeline VulkanRenderTargetCache::GetDumpPipeline(DumpPipelineKey key) { std::vector id_vector_temp; - SpirvBuilder builder(spv::Spv_1_0, + SpirvBuilder builder(spv::Spv_1_5, (SpirvShaderTranslator::kSpirvMagicToolId << 16) | 1, nullptr); spv::Id ext_inst_glsl_std_450 = builder.import("GLSL.std.450"); @@ -5649,7 +5649,7 @@ VkPipeline VulkanRenderTargetCache::GetDumpPipeline(DumpPipelineKey key) { builder.createVariable(spv::NoPrecision, spv::StorageClassInput, type_uint3, "gl_GlobalInvocationID"); builder.addDecoration(input_global_invocation_id, spv::DecorationBuiltIn, - spv::BuiltInGlobalInvocationId); + static_cast(spv::BuiltIn::GlobalInvocationId)); // Begin the main function. std::vector main_param_types; diff --git a/src/xenia/ui/vulkan/premake5.lua b/src/xenia/ui/vulkan/premake5.lua index e272e1adb..9c528e3fa 100644 --- a/src/xenia/ui/vulkan/premake5.lua +++ b/src/xenia/ui/vulkan/premake5.lua @@ -12,6 +12,7 @@ project("xenia-ui-vulkan") }) includedirs({ project_root.."/third_party/Vulkan-Headers/include", + project_root.."/third_party/glslang", -- For glslang SPIRV headers }) local_platform_files() local_platform_files("functions") diff --git a/third_party/glslang b/third_party/glslang index ae2a56293..a57276bf5 160000 --- a/third_party/glslang +++ b/third_party/glslang @@ -1 +1 @@ -Subproject commit ae2a562936cc8504c9ef2757cceaff163147834f +Subproject commit a57276bf558f5cf94d3a9854ebdf5a2236849a5a diff --git a/third_party/glslang-spirv.lua b/third_party/glslang-spirv.lua index 646a83162..80811444b 100644 --- a/third_party/glslang-spirv.lua +++ b/third_party/glslang-spirv.lua @@ -4,34 +4,17 @@ project("glslang-spirv") kind("StaticLib") language("C++") - files({ - "glslang/SPIRV/bitutils.h", - "glslang/SPIRV/disassemble.cpp", - "glslang/SPIRV/disassemble.h", - "glslang/SPIRV/doc.cpp", - "glslang/SPIRV/doc.h", - "glslang/SPIRV/GLSL.ext.AMD.h", - "glslang/SPIRV/GLSL.ext.EXT.h", - "glslang/SPIRV/GLSL.ext.KHR.h", - "glslang/SPIRV/GLSL.ext.NV.h", - "glslang/SPIRV/GLSL.std.450.h", - -- Disabled because GLSL is not used. - -- "glslang/SPIRV/GlslangToSpv.cpp", - -- "glslang/SPIRV/GlslangToSpv.h", - "glslang/SPIRV/hex_float.h", - "glslang/SPIRV/InReadableOrder.cpp", - "glslang/SPIRV/Logger.cpp", - "glslang/SPIRV/Logger.h", - "glslang/SPIRV/NonSemanticDebugPrintf.h", - "glslang/SPIRV/spirv.hpp", - "glslang/SPIRV/SpvBuilder.cpp", - "glslang/SPIRV/SpvBuilder.h", - "glslang/SPIRV/spvIR.h", - -- Disabled because of spirv-tools dependency. - -- "glslang/SPIRV/SpvPostProcess.cpp", - "glslang/SPIRV/SPVRemapper.cpp", - "glslang/SPIRV/SPVRemapper.h", - -- Disabled because of spirv-tools dependency. - -- "glslang/SPIRV/SpvTools.cpp", - -- "glslang/SPIRV/SpvTools.h", + includedirs({ + "glslang", + }) + + files({ + "glslang/SPIRV/*.cpp", + "glslang/SPIRV/*.h", + "glslang/SPIRV/*.hpp11", + "glslang/glslang/Include/visibility.h", + }) + + removefiles({ + "glslang/SPIRV/GlslangToSpv.cpp", })