| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include "common/aglResCommon.h" |
| 4 | |
| 5 | namespace agl { |
| 6 | |
| 7 | struct ResShaderSourceData { |
| 8 | u32 mSize; |
| 9 | u32 mNameLen; |
| 10 | u32 mTextLen; // Text Length |
| 11 | u32 _c; // Text Length... 2 |
| 12 | // char mName[]; |
| 13 | }; |
| 14 | static_assert(sizeof(ResShaderSourceData) == 0x10, "agl::ResShaderSourceData size mismatch"); |
| 15 | |
| 16 | class ResShaderSource : public ResCommon<ResShaderSourceData> { |
| 17 | public: |
| 18 | using ResCommon::ResCommon; |
| 19 | |
| 20 | const char* getName() const { return (const char*)(ptr() + 1); } |
| 21 | |
| 22 | const char* getText() const { return getName() + ptr()->mNameLen; } |
| 23 | }; |
| 24 | |
| 25 | using ResShaderSourceArray = ResArray<ResShaderSource>; |
| 26 | |
| 27 | using ResShaderSourceArrayData = ResShaderSourceArray::DataType; |
| 28 | static_assert(sizeof(ResShaderSourceArrayData) == 8, "agl::ResShaderSourceArrayData size mismatch"); |
| 29 | |
| 30 | } // namespace agl |
| 31 |