Add a way to get access to OpenGL texture index

This commit is contained in:
rdb 2017-10-05 17:34:26 +02:00
parent b71ee446e3
commit 85a9cdd052
4 changed files with 47 additions and 0 deletions

View File

@ -95,6 +95,27 @@ reset_data() {
#endif
}
/**
* Returns an implementation-defined handle or pointer that can be used
* to interface directly with the underlying API.
* Returns 0 if the underlying implementation does not support this.
*/
uint64_t CLP(TextureContext)::
get_native_id() const {
return _index;
}
/**
* Similar to get_native_id, but some implementations use a separate
* identifier for the buffer object associated with buffer textures.
* Returns 0 if the underlying implementation does not support this, or
* if this is not a buffer texture.
*/
uint64_t CLP(TextureContext)::
get_native_buffer_id() const {
return _buffer;
}
/**
*
*/

View File

@ -33,6 +33,9 @@ public:
virtual void evict_lru();
void reset_data();
virtual uint64_t get_native_id() const;
virtual uint64_t get_native_buffer_id() const;
#ifndef OPENGLES
void make_handle_resident();
GLuint64 get_handle();

View File

@ -15,6 +15,27 @@
TypeHandle TextureContext::_type_handle;
/**
* Returns an implementation-defined handle or pointer that can be used
* to interface directly with the underlying API.
* Returns 0 if the underlying implementation does not support this.
*/
uint64_t TextureContext::
get_native_id() const {
return 0;
}
/**
* Similar to get_native_id, but some implementations use a separate
* identifier for the buffer object associated with buffer textures.
* Returns 0 if the underlying implementation does not support this, or
* if this is not a buffer texture.
*/
uint64_t TextureContext::
get_native_buffer_id() const {
return 0;
}
/**
*
*/

View File

@ -37,6 +37,8 @@ public:
PUBLISHED:
INLINE Texture *get_texture() const;
INLINE int get_view() const;
virtual uint64_t get_native_id() const;
virtual uint64_t get_native_buffer_id() const;
INLINE bool was_modified() const;
INLINE bool was_properties_modified() const;