mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
Only add buffer/tex to skymap if asked for
This commit is contained in:
parent
25607709a5
commit
4dad797e20
1 changed files with 9 additions and 5 deletions
|
@ -50,12 +50,16 @@ void Skybox::updateSchemaBuffer() const {
|
|||
}
|
||||
|
||||
void Skybox::prepare(gpu::Batch& batch, int textureSlot, int bufferSlot) const {
|
||||
batch.setUniformBuffer(bufferSlot, _schemaBuffer);
|
||||
if (bufferSlot > -1) {
|
||||
batch.setUniformBuffer(bufferSlot, _schemaBuffer);
|
||||
}
|
||||
|
||||
gpu::TexturePointer skymap = getCubemap();
|
||||
// FIXME: skymap->isDefined may not be threadsafe
|
||||
if (skymap && skymap->isDefined()) {
|
||||
batch.setResourceTexture(textureSlot, skymap);
|
||||
if (textureSlot > -1) {
|
||||
gpu::TexturePointer skymap = getCubemap();
|
||||
// FIXME: skymap->isDefined may not be threadsafe
|
||||
if (skymap && skymap->isDefined()) {
|
||||
batch.setResourceTexture(textureSlot, skymap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue