summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-04-04 16:18:11 +0100
committerJose Fonseca <jfonseca@vmware.com>2016-04-04 16:18:11 +0100
commit1f9e61da66b89bdb2abe1882ea3b246a4e46c830 (patch)
tree85af97867e32f120055ac85df4285593f069c75d
parent8d6653ac387e5fd1a2eae549239099a05e9cac03 (diff)
gltrace: Use glfeature to decide when PBOs are supported.
-rw-r--r--helpers/glfeatures.cpp9
-rw-r--r--helpers/glfeatures.hpp2
-rw-r--r--wrappers/gltrace.py2
3 files changed, 12 insertions, 1 deletions
diff --git a/helpers/glfeatures.cpp b/helpers/glfeatures.cpp
index 69d93325..39531e71 100644
--- a/helpers/glfeatures.cpp
+++ b/helpers/glfeatures.cpp
@@ -347,6 +347,15 @@ Features::load(const Profile & profile, const Extensions & ext)
ARB_program_interface_query = ext.has("GL_ARB_program_interface_query");
NV_read_depth_stencil = ES && ext.has("GL_NV_read_depth_stencil");
+
+ if (profile.es()) {
+ pixel_buffer_object = profile.versionGreaterOrEqual(3, 1) ||
+ ext.has("GL_NV_pixel_buffer_object");
+ } else {
+ pixel_buffer_object = profile.versionGreaterOrEqual(2, 1) ||
+ ext.has("GL_ARB_pixel_buffer_object") ||
+ ext.has("GL_EXT_pixel_buffer_object");
+ }
}
diff --git a/helpers/glfeatures.hpp b/helpers/glfeatures.hpp
index a85a5927..916004c8 100644
--- a/helpers/glfeatures.hpp
+++ b/helpers/glfeatures.hpp
@@ -155,6 +155,8 @@ struct Features
unsigned ARB_shader_storage_buffer_object:1;
unsigned ARB_program_interface_query:1;
+ unsigned pixel_buffer_object:1;
+
Features(void);
void
diff --git a/wrappers/gltrace.py b/wrappers/gltrace.py
index fe1af817..bd9fe529 100644
--- a/wrappers/gltrace.py
+++ b/wrappers/gltrace.py
@@ -933,7 +933,7 @@ class GlTracer(Tracer):
print ' {'
print ' gltrace::Context *ctx = gltrace::getContext();'
print ' GLint _unpack_buffer = 0;'
- print ' if (ctx->profile.desktop())'
+ print ' if (ctx->features.pixel_buffer_object)'
print ' _glGetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, &_unpack_buffer);'
print ' if (_unpack_buffer) {'
print ' trace::localWriter.writePointer((uintptr_t)%s);' % arg.name