Move samplers bindings to shaders.
This commit is contained in:
@ -746,18 +746,15 @@ void rk_set_param_mat3(
|
||||
|
||||
void rk_select_texture(
|
||||
rk_uint slot,
|
||||
rk_texture_t _texture,
|
||||
rk_input_t _sampler) {
|
||||
rk_texture_t _texture) {
|
||||
rk_texture const * const texture = reinterpret_cast<rk_texture const *>(_texture);
|
||||
GLint const sampler = reinterpret_cast<intptr_t>(_sampler) - 1;
|
||||
if (texture && sampler > -1) {
|
||||
if (texture) {
|
||||
glActiveTexture(GL_TEXTURE0 + slot);
|
||||
if (texture->nlevels) {
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, texture->texture);
|
||||
} else {
|
||||
glBindTexture(GL_TEXTURE_2D, texture->texture);
|
||||
}
|
||||
glUniform1i(sampler, slot);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user