mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 12:13:40 +02:00
Allow plugins to query if a texture is ready to render
This commit is contained in:
parent
a4c5c7bc16
commit
f8690867d3
2 changed files with 8 additions and 0 deletions
libraries/gpu-gl/src/gpu/gl
|
@ -163,6 +163,7 @@ public:
|
|||
|
||||
virtual GLuint getFramebufferID(const FramebufferPointer& framebuffer) const = 0;
|
||||
virtual GLuint getTextureID(const TexturePointer& texture, bool needTransfer = true) const = 0;
|
||||
virtual bool isTextureReady(const TexturePointer& texture) const;
|
||||
|
||||
virtual void releaseBuffer(GLuint id, Size size) const;
|
||||
virtual void releaseTexture(GLuint id, Size size) const;
|
||||
|
|
|
@ -14,6 +14,13 @@
|
|||
using namespace gpu;
|
||||
using namespace gpu::gl;
|
||||
|
||||
bool GLBackend::isTextureReady(const TexturePointer& texture) const {
|
||||
// DO not transfer the texture, this call is expected for rendering texture
|
||||
GLTexture* object = syncGPUObject(texture, true);
|
||||
return object && object->isReady();
|
||||
}
|
||||
|
||||
|
||||
void GLBackend::do_generateTextureMips(Batch& batch, size_t paramOffset) {
|
||||
TexturePointer resourceTexture = batch._textures.get(batch._params[paramOffset + 0]._uint);
|
||||
if (!resourceTexture) {
|
||||
|
|
Loading…
Reference in a new issue