38 lines
877 B
C++
38 lines
877 B
C++
#ifndef IConstantMapping_h__
|
|
#define IConstantMapping_h__
|
|
|
|
#include <vector>
|
|
#include "Types.h"
|
|
#include <LString.h>
|
|
|
|
#define HLSL_CONSTANT_SIZE (4*4)
|
|
|
|
struct IConstantMappingData
|
|
{
|
|
IConstantMappingData(uint32 slot, uint32 offset, uint32 row_count, uint32 col_count)
|
|
{
|
|
SlotID = slot;
|
|
SlotOffset = offset;
|
|
RowCount = row_count;
|
|
ColumnCount = col_count;
|
|
}
|
|
uint32 SlotID;
|
|
uint32 SlotOffset;
|
|
uint32 ColumnCount;
|
|
uint32 RowCount;
|
|
};
|
|
class IConstantMapping
|
|
{
|
|
public:
|
|
IConstantMapping();
|
|
~IConstantMapping();
|
|
void InsertConstant(const String& name, uint32 numRows, uint32 numCols);
|
|
uint32 GetAlignedSize();
|
|
private:
|
|
uint32 lastSlotId;
|
|
typedef std::vector<IConstantMappingData> ConstantCollection;
|
|
typedef std::vector<IConstantMappingData>::iterator ConstantCollectionItr;
|
|
ConstantCollection mapping;
|
|
ConstantCollection spaces;
|
|
};
|
|
#endif // IConstantMapping_h__
|