#include "libANGLE/renderer/vulkan/spv_utils.h"
#include <array>
#include <cctype>
#include <numeric>
#include "common/FixedVector.h"
#include "common/spirv/spirv_instruction_builder_autogen.h"
#include "common/spirv/spirv_instruction_parser_autogen.h"
#include "common/string_utils.h"
#include "common/utilities.h"
#include "libANGLE/Caps.h"
#include "libANGLE/ProgramLinkedResources.h"
#include "libANGLE/renderer/vulkan/ShaderInterfaceVariableInfoMap.h"
#include "libANGLE/renderer/vulkan/vk_cache_utils.h"
#include "libANGLE/trace.h"
spirv;
namespace rx
{
namespace
{
bool UniformNameIsIndexZero(const std::string &name)
{ … }
uint32_t SpvIsXfbBufferBlockId(spirv::IdRef id)
{ … }
template <typename OutputIter, typename ImplicitIter>
uint32_t CountExplicitOutputs(OutputIter outputsBegin,
OutputIter outputsEnd,
ImplicitIter implicitsBegin,
ImplicitIter implicitsEnd)
{ … }
ShaderInterfaceVariableInfo *AddResourceInfoToAllStages(ShaderInterfaceVariableInfoMap *infoMap,
gl::ShaderType shaderType,
uint32_t varId,
uint32_t descriptorSet,
uint32_t binding)
{ … }
ShaderInterfaceVariableInfo *AddResourceInfo(ShaderInterfaceVariableInfoMap *infoMap,
gl::ShaderBitSet stages,
gl::ShaderType shaderType,
uint32_t varId,
uint32_t descriptorSet,
uint32_t binding)
{ … }
ShaderInterfaceVariableInfo *AddLocationInfo(ShaderInterfaceVariableInfoMap *infoMap,
gl::ShaderType shaderType,
uint32_t varId,
uint32_t location,
uint32_t component,
uint8_t attributeComponentCount,
uint8_t attributeLocationCount)
{ … }
void AddVaryingLocationInfo(ShaderInterfaceVariableInfoMap *infoMap,
const gl::VaryingInShaderRef &ref,
const uint32_t location,
const uint32_t component)
{ … }
void SetXfbInfo(ShaderInterfaceVariableInfoMap *infoMap,
gl::ShaderType shaderType,
uint32_t varId,
int fieldIndex,
uint32_t xfbBuffer,
uint32_t xfbOffset,
uint32_t xfbStride,
uint32_t arraySize,
uint32_t columnCount,
uint32_t rowCount,
uint32_t arrayIndex,
GLenum componentType)
{ … }
void AssignTransformFeedbackEmulationBindings(gl::ShaderType shaderType,
const gl::ProgramExecutable &programExecutable,
bool isTransformFeedbackStage,
SpvProgramInterfaceInfo *programInterfaceInfo,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
bool IsFirstRegisterOfVarying(const gl::PackedVaryingRegister &varyingReg,
bool allowFields,
uint32_t expectArrayIndex)
{ … }
void AssignAttributeLocations(const gl::ProgramExecutable &programExecutable,
gl::ShaderType shaderType,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void AssignSecondaryOutputLocations(const gl::ProgramExecutable &programExecutable,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void AssignOutputLocations(const gl::ProgramExecutable &programExecutable,
const gl::ShaderType shaderType,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void AssignVaryingLocations(const SpvSourceOptions &options,
const gl::VaryingPacking &varyingPacking,
const gl::ShaderType shaderType,
const gl::ShaderType frontShaderType,
SpvProgramInterfaceInfo *programInterfaceInfo,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void AssignTransformFeedbackQualifiers(const gl::ProgramExecutable &programExecutable,
const gl::VaryingPacking &varyingPacking,
const gl::ShaderType shaderType,
bool usesExtension,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void AssignUniformBindings(const SpvSourceOptions &options,
const gl::ProgramExecutable &programExecutable,
SpvProgramInterfaceInfo *programInterfaceInfo,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void AssignInputAttachmentBindings(const SpvSourceOptions &options,
const gl::ProgramExecutable &programExecutable,
SpvProgramInterfaceInfo *programInterfaceInfo,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void AssignInterfaceBlockBindings(const SpvSourceOptions &options,
const gl::ProgramExecutable &programExecutable,
const std::vector<gl::InterfaceBlock> &blocks,
SpvProgramInterfaceInfo *programInterfaceInfo,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void AssignAtomicCounterBufferBindings(const SpvSourceOptions &options,
const gl::ProgramExecutable &programExecutable,
SpvProgramInterfaceInfo *programInterfaceInfo,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void AssignImageBindings(const SpvSourceOptions &options,
const gl::ProgramExecutable &programExecutable,
SpvProgramInterfaceInfo *programInterfaceInfo,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void AssignNonTextureBindings(const SpvSourceOptions &options,
const gl::ProgramExecutable &programExecutable,
SpvProgramInterfaceInfo *programInterfaceInfo,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void AssignTextureBindings(const SpvSourceOptions &options,
const gl::ProgramExecutable &programExecutable,
SpvProgramInterfaceInfo *programInterfaceInfo,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
bool IsNonSemanticInstruction(const uint32_t *instruction)
{ … }
enum class EntryPointList
{ … };
class SpirvTransformerBase : angle::NonCopyable
{ … };
void SpirvTransformerBase::onTransformBegin()
{ … }
const uint32_t *SpirvTransformerBase::getCurrentInstruction(spv::Op *opCodeOut,
uint32_t *wordCountOut) const
{ … }
void SpirvTransformerBase::copyInstruction(const uint32_t *instruction, size_t wordCount)
{ … }
spirv::IdRef SpirvTransformerBase::GetNewId(spirv::Blob *blob)
{ … }
spirv::IdRef SpirvTransformerBase::getNewId()
{ … }
enum class TransformationState
{ … };
class SpirvNonSemanticInstructions final : angle::NonCopyable
{ … };
bool SpirvNonSemanticInstructions::visitExtInst(const uint32_t *instruction,
sh::vk::spirv::NonSemanticInstruction *instOut)
{ … }
TransformationState SpirvNonSemanticInstructions::transformExtInst(const uint32_t *instruction)
{ … }
namespace ID
{
namespace
{
[[maybe_unused]] constexpr spirv::IdRef EntryPoint(sh::vk::spirv::kIdEntryPoint);
[[maybe_unused]] constexpr spirv::IdRef Void(sh::vk::spirv::kIdVoid);
[[maybe_unused]] constexpr spirv::IdRef Float(sh::vk::spirv::kIdFloat);
[[maybe_unused]] constexpr spirv::IdRef Vec2(sh::vk::spirv::kIdVec2);
[[maybe_unused]] constexpr spirv::IdRef Vec3(sh::vk::spirv::kIdVec3);
[[maybe_unused]] constexpr spirv::IdRef Vec4(sh::vk::spirv::kIdVec4);
[[maybe_unused]] constexpr spirv::IdRef Mat2(sh::vk::spirv::kIdMat2);
[[maybe_unused]] constexpr spirv::IdRef Mat3(sh::vk::spirv::kIdMat3);
[[maybe_unused]] constexpr spirv::IdRef Mat4(sh::vk::spirv::kIdMat4);
[[maybe_unused]] constexpr spirv::IdRef Int(sh::vk::spirv::kIdInt);
[[maybe_unused]] constexpr spirv::IdRef IVec4(sh::vk::spirv::kIdIVec4);
[[maybe_unused]] constexpr spirv::IdRef Uint(sh::vk::spirv::kIdUint);
[[maybe_unused]] constexpr spirv::IdRef IntZero(sh::vk::spirv::kIdIntZero);
[[maybe_unused]] constexpr spirv::IdRef IntOne(sh::vk::spirv::kIdIntOne);
[[maybe_unused]] constexpr spirv::IdRef IntTwo(sh::vk::spirv::kIdIntTwo);
[[maybe_unused]] constexpr spirv::IdRef IntThree(sh::vk::spirv::kIdIntThree);
[[maybe_unused]] constexpr spirv::IdRef IntInputTypePointer(sh::vk::spirv::kIdIntInputTypePointer);
[[maybe_unused]] constexpr spirv::IdRef Vec4OutputTypePointer(
sh::vk::spirv::kIdVec4OutputTypePointer);
[[maybe_unused]] constexpr spirv::IdRef IVec4FunctionTypePointer(
sh::vk::spirv::kIdIVec4FunctionTypePointer);
[[maybe_unused]] constexpr spirv::IdRef OutputPerVertexTypePointer(
sh::vk::spirv::kIdOutputPerVertexTypePointer);
[[maybe_unused]] constexpr spirv::IdRef TransformPositionFunction(
sh::vk::spirv::kIdTransformPositionFunction);
[[maybe_unused]] constexpr spirv::IdRef XfbEmulationGetOffsetsFunction(
sh::vk::spirv::kIdXfbEmulationGetOffsetsFunction);
[[maybe_unused]] constexpr spirv::IdRef SampleID(sh::vk::spirv::kIdSampleID);
[[maybe_unused]] constexpr spirv::IdRef InputPerVertexBlock(sh::vk::spirv::kIdInputPerVertexBlock);
[[maybe_unused]] constexpr spirv::IdRef OutputPerVertexBlock(
sh::vk::spirv::kIdOutputPerVertexBlock);
[[maybe_unused]] constexpr spirv::IdRef OutputPerVertexVar(sh::vk::spirv::kIdOutputPerVertexVar);
[[maybe_unused]] constexpr spirv::IdRef XfbExtensionPosition(
sh::vk::spirv::kIdXfbExtensionPosition);
[[maybe_unused]] constexpr spirv::IdRef XfbEmulationBufferBlockZero(
sh::vk::spirv::kIdXfbEmulationBufferBlockZero);
[[maybe_unused]] constexpr spirv::IdRef XfbEmulationBufferBlockOne(
sh::vk::spirv::kIdXfbEmulationBufferBlockOne);
[[maybe_unused]] constexpr spirv::IdRef XfbEmulationBufferBlockTwo(
sh::vk::spirv::kIdXfbEmulationBufferBlockTwo);
[[maybe_unused]] constexpr spirv::IdRef XfbEmulationBufferBlockThree(
sh::vk::spirv::kIdXfbEmulationBufferBlockThree);
}
}
class SpirvPerVertexTrimmer final : angle::NonCopyable
{ … };
void SpirvPerVertexTrimmer::visitMemberDecorate(spirv::IdRef id,
spirv::LiteralInteger member,
spv::Decoration decoration,
const spirv::LiteralIntegerList &valueList)
{ … }
TransformationState SpirvPerVertexTrimmer::transformMemberDecorate(spirv::IdRef typeId,
spirv::LiteralInteger member,
spv::Decoration decoration)
{ … }
TransformationState SpirvPerVertexTrimmer::transformMemberName(spirv::IdRef id,
spirv::LiteralInteger member,
const spirv::LiteralString &name)
{ … }
TransformationState SpirvPerVertexTrimmer::transformTypeStruct(spirv::IdResult id,
spirv::IdRefList *memberList,
spirv::Blob *blobOut)
{ … }
class SpirvInactiveVaryingRemover final : angle::NonCopyable
{ … };
void SpirvInactiveVaryingRemover::init(size_t indexBound)
{ … }
TransformationState SpirvInactiveVaryingRemover::transformAccessChain(
spirv::IdResultType typeId,
spirv::IdResult id,
spirv::IdRef baseId,
const spirv::IdRefList &indexList,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvInactiveVaryingRemover::transformDecorate(
const ShaderInterfaceVariableInfo &info,
gl::ShaderType shaderType,
spirv::IdRef id,
spv::Decoration decoration,
const spirv::LiteralIntegerList &decorationValues,
spirv::Blob *blobOut)
{ … }
void SpirvInactiveVaryingRemover::modifyEntryPointInterfaceList(
const std::vector<const ShaderInterfaceVariableInfo *> &variableInfoById,
gl::ShaderType shaderType,
EntryPointList entryPointList,
spirv::IdRefList *interfaceList)
{ … }
TransformationState SpirvInactiveVaryingRemover::transformTypePointer(
spirv::IdResult id,
spv::StorageClass storageClass,
spirv::IdRef typeId,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvInactiveVaryingRemover::transformVariable(spirv::IdResultType typeId,
spirv::IdResult id,
spv::StorageClass storageClass,
spirv::Blob *blobOut)
{ … }
class SpirvVaryingPrecisionFixer final : angle::NonCopyable
{ … };
void SpirvVaryingPrecisionFixer::init(size_t indexBound)
{ … }
void SpirvVaryingPrecisionFixer::visitTypePointer(spirv::IdResult id,
spv::StorageClass storageClass,
spirv::IdRef typeId)
{ … }
void SpirvVaryingPrecisionFixer::visitVariable(const ShaderInterfaceVariableInfo &info,
gl::ShaderType shaderType,
spirv::IdResultType typeId,
spirv::IdResult id,
spv::StorageClass storageClass,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvVaryingPrecisionFixer::transformVariable(
const ShaderInterfaceVariableInfo &info,
spirv::IdResultType typeId,
spirv::IdResult id,
spv::StorageClass storageClass,
spirv::Blob *blobOut)
{ … }
void SpirvVaryingPrecisionFixer::writeInputPreamble(
const std::vector<const ShaderInterfaceVariableInfo *> &variableInfoById,
gl::ShaderType shaderType,
spirv::Blob *blobOut)
{ … }
void SpirvVaryingPrecisionFixer::modifyEntryPointInterfaceList(EntryPointList entryPointList,
spirv::IdRefList *interfaceList)
{ … }
void SpirvVaryingPrecisionFixer::addDecorate(spirv::IdRef replacedId, spirv::Blob *blobOut)
{ … }
void SpirvVaryingPrecisionFixer::writeOutputPrologue(
const std::vector<const ShaderInterfaceVariableInfo *> &variableInfoById,
gl::ShaderType shaderType,
spirv::Blob *blobOut)
{ … }
class SpirvTransformFeedbackCodeGenerator final : angle::NonCopyable
{ … };
constexpr size_t SpirvTransformFeedbackCodeGenerator::kXfbDecorationCount;
constexpr spv::Decoration SpirvTransformFeedbackCodeGenerator::kXfbDecorations[kXfbDecorationCount];
void SpirvTransformFeedbackCodeGenerator::visitVariable(const ShaderInterfaceVariableInfo &info,
const XFBInterfaceVariableInfo &xfbInfo,
gl::ShaderType shaderType,
spirv::IdResultType typeId,
spirv::IdResult id,
spv::StorageClass storageClass)
{ … }
TransformationState SpirvTransformFeedbackCodeGenerator::transformCapability(
spv::Capability capability,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvTransformFeedbackCodeGenerator::transformName(spirv::IdRef id,
spirv::LiteralString name)
{ … }
TransformationState SpirvTransformFeedbackCodeGenerator::transformMemberName(
spirv::IdRef id,
spirv::LiteralInteger member,
spirv::LiteralString name)
{ … }
TransformationState SpirvTransformFeedbackCodeGenerator::transformTypeHelper(
const ShaderInterfaceVariableInfo *info,
gl::ShaderType shaderType,
spirv::IdResult id)
{ … }
TransformationState SpirvTransformFeedbackCodeGenerator::transformDecorate(
const ShaderInterfaceVariableInfo *info,
gl::ShaderType shaderType,
spirv::IdRef id,
spv::Decoration decoration,
const spirv::LiteralIntegerList &decorationValues,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvTransformFeedbackCodeGenerator::transformMemberDecorate(
const ShaderInterfaceVariableInfo *info,
gl::ShaderType shaderType,
spirv::IdRef id,
spirv::LiteralInteger member,
spv::Decoration decoration,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvTransformFeedbackCodeGenerator::transformTypeStruct(
const ShaderInterfaceVariableInfo *info,
gl::ShaderType shaderType,
spirv::IdResult id,
const spirv::IdRefList &memberList,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvTransformFeedbackCodeGenerator::transformTypePointer(
const ShaderInterfaceVariableInfo *info,
gl::ShaderType shaderType,
spirv::IdResult id,
spv::StorageClass storageClass,
spirv::IdRef typeId,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvTransformFeedbackCodeGenerator::transformVariable(
const ShaderInterfaceVariableInfo &info,
const ShaderInterfaceVariableInfoMap &variableInfoMap,
gl::ShaderType shaderType,
spv::StorageClass storageBufferStorageClass,
spirv::IdResultType typeId,
spirv::IdResult id,
spv::StorageClass storageClass)
{ … }
void SpirvTransformFeedbackCodeGenerator::gatherXfbVaryings(const XFBInterfaceVariableInfo &info,
spirv::IdRef id)
{ … }
void SpirvTransformFeedbackCodeGenerator::visitXfbVarying(const ShaderInterfaceVariableXfbInfo &xfb,
spirv::IdRef baseId,
uint32_t fieldIndex)
{ … }
void SpirvTransformFeedbackCodeGenerator::writeIntConstant(uint32_t value,
spirv::IdRef intId,
spirv::Blob *blobOut)
{ … }
void SpirvTransformFeedbackCodeGenerator::modifyEntryPointInterfaceList(
const std::vector<const ShaderInterfaceVariableInfo *> &variableInfoById,
gl::ShaderType shaderType,
EntryPointList entryPointList,
spirv::IdRefList *interfaceList)
{ … }
void SpirvTransformFeedbackCodeGenerator::writePendingDeclarations(
const std::vector<const ShaderInterfaceVariableInfo *> &variableInfoById,
spv::StorageClass storageBufferStorageClass,
spirv::Blob *blobOut)
{ … }
void SpirvTransformFeedbackCodeGenerator::writeTransformFeedbackExtensionOutput(
spirv::IdRef positionId,
spirv::Blob *blobOut)
{ … }
class AccessChainIndexListAppend final : angle::NonCopyable
{ … };
void SpirvTransformFeedbackCodeGenerator::writeTransformFeedbackEmulationOutput(
const SpirvInactiveVaryingRemover &inactiveVaryingRemover,
const SpirvVaryingPrecisionFixer &varyingPrecisionFixer,
const bool usePrecisionFixer,
spirv::Blob *blobOut)
{ … }
void SpirvTransformFeedbackCodeGenerator::getVaryingTypeIds(GLenum componentType,
bool isPrivate,
spirv::IdRef *typeIdOut,
spirv::IdRef *typePtrOut)
{ … }
void SpirvTransformFeedbackCodeGenerator::writeGetOffsetsCall(spirv::IdRef xfbOffsets,
spirv::Blob *blobOut)
{ … }
void SpirvTransformFeedbackCodeGenerator::writeComponentCapture(
uint32_t bufferIndex,
spirv::IdRef xfbOffset,
spirv::IdRef varyingTypeId,
spirv::IdRef varyingTypePtr,
spirv::IdRef varyingBaseId,
const spirv::IdRefList &accessChainIndices,
GLenum componentType,
spirv::Blob *blobOut)
{ … }
void SpirvTransformFeedbackCodeGenerator::addExecutionMode(spirv::IdRef entryPointId,
spirv::Blob *blobOut)
{ … }
void SpirvTransformFeedbackCodeGenerator::addMemberDecorate(const XFBInterfaceVariableInfo &info,
spirv::IdRef id,
spirv::Blob *blobOut)
{ … }
void SpirvTransformFeedbackCodeGenerator::addDecorate(const XFBInterfaceVariableInfo &info,
spirv::IdRef id,
spirv::Blob *blobOut)
{ … }
class SpirvPositionTransformer final : angle::NonCopyable
{ … };
void SpirvPositionTransformer::writePositionTransformation(spirv::IdRef positionPointerId,
spirv::IdRef positionId,
spirv::Blob *blobOut)
{ … }
class SpirvMultisampleTransformer final : angle::NonCopyable
{ … };
void SpirvMultisampleTransformer::init(size_t indexBound)
{ … }
TransformationState SpirvMultisampleTransformer::transformImageRead(const uint32_t *instruction,
spirv::Blob *blobOut)
{ … }
void SpirvMultisampleTransformer::writePendingDeclarations(
const SpirvNonSemanticInstructions &nonSemantic,
const std::vector<const ShaderInterfaceVariableInfo *> &variableInfoById,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvMultisampleTransformer::transformTypeImage(const uint32_t *instruction,
spirv::Blob *blobOut)
{ … }
namespace
{
bool verifyEntryPointsContainsID(const spirv::IdRefList &interfaceList)
{ … }
}
void SpirvMultisampleTransformer::modifyEntryPointInterfaceList(
const SpirvNonSemanticInstructions &nonSemantic,
EntryPointList entryPointList,
spirv::IdRefList *interfaceList,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvMultisampleTransformer::transformCapability(
const SpirvNonSemanticInstructions &nonSemantic,
const spv::Capability capability,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvMultisampleTransformer::transformDecorate(
const SpirvNonSemanticInstructions &nonSemantic,
const ShaderInterfaceVariableInfo &info,
gl::ShaderType shaderType,
spirv::IdRef id,
spv::Decoration &decoration,
spirv::Blob *blobOut)
{ … }
bool SpirvMultisampleTransformer::skipSampleDecoration(spv::Decoration decoration)
{ … }
void SpirvMultisampleTransformer::visitDecorate(spirv::IdRef id,
spv::Decoration decoration,
const spirv::LiteralIntegerList &valueList)
{ … }
void SpirvMultisampleTransformer::visitMemberDecorate(spirv::IdRef id,
spirv::LiteralInteger member,
spv::Decoration decoration)
{ … }
void SpirvMultisampleTransformer::visitVarying(gl::ShaderType shaderType,
spirv::IdRef id,
spv::StorageClass storageClass)
{ … }
void SpirvMultisampleTransformer::visitTypeStruct(spirv::IdResult id,
const spirv::IdRefList &memberList)
{ … }
void SpirvMultisampleTransformer::visitTypePointer(gl::ShaderType shaderType,
spirv::IdResult id,
spv::StorageClass storageClass,
spirv::IdRef typeId)
{ … }
void SpirvMultisampleTransformer::visitVariable(gl::ShaderType shaderType,
spirv::IdResultType typeId,
spirv::IdResult id,
spv::StorageClass storageClass)
{ … }
class SpirvSecondaryOutputTransformer final : angle::NonCopyable
{ … };
void SpirvSecondaryOutputTransformer::init(size_t indexBound)
{ … }
void SpirvSecondaryOutputTransformer::visitTypeArray(spirv::IdResult id, spirv::IdRef typeId)
{ … }
void SpirvSecondaryOutputTransformer::visitTypePointer(spirv::IdResult id, spirv::IdRef typeId)
{ … }
void SpirvSecondaryOutputTransformer::modifyEntryPointInterfaceList(
const std::vector<const ShaderInterfaceVariableInfo *> &variableInfoById,
EntryPointList entryPointList,
spirv::IdRefList *interfaceList,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvSecondaryOutputTransformer::transformAccessChain(
spirv::IdResultType typeId,
spirv::IdResult id,
spirv::IdRef baseId,
const spirv::IdRefList &indexList,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvSecondaryOutputTransformer::transformDecorate(
spirv::IdRef id,
spv::Decoration decoration,
const spirv::LiteralIntegerList &decorationValues,
spirv::Blob *blobOut)
{ … }
TransformationState SpirvSecondaryOutputTransformer::transformVariable(
spirv::IdResultType typeId,
spirv::IdResultType privateTypeId,
spirv::IdResult id,
spirv::Blob *blobOut)
{ … }
void SpirvSecondaryOutputTransformer::writeOutputPrologue(
const std::vector<const ShaderInterfaceVariableInfo *> &variableInfoById,
spirv::Blob *blobOut)
{ … }
class SpirvTransformer final : public SpirvTransformerBase
{ … };
void SpirvTransformer::transform()
{ … }
void SpirvTransformer::resolveVariableIds()
{ … }
void SpirvTransformer::transformInstruction()
{ … }
void SpirvTransformer::writePendingDeclarations()
{ … }
void SpirvTransformer::writeInputPreamble()
{ … }
void SpirvTransformer::writeOutputPrologue()
{ … }
void SpirvTransformer::visitDecorate(const uint32_t *instruction)
{ … }
void SpirvTransformer::visitMemberDecorate(const uint32_t *instruction)
{ … }
void SpirvTransformer::visitTypeHelper(spirv::IdResult id, spirv::IdRef typeId)
{ … }
void SpirvTransformer::visitTypeArray(const uint32_t *instruction)
{ … }
void SpirvTransformer::visitTypePointer(const uint32_t *instruction)
{ … }
void SpirvTransformer::visitTypeStruct(const uint32_t *instruction)
{ … }
void SpirvTransformer::visitVariable(const uint32_t *instruction)
{ … }
bool SpirvTransformer::visitExtInst(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformDecorate(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformMemberDecorate(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformCapability(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformName(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformMemberName(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformEntryPoint(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformTypePointer(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformExtension(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformExtInstImport(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformExtInst(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformTypeStruct(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformVariable(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformTypeImage(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformImageRead(const uint32_t *instruction)
{ … }
TransformationState SpirvTransformer::transformAccessChain(const uint32_t *instruction)
{ … }
struct AliasingAttributeMap
{ … };
void ValidateShaderInterfaceVariableIsAttribute(const ShaderInterfaceVariableInfo *info)
{ … }
void ValidateIsAliasingAttribute(const AliasingAttributeMap *aliasingMap, uint32_t id)
{ … }
class SpirvVertexAttributeAliasingTransformer final : public SpirvTransformerBase
{ … };
void SpirvVertexAttributeAliasingTransformer::transform()
{ … }
void SpirvVertexAttributeAliasingTransformer::preprocessAliasingAttributes()
{ … }
void SpirvVertexAttributeAliasingTransformer::transformInstruction()
{ … }
spirv::IdRef SpirvVertexAttributeAliasingTransformer::getAliasingAttributeReplacementId(
spirv::IdRef aliasingId,
uint32_t offset) const
{ … }
bool SpirvVertexAttributeAliasingTransformer::isMatrixAttribute(spirv::IdRef id) const
{ … }
void SpirvVertexAttributeAliasingTransformer::visitTypePointer(const uint32_t *instruction)
{ … }
TransformationState SpirvVertexAttributeAliasingTransformer::transformEntryPoint(
const uint32_t *instruction)
{ … }
TransformationState SpirvVertexAttributeAliasingTransformer::transformExtInst(
const uint32_t *instruction)
{ … }
TransformationState SpirvVertexAttributeAliasingTransformer::transformName(
const uint32_t *instruction)
{ … }
TransformationState SpirvVertexAttributeAliasingTransformer::transformDecorate(
const uint32_t *instruction)
{ … }
TransformationState SpirvVertexAttributeAliasingTransformer::transformVariable(
const uint32_t *instruction)
{ … }
TransformationState SpirvVertexAttributeAliasingTransformer::transformAccessChain(
const uint32_t *instruction)
{ … }
void SpirvVertexAttributeAliasingTransformer::transformLoadHelper(spirv::IdRef pointerId,
spirv::IdRef typeId,
spirv::IdRef replacementId,
spirv::IdRef resultId)
{ … }
TransformationState SpirvVertexAttributeAliasingTransformer::transformLoad(
const uint32_t *instruction)
{ … }
void SpirvVertexAttributeAliasingTransformer::declareExpandedMatrixVectors()
{ … }
void SpirvVertexAttributeAliasingTransformer::writeExpandedMatrixInitialization()
{ … }
}
SpvSourceOptions SpvCreateSourceOptions(const angle::FeaturesVk &features)
{ … }
uint32_t SpvGetXfbBufferBlockId(const uint32_t bufferIndex)
{ … }
void SpvAssignLocations(const SpvSourceOptions &options,
const gl::ProgramExecutable &programExecutable,
const gl::ProgramVaryingPacking &varyingPacking,
const gl::ShaderType transformFeedbackStage,
SpvProgramInterfaceInfo *programInterfaceInfo,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void SpvAssignTransformFeedbackLocations(gl::ShaderType shaderType,
const gl::ProgramExecutable &programExecutable,
bool isTransformFeedbackStage,
SpvProgramInterfaceInfo *programInterfaceInfo,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
void SpvGetShaderSpirvCode(const gl::ProgramState &programState,
gl::ShaderMap<const spirv::Blob *> *spirvBlobsOut)
{ … }
void SpvAssignAllLocations(const SpvSourceOptions &options,
const gl::ProgramState &programState,
const gl::ProgramLinkedResources &resources,
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
{ … }
angle::Result SpvTransformSpirvCode(const SpvTransformOptions &options,
const ShaderInterfaceVariableInfoMap &variableInfoMap,
const spirv::Blob &initialSpirvBlob,
spirv::Blob *spirvBlobOut)
{ … }
}