XPlor/libs/xassets/materialtechset.h
2025-08-17 13:14:17 -04:00

116 lines
2.1 KiB
C++

#ifndef MATERIALTECHSET_H
#define MATERIALTECHSET_H
#include "xd3dresource.h"
#include "materialpixelshader.h"
#include "QString"
#include "qobject.h"
struct MaterialStreamRouting
{
quint8 source;
quint8 dest;
};
struct D3DVertexDeclaration : D3DResource
{
};
struct MaterialVertexStreamRouting
{
MaterialStreamRouting data[16];
D3DVertexDeclaration decl[15];
};
struct MaterialVertexDeclaration
{
int streamCount;
bool hasOptionalSource;
MaterialVertexStreamRouting routing;
};
struct D3DVertexShader : D3DResource
{
};
struct GfxVertexShaderLoadDef
{
qint32 cachedPartPtr;
QVector<int> cachedPart;
qint32 physicalPartPtr;
QVector<int> physicalPart;
int cachedPartSize;
int physicalPartSize;
};
struct MaterialVertexShaderProgram
{
std::shared_ptr<D3DVertexShader> vertexShader;
GfxVertexShaderLoadDef loadDef;
};
struct MaterialVertexShader
{
QString name;
MaterialVertexShaderProgram prog;
};
struct MaterialArgumentCodeConst
{
int index;
int firstRow;
int rowCount;
};
struct MaterialArgumentDef
{
const float *literalConst;
MaterialArgumentCodeConst codeConst;
unsigned int codeSampler;
unsigned int nameHash;
};
struct MaterialShaderArgument
{
int type;
int dest;
MaterialArgumentDef u;
};
struct MaterialPass
{
std::shared_ptr<MaterialVertexDeclaration> vertexDecl;
QVector<std::shared_ptr<MaterialVertexShader>> vertexShaderArray;
std::shared_ptr<MaterialVertexShader> vertexShader;
std::shared_ptr<MaterialPixelShader> pixelShader;
int perPrimArgCount;
int perObjArgCount;
int stableArgCount;
int customSamplerFlags;
int precompiledIndex;
std::shared_ptr<MaterialShaderArgument> args;
};
struct MaterialTechnique
{
QString *name;
int flags;
int passCount;
QVector<std::shared_ptr<MaterialPass>> passArray;
};
struct MaterialTechSet
{
QString name;
int worldVertFormat;
qint32 remappedPtr;
std::shared_ptr<MaterialTechSet> remappedTechniqueSet;
QVector<qint32> techPtrs;
QVector<std::shared_ptr<MaterialTechnique>> techniques;
};
#endif // MATERIALTECHSET_H