summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llterrainpaintmap.cpp18
-rw-r--r--indra/newview/llterrainpaintmap.h6
-rw-r--r--indra/newview/llvlcomposition.h2
3 files changed, 9 insertions, 17 deletions
diff --git a/indra/newview/llterrainpaintmap.cpp b/indra/newview/llterrainpaintmap.cpp
index 09caba8faa..52376e3bf0 100644
--- a/indra/newview/llterrainpaintmap.cpp
+++ b/indra/newview/llterrainpaintmap.cpp
@@ -56,15 +56,15 @@ void check_tex(const LLViewerTexture& tex)
llassert(tex.getPrimaryFormat() == GL_RGB);
llassert(tex.getGLTexture());
}
+#else
+#define check_tex(tex)
#endif
} // namespace
// static
bool LLTerrainPaintMap::bakeHeightNoiseIntoPBRPaintMapRGB(const LLViewerRegion& region, LLViewerTexture& tex)
{
-#ifdef SHOW_ASSERT
check_tex(tex);
-#endif
const LLSurface& surface = region.getLand();
const U32 patch_count = surface.getPatchesPerEdge();
@@ -309,9 +309,7 @@ void LLTerrainPaintMap::applyPaintQueueRGB(LLViewerTexture& tex, LLTerrainPaintQ
{
if (queue.empty()) { return; }
-#ifdef SHOW_ASSERT
check_tex(tex);
-#endif
gGL.getTexUnit(0)->bind(tex.getGLTexture(), false, true);
@@ -362,7 +360,7 @@ namespace
// plane.
// *NOTE: Because we know the vertex XY coordinates go from 0 to 1
// pre-transform, UVs can be calculated from the vertices
-LLVertexBuffer& get_paint_triangle_buffer()
+LLVertexBuffer* get_paint_triangle_buffer()
{
static LLPointer<LLVertexBuffer> buf = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX);
static bool initialized = false;
@@ -395,7 +393,7 @@ LLVertexBuffer& get_paint_triangle_buffer()
*(indices++) = 2;
buf->unmapBuffer();
}
- return *buf;
+ return buf.get();
}
};
@@ -403,9 +401,7 @@ LLVertexBuffer& get_paint_triangle_buffer()
// static
LLTerrainPaintQueue LLTerrainPaintMap::convertPaintQueueRGBAToRGB(LLViewerTexture& tex, LLTerrainPaintQueue& queue_in)
{
-#ifdef SHOW_ASSERT
check_tex(tex);
-#endif
llassert(queue_in.getComponents() == LLTerrainPaint::RGBA);
// TODO: Avoid allocating a scratch render buffer and use mAuxillaryRT instead
@@ -429,7 +425,7 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertPaintQueueRGBAToRGB(LLViewerTextur
const F32 target_half_width = (F32)scratch_target.getWidth() / 2.0f;
const F32 target_half_height = (F32)scratch_target.getHeight() / 2.0f;
- LLVertexBuffer* buf = &get_paint_triangle_buffer();
+ LLVertexBuffer* buf = get_paint_triangle_buffer();
// Update projection matrix and viewport
// *NOTE: gl_state_for_2d also sets the modelview matrix. This will be overridden later.
@@ -621,9 +617,7 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertPaintQueueRGBAToRGB(LLViewerTextur
// static
LLTerrainPaintQueue LLTerrainPaintMap::convertBrushQueueToPaintRGB(const LLViewerRegion& region, LLViewerTexture& tex, LLTerrainBrushQueue& queue_in)
{
-#ifdef SHOW_ASSERT
check_tex(tex);
-#endif
// TODO: Avoid allocating a scratch render buffer and use mAuxillaryRT instead
// TODO: even if it means performing extra render operations to apply the brushes, in rare cases where the paints can't all fit within an area that can be represented by the buffer
@@ -646,7 +640,7 @@ LLTerrainPaintQueue LLTerrainPaintMap::convertBrushQueueToPaintRGB(const LLViewe
const F32 target_half_width = (F32)scratch_target.getWidth() / 2.0f;
const F32 target_half_height = (F32)scratch_target.getHeight() / 2.0f;
- LLVertexBuffer* buf = &get_paint_triangle_buffer();
+ LLVertexBuffer* buf = get_paint_triangle_buffer();
// Update projection matrix and viewport
// *NOTE: gl_state_for_2d also sets the modelview matrix. This will be overridden later.
diff --git a/indra/newview/llterrainpaintmap.h b/indra/newview/llterrainpaintmap.h
index cffdad80a2..6c321dc9c6 100644
--- a/indra/newview/llterrainpaintmap.h
+++ b/indra/newview/llterrainpaintmap.h
@@ -26,7 +26,7 @@
#pragma once
-#include "llviewerprecompiledheaders.h"
+#include <memory>
class LLTexture;
class LLViewerRegion;
@@ -90,8 +90,8 @@ struct LLTerrainPaint
U16 mWidthY;
U8 mBitDepth;
U8 mComponents;
- const static U8 RGB = 3;
- const static U8 RGBA = 4;
+ static constexpr U8 RGB = 3;
+ static constexpr U8 RGBA = 4;
std::vector<U8> mData;
// Asserts that this paint's start/width fit within the bounds of the
diff --git a/indra/newview/llvlcomposition.h b/indra/newview/llvlcomposition.h
index 9a5d74adda..21fd484375 100644
--- a/indra/newview/llvlcomposition.h
+++ b/indra/newview/llvlcomposition.h
@@ -27,8 +27,6 @@
#ifndef LL_LLVLCOMPOSITION_H
#define LL_LLVLCOMPOSITION_H
-#include <memory>
-
#include "llviewerlayer.h"
#include "llviewershadermgr.h"
#include "llviewertexture.h"