glgsg: Expose native IDs for other kinds of resources than textures
Fixes #1468
This commit is contained in:
parent
d94b2dc5af
commit
0b3bdae8e8
|
|
@ -47,3 +47,13 @@ evict_lru() {
|
|||
update_data_size_bytes(0);
|
||||
set_resident(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(BufferContext)::
|
||||
get_native_id() const {
|
||||
return _index;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ public:
|
|||
|
||||
virtual void evict_lru();
|
||||
|
||||
virtual uint64_t get_native_id() const;
|
||||
|
||||
CLP(GraphicsStateGuardian) *_glgsg;
|
||||
|
||||
// This is the GL "name" of the data object.
|
||||
|
|
|
|||
|
|
@ -47,3 +47,13 @@ evict_lru() {
|
|||
update_data_size_bytes(0);
|
||||
mark_unloaded();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(IndexBufferContext)::
|
||||
get_native_id() const {
|
||||
return _index;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ public:
|
|||
|
||||
virtual void evict_lru();
|
||||
|
||||
virtual uint64_t get_native_id() const;
|
||||
|
||||
CLP(GraphicsStateGuardian) *_glgsg;
|
||||
|
||||
// This is the GL "name" of the data object.
|
||||
|
|
|
|||
|
|
@ -68,4 +68,14 @@ reset_data() {
|
|||
// the sampler later. glGenSamplers(1, &_index);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(SamplerContext)::
|
||||
get_native_id() const {
|
||||
return _index;
|
||||
}
|
||||
|
||||
#endif // OPENGLES_1
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ public:
|
|||
virtual void evict_lru();
|
||||
void reset_data();
|
||||
|
||||
virtual uint64_t get_native_id() const;
|
||||
|
||||
// This is the GL "name" of the sampler object.
|
||||
GLuint _index;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,3 +47,13 @@ evict_lru() {
|
|||
update_data_size_bytes(0);
|
||||
mark_unloaded();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(VertexBufferContext)::
|
||||
get_native_id() const {
|
||||
return _index;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ public:
|
|||
|
||||
virtual void evict_lru();
|
||||
|
||||
virtual uint64_t get_native_id() const;
|
||||
|
||||
CLP(GraphicsStateGuardian) *_glgsg;
|
||||
|
||||
// This is the GL "name" of the data object.
|
||||
|
|
|
|||
|
|
@ -31,3 +31,13 @@ void SavedContext::
|
|||
write(std::ostream &out, int indent_level) const {
|
||||
indent(out, indent_level) << *this << "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 SavedContext::
|
||||
get_native_id() const {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,10 +31,12 @@ public:
|
|||
virtual void write(std::ostream &out, int indent_level) const;
|
||||
|
||||
PUBLISHED:
|
||||
virtual uint64_t get_native_id() const;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
}
|
||||
public:
|
||||
static void init_type() {
|
||||
TypedObject::init_type();
|
||||
register_type(_type_handle, "SavedContext",
|
||||
|
|
|
|||
|
|
@ -15,16 +15,6 @@
|
|||
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -37,7 +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_id() const;
|
||||
virtual uint64_t get_native_buffer_id() const;
|
||||
|
||||
INLINE bool was_modified() const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue