WIP Shader Reflection Refactoring

This commit is contained in:
2025-08-23 15:46:36 -07:00
parent 6739e9c1a5
commit a917f70f62
3 changed files with 10 additions and 1 deletions

View File

@@ -111,5 +111,5 @@ const char* SHADER_VALUE_NAMES[];
class KRReflectedObject class KRReflectedObject
{ {
public: public:
static std::map<ShaderValue, std::pair<size_t, size_t>> ValueMap; virtual bool GetShaderValue(ShaderValue value, void* buffer, size_t size) = 0;
}; };

View File

@@ -55,6 +55,12 @@ KRViewport::KRViewport(const Vector2& size, const Matrix4& matView, const Matrix
calculateDerivedValues(); calculateDerivedValues();
} }
bool KRViewport::GetShaderValue(ShaderValue value, void* buffer, size_t size)
{
return false;
}
KRViewport& KRViewport::operator=(const KRViewport& v) KRViewport& KRViewport::operator=(const KRViewport& v)
{ {

View File

@@ -40,12 +40,15 @@
class KRLight; class KRLight;
class KRViewport class KRViewport
: public KRReflectedObject
{ {
public: public:
KRViewport(); KRViewport();
KRViewport(const hydra::Vector2& size, const hydra::Matrix4& matView, const hydra::Matrix4& matProjection); KRViewport(const hydra::Vector2& size, const hydra::Matrix4& matView, const hydra::Matrix4& matProjection);
~KRViewport(); ~KRViewport();
bool GetShaderValue(ShaderValue value, void* buffer, size_t size) final;
const hydra::Vector2& getSize() const; const hydra::Vector2& getSize() const;
const hydra::Matrix4& getViewMatrix() const; const hydra::Matrix4& getViewMatrix() const;
const hydra::Matrix4& getProjectionMatrix() const; const hydra::Matrix4& getProjectionMatrix() const;