diff --git a/CMakeLists.txt b/CMakeLists.txt index 63921bd..2b5cd3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ add_library(agl OBJECT include/detail/aglGPUMemBlockMgr.h include/detail/aglMemoryPoolHeap.h include/detail/aglPrivateResource.h + include/detail/aglShaderHolder.h include/detail/aglSurface.h include/driver/aglGraphicsDriverMgr.h diff --git a/include/common/aglShaderProgramArchive.h b/include/common/aglShaderProgramArchive.h index 2907c81..95d5811 100644 --- a/include/common/aglShaderProgramArchive.h +++ b/include/common/aglShaderProgramArchive.h @@ -1,14 +1,19 @@ #pragma once +#include #include #include +#include +#include "common/aglResBinaryShaderArchive.h" +#include "common/aglResShaderArchive.h" namespace agl { -class ResBinaryShaderArchive; -class ResShaderArchive; class ResShaderProgram; class ResShaderSource; +class ShaderProgram; +class ShaderProgramEdit; +class ShaderSource; class ShaderProgramArchive : public sead::IDisposer, public sead::hostio::Node { public: @@ -22,11 +27,22 @@ class ShaderProgramArchive : public sead::IDisposer, public sead::hostio::Node { void updateCompileInfo(); void setUp(); void setUp_(bool); + void setUpFromObjectReflector(bool, bool); + int searchShaderProgramIndex(const sead::SafeString&) const; + sead::FormatFixedSafeString<1024> genMessage(sead::hostio::Context* context); + void listenPropertyEvent(const sead::hostio::PropertyEvent* property_event); private: - void* _20; - ResBinaryShaderArchive* mBinaryShaderArchive; - ResShaderArchive* mResShaderArchive; + ResBinaryShaderArchive mBinaryShaderArchive; + ResShaderArchive mResShaderArchive; + sead::Buffer mShaderPrograms; + void* _48[6]; + short _78[2]; + sead::Buffer mShaderProgramEdits; + sead::Buffer mShaderSources; + sead::Buffer unkData; + sead::Buffer unkData2; }; +static_assert(sizeof(ShaderProgramArchive) == 0xC0); } // namespace agl diff --git a/include/detail/aglShaderHolder.h b/include/detail/aglShaderHolder.h new file mode 100644 index 0000000..cfb34ea --- /dev/null +++ b/include/detail/aglShaderHolder.h @@ -0,0 +1,35 @@ +#pragma once + +#include +#include +#include +#include +#include +#include "common/aglShaderProgramArchive.h" + +namespace agl { + +class ShaderProgram; + +namespace detail { + +class ShaderHolder { + SEAD_SINGLETON_DISPOSER(ShaderHolder); + +public: + ShaderHolder(); + virtual ~ShaderHolder(); + + void initialize(sead::ArchiveRes* archiveRes, sead::Heap* heap); + sead::FormatFixedSafeString<1024> genMessage(sead::hostio::Context* context); + void listenPropertyEvent(const sead::hostio::PropertyEvent* property_event); + +private: + sead::FixedPtrArray mShaderPrograms; + sead::UnsafeArray mShaderProgramArchives; + bool mArchiveOptions; +}; +static_assert(sizeof(ShaderHolder) == 0xB30); + +} // namespace detail +} // namespace agl