summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--game/network/rail.cpp4
-rw-r--r--game/scenary/foliage.cpp7
-rw-r--r--game/scenary/illuminator.cpp5
-rw-r--r--game/terrain.cpp3
-rw-r--r--game/vehicles/railVehicleClass.cpp3
-rw-r--r--game/water.cpp1
-rw-r--r--gfx/gl/shadowStenciller.cpp1
7 files changed, 21 insertions, 3 deletions
diff --git a/game/network/rail.cpp b/game/network/rail.cpp
index 1ae5aca..13d5ef5 100644
--- a/game/network/rail.cpp
+++ b/game/network/rail.cpp
@@ -157,6 +157,7 @@ namespace {
renderType(const NetworkLinkHolder<LinkType> & networkLinks, auto & shader, GLenum mode)
{
if (auto count = networkLinks.vertices.size()) {
+ auto _ = glDebugScope(networkLinks.vao);
shader.use(RAIL_CROSS_SECTION, RAIL_TEXTURE_POS);
glBindVertexArray(networkLinks.vao);
networkLinks.vao.useBuffer(0, networkLinks.vertices);
@@ -168,7 +169,8 @@ namespace {
void
RailLinks::render(const SceneShader & shader, const Frustum &) const
{
- if (auto _ = glDebugScope(0); !links.empty()) {
+ if (!links.empty()) {
+ auto _ = glDebugScope(0);
texture->bind(0);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-1, 0);
diff --git a/game/scenary/foliage.cpp b/game/scenary/foliage.cpp
index 528d3e1..b5b409e 100644
--- a/game/scenary/foliage.cpp
+++ b/game/scenary/foliage.cpp
@@ -37,6 +37,7 @@ void
Foliage::postLoad()
{
texture = getTexture();
+ glDebugScope _ {0};
bodyMesh->configureVAO(instanceVAO, 0)
.addAttribs<LocationVertex, &LocationVertex::rotation, &LocationVertex::position>(1);
instancePointVAO.configure().addAttribs<LocationVertex, &LocationVertex::position, &LocationVertex::yaw>(0);
@@ -92,7 +93,7 @@ void
Foliage::render(const SceneShader & shader, const Frustum &) const
{
if (instancePartitions.first) {
- glDebugScope _ {instancePointVAO};
+ glDebugScope _ {instanceVAO};
std::ignore = instances.size();
if (const auto count = instancePartitions.first - instancePartitions.second.first) {
glDebugScope _ {0, "Billboard"};
@@ -122,9 +123,10 @@ void
Foliage::shadows(const ShadowMapper & mapper, const Frustum &) const
{
if (instancePartitions.second.second) {
- glDebugScope _ {instancePointVAO};
+ glDebugScope _ {instanceVAO};
std::ignore = instances.size();
if (const auto count = instancePartitions.second.second - instancePartitions.second.first) {
+ glDebugScope _ {0, "Billboard"};
const auto dimensions = bodyMesh->getDimensions();
mapper.stencilShadowProgram.use(dimensions.centre, dimensions.size);
shadowStencil.bind(0);
@@ -134,6 +136,7 @@ Foliage::shadows(const ShadowMapper & mapper, const Frustum &) const
glBindVertexArray(0);
}
if (const auto count = instancePartitions.second.first) {
+ glDebugScope _ {0, "Mesh"};
if (texture) {
texture->bind(3);
mapper.dynamicPointInstWithTextures.use();
diff --git a/game/scenary/illuminator.cpp b/game/scenary/illuminator.cpp
index 382cc60..a0ea5be 100644
--- a/game/scenary/illuminator.cpp
+++ b/game/scenary/illuminator.cpp
@@ -40,6 +40,7 @@ Illuminator::postLoad()
throw std::logic_error {"Illuminator has no lights"};
}
texture = getTexture();
+ glDebugScope _ {0};
bodyMesh->configureVAO(instanceVAO, 0)
.addAttribs<LocationVertex, &LocationVertex::first, &LocationVertex::second>(1);
if (!spotLight.empty()) {
@@ -70,6 +71,7 @@ void
Illuminator::render(const SceneShader & shader, const Frustum &) const
{
if (const auto count = instances.size()) {
+ glDebugScope _ {instanceVAO};
shader.basicInst.use();
if (texture) {
texture->bind(0);
@@ -83,7 +85,9 @@ void
Illuminator::lights(const SceneShader & shader) const
{
if (const auto count = instances.size()) {
+ glDebugScope _ {instanceVAO};
if (const auto scount = instancesSpotLight.size()) {
+ glDebugScope _ {*instancesSpotLightVAO, "Spot lights"};
shader.spotLightInst.use();
glBindVertexArray(*instancesSpotLightVAO);
instancesSpotLightVAO->useBuffer(0, instancesSpotLight);
@@ -91,6 +95,7 @@ Illuminator::lights(const SceneShader & shader) const
glDrawArraysInstanced(GL_POINTS, 0, static_cast<GLsizei>(scount), static_cast<GLsizei>(count));
}
if (const auto pcount = instancesPointLight.size()) {
+ glDebugScope _ {*instancesPointLightVAO, "Point llights"};
shader.pointLightInst.use();
glBindVertexArray(*instancesPointLightVAO);
instancesPointLightVAO->useBuffer(0, instancesPointLight);
diff --git a/game/terrain.cpp b/game/terrain.cpp
index 065842f..43b1152 100644
--- a/game/terrain.cpp
+++ b/game/terrain.cpp
@@ -108,6 +108,7 @@ Terrain::pruneOrphanMeshes(const SurfaceIndices & surfaceIndices)
void
Terrain::generateMeshes()
{
+ glDebugScope _ {0};
copyVerticesToBuffer();
const auto surfaceIndices = mapSurfaceFacesToIndices();
copyIndicesToBuffers(surfaceIndices);
@@ -128,6 +129,7 @@ Terrain::afterChange()
void
Terrain::render(const SceneShader & shader, const Frustum & frustum) const
{
+ glDebugScope _ {0};
grass->bind(0);
const auto chunkBySurface = std::views::chunk_by([](const auto & itr1, const auto & itr2) {
@@ -149,6 +151,7 @@ Terrain::render(const SceneShader & shader, const Frustum & frustum) const
void
Terrain::shadows(const ShadowMapper & shadowMapper, const Frustum & frustum) const
{
+ glDebugScope _ {0};
shadowMapper.landmess.use();
for (const auto & [surface, sab] : meshes) {
if (frustum.contains(sab.aabb)) {
diff --git a/game/vehicles/railVehicleClass.cpp b/game/vehicles/railVehicleClass.cpp
index 21a5666..d94d4ca 100644
--- a/game/vehicles/railVehicleClass.cpp
+++ b/game/vehicles/railVehicleClass.cpp
@@ -33,6 +33,7 @@ void
RailVehicleClass::postLoad()
{
texture = getTexture();
+ glDebugScope _ {0};
bodyMesh->configureVAO(instanceVAO, 0)
.addAttribs<LocationVertex, &LocationVertex::body, &LocationVertex::bodyPos>(1);
bogies.front()
@@ -48,6 +49,7 @@ void
RailVehicleClass::render(const SceneShader & shader, const Frustum &) const
{
if (const auto count = static_cast<GLsizei>(instances.size())) {
+ glDebugScope _ {instanceVAO};
if (texture) {
texture->bind(0);
}
@@ -65,6 +67,7 @@ void
RailVehicleClass::shadows(const ShadowMapper & mapper, const Frustum &) const
{
if (const auto count = static_cast<GLsizei>(instances.size())) {
+ glDebugScope _ {instanceVAO};
mapper.dynamicPointInst.use();
bodyMesh->drawInstanced(instanceVAO, count);
bogies.front()->drawInstanced(instancesBogiesVAO.front(), count);
diff --git a/game/water.cpp b/game/water.cpp
index b8d51db..a3c1452 100644
--- a/game/water.cpp
+++ b/game/water.cpp
@@ -104,6 +104,7 @@ Water::tick(TickDuration dur)
void
Water::render(const SceneShader & shader, const Frustum &) const
{
+ glDebugScope _ {0};
shader.water.use(waveCycle);
water->bind(0);
meshes.apply(&MeshT<GlobalPosition3D>::draw);
diff --git a/gfx/gl/shadowStenciller.cpp b/gfx/gl/shadowStenciller.cpp
index 9d43fdc..77ce309 100644
--- a/gfx/gl/shadowStenciller.cpp
+++ b/gfx/gl/shadowStenciller.cpp
@@ -39,6 +39,7 @@ ShadowStenciller::getLightDirection() const
void
ShadowStenciller::configureStencilTexture(glTexture<GL_TEXTURE_2D_ARRAY> & stencil, ImageDimensions size)
{
+ glDebugScope _ {0};
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
stencil.storage(1, GL_DEPTH_COMPONENT16, size || STENCIL_ANGLES<GLsizei>);
stencil.parameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR);