@@ -74,33 +74,37 @@ inline QMetaType::Type GetVariantMetatype(const QVariant &v)
74
74
return (QMetaType::Type)v.type ();
75
75
}
76
76
77
- struct FormatElement
77
+ struct BufferFormatter
78
78
{
79
- Q_DECLARE_TR_FUNCTIONS (FormatElement );
79
+ Q_DECLARE_TR_FUNCTIONS (BufferFormatter );
80
80
81
- public:
82
- FormatElement ();
83
- FormatElement (const QString &Name, uint offs, bool rowMat, uint matDim, ResourceFormat f,
84
- bool hexDisplay, bool rgbDisplay);
81
+ static GraphicsAPI m_API;
85
82
86
- static QList<FormatElement> ParseFormatString ( const QString &formatString, uint64_t maxLen ,
87
- bool tightPacking, QString &errors );
83
+ static QString DeclareStruct ( QList<QString> &declaredStructs, const QString &name ,
84
+ const rdcarray<ShaderConstant> &members, uint32_t requiredByteStride );
88
85
89
- static QString GenerateTextureBufferFormat (const TextureDescription &tex);
86
+ public:
87
+ BufferFormatter () = default ;
90
88
91
- ShaderVariable GetShaderVar (const byte *&data, const byte *end) const ;
89
+ static void Init (GraphicsAPI api) { m_API = api; }
90
+ static ShaderConstant ParseFormatString (const QString &formatString, uint64_t maxLen,
91
+ bool tightPacking, QString &errors);
92
92
93
- QString name;
94
- ResourceFormat format;
95
- uint32_t offset;
96
- uint32_t matrixdim;
97
- bool rowmajor;
93
+ static QString GetTextureFormatString (const TextureDescription &tex);
94
+ static QString GetBufferFormatString (const ShaderResource &res, const ResourceFormat &viewFormat,
95
+ uint64_t &baseByteOffset);
98
96
99
- bool hex, rgb;
97
+ static QString DeclareStruct (const QString &name, const rdcarray<ShaderConstant> &members,
98
+ uint32_t requiredByteStride);
99
+ static QString DeclarePaddingBytes (uint32_t bytes);
100
100
};
101
101
102
- QVariantList GetVariants (ResourceFormat rowFormat, uint32_t rowCount, const byte *&data,
103
- const byte *end);
102
+ QVariantList GetVariants (ResourceFormat rowFormat, uint32_t rowCount, uint32_t rowByteStride,
103
+ const byte *&data, const byte *end);
104
+ ResourceFormat GetInterpretedResourceFormat (const ShaderConstant &elem);
105
+ void SetInterpretedResourceFormat (ShaderConstant &elem, ResourceFormatType interpretType,
106
+ CompType interpretCompType);
107
+ ShaderVariable InterpretShaderVar (const ShaderConstant &elem, const byte *data, const byte *end);
104
108
105
109
QString TypeString (const ShaderVariable &v);
106
110
QString RowString (const ShaderVariable &v, uint32_t row, VarType type = VarType::Unknown);
0 commit comments