for(const PipelineState::BoundUniformBlock &u: self.uniform_blocks)
if(u.changed || changed_sets==~0U)
{
- u.used = self.shprog->uses_uniform_block_binding(u.binding);
+ if(u.block)
+ u.used = self.shprog->uses_uniform_block_binding(u.binding);
if(u.binding>=0)
changed_sets |= 1<<(u.binding>>20);
u.changed = false;
for(const PipelineState::BoundTexture &t: self.textures)
if(t.changed || changed_sets==~0U)
{
- t.used = self.shprog->uses_texture_binding(t.binding);
+ if(t.texture && t.sampler)
+ t.used = self.shprog->uses_texture_binding(t.binding);
changed_sets |= 1<<(t.binding>>20);
if(t.texture && t.level>=0)
t.texture->refresh_mip_views();
auto i = lower_bound_member(uniform_blocks, binding, &BoundUniformBlock::binding);
if(i==uniform_blocks.end() || i->binding!=binding)
i = uniform_blocks.insert(i, BoundUniformBlock(binding));
- i->used = block;
const Buffer *buffer = (block ? block->get_buffer() : 0);
if(block!=i->block || buffer!=i->buffer || binding<0)
{
i->block = block;
i->buffer = buffer;
i->changed = true;
+ i->used = block;
changes |= UNIFORMS;
}
}
auto i = lower_bound_member(textures, binding, &BoundTexture::binding);
if(i==textures.end() || i->binding!=binding)
i = textures.insert(i, BoundTexture(binding));
- i->used = (tex && samp);
if(tex!=i->texture || level!=i->level || samp!=i->sampler)
{
i->texture = tex;
i->sampler = samp;
i->level = level;
i->changed = true;
+ i->used = (tex && samp);
changes |= TEXTURES;
}
}