Make gcc happier.

This commit is contained in:
Shyotl
2018-11-20 02:49:57 -06:00
parent 523717477d
commit 04ea11c61e
18 changed files with 28 additions and 30 deletions

View File

@@ -80,14 +80,14 @@ void LLCubeMap::initGL()
// Not initialized, do stuff.
if (mImages[0].isNull())
{
auto texname = LLImageGL::createTextureName();
LLImageGL::GLTextureName texname = LLImageGL::createTextureName();
for (int i = 0; i < 6; i++)
{
mImages[i] = new LLImageGL(64, 64, 4, (use_cube_mipmaps? TRUE : FALSE));
mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP);
mRawImages[i] = new LLImageRaw(64, 64, 4);
mImages[i]->createGLTexture(0, mRawImages[i], texname);
mImages[i]->createGLTexture(0, mRawImages[i], &texname);
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname->getTexName());
mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP);

View File

@@ -73,9 +73,9 @@ void* gl_get_proc_address(const char *pStr)
#undef GLH_EXT_GET_PROC_ADDRESS
#define GLH_EXT_GET_PROC_ADDRESS(p) gl_get_proc_address(p)
#undef GLH_EXT_GET_PROC_ADDRESS_CORE
#define GLH_EXT_GET_PROC_ADDRESS_CORE(ver, p) gl_get_proc_address((mGLVersion >= ver) ? p : p##"ARB")
#define GLH_EXT_GET_PROC_ADDRESS_CORE(ver, p) gl_get_proc_address((mGLVersion >= ver) ? p : p"ARB")
#undef GLH_EXT_GET_PROC_ADDRESS_CORE_EXT
#define GLH_EXT_GET_PROC_ADDRESS_CORE_EXT(ver, p) gl_get_proc_address((mGLVersion >= ver) ? p : p##"EXT")
#define GLH_EXT_GET_PROC_ADDRESS_CORE_EXT(ver, p) gl_get_proc_address((mGLVersion >= ver) ? p : p"EXT")
#undef GLH_EXT_GET_PROC_ADDRESS_CORE_OR_ARB
#define GLH_EXT_GET_PROC_ADDRESS_CORE_OR_ARB(ver, p, arb) gl_get_proc_address((mGLVersion >= ver) ? p : arb)
#endif //!LL_DARWIN

View File

@@ -349,6 +349,7 @@ private:
}
};
#define initLLGLState(state, value, disabler_ptr) \
template <> \
LLGLStateStaticData LLGLState<state>::staticData = {#state, state, value, 0, nullptr, disabler_ptr}; \
bool registered_##state = LLGLStateValidator::registerStateData(LLGLState<state>::staticData);

View File

@@ -167,7 +167,7 @@ BOOL LLGLTexture::createGLTexture()
return mGLTexturep->createGLTexture() ;
}
BOOL LLGLTexture::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, LLImageGL::GLTextureName& usename, BOOL to_create, S32 category)
BOOL LLGLTexture::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, LLImageGL::GLTextureName* usename, BOOL to_create, S32 category)
{
llassert(mGLTexturep.notNull()) ;

View File

@@ -123,7 +123,7 @@ public:
BOOL hasGLTexture() const ;
LLGLuint getTexName() const ;
BOOL createGLTexture() ;
BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, LLImageGL::GLTextureName& usename = LLImageGL::GLTextureName(), BOOL to_create = TRUE, S32 category = LLGLTexture::OTHER);
BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, LLImageGL::GLTextureName* usename = nullptr, BOOL to_create = TRUE, S32 category = LLGLTexture::OTHER);
void setFilteringOption(LLTexUnit::eTextureFilterOptions option);
void setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format = 0, BOOL swap_bytes = FALSE);
void setAddressMode(LLTexUnit::eTextureAddressMode mode);

View File

@@ -222,7 +222,7 @@ void LLImageGL::setHighlightTexture(S32 category)
}
}
}
sHighlightTexturep->createGLTexture(0, image_raw, LLImageGL::GLTextureName(), TRUE, category);
sHighlightTexturep->createGLTexture(0, image_raw, nullptr, TRUE, category);
image_raw = NULL;
}
@@ -386,7 +386,7 @@ void LLImageGL::restoreGL()
if (data.notNull() && glimage->getComponents() &&
data->getComponents() &&
glimage->mSaveDiscardLevel >= 0 &&
glimage->createGLTexture(glimage->mSaveDiscardLevel, data, LLImageGL::GLTextureName(), TRUE, glimage->getCategory()))
glimage->createGLTexture(glimage->mSaveDiscardLevel, data, nullptr, TRUE, glimage->getCategory()))
{
stop_glerror();
/*if (glimage->getHasGLTexture())
@@ -1633,7 +1633,7 @@ BOOL LLImageGL::createGLTexture()
}
static LLTrace::BlockTimerStatHandle FTM_CREATE_GL_TEXTURE2("createGLTexture(raw)");
BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, GLTextureName& usename, BOOL to_create, S32 category)
BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, GLTextureName* usename, BOOL to_create, S32 category)
{
LL_RECORD_BLOCK_TIME(FTM_CREATE_GL_TEXTURE2);
if (gGLManager.mIsDisabled)
@@ -1710,7 +1710,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, G
}
static LLTrace::BlockTimerStatHandle FTM_CREATE_GL_TEXTURE3("createGLTexture3(data)");
BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_hasmips, GLTextureName& usename)
BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_hasmips, GLTextureName* usename)
{
LL_RECORD_BLOCK_TIME(FTM_CREATE_GL_TEXTURE3);
llassert(data_in);
@@ -1733,9 +1733,9 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
// S32 old_discard = mCurrentDiscardLevel;
if (usename)
if (usename && *usename)
{
mTexName = usename;
mTexName = *usename;
}
else
{

View File

@@ -155,9 +155,9 @@ public:
static void setManualImage(U32 target, S32 miplevel, S32 intformat, S32 width, S32 height, U32 pixformat, U32 pixtype, const void *pixels, bool allow_compression = true);
BOOL createGLTexture() ;
BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, GLTextureName& usename = GLTextureName(), BOOL to_create = TRUE,
BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, GLTextureName* usename = nullptr, BOOL to_create = TRUE,
S32 category = sMaxCategories-1);
BOOL createGLTexture(S32 discard_level, const U8* data, BOOL data_hasmips = FALSE, GLTextureName& usename = GLTextureName());
BOOL createGLTexture(S32 discard_level, const U8* data, BOOL data_hasmips = FALSE, GLTextureName* usename = nullptr);
void setImage(const LLImageRaw* imageraw);
void setImage(const U8* data_in, BOOL data_hasmips = FALSE);
BOOL setSubImage(const LLImageRaw* imageraw, S32 x_pos, S32 y_pos, S32 width, S32 height, BOOL force_fast_update = FALSE);

View File

@@ -2139,7 +2139,7 @@ void LLRender::setAmbientLightColor(const LLColor4& color)
void LLRender::setLineWidth(F32 line_width)
{
//if (LLRender::sGLCoreProfile)
if (LLRender::sGLCoreProfile)
{
mNewContext.lineWidth = 1.f;
return;

View File

@@ -295,9 +295,9 @@ protected:
ptrdiff_t mAlignedOffset;
ptrdiff_t mAlignedIndexOffset;
S32 mSize;
S32 mResidentSize;
U32 mResidentSize;
S32 mIndicesSize;
S32 mResidentIndicesSize;
U32 mResidentIndicesSize;
U32 mTypeMask;
const S32 mUsage; // GL usage