Removes ogl_WarnIfError from regular renderer code.

This was SVN commit r26850.
This commit is contained in:
vladislavbelov
2022-05-02 21:52:21 +00:00
parent a493a9f07f
commit 3ed4eaf247
28 changed files with 13 additions and 87 deletions
-1
View File
@@ -19,7 +19,6 @@
#define INCLUDED_PARTICLEEMITTERTYPE #define INCLUDED_PARTICLEEMITTERTYPE
#include "graphics/Texture.h" #include "graphics/Texture.h"
#include "lib/ogl.h"
#include "lib/file/vfs/vfs_path.h" #include "lib/file/vfs/vfs_path.h"
#include "maths/BoundingBoxAligned.h" #include "maths/BoundingBoxAligned.h"
-1
View File
@@ -24,7 +24,6 @@
#include "graphics/TerrainProperties.h" #include "graphics/TerrainProperties.h"
#include "graphics/TerrainTextureManager.h" #include "graphics/TerrainTextureManager.h"
#include "graphics/TextureManager.h" #include "graphics/TextureManager.h"
#include "lib/ogl.h"
#include "lib/utf8.h" #include "lib/utf8.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
#include "ps/CStrInternStatic.h" #include "ps/CStrInternStatic.h"
@@ -24,7 +24,6 @@
#include "graphics/TextureManager.h" #include "graphics/TextureManager.h"
#include "lib/allocators/shared_ptr.h" #include "lib/allocators/shared_ptr.h"
#include "lib/bits.h" #include "lib/bits.h"
#include "lib/ogl.h"
#include "lib/tex/tex.h" #include "lib/tex/tex.h"
#include "lib/timer.h" #include "lib/timer.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
-1
View File
@@ -23,7 +23,6 @@
#include "graphics/FontManager.h" #include "graphics/FontManager.h"
#include "graphics/ShaderProgram.h" #include "graphics/ShaderProgram.h"
#include "graphics/TextureManager.h" #include "graphics/TextureManager.h"
#include "lib/ogl.h"
#include "maths/Matrix3D.h" #include "maths/Matrix3D.h"
#include "ps/CStrIntern.h" #include "ps/CStrIntern.h"
#include "ps/CStrInternStatic.h" #include "ps/CStrInternStatic.h"
@@ -21,7 +21,6 @@
#include "lib/external_libraries/libsdl.h" #include "lib/external_libraries/libsdl.h"
#include "lib/file/vfs/vfs.h" #include "lib/file/vfs/vfs.h"
#include "lib/tex/tex.h" #include "lib/tex/tex.h"
#include "lib/ogl.h"
#include "ps/XML/Xeromyces.h" #include "ps/XML/Xeromyces.h"
class TestTextureManager : public CxxTest::TestSuite class TestTextureManager : public CxxTest::TestSuite
-1
View File
@@ -35,7 +35,6 @@
#include "gui/GUIMatrix.h" #include "gui/GUIMatrix.h"
#include "lib/bits.h" #include "lib/bits.h"
#include "lib/external_libraries/libsdl.h" #include "lib/external_libraries/libsdl.h"
#include "lib/ogl.h"
#include "lib/timer.h" #include "lib/timer.h"
#include "maths/MathUtil.h" #include "maths/MathUtil.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
-8
View File
@@ -36,7 +36,6 @@ that of Atlas depending on commandline parameters.
#include "lib/secure_crt.h" #include "lib/secure_crt.h"
#include "lib/frequency_filter.h" #include "lib/frequency_filter.h"
#include "lib/input.h" #include "lib/input.h"
#include "lib/ogl.h"
#include "lib/timer.h" #include "lib/timer.h"
#include "lib/external_libraries/libsdl.h" #include "lib/external_libraries/libsdl.h"
@@ -361,8 +360,6 @@ static void Frame()
g_Profiler2.IncrementFrameNumber(); g_Profiler2.IncrementFrameNumber();
PROFILE2_ATTR("%d", g_Profiler2.GetFrameNumber()); PROFILE2_ATTR("%d", g_Profiler2.GetFrameNumber());
ogl_WarnIfError();
// get elapsed time // get elapsed time
const double time = timer_Time(); const double time = timer_Time();
g_frequencyFilter->Update(time); g_frequencyFilter->Update(time);
@@ -420,12 +417,8 @@ static void Frame()
if (g_NetClient) if (g_NetClient)
g_NetClient->Poll(); g_NetClient->Poll();
ogl_WarnIfError();
g_GUI->TickObjects(); g_GUI->TickObjects();
ogl_WarnIfError();
if (g_RLInterface) if (g_RLInterface)
g_RLInterface->TryApplyMessage(); g_RLInterface->TryApplyMessage();
@@ -444,7 +437,6 @@ static void Frame()
g_UserReporter.Update(); g_UserReporter.Update();
g_Console->Update(realTimeSinceLastFrame); g_Console->Update(realTimeSinceLastFrame);
ogl_WarnIfError();
if (g_SoundManager) if (g_SoundManager)
g_SoundManager->IdleTask(); g_SoundManager->IdleTask();
-1
View File
@@ -25,7 +25,6 @@
#include "gui/CGUI.h" #include "gui/CGUI.h"
#include "gui/GUIManager.h" #include "gui/GUIManager.h"
#include "lib/code_generation.h" #include "lib/code_generation.h"
#include "lib/ogl.h"
#include "lib/timer.h" #include "lib/timer.h"
#include "lib/utf8.h" #include "lib/utf8.h"
#include "maths/MathUtil.h" #include "maths/MathUtil.h"
-1
View File
@@ -22,7 +22,6 @@
#include "graphics/Canvas2D.h" #include "graphics/Canvas2D.h"
#include "graphics/FontMetrics.h" #include "graphics/FontMetrics.h"
#include "graphics/TextRenderer.h" #include "graphics/TextRenderer.h"
#include "lib/ogl.h"
#include "lib/os_path.h" #include "lib/os_path.h"
#include "lib/timer.h" #include "lib/timer.h"
#include "lib/utf8.h" #include "lib/utf8.h"
-6
View File
@@ -635,8 +635,6 @@ void InitGraphics(const CmdLineArgs& args, int flags, const std::vector<CStr>& i
RunHardwareDetection(); RunHardwareDetection();
ogl_WarnIfError();
// Optionally start profiler GPU timings automatically // Optionally start profiler GPU timings automatically
// (By default it's only enabled by a hotkey, for performance/compatibility) // (By default it's only enabled by a hotkey, for performance/compatibility)
bool profilerGPUEnable = false; bool profilerGPUEnable = false;
@@ -670,8 +668,6 @@ void InitGraphics(const CmdLineArgs& args, int flags, const std::vector<CStr>& i
); );
} }
ogl_WarnIfError();
g_RenderingOptions.ReadConfigAndSetupHooks(); g_RenderingOptions.ReadConfigAndSetupHooks();
// create renderer // create renderer
@@ -679,8 +675,6 @@ void InitGraphics(const CmdLineArgs& args, int flags, const std::vector<CStr>& i
InitInput(); InitInput();
ogl_WarnIfError();
// TODO: Is this the best place for this? // TODO: Is this the best place for this?
if (VfsDirectoryExists(L"maps/")) if (VfsDirectoryExists(L"maps/"))
CXeromyces::AddValidator(g_VFS, "map", "maps/scenario.rng"); CXeromyces::AddValidator(g_VFS, "map", "maps/scenario.rng");
-1
View File
@@ -23,7 +23,6 @@
#include "gui/GUIManager.h" #include "gui/GUIManager.h"
#include "lib/config2.h" #include "lib/config2.h"
#include "lib/external_libraries/libsdl.h" #include "lib/external_libraries/libsdl.h"
#include "lib/ogl.h"
#include "lib/tex/tex.h" #include "lib/tex/tex.h"
#include "ps/CConsole.h" #include "ps/CConsole.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
-1
View File
@@ -23,7 +23,6 @@
#include "graphics/Color.h" #include "graphics/Color.h"
#include "graphics/ShaderManager.h" #include "graphics/ShaderManager.h"
#include "graphics/ShaderProgram.h" #include "graphics/ShaderProgram.h"
#include "lib/ogl.h"
#include "maths/BoundingBoxAligned.h" #include "maths/BoundingBoxAligned.h"
#include "maths/Brush.h" #include "maths/Brush.h"
#include "maths/Matrix3D.h" #include "maths/Matrix3D.h"
@@ -25,7 +25,6 @@
#include "graphics/ModelDef.h" #include "graphics/ModelDef.h"
#include "graphics/ShaderProgram.h" #include "graphics/ShaderProgram.h"
#include "lib/bits.h" #include "lib/bits.h"
#include "lib/ogl.h"
#include "lib/sysdep/rtl.h" #include "lib/sysdep/rtl.h"
#include "maths/Vector3D.h" #include "maths/Vector3D.h"
#include "renderer/Renderer.h" #include "renderer/Renderer.h"
@@ -22,7 +22,6 @@
#include "graphics/LightEnv.h" #include "graphics/LightEnv.h"
#include "graphics/Model.h" #include "graphics/Model.h"
#include "graphics/ModelDef.h" #include "graphics/ModelDef.h"
#include "lib/ogl.h"
#include "maths/Vector3D.h" #include "maths/Vector3D.h"
#include "maths/Vector4D.h" #include "maths/Vector4D.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
-1
View File
@@ -27,7 +27,6 @@
#include "lib/allocators/DynamicArena.h" #include "lib/allocators/DynamicArena.h"
#include "lib/allocators/STLAllocators.h" #include "lib/allocators/STLAllocators.h"
#include "lib/hash.h" #include "lib/hash.h"
#include "lib/ogl.h"
#include "maths/Vector3D.h" #include "maths/Vector3D.h"
#include "maths/Vector4D.h" #include "maths/Vector4D.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
-1
View File
@@ -26,7 +26,6 @@
#include "graphics/Terrain.h" #include "graphics/Terrain.h"
#include "graphics/TextureManager.h" #include "graphics/TextureManager.h"
#include "lib/hash.h" #include "lib/hash.h"
#include "lib/ogl.h"
#include "maths/MathUtil.h" #include "maths/MathUtil.h"
#include "maths/Quaternion.h" #include "maths/Quaternion.h"
#include "ps/CStrInternStatic.h" #include "ps/CStrInternStatic.h"
-1
View File
@@ -23,7 +23,6 @@
#include "graphics/LightEnv.h" #include "graphics/LightEnv.h"
#include "graphics/ShaderManager.h" #include "graphics/ShaderManager.h"
#include "lib/bits.h" #include "lib/bits.h"
#include "lib/ogl.h"
#include "maths/MathUtil.h" #include "maths/MathUtil.h"
#include "ps/ConfigDB.h" #include "ps/ConfigDB.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
-1
View File
@@ -24,7 +24,6 @@
#include "graphics/LOSTexture.h" #include "graphics/LOSTexture.h"
#include "graphics/Model.h" #include "graphics/Model.h"
#include "graphics/TextureManager.h" #include "graphics/TextureManager.h"
#include "lib/ogl.h"
#include "maths/Vector3D.h" #include "maths/Vector3D.h"
#include "maths/Vector4D.h" #include "maths/Vector4D.h"
#include "maths/Matrix3D.h" #include "maths/Matrix3D.h"
-17
View File
@@ -27,7 +27,6 @@
#include "graphics/TerrainTextureManager.h" #include "graphics/TerrainTextureManager.h"
#include "i18n/L10n.h" #include "i18n/L10n.h"
#include "lib/allocators/shared_ptr.h" #include "lib/allocators/shared_ptr.h"
#include "lib/ogl.h"
#include "lib/tex/tex.h" #include "lib/tex/tex.h"
#include "gui/GUIManager.h" #include "gui/GUIManager.h"
#include "ps/CConsole.h" #include "ps/CConsole.h"
@@ -440,7 +439,6 @@ void CRenderer::RenderFrameImpl(const bool renderGUI, const bool renderLogger)
PROFILE3("render"); PROFILE3("render");
g_Profiler2.RecordGPUFrameStart(); g_Profiler2.RecordGPUFrameStart();
ogl_WarnIfError();
g_TexMan.UploadResourcesIfNeeded(m->deviceCommandContext.get()); g_TexMan.UploadResourcesIfNeeded(m->deviceCommandContext.get());
@@ -456,12 +454,9 @@ void CRenderer::RenderFrameImpl(const bool renderGUI, const bool renderLogger)
// start new frame // start new frame
BeginFrame(); BeginFrame();
ogl_WarnIfError();
if (g_Game && g_Game->IsGameStarted()) if (g_Game && g_Game->IsGameStarted())
{ {
g_Game->GetView()->Render(); g_Game->GetView()->Render();
ogl_WarnIfError();
} }
m->deviceCommandContext->SetFramebuffer( m->deviceCommandContext->SetFramebuffer(
@@ -471,13 +466,11 @@ void CRenderer::RenderFrameImpl(const bool renderGUI, const bool renderLogger)
if (g_AtlasGameLoop && g_AtlasGameLoop->view) if (g_AtlasGameLoop && g_AtlasGameLoop->view)
{ {
g_AtlasGameLoop->view->DrawCinemaPathTool(); g_AtlasGameLoop->view->DrawCinemaPathTool();
ogl_WarnIfError();
} }
if (g_Game && g_Game->IsGameStarted()) if (g_Game && g_Game->IsGameStarted())
{ {
g_Game->GetView()->GetCinema()->Render(); g_Game->GetView()->GetCinema()->Render();
ogl_WarnIfError();
} }
RenderFrame2D(renderGUI, renderLogger); RenderFrame2D(renderGUI, renderLogger);
@@ -493,10 +486,7 @@ void CRenderer::RenderFrameImpl(const bool renderGUI, const bool renderLogger)
PROFILE2_ATTR("blend splats: %zu", stats.m_BlendSplats); PROFILE2_ATTR("blend splats: %zu", stats.m_BlendSplats);
PROFILE2_ATTR("particles: %zu", stats.m_Particles); PROFILE2_ATTR("particles: %zu", stats.m_Particles);
ogl_WarnIfError();
g_Profiler2.RecordGPUFrameEnd(); g_Profiler2.RecordGPUFrameEnd();
ogl_WarnIfError();
} }
void CRenderer::RenderFrame2D(const bool renderGUI, const bool renderLogger) void CRenderer::RenderFrame2D(const bool renderGUI, const bool renderLogger)
@@ -511,34 +501,29 @@ void CRenderer::RenderFrame2D(const bool renderGUI, const bool renderLogger)
// All GUI elements are drawn in Z order to render semi-transparent // All GUI elements are drawn in Z order to render semi-transparent
// objects correctly. // objects correctly.
g_GUI->Draw(canvas); g_GUI->Draw(canvas);
ogl_WarnIfError();
} }
// If we're in Atlas game view, render special overlays (e.g. editor bandbox). // If we're in Atlas game view, render special overlays (e.g. editor bandbox).
if (g_AtlasGameLoop && g_AtlasGameLoop->view) if (g_AtlasGameLoop && g_AtlasGameLoop->view)
{ {
g_AtlasGameLoop->view->DrawOverlays(canvas); g_AtlasGameLoop->view->DrawOverlays(canvas);
ogl_WarnIfError();
} }
{ {
GPU_SCOPED_LABEL(m->deviceCommandContext.get(), "Render console"); GPU_SCOPED_LABEL(m->deviceCommandContext.get(), "Render console");
g_Console->Render(canvas); g_Console->Render(canvas);
ogl_WarnIfError();
} }
if (renderLogger) if (renderLogger)
{ {
GPU_SCOPED_LABEL(m->deviceCommandContext.get(), "Render logger"); GPU_SCOPED_LABEL(m->deviceCommandContext.get(), "Render logger");
g_Logger->Render(canvas); g_Logger->Render(canvas);
ogl_WarnIfError();
} }
{ {
GPU_SCOPED_LABEL(m->deviceCommandContext.get(), "Render profiler"); GPU_SCOPED_LABEL(m->deviceCommandContext.get(), "Render profiler");
// Profile information // Profile information
g_ProfileViewer.RenderProfile(canvas); g_ProfileViewer.RenderProfile(canvas);
ogl_WarnIfError();
} }
} }
@@ -638,8 +623,6 @@ void CRenderer::RenderBigScreenShot(const bool needsPresent)
return; return;
} }
ogl_WarnIfError();
CCamera oldCamera = *g_Game->GetView()->GetCamera(); CCamera oldCamera = *g_Game->GetView()->GetCamera();
// Resize various things so that the sizes and aspect ratios are correct // Resize various things so that the sizes and aspect ratios are correct
+3 -30
View File
@@ -587,20 +587,17 @@ void CSceneRenderer::RenderReflections(
CShaderDefines reflectionsContext = context; CShaderDefines reflectionsContext = context;
reflectionsContext.Add(str_PASS_REFLECTIONS, str_1); reflectionsContext.Add(str_PASS_REFLECTIONS, str_1);
// Render terrain and models // Render terrain and models
RenderPatches(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS); RenderPatches(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS);
ogl_WarnIfError();
RenderModels(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS); RenderModels(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS);
ogl_WarnIfError();
RenderTransparentModels(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS, TRANSPARENT); RenderTransparentModels(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS, TRANSPARENT);
ogl_WarnIfError();
// Particles are always oriented to face the camera in the vertex shader, // Particles are always oriented to face the camera in the vertex shader,
// so they don't need the inverted cull face. // so they don't need the inverted cull face.
if (g_RenderingOptions.GetParticles()) if (g_RenderingOptions.GetParticles())
{ {
RenderParticles(deviceCommandContext, CULL_REFLECTIONS); RenderParticles(deviceCommandContext, CULL_REFLECTIONS);
ogl_WarnIfError();
} }
deviceCommandContext->SetScissors(0, nullptr); deviceCommandContext->SetScissors(0, nullptr);
@@ -660,14 +657,12 @@ void CSceneRenderer::RenderRefractions(
// Render terrain and models // Render terrain and models
RenderPatches(deviceCommandContext, context, CULL_REFRACTIONS); RenderPatches(deviceCommandContext, context, CULL_REFRACTIONS);
ogl_WarnIfError();
// Render debug-related terrain overlays to make it visible under water. // Render debug-related terrain overlays to make it visible under water.
ITerrainOverlay::RenderOverlaysBeforeWater(deviceCommandContext); ITerrainOverlay::RenderOverlaysBeforeWater(deviceCommandContext);
ogl_WarnIfError();
RenderModels(deviceCommandContext, context, CULL_REFRACTIONS); RenderModels(deviceCommandContext, context, CULL_REFRACTIONS);
ogl_WarnIfError();
RenderTransparentModels(deviceCommandContext, context, CULL_REFRACTIONS, TRANSPARENT_OPAQUE); RenderTransparentModels(deviceCommandContext, context, CULL_REFRACTIONS, TRANSPARENT_OPAQUE);
ogl_WarnIfError();
deviceCommandContext->SetScissors(0, nullptr); deviceCommandContext->SetScissors(0, nullptr);
@@ -766,8 +761,6 @@ void CSceneRenderer::RenderSubmissions(
int cullGroup = CULL_DEFAULT; int cullGroup = CULL_DEFAULT;
ogl_WarnIfError();
// Set the camera // Set the camera
g_Renderer.SetViewport(m_ViewCamera.GetViewPort()); g_Renderer.SetViewport(m_ViewCamera.GetViewPort());
@@ -793,8 +786,6 @@ void CSceneRenderer::RenderSubmissions(
RenderShadowMap(deviceCommandContext, context); RenderShadowMap(deviceCommandContext, context);
} }
ogl_WarnIfError();
if (m->waterManager.m_RenderWater) if (m->waterManager.m_RenderWater)
{ {
if (waterScissor.GetVolume() > 0 && m->waterManager.WillRenderFancyWater()) if (waterScissor.GetVolume() > 0 && m->waterManager.WillRenderFancyWater())
@@ -844,18 +835,14 @@ void CSceneRenderer::RenderSubmissions(
// render submitted patches and models // render submitted patches and models
RenderPatches(deviceCommandContext, context, cullGroup); RenderPatches(deviceCommandContext, context, cullGroup);
ogl_WarnIfError();
// render debug-related terrain overlays // render debug-related terrain overlays
ITerrainOverlay::RenderOverlaysBeforeWater(deviceCommandContext); ITerrainOverlay::RenderOverlaysBeforeWater(deviceCommandContext);
ogl_WarnIfError();
// render other debug-related overlays before water (so they can be seen when underwater) // render other debug-related overlays before water (so they can be seen when underwater)
m->overlayRenderer.RenderOverlaysBeforeWater(deviceCommandContext); m->overlayRenderer.RenderOverlaysBeforeWater(deviceCommandContext);
ogl_WarnIfError();
RenderModels(deviceCommandContext, context, cullGroup); RenderModels(deviceCommandContext, context, cullGroup);
ogl_WarnIfError();
// render water // render water
if (m->waterManager.m_RenderWater && g_Game && waterScissor.GetVolume() > 0) if (m->waterManager.m_RenderWater && g_Game && waterScissor.GetVolume() > 0)
@@ -864,45 +851,36 @@ void CSceneRenderer::RenderSubmissions(
{ {
// Render transparent stuff, but only the solid parts that can occlude block water. // Render transparent stuff, but only the solid parts that can occlude block water.
RenderTransparentModels(deviceCommandContext, context, cullGroup, TRANSPARENT_OPAQUE); RenderTransparentModels(deviceCommandContext, context, cullGroup, TRANSPARENT_OPAQUE);
ogl_WarnIfError();
m->terrainRenderer.RenderWater(deviceCommandContext, context, cullGroup, &m->shadow); m->terrainRenderer.RenderWater(deviceCommandContext, context, cullGroup, &m->shadow);
ogl_WarnIfError();
// Render transparent stuff again, but only the blended parts that overlap water. // Render transparent stuff again, but only the blended parts that overlap water.
RenderTransparentModels(deviceCommandContext, context, cullGroup, TRANSPARENT_BLEND); RenderTransparentModels(deviceCommandContext, context, cullGroup, TRANSPARENT_BLEND);
ogl_WarnIfError();
} }
else else
{ {
m->terrainRenderer.RenderWater(deviceCommandContext, context, cullGroup, &m->shadow); m->terrainRenderer.RenderWater(deviceCommandContext, context, cullGroup, &m->shadow);
ogl_WarnIfError();
// Render transparent stuff, so it can overlap models/terrain. // Render transparent stuff, so it can overlap models/terrain.
RenderTransparentModels(deviceCommandContext, context, cullGroup, TRANSPARENT); RenderTransparentModels(deviceCommandContext, context, cullGroup, TRANSPARENT);
ogl_WarnIfError();
} }
} }
else else
{ {
// render transparent stuff, so it can overlap models/terrain // render transparent stuff, so it can overlap models/terrain
RenderTransparentModels(deviceCommandContext, context, cullGroup, TRANSPARENT); RenderTransparentModels(deviceCommandContext, context, cullGroup, TRANSPARENT);
ogl_WarnIfError();
} }
// render debug-related terrain overlays // render debug-related terrain overlays
ITerrainOverlay::RenderOverlaysAfterWater(deviceCommandContext, cullGroup); ITerrainOverlay::RenderOverlaysAfterWater(deviceCommandContext, cullGroup);
ogl_WarnIfError();
// render some other overlays after water (so they can be displayed on top of water) // render some other overlays after water (so they can be displayed on top of water)
m->overlayRenderer.RenderOverlaysAfterWater(deviceCommandContext); m->overlayRenderer.RenderOverlaysAfterWater(deviceCommandContext);
ogl_WarnIfError();
// particles are transparent so render after water // particles are transparent so render after water
if (g_RenderingOptions.GetParticles()) if (g_RenderingOptions.GetParticles())
{ {
RenderParticles(deviceCommandContext, cullGroup); RenderParticles(deviceCommandContext, cullGroup);
ogl_WarnIfError();
} }
if (postprocManager.IsEnabled()) if (postprocManager.IsEnabled())
@@ -931,7 +909,6 @@ void CSceneRenderer::RenderSubmissions(
// render overlays that should appear on top of all other objects // render overlays that should appear on top of all other objects
m->overlayRenderer.RenderForegroundOverlays(deviceCommandContext, m_ViewCamera); m->overlayRenderer.RenderForegroundOverlays(deviceCommandContext, m_ViewCamera);
ogl_WarnIfError();
} }
void CSceneRenderer::EndFrame() void CSceneRenderer::EndFrame()
@@ -964,8 +941,6 @@ void CSceneRenderer::RenderTextOverlays(CCanvas2D& canvas)
if (m_DisplayTerrainPriorities) if (m_DisplayTerrainPriorities)
m->terrainRenderer.RenderPriorities(canvas, CULL_DEFAULT); m->terrainRenderer.RenderPriorities(canvas, CULL_DEFAULT);
ogl_WarnIfError();
} }
// SetSceneCamera: setup projection and transform of camera and adjust viewport to current view // SetSceneCamera: setup projection and transform of camera and adjust viewport to current view
@@ -1155,8 +1130,6 @@ void CSceneRenderer::RenderScene(
m_CurrentCullGroup = -1; m_CurrentCullGroup = -1;
ogl_WarnIfError();
RenderSubmissions(deviceCommandContext, waterScissor); RenderSubmissions(deviceCommandContext, waterScissor);
m_CurrentScene = NULL; m_CurrentScene = NULL;
-3
View File
@@ -24,7 +24,6 @@
#include "graphics/ShaderManager.h" #include "graphics/ShaderManager.h"
#include "gui/GUIMatrix.h" #include "gui/GUIMatrix.h"
#include "lib/bits.h" #include "lib/bits.h"
#include "lib/ogl.h"
#include "maths/BoundingBoxAligned.h" #include "maths/BoundingBoxAligned.h"
#include "maths/Brush.h" #include "maths/Brush.h"
#include "maths/Frustum.h" #include "maths/Frustum.h"
@@ -722,8 +721,6 @@ void ShadowMap::RenderDebugBounds()
g_Renderer.GetDebugRenderer().DrawBrush(frustumBrush, CColor(1.0f, 0.0f, 0.0f, 0.1f)); g_Renderer.GetDebugRenderer().DrawBrush(frustumBrush, CColor(1.0f, 0.0f, 0.0f, 0.1f));
g_Renderer.GetDebugRenderer().DrawBrush(frustumBrush, CColor(1.0f, 0.0f, 0.0f, 0.1f), true); g_Renderer.GetDebugRenderer().DrawBrush(frustumBrush, CColor(1.0f, 0.0f, 0.0f, 0.1f), true);
} }
ogl_WarnIfError();
} }
int ShadowMap::GetCascadeCount() const int ShadowMap::GetCascadeCount() const
-1
View File
@@ -24,7 +24,6 @@
#include "graphics/ShaderProgram.h" #include "graphics/ShaderProgram.h"
#include "graphics/Terrain.h" #include "graphics/Terrain.h"
#include "lib/bits.h" #include "lib/bits.h"
#include "lib/ogl.h"
#include "maths/MathUtil.h" #include "maths/MathUtil.h"
#include "ps/CStrInternStatic.h" #include "ps/CStrInternStatic.h"
#include "ps/Game.h" #include "ps/Game.h"
-1
View File
@@ -19,7 +19,6 @@
#include "VertexBuffer.h" #include "VertexBuffer.h"
#include "lib/ogl.h"
#include "lib/sysdep/cpu.h" #include "lib/sysdep/cpu.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
#include "ps/Errors.h" #include "ps/Errors.h"
-1
View File
@@ -19,7 +19,6 @@
#include "VertexBufferManager.h" #include "VertexBufferManager.h"
#include "lib/ogl.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
#define DUMP_VB_STATS 0 // for debugging #define DUMP_VB_STATS 0 // for debugging
-1
View File
@@ -23,7 +23,6 @@
#include "graphics/ShaderProgram.h" #include "graphics/ShaderProgram.h"
#include "lib/bits.h" #include "lib/bits.h"
#include "lib/timer.h" #include "lib/timer.h"
#include "lib/ogl.h"
#include "maths/MathUtil.h" #include "maths/MathUtil.h"
#include "maths/Vector2D.h" #include "maths/Vector2D.h"
#include "ps/CLogger.h" #include "ps/CLogger.h"
@@ -334,6 +334,7 @@ void CDeviceCommandContext::UploadBufferRegion(
{ {
// Tell the driver that it can reallocate the whole VBO // Tell the driver that it can reallocate the whole VBO
glBufferDataARB(target, buffer->GetSize(), nullptr, buffer->IsDynamic() ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW); glBufferDataARB(target, buffer->GetSize(), nullptr, buffer->IsDynamic() ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW);
ogl_WarnIfError();
// (In theory, glMapBufferRange with GL_MAP_INVALIDATE_BUFFER_BIT could be used // (In theory, glMapBufferRange with GL_MAP_INVALIDATE_BUFFER_BIT could be used
// here instead of glBufferData(..., NULL, ...) plus glMapBuffer(), but with // here instead of glBufferData(..., NULL, ...) plus glMapBuffer(), but with
@@ -348,6 +349,7 @@ void CDeviceCommandContext::UploadBufferRegion(
else else
{ {
glBufferSubDataARB(target, dataOffset, dataSize, data); glBufferSubDataARB(target, dataOffset, dataSize, data);
ogl_WarnIfError();
} }
} }
@@ -401,6 +403,7 @@ void CDeviceCommandContext::BindTexture(
glBindTexture(m_BoundTextures[unit].target, 0); glBindTexture(m_BoundTextures[unit].target, 0);
if (m_BoundTextures[unit].handle != handle) if (m_BoundTextures[unit].handle != handle)
glBindTexture(target, handle); glBindTexture(target, handle);
ogl_WarnIfError();
m_BoundTextures[unit] = {target, handle}; m_BoundTextures[unit] = {target, handle};
} }
@@ -422,6 +425,7 @@ void CDeviceCommandContext::BindBuffer(const CBuffer::Type type, CBuffer* buffer
const GLenum target = BufferTypeToGLTarget(type); const GLenum target = BufferTypeToGLTarget(type);
const GLuint handle = buffer ? buffer->GetHandle() : 0; const GLuint handle = buffer ? buffer->GetHandle() : 0;
glBindBufferARB(target, handle); glBindBufferARB(target, handle);
ogl_WarnIfError();
const size_t cacheIndex = static_cast<size_t>(type); const size_t cacheIndex = static_cast<size_t>(type);
ENSURE(cacheIndex < m_BoundBuffers.size()); ENSURE(cacheIndex < m_BoundBuffers.size());
m_BoundBuffers[cacheIndex].second = handle; m_BoundBuffers[cacheIndex].second = handle;
@@ -703,6 +707,8 @@ void CDeviceCommandContext::SetGraphicsPipelineStateImpl(
} }
#endif #endif
ogl_WarnIfError();
m_GraphicsPipelineStateDesc = pipelineStateDesc; m_GraphicsPipelineStateDesc = pipelineStateDesc;
} }
@@ -726,6 +732,7 @@ void CDeviceCommandContext::BlitFramebuffer(
0, 0, sourceFramebuffer->GetWidth(), sourceFramebuffer->GetHeight(), 0, 0, sourceFramebuffer->GetWidth(), sourceFramebuffer->GetHeight(),
(sourceFramebuffer->GetAttachmentMask() & destinationFramebuffer->GetAttachmentMask()), (sourceFramebuffer->GetAttachmentMask() & destinationFramebuffer->GetAttachmentMask()),
GL_NEAREST); GL_NEAREST);
ogl_WarnIfError();
#endif #endif
} }
@@ -776,6 +783,7 @@ void CDeviceCommandContext::SetFramebuffer(CFramebuffer* framebuffer)
ENSURE(framebuffer->GetHandle() == 0 || (framebuffer->GetWidth() > 0 && framebuffer->GetHeight() > 0)); ENSURE(framebuffer->GetHandle() == 0 || (framebuffer->GetWidth() > 0 && framebuffer->GetHeight() > 0));
m_Framebuffer = framebuffer; m_Framebuffer = framebuffer;
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer->GetHandle()); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer->GetHandle());
ogl_WarnIfError();
} }
void CDeviceCommandContext::ReadbackFramebufferSync( void CDeviceCommandContext::ReadbackFramebufferSync(
@@ -806,6 +814,7 @@ void CDeviceCommandContext::SetScissors(const uint32_t scissorCount, const Rect*
glScissor(m_Scissors[0].x, m_Scissors[0].y, m_Scissors[0].width, m_Scissors[0].height); glScissor(m_Scissors[0].x, m_Scissors[0].y, m_Scissors[0].width, m_Scissors[0].height);
} }
} }
ogl_WarnIfError();
m_ScissorCount = scissorCount; m_ScissorCount = scissorCount;
} }
@@ -813,6 +822,7 @@ void CDeviceCommandContext::SetViewports(const uint32_t viewportCount, const Rec
{ {
ENSURE(viewportCount == 1); ENSURE(viewportCount == 1);
glViewport(viewports[0].x, viewports[0].y, viewports[0].width, viewports[0].height); glViewport(viewports[0].x, viewports[0].y, viewports[0].width, viewports[0].height);
ogl_WarnIfError();
} }
void CDeviceCommandContext::SetVertexAttributeFormat( void CDeviceCommandContext::SetVertexAttributeFormat(
@@ -536,8 +536,6 @@ void ActorViewer::Render()
} }
g_Renderer.EndFrame(); g_Renderer.EndFrame();
ogl_WarnIfError();
} }
void ActorViewer::Update(float simFrameLength, float realFrameLength) void ActorViewer::Update(float simFrameLength, float realFrameLength)
@@ -28,7 +28,6 @@
#include "graphics/ObjectManager.h" #include "graphics/ObjectManager.h"
#include "gui/GUIManager.h" #include "gui/GUIManager.h"
#include "lib/external_libraries/libsdl.h" #include "lib/external_libraries/libsdl.h"
#include "lib/ogl.h"
#include "lib/timer.h" #include "lib/timer.h"
#include "maths/MathUtil.h" #include "maths/MathUtil.h"
#include "ps/CConsole.h" #include "ps/CConsole.h"