]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/sampler.cpp
Set OpenGL debug labels on various objects loaded from Resources
[libs/gl.git] / source / core / sampler.cpp
index 273f2bb712cf96a1acb0ee93f7afb6e0343f86c5..93b3b5c9f702e69e091ffbd480c438d7fe8f695c 100644 (file)
@@ -3,6 +3,7 @@
 #include <msp/gl/extensions/arb_shadow.h>
 #include <msp/gl/extensions/ext_texture_filter_anisotropic.h>
 #include <msp/gl/extensions/ext_texture3d.h>
+#include <msp/gl/extensions/khr_debug.h>
 #include <msp/strings/format.h>
 #include "error.h"
 #include "sampler.h"
@@ -255,6 +256,16 @@ void Sampler::unload()
        }
 }
 
+void Sampler::set_debug_name(const string &name)
+{
+#ifdef DEBUG
+       if(id && KHR_debug)
+               glObjectLabel(GL_SAMPLER, id, name.size(), name.c_str());
+#else
+       (void)name;
+#endif
+}
+
 
 Sampler::Loader::Loader(Sampler &s):
        DataFile::ObjectLoader<Sampler>(s)