47 const hpp::string_view& _sampler,
52 if(frameBuffer ==
nullptr)
68 const hpp::string_view& _sampler,
72 if(_texture ==
nullptr)
101 bool is_texture = stage != uint8_t(-1) && stage < textures_uniforms.size();
105 uniform = textures_uniforms[stage];
110 auto it = uniforms.find(_name);
112 if(it != uniforms.end())
118 textures_uniforms[stage] =
uniform;
auto is_valid() const -> bool
auto native_handle() const -> T
program_handle create_program(shader_handle _vsh, shader_handle _fsh, bool _destroyShaders)
void set_uniform(uniform_handle _handle, const void *_value, uint16_t _num)
void set_texture(uint8_t _stage, uniform_handle _sampler, texture_handle _handle, uint32_t _flags)
auto get_texture(std::uint32_t index=0) const -> const gfx::texture::ptr &
std::map< std::string, uniform_ptr, std::less<> > uniforms
All uniforms for this program.
std::array< uniform_ptr, 64 > textures_uniforms
void set_texture(uint8_t _stage, const hpp::string_view &_sampler, const gfx::frame_buffer *_handle, uint8_t _attachment=0, uint32_t _flags=std::numeric_limits< uint32_t >::max())
std::shared_ptr< uniform > uniform_ptr
auto get_uniform(const hpp::string_view &_name, uint8_t stage=uint8_t(-1)) -> uniform_ptr
void set_uniform(const hpp::string_view &_name, const void *_value, uint16_t _num=1)
std::vector< std::shared_ptr< uniform > > uniforms
Uniforms for this shader.