summaryrefslogtreecommitdiff
path: root/gfx/gl/program.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-01-16 02:53:57 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2026-01-16 03:18:29 +0000
commit09533ab9379a675a89638132fb6831b420ebb8f4 (patch)
tree984985821bcad18e0d8d93831150407e0d5b1a8e /gfx/gl/program.h
parentTidy thirdparty jam, use -isystem for thirdparty includes (diff)
downloadilt-09533ab9379a675a89638132fb6831b420ebb8f4.tar.bz2
ilt-09533ab9379a675a89638132fb6831b420ebb8f4.tar.xz
ilt-09533ab9379a675a89638132fb6831b420ebb8f4.zip
Add glDebugScope
Wrapper for glPushDebugGroup/glPopDebugGroup which allows neatly grouping OpenGL calls in diagnostic tools.
Diffstat (limited to 'gfx/gl/program.h')
-rw-r--r--gfx/gl/program.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/gfx/gl/program.h b/gfx/gl/program.h
index 20be1aa..2b06d2d 100644
--- a/gfx/gl/program.h
+++ b/gfx/gl/program.h
@@ -1,5 +1,6 @@
#pragma once
+#include "gldebug.h"
#include "shader.h" // IWYU pragma: export
#include <glRef.h>
#include <glad/gl.h>
@@ -14,7 +15,9 @@ class Program {
public:
Program() = delete;
- template<typename... S> explicit Program(const S &... srcs)
+ template<typename... S> explicit Program(const S &... srcs) : Program {glDebugScope {0}, srcs...} { }
+
+ template<typename... S> explicit Program(glDebugScope, const S &... srcs)
{
(glAttachShader(m_program, srcs.compile()), ...);
linkAndValidate();