[Vulkan] Update glslang to 16.0.0 and introduce compat layer
This commit is contained in:
@@ -17,39 +17,44 @@ project("xenia-gpu")
|
|||||||
})
|
})
|
||||||
includedirs({
|
includedirs({
|
||||||
project_root.."/third_party/Vulkan-Headers/include",
|
project_root.."/third_party/Vulkan-Headers/include",
|
||||||
|
project_root.."/third_party/glslang", -- For glslang SPIRV headers
|
||||||
})
|
})
|
||||||
local_platform_files()
|
local_platform_files()
|
||||||
|
|
||||||
group("src")
|
if enableMiscSubprojects then
|
||||||
project("xenia-gpu-shader-compiler")
|
group("src")
|
||||||
uuid("ad76d3e4-4c62-439b-a0f6-f83fcf0e83c5")
|
project("xenia-gpu-shader-compiler")
|
||||||
kind("ConsoleApp")
|
uuid("ad76d3e4-4c62-439b-a0f6-f83fcf0e83c5")
|
||||||
language("C++")
|
kind("ConsoleApp")
|
||||||
links({
|
language("C++")
|
||||||
"dxbc",
|
links({
|
||||||
"fmt",
|
"dxbc",
|
||||||
"glslang-spirv",
|
"fmt",
|
||||||
"snappy",
|
"glslang-spirv",
|
||||||
"xenia-base",
|
"snappy",
|
||||||
"xenia-gpu",
|
"xenia-base",
|
||||||
"xenia-ui",
|
"xenia-gpu",
|
||||||
"xenia-ui-vulkan",
|
"xenia-ui",
|
||||||
})
|
"xenia-ui-vulkan",
|
||||||
includedirs({
|
})
|
||||||
project_root.."/third_party/Vulkan-Headers/include",
|
includedirs({
|
||||||
})
|
project_root.."/third_party/Vulkan-Headers/include",
|
||||||
files({
|
project_root.."/third_party/glslang", -- For glslang SPIRV headers
|
||||||
"shader_compiler_main.cc",
|
})
|
||||||
"../base/console_app_main_"..platform_suffix..".cc",
|
files({
|
||||||
})
|
"shader_compiler_main.cc",
|
||||||
|
"../base/console_app_main_"..platform_suffix..".cc",
|
||||||
|
})
|
||||||
|
|
||||||
filter("platforms:Windows")
|
filter("platforms:Windows")
|
||||||
-- Only create the .user file if it doesn't already exist.
|
-- Only create the .user file if it doesn't already exist.
|
||||||
local user_file = project_root.."/build/xenia-gpu-shader-compiler.vcxproj.user"
|
local user_file = project_root.."/build/xenia-gpu-shader-compiler.vcxproj.user"
|
||||||
if not os.isfile(user_file) then
|
if not os.isfile(user_file) then
|
||||||
debugdir(project_root)
|
debugdir(project_root)
|
||||||
debugargs({
|
debugargs({
|
||||||
"2>&1",
|
"2>&1",
|
||||||
"1>scratch/stdout-shader-compiler.txt",
|
"1>scratch/stdout-shader-compiler.txt",
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
filter({})
|
||||||
|
end
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "xenia/gpu/spirv_builder.h"
|
#include "xenia/gpu/spirv_builder.h"
|
||||||
|
|
||||||
#include "xenia/base/assert.h"
|
#include "xenia/base/assert.h"
|
||||||
|
#include "xenia/gpu/spirv_compatibility.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace gpu {
|
namespace gpu {
|
||||||
@@ -99,7 +100,8 @@ spv::Id SpirvBuilder::createTriBuiltinCall(spv::Id result_type,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpirvBuilder::IfBuilder::IfBuilder(spv::Id condition, unsigned int control,
|
SpirvBuilder::IfBuilder::IfBuilder(spv::Id condition,
|
||||||
|
spv::SelectionControlMask control,
|
||||||
SpirvBuilder& builder,
|
SpirvBuilder& builder,
|
||||||
unsigned int thenWeight,
|
unsigned int thenWeight,
|
||||||
unsigned int elseWeight)
|
unsigned int elseWeight)
|
||||||
@@ -199,9 +201,9 @@ spv::Id SpirvBuilder::IfBuilder::createMergePhi(spv::Id then_variable,
|
|||||||
getElsePhiParent());
|
getElsePhiParent());
|
||||||
}
|
}
|
||||||
|
|
||||||
SpirvBuilder::SwitchBuilder::SwitchBuilder(spv::Id selector,
|
SpirvBuilder::SwitchBuilder::SwitchBuilder(
|
||||||
unsigned int selection_control,
|
spv::Id selector, spv::SelectionControlMask selection_control,
|
||||||
SpirvBuilder& builder)
|
SpirvBuilder& builder)
|
||||||
: builder_(builder),
|
: builder_(builder),
|
||||||
selector_(selector),
|
selector_(selector),
|
||||||
selection_control_(selection_control),
|
selection_control_(selection_control),
|
||||||
|
|||||||
@@ -94,8 +94,9 @@ class SpirvBuilder : public spv::Builder {
|
|||||||
// additions over SpvBuilder::If.
|
// additions over SpvBuilder::If.
|
||||||
class IfBuilder {
|
class IfBuilder {
|
||||||
public:
|
public:
|
||||||
IfBuilder(spv::Id condition, unsigned int control, SpirvBuilder& builder,
|
IfBuilder(spv::Id condition, spv::SelectionControlMask control,
|
||||||
unsigned int thenWeight = 0, unsigned int elseWeight = 0);
|
SpirvBuilder& builder, unsigned int thenWeight = 0,
|
||||||
|
unsigned int elseWeight = 0);
|
||||||
|
|
||||||
~IfBuilder() {
|
~IfBuilder() {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
@@ -125,7 +126,7 @@ class SpirvBuilder : public spv::Builder {
|
|||||||
|
|
||||||
SpirvBuilder& builder;
|
SpirvBuilder& builder;
|
||||||
spv::Id condition;
|
spv::Id condition;
|
||||||
unsigned int control;
|
spv::SelectionControlMask control;
|
||||||
unsigned int thenWeight;
|
unsigned int thenWeight;
|
||||||
unsigned int elseWeight;
|
unsigned int elseWeight;
|
||||||
|
|
||||||
@@ -148,7 +149,7 @@ class SpirvBuilder : public spv::Builder {
|
|||||||
// block) compared to makeSwitch.
|
// block) compared to makeSwitch.
|
||||||
class SwitchBuilder {
|
class SwitchBuilder {
|
||||||
public:
|
public:
|
||||||
SwitchBuilder(spv::Id selector, unsigned int selection_control,
|
SwitchBuilder(spv::Id selector, spv::SelectionControlMask selection_control,
|
||||||
SpirvBuilder& builder);
|
SpirvBuilder& builder);
|
||||||
~SwitchBuilder() { assert_true(current_branch_ == Branch::kMerge); }
|
~SwitchBuilder() { assert_true(current_branch_ == Branch::kMerge); }
|
||||||
|
|
||||||
@@ -173,7 +174,7 @@ class SpirvBuilder : public spv::Builder {
|
|||||||
|
|
||||||
SpirvBuilder& builder_;
|
SpirvBuilder& builder_;
|
||||||
spv::Id selector_;
|
spv::Id selector_;
|
||||||
unsigned int selection_control_;
|
spv::SelectionControlMask selection_control_;
|
||||||
|
|
||||||
spv::Function& function_;
|
spv::Function& function_;
|
||||||
|
|
||||||
|
|||||||
461
src/xenia/gpu/spirv_compatibility.h
Normal file
461
src/xenia/gpu/spirv_compatibility.h
Normal file
@@ -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
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "xenia/base/assert.h"
|
#include "xenia/base/assert.h"
|
||||||
#include "xenia/base/math.h"
|
#include "xenia/base/math.h"
|
||||||
#include "xenia/base/string_buffer.h"
|
#include "xenia/base/string_buffer.h"
|
||||||
|
#include "xenia/gpu/spirv_compatibility.h"
|
||||||
#include "xenia/gpu/spirv_shader.h"
|
#include "xenia/gpu/spirv_shader.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
@@ -1193,13 +1194,13 @@ void SpirvShaderTranslator::StartVertexOrTessEvalShaderBeforeMain() {
|
|||||||
input_primitive_id_ = builder_->createVariable(
|
input_primitive_id_ = builder_->createVariable(
|
||||||
spv::NoPrecision, spv::StorageClassInput, type_int_, "gl_PrimitiveID");
|
spv::NoPrecision, spv::StorageClassInput, type_int_, "gl_PrimitiveID");
|
||||||
builder_->addDecoration(input_primitive_id_, spv::DecorationBuiltIn,
|
builder_->addDecoration(input_primitive_id_, spv::DecorationBuiltIn,
|
||||||
spv::BuiltInPrimitiveId);
|
static_cast<int>(spv::BuiltIn::PrimitiveId));
|
||||||
main_interface_.push_back(input_primitive_id_);
|
main_interface_.push_back(input_primitive_id_);
|
||||||
} else {
|
} else {
|
||||||
input_vertex_index_ = builder_->createVariable(
|
input_vertex_index_ = builder_->createVariable(
|
||||||
spv::NoPrecision, spv::StorageClassInput, type_int_, "gl_VertexIndex");
|
spv::NoPrecision, spv::StorageClassInput, type_int_, "gl_VertexIndex");
|
||||||
builder_->addDecoration(input_vertex_index_, spv::DecorationBuiltIn,
|
builder_->addDecoration(input_vertex_index_, spv::DecorationBuiltIn,
|
||||||
spv::BuiltInVertexIndex);
|
static_cast<int>(spv::BuiltIn::VertexIndex));
|
||||||
main_interface_.push_back(input_vertex_index_);
|
main_interface_.push_back(input_vertex_index_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1262,9 +1263,9 @@ void SpirvShaderTranslator::StartVertexOrTessEvalShaderBeforeMain() {
|
|||||||
builder_->makeStructType(struct_per_vertex_members, "gl_PerVertex");
|
builder_->makeStructType(struct_per_vertex_members, "gl_PerVertex");
|
||||||
builder_->addMemberName(type_struct_per_vertex,
|
builder_->addMemberName(type_struct_per_vertex,
|
||||||
kOutputPerVertexMemberPosition, "gl_Position");
|
kOutputPerVertexMemberPosition, "gl_Position");
|
||||||
builder_->addMemberDecoration(type_struct_per_vertex,
|
builder_->addMemberDecoration(
|
||||||
kOutputPerVertexMemberPosition,
|
type_struct_per_vertex, kOutputPerVertexMemberPosition,
|
||||||
spv::DecorationBuiltIn, spv::BuiltInPosition);
|
spv::DecorationBuiltIn, static_cast<int>(spv::BuiltIn::Position));
|
||||||
builder_->addDecoration(type_struct_per_vertex, spv::DecorationBlock);
|
builder_->addDecoration(type_struct_per_vertex, spv::DecorationBlock);
|
||||||
output_per_vertex_ = builder_->createVariable(
|
output_per_vertex_ = builder_->createVariable(
|
||||||
spv::NoPrecision, spv::StorageClassOutput, type_struct_per_vertex, "");
|
spv::NoPrecision, spv::StorageClassOutput, type_struct_per_vertex, "");
|
||||||
@@ -1861,7 +1862,7 @@ void SpirvShaderTranslator::StartFragmentShaderBeforeMain() {
|
|||||||
input_fragment_coordinates_ = builder_->createVariable(
|
input_fragment_coordinates_ = builder_->createVariable(
|
||||||
spv::NoPrecision, spv::StorageClassInput, type_float4_, "gl_FragCoord");
|
spv::NoPrecision, spv::StorageClassInput, type_float4_, "gl_FragCoord");
|
||||||
builder_->addDecoration(input_fragment_coordinates_, spv::DecorationBuiltIn,
|
builder_->addDecoration(input_fragment_coordinates_, spv::DecorationBuiltIn,
|
||||||
spv::BuiltInFragCoord);
|
static_cast<int>(spv::BuiltIn::FragCoord));
|
||||||
main_interface_.push_back(input_fragment_coordinates_);
|
main_interface_.push_back(input_fragment_coordinates_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1872,7 +1873,7 @@ void SpirvShaderTranslator::StartFragmentShaderBeforeMain() {
|
|||||||
input_front_facing_ = builder_->createVariable(
|
input_front_facing_ = builder_->createVariable(
|
||||||
spv::NoPrecision, spv::StorageClassInput, type_bool_, "gl_FrontFacing");
|
spv::NoPrecision, spv::StorageClassInput, type_bool_, "gl_FrontFacing");
|
||||||
builder_->addDecoration(input_front_facing_, spv::DecorationBuiltIn,
|
builder_->addDecoration(input_front_facing_, spv::DecorationBuiltIn,
|
||||||
spv::BuiltInFrontFacing);
|
static_cast<int>(spv::BuiltIn::FrontFacing));
|
||||||
main_interface_.push_back(input_front_facing_);
|
main_interface_.push_back(input_front_facing_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1886,7 +1887,7 @@ void SpirvShaderTranslator::StartFragmentShaderBeforeMain() {
|
|||||||
"gl_SampleMaskIn");
|
"gl_SampleMaskIn");
|
||||||
builder_->addDecoration(input_sample_mask_, spv::DecorationFlat);
|
builder_->addDecoration(input_sample_mask_, spv::DecorationFlat);
|
||||||
builder_->addDecoration(input_sample_mask_, spv::DecorationBuiltIn,
|
builder_->addDecoration(input_sample_mask_, spv::DecorationBuiltIn,
|
||||||
spv::BuiltInSampleMask);
|
static_cast<int>(spv::BuiltIn::SampleMask));
|
||||||
main_interface_.push_back(input_sample_mask_);
|
main_interface_.push_back(input_sample_mask_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "third_party/glslang/SPIRV/GLSL.std.450.h"
|
#include "third_party/glslang/SPIRV/GLSL.std.450.h"
|
||||||
#include "xenia/base/assert.h"
|
#include "xenia/base/assert.h"
|
||||||
#include "xenia/base/math.h"
|
#include "xenia/base/math.h"
|
||||||
|
#include "xenia/gpu/spirv_compatibility.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace gpu {
|
namespace gpu {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "third_party/glslang/SPIRV/GLSL.std.450.h"
|
#include "third_party/glslang/SPIRV/GLSL.std.450.h"
|
||||||
#include "xenia/base/assert.h"
|
#include "xenia/base/assert.h"
|
||||||
#include "xenia/base/math.h"
|
#include "xenia/base/math.h"
|
||||||
|
#include "xenia/gpu/spirv_compatibility.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace gpu {
|
namespace gpu {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "third_party/glslang/SPIRV/GLSL.std.450.h"
|
#include "third_party/glslang/SPIRV/GLSL.std.450.h"
|
||||||
#include "xenia/base/assert.h"
|
#include "xenia/base/assert.h"
|
||||||
#include "xenia/base/math.h"
|
#include "xenia/base/math.h"
|
||||||
|
#include "xenia/gpu/spirv_compatibility.h"
|
||||||
#include "xenia/gpu/ucode.h"
|
#include "xenia/gpu/ucode.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "xenia/base/math.h"
|
#include "xenia/base/math.h"
|
||||||
#include "xenia/gpu/draw_util.h"
|
#include "xenia/gpu/draw_util.h"
|
||||||
#include "xenia/gpu/render_target_cache.h"
|
#include "xenia/gpu/render_target_cache.h"
|
||||||
|
#include "xenia/gpu/spirv_compatibility.h"
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace gpu {
|
namespace gpu {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ project("xenia-gpu-vulkan")
|
|||||||
})
|
})
|
||||||
includedirs({
|
includedirs({
|
||||||
project_root.."/third_party/Vulkan-Headers/include",
|
project_root.."/third_party/Vulkan-Headers/include",
|
||||||
|
project_root.."/third_party/glslang", -- For glslang SPIRV headers
|
||||||
})
|
})
|
||||||
local_platform_files()
|
local_platform_files()
|
||||||
files({
|
files({
|
||||||
@@ -60,6 +61,7 @@ if enableMiscSubprojects then
|
|||||||
})
|
})
|
||||||
includedirs({
|
includedirs({
|
||||||
project_root.."/third_party/Vulkan-Headers/include",
|
project_root.."/third_party/Vulkan-Headers/include",
|
||||||
|
project_root.."/third_party/glslang", -- For glslang SPIRV headers
|
||||||
})
|
})
|
||||||
files({
|
files({
|
||||||
"vulkan_trace_viewer_main.cc",
|
"vulkan_trace_viewer_main.cc",
|
||||||
@@ -125,6 +127,7 @@ if enableMiscSubprojects then
|
|||||||
})
|
})
|
||||||
includedirs({
|
includedirs({
|
||||||
project_root.."/third_party/Vulkan-Headers/include",
|
project_root.."/third_party/Vulkan-Headers/include",
|
||||||
|
project_root.."/third_party/glslang", -- For glslang SPIRV headers
|
||||||
})
|
})
|
||||||
files({
|
files({
|
||||||
"vulkan_trace_dump_main.cc",
|
"vulkan_trace_dump_main.cc",
|
||||||
@@ -153,4 +156,4 @@ if enableMiscSubprojects then
|
|||||||
"1>scratch/stdout-trace-dump.txt",
|
"1>scratch/stdout-trace-dump.txt",
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include "xenia/gpu/register_file.h"
|
#include "xenia/gpu/register_file.h"
|
||||||
#include "xenia/gpu/registers.h"
|
#include "xenia/gpu/registers.h"
|
||||||
#include "xenia/gpu/spirv_builder.h"
|
#include "xenia/gpu/spirv_builder.h"
|
||||||
|
#include "xenia/gpu/spirv_compatibility.h"
|
||||||
#include "xenia/gpu/spirv_shader_translator.h"
|
#include "xenia/gpu/spirv_shader_translator.h"
|
||||||
#include "xenia/gpu/vulkan/vulkan_command_processor.h"
|
#include "xenia/gpu/vulkan/vulkan_command_processor.h"
|
||||||
#include "xenia/gpu/vulkan/vulkan_shader.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.user_clip_plane_cull ? key.user_clip_plane_count : 0) +
|
||||||
key.has_vertex_kill_and;
|
key.has_vertex_kill_and;
|
||||||
|
|
||||||
SpirvBuilder builder(spv::Spv_1_0,
|
SpirvBuilder builder(spv::Spv_1_5,
|
||||||
(SpirvShaderTranslator::kSpirvMagicToolId << 16) | 1,
|
(SpirvShaderTranslator::kSpirvMagicToolId << 16) | 1,
|
||||||
nullptr);
|
nullptr);
|
||||||
spv::Id ext_inst_glsl_std_450 = builder.import("GLSL.std.450");
|
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.makeStructType(id_vector_temp, "gl_PerVertex");
|
||||||
builder.addMemberName(type_struct_in_gl_per_vertex,
|
builder.addMemberName(type_struct_in_gl_per_vertex,
|
||||||
member_in_gl_per_vertex_position, "gl_Position");
|
member_in_gl_per_vertex_position, "gl_Position");
|
||||||
builder.addMemberDecoration(type_struct_in_gl_per_vertex,
|
builder.addMemberDecoration(
|
||||||
member_in_gl_per_vertex_position,
|
type_struct_in_gl_per_vertex, member_in_gl_per_vertex_position,
|
||||||
spv::DecorationBuiltIn, spv::BuiltInPosition);
|
spv::DecorationBuiltIn, static_cast<int>(spv::BuiltIn::Position));
|
||||||
if (clip_distance_count) {
|
if (clip_distance_count) {
|
||||||
builder.addMemberName(type_struct_in_gl_per_vertex,
|
builder.addMemberName(type_struct_in_gl_per_vertex,
|
||||||
member_in_gl_per_vertex_clip_distance,
|
member_in_gl_per_vertex_clip_distance,
|
||||||
"gl_ClipDistance");
|
"gl_ClipDistance");
|
||||||
builder.addMemberDecoration(
|
builder.addMemberDecoration(
|
||||||
type_struct_in_gl_per_vertex, member_in_gl_per_vertex_clip_distance,
|
type_struct_in_gl_per_vertex, member_in_gl_per_vertex_clip_distance,
|
||||||
spv::DecorationBuiltIn, spv::BuiltInClipDistance);
|
spv::DecorationBuiltIn, static_cast<int>(spv::BuiltIn::ClipDistance));
|
||||||
}
|
}
|
||||||
if (cull_distance_count) {
|
if (cull_distance_count) {
|
||||||
builder.addMemberName(type_struct_in_gl_per_vertex,
|
builder.addMemberName(type_struct_in_gl_per_vertex,
|
||||||
@@ -972,7 +973,7 @@ VkShaderModule VulkanPipelineCache::GetGeometryShader(GeometryShaderKey key) {
|
|||||||
"gl_CullDistance");
|
"gl_CullDistance");
|
||||||
builder.addMemberDecoration(
|
builder.addMemberDecoration(
|
||||||
type_struct_in_gl_per_vertex, member_in_gl_per_vertex_cull_distance,
|
type_struct_in_gl_per_vertex, member_in_gl_per_vertex_cull_distance,
|
||||||
spv::DecorationBuiltIn, spv::BuiltInCullDistance);
|
spv::DecorationBuiltIn, static_cast<int>(spv::BuiltIn::CullDistance));
|
||||||
}
|
}
|
||||||
builder.addDecoration(type_struct_in_gl_per_vertex, spv::DecorationBlock);
|
builder.addDecoration(type_struct_in_gl_per_vertex, spv::DecorationBlock);
|
||||||
spv::Id type_array_in_gl_per_vertex = builder.makeArrayType(
|
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.makeStructType(id_vector_temp, "gl_PerVertex");
|
||||||
builder.addMemberName(type_struct_out_gl_per_vertex,
|
builder.addMemberName(type_struct_out_gl_per_vertex,
|
||||||
member_out_gl_per_vertex_position, "gl_Position");
|
member_out_gl_per_vertex_position, "gl_Position");
|
||||||
builder.addMemberDecoration(type_struct_out_gl_per_vertex,
|
builder.addMemberDecoration(
|
||||||
member_out_gl_per_vertex_position,
|
type_struct_out_gl_per_vertex, member_out_gl_per_vertex_position,
|
||||||
spv::DecorationBuiltIn, spv::BuiltInPosition);
|
spv::DecorationBuiltIn, static_cast<int>(spv::BuiltIn::Position));
|
||||||
if (clip_distance_count) {
|
if (clip_distance_count) {
|
||||||
builder.addMemberName(type_struct_out_gl_per_vertex,
|
builder.addMemberName(type_struct_out_gl_per_vertex,
|
||||||
member_out_gl_per_vertex_clip_distance,
|
member_out_gl_per_vertex_clip_distance,
|
||||||
"gl_ClipDistance");
|
"gl_ClipDistance");
|
||||||
builder.addMemberDecoration(
|
builder.addMemberDecoration(
|
||||||
type_struct_out_gl_per_vertex, member_out_gl_per_vertex_clip_distance,
|
type_struct_out_gl_per_vertex, member_out_gl_per_vertex_clip_distance,
|
||||||
spv::DecorationBuiltIn, spv::BuiltInClipDistance);
|
spv::DecorationBuiltIn, static_cast<int>(spv::BuiltIn::ClipDistance));
|
||||||
}
|
}
|
||||||
builder.addDecoration(type_struct_out_gl_per_vertex, spv::DecorationBlock);
|
builder.addDecoration(type_struct_out_gl_per_vertex, spv::DecorationBlock);
|
||||||
spv::Id out_gl_per_vertex =
|
spv::Id out_gl_per_vertex =
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "xenia/gpu/draw_util.h"
|
#include "xenia/gpu/draw_util.h"
|
||||||
#include "xenia/gpu/registers.h"
|
#include "xenia/gpu/registers.h"
|
||||||
#include "xenia/gpu/spirv_builder.h"
|
#include "xenia/gpu/spirv_builder.h"
|
||||||
|
#include "xenia/gpu/spirv_compatibility.h"
|
||||||
#include "xenia/gpu/spirv_shader_translator.h"
|
#include "xenia/gpu/spirv_shader_translator.h"
|
||||||
#include "xenia/gpu/texture_cache.h"
|
#include "xenia/gpu/texture_cache.h"
|
||||||
#include "xenia/gpu/vulkan/deferred_command_buffer.h"
|
#include "xenia/gpu/vulkan/deferred_command_buffer.h"
|
||||||
@@ -2288,8 +2289,7 @@ VkShaderModule VulkanRenderTargetCache::GetTransferShader(
|
|||||||
|
|
||||||
std::vector<spv::Id> id_vector_temp;
|
std::vector<spv::Id> id_vector_temp;
|
||||||
std::vector<unsigned int> uint_vector_temp;
|
std::vector<unsigned int> uint_vector_temp;
|
||||||
|
SpirvBuilder builder(spv::Spv_1_5,
|
||||||
SpirvBuilder builder(spv::Spv_1_0,
|
|
||||||
(SpirvShaderTranslator::kSpirvMagicToolId << 16) | 1,
|
(SpirvShaderTranslator::kSpirvMagicToolId << 16) | 1,
|
||||||
nullptr);
|
nullptr);
|
||||||
spv::Id ext_inst_glsl_std_450 = builder.import("GLSL.std.450");
|
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,
|
builder.createVariable(spv::NoPrecision, spv::StorageClassOutput,
|
||||||
type_float, "gl_FragDepth");
|
type_float, "gl_FragDepth");
|
||||||
builder.addDecoration(output_fragment_depth, spv::DecorationBuiltIn,
|
builder.addDecoration(output_fragment_depth, spv::DecorationBuiltIn,
|
||||||
spv::BuiltInFragDepth);
|
static_cast<int>(spv::BuiltIn::FragDepth));
|
||||||
main_interface.push_back(output_fragment_depth);
|
main_interface.push_back(output_fragment_depth);
|
||||||
if (shader_uses_stencil_reference_output) {
|
if (shader_uses_stencil_reference_output) {
|
||||||
builder.addExtension("SPV_EXT_shader_stencil_export");
|
builder.addExtension("SPV_EXT_shader_stencil_export");
|
||||||
@@ -2413,9 +2413,9 @@ VkShaderModule VulkanRenderTargetCache::GetTransferShader(
|
|||||||
output_fragment_stencil_ref =
|
output_fragment_stencil_ref =
|
||||||
builder.createVariable(spv::NoPrecision, spv::StorageClassOutput,
|
builder.createVariable(spv::NoPrecision, spv::StorageClassOutput,
|
||||||
type_int, "gl_FragStencilRefARB");
|
type_int, "gl_FragStencilRefARB");
|
||||||
builder.addDecoration(output_fragment_stencil_ref,
|
builder.addDecoration(
|
||||||
spv::DecorationBuiltIn,
|
output_fragment_stencil_ref, spv::DecorationBuiltIn,
|
||||||
spv::BuiltInFragStencilRefEXT);
|
static_cast<int>(spv::BuiltIn::FragStencilRefEXT));
|
||||||
main_interface.push_back(output_fragment_stencil_ref);
|
main_interface.push_back(output_fragment_stencil_ref);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -2603,7 +2603,7 @@ VkShaderModule VulkanRenderTargetCache::GetTransferShader(
|
|||||||
spv::Id input_fragment_coord = builder.createVariable(
|
spv::Id input_fragment_coord = builder.createVariable(
|
||||||
spv::NoPrecision, spv::StorageClassInput, type_float4, "gl_FragCoord");
|
spv::NoPrecision, spv::StorageClassInput, type_float4, "gl_FragCoord");
|
||||||
builder.addDecoration(input_fragment_coord, spv::DecorationBuiltIn,
|
builder.addDecoration(input_fragment_coord, spv::DecorationBuiltIn,
|
||||||
spv::BuiltInFragCoord);
|
static_cast<int>(spv::BuiltIn::FragCoord));
|
||||||
main_interface.push_back(input_fragment_coord);
|
main_interface.push_back(input_fragment_coord);
|
||||||
spv::Id input_sample_id = spv::NoResult;
|
spv::Id input_sample_id = spv::NoResult;
|
||||||
spv::Id spec_const_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");
|
spv::NoPrecision, spv::StorageClassInput, type_int, "gl_SampleID");
|
||||||
builder.addDecoration(input_sample_id, spv::DecorationFlat);
|
builder.addDecoration(input_sample_id, spv::DecorationFlat);
|
||||||
builder.addDecoration(input_sample_id, spv::DecorationBuiltIn,
|
builder.addDecoration(input_sample_id, spv::DecorationBuiltIn,
|
||||||
spv::BuiltInSampleId);
|
static_cast<int>(spv::BuiltIn::SampleId));
|
||||||
main_interface.push_back(input_sample_id);
|
main_interface.push_back(input_sample_id);
|
||||||
} else {
|
} else {
|
||||||
// One sample per draw, with different sample masks.
|
// One sample per draw, with different sample masks.
|
||||||
@@ -5550,7 +5550,7 @@ VkPipeline VulkanRenderTargetCache::GetDumpPipeline(DumpPipelineKey key) {
|
|||||||
|
|
||||||
std::vector<spv::Id> id_vector_temp;
|
std::vector<spv::Id> id_vector_temp;
|
||||||
|
|
||||||
SpirvBuilder builder(spv::Spv_1_0,
|
SpirvBuilder builder(spv::Spv_1_5,
|
||||||
(SpirvShaderTranslator::kSpirvMagicToolId << 16) | 1,
|
(SpirvShaderTranslator::kSpirvMagicToolId << 16) | 1,
|
||||||
nullptr);
|
nullptr);
|
||||||
spv::Id ext_inst_glsl_std_450 = builder.import("GLSL.std.450");
|
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,
|
builder.createVariable(spv::NoPrecision, spv::StorageClassInput,
|
||||||
type_uint3, "gl_GlobalInvocationID");
|
type_uint3, "gl_GlobalInvocationID");
|
||||||
builder.addDecoration(input_global_invocation_id, spv::DecorationBuiltIn,
|
builder.addDecoration(input_global_invocation_id, spv::DecorationBuiltIn,
|
||||||
spv::BuiltInGlobalInvocationId);
|
static_cast<int>(spv::BuiltIn::GlobalInvocationId));
|
||||||
|
|
||||||
// Begin the main function.
|
// Begin the main function.
|
||||||
std::vector<spv::Id> main_param_types;
|
std::vector<spv::Id> main_param_types;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ project("xenia-ui-vulkan")
|
|||||||
})
|
})
|
||||||
includedirs({
|
includedirs({
|
||||||
project_root.."/third_party/Vulkan-Headers/include",
|
project_root.."/third_party/Vulkan-Headers/include",
|
||||||
|
project_root.."/third_party/glslang", -- For glslang SPIRV headers
|
||||||
})
|
})
|
||||||
local_platform_files()
|
local_platform_files()
|
||||||
local_platform_files("functions")
|
local_platform_files("functions")
|
||||||
|
|||||||
2
third_party/glslang
vendored
2
third_party/glslang
vendored
Submodule third_party/glslang updated: ae2a562936...a57276bf55
43
third_party/glslang-spirv.lua
vendored
43
third_party/glslang-spirv.lua
vendored
@@ -4,34 +4,17 @@ project("glslang-spirv")
|
|||||||
kind("StaticLib")
|
kind("StaticLib")
|
||||||
language("C++")
|
language("C++")
|
||||||
|
|
||||||
files({
|
includedirs({
|
||||||
"glslang/SPIRV/bitutils.h",
|
"glslang",
|
||||||
"glslang/SPIRV/disassemble.cpp",
|
})
|
||||||
"glslang/SPIRV/disassemble.h",
|
|
||||||
"glslang/SPIRV/doc.cpp",
|
files({
|
||||||
"glslang/SPIRV/doc.h",
|
"glslang/SPIRV/*.cpp",
|
||||||
"glslang/SPIRV/GLSL.ext.AMD.h",
|
"glslang/SPIRV/*.h",
|
||||||
"glslang/SPIRV/GLSL.ext.EXT.h",
|
"glslang/SPIRV/*.hpp11",
|
||||||
"glslang/SPIRV/GLSL.ext.KHR.h",
|
"glslang/glslang/Include/visibility.h",
|
||||||
"glslang/SPIRV/GLSL.ext.NV.h",
|
})
|
||||||
"glslang/SPIRV/GLSL.std.450.h",
|
|
||||||
-- Disabled because GLSL is not used.
|
removefiles({
|
||||||
-- "glslang/SPIRV/GlslangToSpv.cpp",
|
"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",
|
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user