| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <nn/gfx/gfx_ShaderInfo.h> |
| 4 | #include <nn/util.h> |
| 5 | #include <nn/util/util_BinaryFormat.h> |
| 6 | |
| 7 | namespace nn { |
| 8 | |
| 9 | namespace util { |
| 10 | class ResDic; |
| 11 | } |
| 12 | |
| 13 | namespace gfx { |
| 14 | |
| 15 | struct ResShaderVariationData; |
| 16 | struct ResShaderReflectionData; |
| 17 | struct ResShaderContainerData; |
| 18 | struct nngfxToolShaderCompilerShaderReflection; |
| 19 | struct ResShaderReflectionStageData2; |
| 20 | |
| 21 | struct ResShaderProgramData { |
| 22 | ShaderInfoData info; |
| 23 | uint32_t objSize; |
| 24 | char reserved2[4]; |
| 25 | nn::util::BinTPtr<void> pObj; |
| 26 | nn::util::BinTPtr<ResShaderVariationData> pParent; |
| 27 | nn::util::BinTPtr<ResShaderReflectionData> pShaderReflection; |
| 28 | nn::util::BinTPtr<nngfxToolShaderCompilerShaderReflection> pShaderCompilerReflection; |
| 29 | char reserved[24]; |
| 30 | }; |
| 31 | |
| 32 | struct ResShaderVariationData { |
| 33 | nn::util::BinTPtr<ResShaderProgramData> pSourceProgram; |
| 34 | nn::util::BinTPtr<ResShaderProgramData> pIntermediateLanguageProgram; |
| 35 | nn::util::BinTPtr<ResShaderProgramData> pBinaryProgram; |
| 36 | nn::util::BinTPtr<ResShaderContainerData> pParent; |
| 37 | char reserved[32]; |
| 38 | }; |
| 39 | |
| 40 | struct ResShaderContainerData { |
| 41 | nn::util::BinaryBlockHeader blockHeader; |
| 42 | uint16_t targetApiType; |
| 43 | uint16_t targetApiVersion; |
| 44 | uint8_t targetCodeType; |
| 45 | char reserved2[3]; |
| 46 | uint32_t compilerVersion; |
| 47 | uint32_t shaderVariationCount; |
| 48 | nn::util::BinTPtr<ResShaderVariationData> pShaderVariationArray; |
| 49 | nn::util::BinTPtr<void> pShaderBinaryPool; |
| 50 | uint64_t lowLevelCompilerVersion; |
| 51 | char reserved[40]; |
| 52 | }; |
| 53 | |
| 54 | struct ResShaderFileData { |
| 55 | nn::util::BinaryFileHeader fileHeader; |
| 56 | char reserved[64]; |
| 57 | }; |
| 58 | |
| 59 | struct ResShaderReflectionStageData { |
| 60 | nn::util::BinTPtr<nn::util::ResDic> pShaderInputDic; |
| 61 | nn::util::BinTPtr<nn::util::ResDic> pShaderOutputDic; |
| 62 | nn::util::BinTPtr<nn::util::ResDic> pSamplerDic; |
| 63 | nn::util::BinTPtr<nn::util::ResDic> pConstantBufferDic; |
| 64 | nn::util::BinTPtr<nn::util::ResDic> pUnorderedAccessBufferDic; |
| 65 | int32_t offsetShaderOutput; |
| 66 | int32_t offsetSampler; |
| 67 | int32_t offsetConstantBuffer; |
| 68 | int32_t offsetUnorderedAccessBuffer; |
| 69 | nn::util::BinTPtr<int> pShaderSlotArray; |
| 70 | uint32_t computeWorkGroupSizeX; |
| 71 | uint32_t computeWorkGroupSizeY; |
| 72 | uint32_t computeWorkGroupSizeZ; |
| 73 | int32_t offsetImage; |
| 74 | nn::util::BinTPtr<nn::util::ResDic> pImageDic; |
| 75 | nn::util::BinTPtr<ResShaderReflectionStageData2> pReflectionStageData2; |
| 76 | }; |
| 77 | |
| 78 | struct ResShaderReflectionStageData2 { |
| 79 | nn::util::BinTPtr<nn::util::ResDic> pSeparateTextureDic; |
| 80 | nn::util::BinTPtr<nn::util::ResDic> pSeparateSamplerDic; |
| 81 | int32_t offsetSeparateTexture; |
| 82 | int32_t offsetSeparateSampler; |
| 83 | char reserved[24]; |
| 84 | }; |
| 85 | |
| 86 | struct ResShaderReflectionData { |
| 87 | nn::util::BinTPtr<ResShaderReflectionStageData> pVertexReflection; |
| 88 | nn::util::BinTPtr<ResShaderReflectionStageData> pHullReflection; |
| 89 | nn::util::BinTPtr<ResShaderReflectionStageData> pDomainReflection; |
| 90 | nn::util::BinTPtr<ResShaderReflectionStageData> pGeometryReflection; |
| 91 | nn::util::BinTPtr<ResShaderReflectionStageData> pPixelReflection; |
| 92 | nn::util::BinTPtr<ResShaderReflectionStageData> pComputeReflection; |
| 93 | char reserved[16]; |
| 94 | }; |
| 95 | } // namespace gfx |
| 96 | |
| 97 | } // namespace nn |