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();
{
result = hash_update<64>(result, b.binding);
result = hash_update<64>(result, reinterpret_cast<uintptr_t>(b.block));
- result = hash_update<64>(result, reinterpret_cast<uintptr_t>(b.buffer));
+ result = hash_update<64>(result, reinterpret_cast<uintptr_t>(b.buffer->handle));
}
for(const PipelineState::BoundTexture &t: self.textures)
if(t.used && (t.binding>>20)==index)
{
result = hash_update<64>(result, t.binding);
- result = hash_update<64>(result, reinterpret_cast<uintptr_t>(t.texture));
- result = hash_update<64>(result, reinterpret_cast<uintptr_t>(t.sampler));
+ result = hash_update<64>(result, reinterpret_cast<uintptr_t>(t.texture->handle));
+ result = hash_update<64>(result, reinterpret_cast<uintptr_t>(t.sampler->handle));
result = hash_update<64>(result, t.level);
}