Removes CONFIG2_GLES from CPostprocManager and renderers.

This was SVN commit r26817.
This commit is contained in:
Vladislav Belov 2022-04-23 23:49:52 +00:00
parent df612ab8b4
commit d3a7491724
6 changed files with 7 additions and 215 deletions

View File

@ -79,10 +79,6 @@ void CDebugRenderer::DrawLine(
const std::vector<CVector3D>& line, const CColor& color,
const float width, const bool depthTestEnabled)
{
#if CONFIG2_GLES
UNUSED2(line); UNUSED2(color); UNUSED2(width); UNUSED2(depthTestEnabled);
#warning TODO: implement drawing line for GLES
#else
CShaderTechniquePtr debugLineTech =
g_Renderer.GetShaderManager().LoadEffect(str_debug_line);
Renderer::Backend::GL::CDeviceCommandContext* deviceCommandContext =
@ -134,15 +130,10 @@ void CDebugRenderer::DrawLine(
deviceCommandContext->Draw(0, vertices.size() / 3);
deviceCommandContext->EndPass();
#endif
}
void CDebugRenderer::DrawCircle(const CVector3D& origin, const float radius, const CColor& color)
{
#if CONFIG2_GLES
UNUSED2(origin); UNUSED2(radius); UNUSED2(color);
#warning TODO: implement drawing circle for GLES
#else
CShaderTechniquePtr debugCircleTech =
g_Renderer.GetShaderManager().LoadEffect(str_debug_line);
Renderer::Backend::GL::CDeviceCommandContext* deviceCommandContext =
@ -188,15 +179,10 @@ void CDebugRenderer::DrawCircle(const CVector3D& origin, const float radius, con
deviceCommandContext->Draw(0, vertices.size() / 3);
deviceCommandContext->EndPass();
#endif
}
void CDebugRenderer::DrawCameraFrustum(const CCamera& camera, const CColor& color, int intermediates, bool wireframe)
{
#if CONFIG2_GLES
UNUSED2(camera); UNUSED2(color); UNUSED2(intermediates); UNUSED2(wireframe);
#warning TODO: implement camera frustum for GLES
#else
CCamera::Quad nearPoints;
CCamera::Quad farPoints;
@ -289,7 +275,6 @@ void CDebugRenderer::DrawCameraFrustum(const CCamera& camera, const CColor& colo
#undef ADD
deviceCommandContext->EndPass();
#endif
}
void CDebugRenderer::DrawBoundingBox(

View File

@ -373,9 +373,6 @@ void OverlayRenderer::RenderOverlaysBeforeWater(
PROFILE3_GPU("overlays (before)");
GPU_SCOPED_LABEL(deviceCommandContext, "Render overlays before water");
#if CONFIG2_GLES
#warning TODO: implement OverlayRenderer::RenderOverlaysBeforeWater for GLES
#else
for (SOverlayLine* line : m->lines)
{
if (line->m_Coords.empty())
@ -383,7 +380,6 @@ void OverlayRenderer::RenderOverlaysBeforeWater(
g_Renderer.GetDebugRenderer().DrawLine(line->m_Coords, line->m_Color, static_cast<float>(line->m_Thickness));
}
#endif
}
void OverlayRenderer::RenderOverlaysAfterWater(
@ -399,15 +395,9 @@ void OverlayRenderer::RenderOverlaysAfterWater(
void OverlayRenderer::RenderTexturedOverlayLines(Renderer::Backend::GL::CDeviceCommandContext* deviceCommandContext)
{
#if CONFIG2_GLES
#warning TODO: implement OverlayRenderer::RenderTexturedOverlayLines for GLES
return;
#endif
if (m->texlines.empty())
return;
ogl_WarnIfError();
CLOSTexture& los = g_Renderer.GetSceneRenderer().GetScene().GetLOSTexture();
// ----------------------------------------------------------------------------------------
@ -504,10 +494,6 @@ void OverlayRenderer::RenderTexturedOverlayLines(
void OverlayRenderer::RenderQuadOverlays(
Renderer::Backend::GL::CDeviceCommandContext* deviceCommandContext)
{
#if CONFIG2_GLES
#warning TODO: implement OverlayRenderer::RenderQuadOverlays for GLES
return;
#endif
if (m->quadBatchMap.empty())
return;
@ -597,13 +583,8 @@ void OverlayRenderer::RenderForegroundOverlays(
{
PROFILE3_GPU("overlays (fg)");
#if CONFIG2_GLES
UNUSED2(deviceCommandContext);
UNUSED2(viewCamera);
#warning TODO: implement OverlayRenderer::RenderForegroundOverlays for GLES
#else
CVector3D right = -viewCamera.GetOrientation().GetLeft();
CVector3D up = viewCamera.GetOrientation().GetUp();
const CVector3D right = -viewCamera.GetOrientation().GetLeft();
const CVector3D up = viewCamera.GetOrientation().GetUp();
CShaderTechniquePtr tech = g_Renderer.GetShaderManager().LoadEffect(str_foreground_overlay);
Renderer::Backend::GraphicsPipelineStateDesc pipelineStateDesc =
@ -674,7 +655,6 @@ void OverlayRenderer::RenderForegroundOverlays(
}
deviceCommandContext->EndPass();
#endif
}
static void TessellateSphereFace(const CVector3D& a, u16 ai,
@ -743,10 +723,6 @@ void OverlayRenderer::RenderSphereOverlays(
{
PROFILE3_GPU("overlays (spheres)");
#if CONFIG2_GLES
UNUSED2(deviceCommandContext);
#warning TODO: implement OverlayRenderer::RenderSphereOverlays for GLES
#else
if (m->spheres.empty())
return;
@ -800,5 +776,4 @@ void OverlayRenderer::RenderSphereOverlays(
}
deviceCommandContext->EndPass();
#endif
}

View File

@ -37,8 +37,6 @@
#include "renderer/RenderingOptions.h"
#include "tools/atlas/GameInterface/GameLoop.h"
#if !CONFIG2_GLES
CPostprocManager::CPostprocManager()
: m_IsInitialized(false), m_PostProcEffect(L"default"), m_WhichBuffer(true),
m_Sharpness(0.3f), m_UsingMultisampleBuffer(false), m_MultisampleCount(0)
@ -52,8 +50,11 @@ CPostprocManager::~CPostprocManager()
bool CPostprocManager::IsEnabled() const
{
return g_RenderingOptions.GetPostProc() &&
g_VideoMode.GetBackend() != CVideoMode::Backend::GL_ARB;
return
g_RenderingOptions.GetPostProc() &&
g_VideoMode.GetBackend() != CVideoMode::Backend::GL_ARB &&
g_VideoMode.GetBackendDevice()->IsTextureFormatSupported(
Renderer::Backend::Format::D24_S8);
}
void CPostprocManager::Cleanup()
@ -683,120 +684,3 @@ void CPostprocManager::ResolveMultisampleFramebuffer(
m_PingFramebuffer.get(), m_MultisampleFramebuffer.get());
deviceCommandContext->SetFramebuffer(m_PingFramebuffer.get());
}
#else
#warning TODO: implement PostprocManager for GLES
void ApplyBlurDownscale2x(
Renderer::Backend::GL::CDeviceCommandContext* UNUSED(deviceCommandContext),
Renderer::Backend::GL::CFramebuffer* UNUSED(framebuffer),
Renderer::Backend::GL::CTexture* UNUSED(inTex),
int UNUSED(inWidth), int UNUSED(inHeight))
{
}
void CPostprocManager::ApplyBlurGauss(
Renderer::Backend::GL::CDeviceCommandContext* UNUSED(deviceCommandContext),
Renderer::Backend::GL::CTexture* UNUSED(inTex),
Renderer::Backend::GL::CTexture* UNUSED(tempTex),
Renderer::Backend::GL::CFramebuffer* UNUSED(tempFramebuffer),
Renderer::Backend::GL::CFramebuffer* UNUSED(outFramebuffer),
int UNUSED(inWidth), int UNUSED(inHeight))
{
}
void CPostprocManager::ApplyEffect(
Renderer::Backend::GL::CDeviceCommandContext* UNUSED(deviceCommandContext),
const CShaderTechniquePtr& UNUSED(shaderTech), int UNUSED(pass))
{
}
CPostprocManager::CPostprocManager()
{
}
CPostprocManager::~CPostprocManager()
{
}
bool CPostprocManager::IsEnabled() const
{
return false;
}
void CPostprocManager::Initialize()
{
}
void CPostprocManager::Resize()
{
}
void CPostprocManager::Cleanup()
{
}
void CPostprocManager::RecreateBuffers()
{
}
std::vector<CStrW> CPostprocManager::GetPostEffects()
{
return std::vector<CStrW>();
}
void CPostprocManager::SetPostEffect(const CStrW& UNUSED(name))
{
}
void CPostprocManager::SetDepthBufferClipPlanes(float UNUSED(nearPlane), float UNUSED(farPlane))
{
}
void CPostprocManager::UpdateAntiAliasingTechnique()
{
}
void CPostprocManager::UpdateSharpeningTechnique()
{
}
void CPostprocManager::UpdateSharpnessFactor()
{
}
void CPostprocManager::CaptureRenderOutput(
Renderer::Backend::GL::CDeviceCommandContext* UNUSED(deviceCommandContext))
{
}
void CPostprocManager::ApplyPostproc(
Renderer::Backend::GL::CDeviceCommandContext* UNUSED(deviceCommandContext))
{
}
void CPostprocManager::ReleaseRenderOutput(
Renderer::Backend::GL::CDeviceCommandContext* UNUSED(deviceCommandContext))
{
}
void CPostprocManager::CreateMultisampleBuffer()
{
}
void CPostprocManager::DestroyMultisampleBuffer()
{
}
bool CPostprocManager::IsMultisampleEnabled() const
{
return false;
}
void CPostprocManager::ResolveMultisampleFramebuffer(
Renderer::Backend::GL::CDeviceCommandContext* UNUSED(deviceCommandContext))
{
}
#endif

View File

@ -120,10 +120,6 @@ void TerrainOverlay::RenderBeforeWater(
if (!m_Terrain)
return; // should never happen, but let's play it safe
#if CONFIG2_GLES
UNUSED2(deviceCommandContext);
#warning TODO: implement TerrainOverlay::RenderOverlays for GLES
#else
StartRender();
ssize_t min_i, min_j, max_i, max_j;
@ -141,7 +137,6 @@ void TerrainOverlay::RenderBeforeWater(
ProcessTile(deviceCommandContext, m_i, m_j);
EndRender();
#endif
}
void TerrainOverlay::RenderTile(
@ -159,15 +154,6 @@ void TerrainOverlay::RenderTile(
// a vertex buffer or a vertex shader with a texture.
// Not sure if it's possible on old OpenGL.
#if CONFIG2_GLES
UNUSED2(deviceCommandContext);
UNUSED2(color);
UNUSED2(drawHidden);
UNUSED2(i);
UNUSED2(j);
#warning TODO: implement TerrainOverlay::RenderTile for GLES
#else
CVector3D pos[2][2];
for (int di = 0; di < 2; ++di)
for (int dj = 0; dj < 2; ++dj)
@ -238,7 +224,6 @@ void TerrainOverlay::RenderTile(
deviceCommandContext->Draw(0, vertices.size() / 3);
deviceCommandContext->EndPass();
#endif
}
void TerrainOverlay::RenderTileOutline(
@ -252,15 +237,6 @@ void TerrainOverlay::RenderTileOutline(
Renderer::Backend::GL::CDeviceCommandContext* deviceCommandContext,
const CColor& color, bool drawHidden, ssize_t i, ssize_t j)
{
#if CONFIG2_GLES
UNUSED2(deviceCommandContext);
UNUSED2(color);
UNUSED2(drawHidden);
UNUSED2(i);
UNUSED2(j);
#warning TODO: implement TerrainOverlay::RenderTileOutline for GLES
#else
std::vector<float> vertices;
#define ADD(i, j) \
m_Terrain->CalcPosition(i, j, position); \
@ -309,7 +285,6 @@ void TerrainOverlay::RenderTileOutline(
deviceCommandContext->Draw(0, vertices.size() / 3);
deviceCommandContext->EndPass();
#endif
}
//////////////////////////////////////////////////////////////////////////

View File

@ -165,13 +165,6 @@ void TerrainRenderer::RenderTerrainOverlayTexture(
int cullGroup, CMatrix3D& textureMatrix,
Renderer::Backend::GL::CTexture* texture)
{
#if CONFIG2_GLES
#warning TODO: implement TerrainRenderer::RenderTerrainOverlayTexture for GLES
UNUSED2(deviceCommandContext);
UNUSED2(cullGroup);
UNUSED2(textureMatrix);
UNUSED2(texture);
#else
ENSURE(m->phase == Phase_Render);
std::vector<CPatchRData*>& visiblePatches = m->visiblePatches[cullGroup];
@ -220,7 +213,6 @@ void TerrainRenderer::RenderTerrainOverlayTexture(
}
deviceCommandContext->EndPass();
#endif
}
@ -308,13 +300,6 @@ void TerrainRenderer::RenderPatches(
GPU_SCOPED_LABEL(deviceCommandContext, "Render terrain patches");
#if CONFIG2_GLES
UNUSED2(deviceCommandContext);
UNUSED2(defines);
UNUSED2(color);
#warning TODO: implement TerrainRenderer::RenderPatches for GLES
#else
CShaderTechniquePtr solidTech = g_Renderer.GetShaderManager().LoadEffect(str_terrain_solid, defines);
deviceCommandContext->SetGraphicsPipelineState(
solidTech->GetGraphicsPipelineStateDesc());
@ -326,7 +311,6 @@ void TerrainRenderer::RenderPatches(
CPatchRData::RenderStreams(deviceCommandContext, visiblePatches, solidShader, false);
deviceCommandContext->EndPass();
#endif
}
@ -520,10 +504,6 @@ void TerrainRenderer::RenderSimpleWater(
Renderer::Backend::GL::CDeviceCommandContext* deviceCommandContext,
int cullGroup)
{
#if CONFIG2_GLES
UNUSED2(deviceCommandContext);
UNUSED2(cullGroup);
#else
PROFILE3_GPU("simple water");
GPU_SCOPED_LABEL(deviceCommandContext, "Render Simple Water");
@ -562,7 +542,6 @@ void TerrainRenderer::RenderSimpleWater(
deviceCommandContext->BindTexture(1, GL_TEXTURE_2D, 0);
deviceCommandContext->EndPass();
#endif
}
///////////////////////////////////////////////////////////////////

View File

@ -24,7 +24,6 @@
#include "lib/bits.h"
#include "lib/timer.h"
#include "lib/ogl.h"
#include "lib/tex/tex.h"
#include "maths/MathUtil.h"
#include "maths/Vector2D.h"
#include "ps/CLogger.h"
@ -791,10 +790,6 @@ void WaterManager::RenderWaves(
const CFrustum& frustrum)
{
GPU_SCOPED_LABEL(deviceCommandContext, "Render Waves");
#if CONFIG2_GLES
UNUSED2(frustrum);
#warning Fix WaterManager::RenderWaves on GLES
#else
if (!m_WaterFancyEffects)
return;
@ -872,7 +867,6 @@ void WaterManager::RenderWaves(
deviceCommandContext->EndPass();
deviceCommandContext->SetFramebuffer(
deviceCommandContext->GetDevice()->GetCurrentBackbuffer());
#endif
}
void WaterManager::RecomputeWaterData()