summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llglslshader.cpp5
-rw-r--r--indra/llrender/llrender.cpp2
-rw-r--r--indra/llrender/llrender.h6
-rw-r--r--indra/llrender/llrendertarget.cpp2
-rw-r--r--indra/llrender/llvertexbuffer.cpp78
5 files changed, 14 insertions, 79 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 9fb916acfe..e79d67c5c7 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -327,16 +327,15 @@ bool LLGLSLShader::readProfileQuery(bool for_runtime, bool force_read)
GLuint64 primitives_generated = 0;
glGetQueryObjectui64v(mPrimitivesQuery, GL_QUERY_RESULT, &primitives_generated);
#else
- GLuint samples_passed = 0;
- glGetQueryObjectuiv(mSamplesQuery, GL_QUERY_RESULT, &samples_passed);
-
GLuint primitives_generated = 0;
glGetQueryObjectuiv(mPrimitivesQuery, GL_QUERY_RESULT, &primitives_generated);
#endif
sTotalTimeElapsed += time_elapsed;
+#if GL_VERSION_1_5
sTotalSamplesDrawn += samples_passed;
mSamplesDrawn += samples_passed;
+#endif
U32 tri_count = (U32)primitives_generated / 3;
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 2c75a177f7..db3a04c581 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -2031,9 +2031,11 @@ void LLRender::debugTexUnits(void)
case LLTexUnit::TT_TEXTURE:
LL_CONT << "Texture 2D";
break;
+#if GL_VERSION_3_1
case LLTexUnit::TT_RECT_TEXTURE:
LL_CONT << "Texture Rectangle";
break;
+#endif
case LLTexUnit::TT_CUBE_MAP:
LL_CONT << "Cube Map";
break;
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index e31db7bdf2..7162ce51a4 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -69,10 +69,16 @@ public:
typedef enum
{
TT_TEXTURE = 0, // Standard 2D Texture
+#if GL_VERSION_3_1
TT_RECT_TEXTURE, // Non power of 2 texture
+#endif
TT_CUBE_MAP, // 6-sided cube map texture
+#if GL_VERSION_4_0
TT_CUBE_MAP_ARRAY, // Array of cube maps
+#endif
+#if GL_VERSION_3_2
TT_MULTISAMPLE_TEXTURE, // see GL_ARB_texture_multisample
+#endif
TT_TEXTURE_3D, // standard 3D Texture
TT_NONE, // No texture type is currently enabled
} eTextureType;
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index 180b8677ee..0e4aa2ee7a 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -255,12 +255,14 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt)
stop_glerror();
}
+#if GL_VERSION_3_1
if (mUsage != LLTexUnit::TT_RECT_TEXTURE)
{
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_MIRROR);
stop_glerror();
}
else
+#endif
{
// ATI doesn't support mirrored repeat for rectangular textures.
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index f881a12770..52ee998dcb 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -386,9 +386,6 @@ class LLDefaultVBOPool final : public LLVBOPool
{
public:
typedef std::chrono::steady_clock::time_point Time;
-
- U32 mMappingMode;
-
struct Entry
{
U8* mData;
@@ -398,7 +395,6 @@ public:
~LLDefaultVBOPool() override
{
- if(mMappingMode == 3) return;
clear();
}
@@ -417,8 +413,7 @@ public:
U64 getVramBytesUsed() override
{
- if(mMappingMode == 3) return mAllocated;
- else return mAllocated + mReserved;
+ return mAllocated + mReserved;
}
// increase the size to some common value (e.g. a power of two) to increase hit rate
@@ -440,20 +435,6 @@ public:
llassert(data == nullptr); // non null data indicates a buffer that wasn't freed
llassert(size >= 2); // any buffer size smaller than a single index is nonsensical
- if(mMappingMode == 3)
- {
- mAllocated += size;
-
- { //allocate a new buffer
- LL_PROFILE_GPU_ZONE("vbo alloc");
- // ON OS X, we don't allocate a VBO until the last possible moment
- // in unmapBuffer
- data = (U8*) ll_aligned_malloc_16(size);
- //STOP_GLERROR;
- }
- return;
- }
-
mDistributed += size;
adjustSize(size);
mAllocated += size;
@@ -507,25 +488,6 @@ public:
LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX;
llassert(type == GL_ARRAY_BUFFER || type == GL_ELEMENT_ARRAY_BUFFER);
llassert(size >= 2);
-
- if(mMappingMode == 3)
- {
- if (data)
- {
- ll_aligned_free_16(data);
- }
-
- mAllocated -= size;
- //STOP_GLERROR;
- if (name)
- {
- glDeleteBuffers(1, &name);
- }
- //STOP_GLERROR;
-
- return;
- }
-
llassert(name != 0);
llassert(data != nullptr);
@@ -1374,35 +1336,7 @@ U8* LLVertexBuffer::mapIndexBuffer(U32 index, S32 count)
// dst -- mMappedData or mMappedIndexData
void LLVertexBuffer::flush_vbo(GLenum target, U32 start, U32 end, void* data, U8* dst)
{
- if(sMappingMode == 2)
- {
- //LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("vb glMapBufferRange");
- if (end == 0) return;
- U32 buffer_size = end-start+1;
- U8 * mptr = (U8*) glMapBufferRange( target, start, end-start+1, GL_MAP_WRITE_BIT);
-
- if (mptr)
- {
- std::memcpy(mptr, (U8*) data, buffer_size);
- if(!glUnmapBuffer(target)) LL_WARNS() << "glUnmapBuffer() failed" << LL_ENDL;
- }
- else LL_WARNS() << "glMapBufferRange() returned NULL" << LL_ENDL;
- return;
- }
-
- if(sMappingMode == 3)
- {
- LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("vb memcpy");
- //STOP_GLERROR;
- // copy into mapped buffer
- memcpy(dst+start, data, end-start+1);
- return;
- }
-
- llassert(target == GL_ARRAY_BUFFER ? sGLRenderBuffer == mGLBuffer : sGLRenderIndices == mGLIndices);
-
- // skip mapped data and stream to GPU via glBufferSubData
- if (end != 0)
+ if (gGLManager.mIsApple)
{
// on OS X, flush_vbo doesn't actually write to the GL buffer, so be sure to call
// _mapBuffer to tag the buffer for flushing to GL
@@ -1698,14 +1632,6 @@ bool LLVertexBuffer::getClothWeightStrider(LLStrider<LLVector4>& strider, U32 in
// Set for rendering
void LLVertexBuffer::setBuffer()
{
- if(sMappingMode == 3)
- {
- if (!mGLBuffer)
- {
- return;
- }
- }
-
STOP_GLERROR;
if (mMapped)