mirror of
https://github.com/shadps4-emu/sirit.git
synced 2026-01-31 00:55:22 +01:00
Add SPV_AMD_shader_explicit_vertex_parameter
This commit is contained in:
@@ -1428,8 +1428,8 @@ public:
|
||||
/// 3) store the New Value back through Pointer.
|
||||
Id OpAtomicXor(Id result_type, Id pointer, Id memory, Id semantics, Id value);
|
||||
|
||||
// Print a message for vulkan layers to use, e.g. renderdoc
|
||||
// Usage is like C printf
|
||||
/// Print a message for vulkan layers to use, e.g. renderdoc
|
||||
/// Usage is like C printf
|
||||
Id OpDebugPrintf(Id fmt, std::span<const Id> fmt_args);
|
||||
|
||||
/// Returns a two-component floating point vector that represents the 2D texture coordinates
|
||||
@@ -1476,11 +1476,15 @@ public:
|
||||
/// Result is the middle of x, y, and z, interpreted as signed integers.
|
||||
Id OpSMid3AMD(Id result_type, Id x, Id y, Id z);
|
||||
|
||||
/// Returns the value of the input <interpolant> without any interpolation, i.e. the raw output value of previous shader stage.
|
||||
Id OpInterpolateAtVertexAMD(Id result_type, Id interpolant, Id vertex_index);
|
||||
|
||||
private:
|
||||
Id GetGLSLstd450();
|
||||
Id GetNonSemanticDebugPrintf();
|
||||
Id GetAmdGcnShader();
|
||||
Id GetAmdShaderTrinaryMinMax();
|
||||
Id GetAmdExplicitVertexParameter();
|
||||
|
||||
std::uint32_t version{};
|
||||
std::uint32_t bound{};
|
||||
@@ -1491,6 +1495,7 @@ private:
|
||||
std::optional<Id> non_semantic_debug_printf;
|
||||
std::optional<Id> amd_gcn_shader;
|
||||
std::optional<Id> amd_shader_trinary_minmax;
|
||||
std::optional<Id> amd_explicit_vertex_parameter;
|
||||
|
||||
spv::AddressingModel addressing_model{spv::AddressingModel::Logical};
|
||||
spv::MemoryModel memory_model{spv::MemoryModel::GLSL450};
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <iterator>
|
||||
#include <spirv/unified1/AMD_gcn_shader.h>
|
||||
#include <spirv/unified1/AMD_shader_trinary_minmax.h>
|
||||
#include <spirv/unified1/AMD_shader_explicit_vertex_parameter.h>
|
||||
#include <spirv/unified1/GLSL.std.450.h>
|
||||
#include <spirv/unified1/NonSemanticDebugPrintf.h>
|
||||
|
||||
@@ -110,6 +111,8 @@ DEFINE_UNARY(GetAmdGcnShader(), OpCubeFaceCoordAMD, AMD_gcn_shaderCubeFaceCoordA
|
||||
DEFINE_UNARY(GetAmdGcnShader(), OpCubeFaceIndexAMD, AMD_gcn_shaderCubeFaceIndexAMD)
|
||||
DEFINE_NULLARY(GetAmdGcnShader(), OpTimeAMD, AMD_gcn_shaderTimeAMD)
|
||||
|
||||
DEFINE_BINARY(GetAmdExplicitVertexParameter(), OpInterpolateAtVertexAMD, AMD_shader_explicit_vertex_parameterInterpolateAtVertexAMD)
|
||||
|
||||
DEFINE_TRINARY(GetAmdShaderTrinaryMinMax(), OpFMin3AMD, AMD_shader_trinary_minmaxFMin3AMD)
|
||||
DEFINE_TRINARY(GetAmdShaderTrinaryMinMax(), OpUMin3AMD, AMD_shader_trinary_minmaxUMin3AMD)
|
||||
DEFINE_TRINARY(GetAmdShaderTrinaryMinMax(), OpSMin3AMD, AMD_shader_trinary_minmaxSMin3AMD)
|
||||
@@ -120,4 +123,5 @@ DEFINE_TRINARY(GetAmdShaderTrinaryMinMax(), OpFMid3AMD, AMD_shader_trinary_minma
|
||||
DEFINE_TRINARY(GetAmdShaderTrinaryMinMax(), OpUMid3AMD, AMD_shader_trinary_minmaxUMid3AMD)
|
||||
DEFINE_TRINARY(GetAmdShaderTrinaryMinMax(), OpSMid3AMD, AMD_shader_trinary_minmaxSMid3AMD)
|
||||
|
||||
|
||||
} // namespace Sirit
|
||||
|
||||
@@ -175,4 +175,15 @@ Id Module::GetAmdShaderTrinaryMinMax() {
|
||||
return *amd_shader_trinary_minmax;
|
||||
}
|
||||
|
||||
|
||||
Id Module::GetAmdExplicitVertexParameter() {
|
||||
const char* extname = "SPV_AMD_shader_explicit_vertex_parameter";
|
||||
size_t len = WordsInString(extname);
|
||||
if (!amd_explicit_vertex_parameter) {
|
||||
ext_inst_imports->Reserve(3 + len);
|
||||
amd_explicit_vertex_parameter = *ext_inst_imports << OpId{spv::Op::OpExtInstImport} << extname << EndOp{};
|
||||
}
|
||||
return *amd_explicit_vertex_parameter;
|
||||
}
|
||||
|
||||
} // namespace Sirit
|
||||
|
||||
Reference in New Issue
Block a user