#pragma once

#include "managedObject.hpp"
#include "shaderPatcher.hpp"

#include <psp2/gxm.h>
#include <string>
#include <vector>

namespace render::kernel
{

class VertexShader : public ManagedObject
{
private:
    SceGxmShaderPatcherId id;
    const SceGxmProgram *program;
    SceGxmVertexProgram *vProgram;
    const ShaderPatcher *patcher;

public:
    SceGxmVertexStream stream;
    std::vector<SceGxmVertexAttribute> attribs;

    VertexShader(const char *path, ShaderPatcher *patcher);
    virtual ~VertexShader();

    void Assembly();
    void Bind(SceGxmContext *context);

    const SceGxmProgramParameter *GetParam(const char *name);
    unsigned int GetParamIndex(const char *name);

    void SetDefaultUniform(SceGxmContext *context, const SceGxmProgramParameter *param, unsigned int count, const float *data);
};

} // namespace render::kernel