Skip to content

Commit

Permalink
Merge pull request #13 from MonsterDruide1/shader-archive
Browse files Browse the repository at this point in the history
detail: Add aglShaderHolder.h
  • Loading branch information
ThePixelGamer committed Sep 14, 2023
2 parents 611fe02 + 5000aae commit 20374c4
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 5 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 21 additions & 5 deletions include/common/aglShaderProgramArchive.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
#pragma once

#include <container/seadBuffer.h>
#include <heap/seadDisposer.h>
#include <hostio/seadHostIONode.h>
#include <prim/seadSafeString.h>
#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:
Expand All @@ -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<ShaderProgram> mShaderPrograms;
void* _48[6];
short _78[2];
sead::Buffer<ShaderProgramEdit> mShaderProgramEdits;
sead::Buffer<ShaderSource> mShaderSources;
sead::Buffer<void*> unkData;
sead::Buffer<bool*> unkData2;
};
static_assert(sizeof(ShaderProgramArchive) == 0xC0);

} // namespace agl
35 changes: 35 additions & 0 deletions include/detail/aglShaderHolder.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#pragma once

#include <container/seadPtrArray.h>
#include <heap/seadDisposer.h>
#include <hostio/seadHostIOReflexible.h>
#include <prim/seadSafeString.h>
#include <resource/seadArchiveRes.h>
#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<ShaderProgram, 206> mShaderPrograms;
sead::UnsafeArray<ShaderProgramArchive, 6> mShaderProgramArchives;
bool mArchiveOptions;
};
static_assert(sizeof(ShaderHolder) == 0xB30);

} // namespace detail
} // namespace agl

0 comments on commit 20374c4

Please sign in to comment.