mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 08:30:35 +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
|
@ -163,6 +163,7 @@ public:
|
||||||
|
|
||||||
virtual GLuint getFramebufferID(const FramebufferPointer& framebuffer) const = 0;
|
virtual GLuint getFramebufferID(const FramebufferPointer& framebuffer) const = 0;
|
||||||
virtual GLuint getTextureID(const TexturePointer& texture, bool needTransfer = true) 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 releaseBuffer(GLuint id, Size size) const;
|
||||||
virtual void releaseTexture(GLuint id, Size size) const;
|
virtual void releaseTexture(GLuint id, Size size) const;
|
||||||
|
|
|
@ -14,6 +14,13 @@
|
||||||
using namespace gpu;
|
using namespace gpu;
|
||||||
using namespace gpu::gl;
|
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) {
|
void GLBackend::do_generateTextureMips(Batch& batch, size_t paramOffset) {
|
||||||
TexturePointer resourceTexture = batch._textures.get(batch._params[paramOffset + 0]._uint);
|
TexturePointer resourceTexture = batch._textures.get(batch._params[paramOffset + 0]._uint);
|
||||||
if (!resourceTexture) {
|
if (!resourceTexture) {
|
||||||
|
|
Loading…
Reference in a new issue