Commit ca5b534c authored by Kitty Barnett's avatar Kitty Barnett
Browse files

Merged with .Catznip tip

--HG--
branch : Catznip
parents 3cdca55e 75f97297
b5db4628537f1113e030b35c5ab2271f44e157f5
\ No newline at end of file
529a80ebe5bef90841727e65eb2dd5e9875ab23a
\ No newline at end of file
......@@ -536,6 +536,7 @@ ad0e15543836d64d6399d28b32852510435e344a 5.1.0-release
2eb917875efdfe920680b9049302d0f03721245d 5.1.2-release
7c00e5b6cb3d95712e9d8e29277c805bca2bda90 5.1.3-release
7b6b020fd5ad9a8dc3670c5c92d1ca92e55fc485 5.1.4-release
2ea47f358b171178eb9a95503a1670d519c2886f 5.1.5-release
0000000000000000000000000000000000000000 v2start
0000000000000000000000000000000000000000 alpha-3
0000000000000000000000000000000000000000 fork to viewer-2-0
......@@ -1075,6 +1076,7 @@ ad0e15543836d64d6399d28b32852510435e344a 5.1.0-release
0000000000000000000000000000000000000000 5.1.2-release
0000000000000000000000000000000000000000 5.1.3-release
0000000000000000000000000000000000000000 5.1.4-release
0000000000000000000000000000000000000000 5.1.5-release
4f777ffb99fefdc6497c61385c22688ff149c659 SL-2.0.0
668851b2ef0f8cf8df07a0fba429e4a6c1e70abb SL-2.0.1
b03065d018b8a2e28b7de85b293a4c992cb4c12d SL-2.1.0
......@@ -1200,6 +1202,7 @@ ad0e15543836d64d6399d28b32852510435e344a SL-5.1.0
2eb917875efdfe920680b9049302d0f03721245d SL-5.1.2
7c00e5b6cb3d95712e9d8e29277c805bca2bda90 SL-5.1.3
7b6b020fd5ad9a8dc3670c5c92d1ca92e55fc485 SL-5.1.4
2ea47f358b171178eb9a95503a1670d519c2886f SL-5.1.5
89532c8dfd5b6c29f1cb032665b44a74a52452e1 RLVa-1.3.0
7bc5039ccf0b36eafbf6ce33a52b5e26332aa04c RLVa-1.3.1
a563f7e215c7883c1cfd20908085687a0ed96284 RLVa-1.4.0
......
......@@ -1632,11 +1632,11 @@
<key>darwin</key>
<map>
<key>archive</key>
<map>
<map>
<key>hash</key>
<string>7b769c4284bdbd5fce536395d1eab695</string>
<string>3855bd40f950e3c22739ae8f3ee2afc9</string>
<key>url</key>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4054/11304/kdu-7.9.1.504041-darwin-504041.tar.bz2</string>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15258/98444/kdu-7.10.4.513518-darwin-513518.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
......@@ -1645,10 +1645,10 @@
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>a48db5cf79a4631090bfc968572d9953</string>
<key>hash</key>
<string>d1521becaf21bf7233173722af63f57d</string>
<key>url</key>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4052/11292/kdu-7.9.1.504041-darwin64-504041.tar.bz2</string>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15257/98440/kdu-7.10.4.513518-darwin64-513518.tar.bz2</string>
</map>
<key>name</key>
<string>darwin64</string>
......@@ -1657,10 +1657,10 @@
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>ed952c0cb86329e63a8db190953962d8</string>
<key>hash</key>
<string>43d7a6a69a54534a736f132e9c81795b</string>
<key>url</key>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/kdu_3p-update-kdu/rev/296932/arch/Linux/installer/kdu-7.2.296932-linux-296932.tar.bz2</string>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15255/98451/kdu-7.10.4.513518-linux-513518.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
......@@ -1670,9 +1670,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>99b0b22f87cebdd02c4cc954a7b3b465</string>
<string>a705a665810a71e7b0114a97ae9a2224</string>
<key>url</key>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4053/11298/kdu-7.9.1.504041-linux64-504041.tar.bz2</string>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15256/98457/kdu-7.10.4.513518-linux64-513518.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
......@@ -1682,9 +1682,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>f3ff5982b3b5f02738044432dd77a2c1</string>
<string>0e5b37a03a3f873d15142473b193ec5f</string>
<key>url</key>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4055/11310/kdu-7.9.1.504041-windows-504041.tar.bz2</string>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15259/98463/kdu-7.10.4.513518-windows-513518.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
......@@ -1692,18 +1692,18 @@
<key>windows64</key>
<map>
<key>archive</key>
<map>
<map>
<key>hash</key>
<string>3010fa35f412b36296342b07de06f1ca</string>
<string>da3b1ea90797b189d80ab5d50fdf05d4</string>
<key>url</key>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4056/11316/kdu-7.9.1.504041-windows64-504041.tar.bz2</string>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15260/98469/kdu-7.10.4.513518-windows64-513518.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>7.9.1.504041</string>
<string>7.A.4.513518</string>
</map>
<key>libhunspell</key>
<map>
......
......@@ -218,6 +218,7 @@ Ansariel Hiller
MAINT-7899
STORM-2105
STORM-2151
MAINT-6917
MAINT-8085
Aralara Rajal
Arare Chantilly
......
......@@ -167,29 +167,26 @@ if (DARWIN)
COMMENT "Creating Resources directory in app bundle."
)
# Copy the required libraries to the package app
add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib ${LL_TEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib
)
add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib ${LL_TEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib
)
add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib ${LL_TEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib
)
# Copy the required libraries to the package app. We used to use a sequence
# of '${CMAKE_COMMAND} -E copy' commands, but 'cmake -E copy' does only a
# single file at a time: it doesn't understand wildcards. 'cmake -E copy' is
# for portability. This operation is Darwin-specific. We can count on the
# 'cp' command.
set(copy_dylibs
libapr-1.0.dylib
libaprutil-1.0.dylib
libexception_handler.dylib
libnghttp2*.dylib
${EXPAT_COPY}
)
add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libnghttp2*.dylib ${LL_TEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libnghttp2.dylib
WORKING_DIRECTORY "${AUTOBUILD_INSTALL_DIR}/lib/release"
COMMAND cp -v
${copy_dylibs}
${LL_TEST_DESTINATION_DIR}
DEPENDS ${copy_dylibs}
)
foreach(expat ${EXPAT_COPY})
add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat} ${LL_TEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat}
)
endforeach(expat)
endif (DARWIN)
......
......@@ -119,6 +119,10 @@ bool LLKDUMemIn::get(int, kdu_core::kdu_line_buf&, int) { return false; }
// Stub Kakadu Library calls
// they're all namespaced now
namespace kdu_core_local
{
class kd_coremem;
}
namespace kdu_core {
kdu_tile_comp kdu_tile::access_component(int ) { kdu_tile_comp a; return a; }
kdu_block_encoder::kdu_block_encoder() { }
......@@ -140,7 +144,8 @@ void kdu_resolution::get_dims(kdu_dims& ) { }
int kdu_resolution::which() { return 0; }
int kdu_resolution::get_valid_band_indices(int &) { return 1; }
kdu_synthesis::kdu_synthesis(kdu_resolution, kdu_sample_allocator*, bool, float, kdu_thread_env*, kdu_thread_queue*) { }
kdu_params::kdu_params(const char*, bool, bool, bool, bool, bool) { }
//kdu_params::kdu_params(const char*, bool, bool, bool, bool, bool) { }
kdu_params::kdu_params(const char*, bool, bool, bool, bool, bool, kd_core_local::kd_coremem*) {}
kdu_params::~kdu_params() { }
void kdu_params::set(const char* , int , int , bool ) { }
void kdu_params::set(const char* , int , int , int ) { }
......@@ -164,39 +169,61 @@ void kdu_codestream::destroy() { }
void kdu_codestream::collect_timing_stats(int ) { }
void kdu_codestream::set_max_bytes(kdu_long, bool, bool ) { }
void kdu_codestream::get_valid_tiles(kdu_dims& ) { }
void kdu_codestream::create(kdu_compressed_source*, kdu_thread_env*) { }
void kdu_codestream::create(
siz_params*,
kdu_compressed_target*,
kdu_dims*,
int,
kdu_long,
kdu_thread_env*,
kdu_membroker*) {}
void kdu_codestream::create(kdu_compressed_source *,kdu_thread_env *, kdu_membroker *) {}
void kdu_codestream::apply_input_restrictions(int, int, int, int, kdu_dims const *, kdu_component_access_mode, kdu_thread_env *, kdu_quality_limiter const *) {}
void kdu_codestream::get_subsampling(int , kdu_coords&, bool ) { }
void kdu_codestream::flush(kdu_long *, int, kdu_uint16 *, bool, bool, double, kdu_thread_env*, int) { }
void kdu_codestream::set_resilient(bool ) { }
int kdu_codestream::get_num_components(bool ) { return 0; }
kdu_long kdu_codestream::get_total_bytes(bool ) { return 0; }
kdu_long kdu_codestream::get_compressed_data_memory(bool ) {return 0; }
kdu_long kdu_codestream::get_compressed_data_memory(bool ) const {return 0; }
void kdu_codestream::share_buffering(kdu_codestream ) { }
int kdu_codestream::get_num_tparts() { return 0; }
int kdu_codestream::trans_out(kdu_long, kdu_long*, int, bool, kdu_thread_env* ) { return 0; }
bool kdu_codestream::ready_for_flush(kdu_thread_env*) { return false; }
siz_params* kdu_codestream::access_siz() { return NULL; }
kdu_tile kdu_codestream::open_tile(kdu_coords , kdu_thread_env* ) { kdu_tile a; return a; }
kdu_codestream_comment kdu_codestream::add_comment() { kdu_codestream_comment a; return a; }
kdu_codestream_comment kdu_codestream::add_comment(kdu_thread_env*) { kdu_codestream_comment a; return a; }
void kdu_subband::close_block(kdu_block*, kdu_thread_env*) { }
void kdu_subband::get_valid_blocks(kdu_dims &indices) const { }
kdu_block * kdu_subband::open_block(kdu_coords, int *, kdu_thread_env *, int, bool) { return NULL; }
bool kdu_codestream_comment::put_text(const char*) { return false; }
void kdu_customize_warnings(kdu_message*) { }
void kdu_customize_errors(kdu_message*) { }
kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, kdu_thread_env *,kdu_thread_queue *, int, kdu_roi_image *, int, kdu_sample_allocator *, kdu_push_pull_params const *) { return kdu_long(0); }
kdu_long kdu_multi_analysis::create(
kdu_codestream,
kdu_tile,
kdu_thread_env*,
kdu_thread_queue*,
int,
kdu_roi_image*,
int,
kdu_sample_allocator*,
const kdu_push_pull_params*,
kdu_membroker*) { return kdu_long(0); }
void kdu_multi_analysis::destroy(kdu_thread_env *) {}
siz_params::siz_params() : kdu_params(NULL, false, false, false, false, false) { }
siz_params::siz_params(kd_core_local::kd_coremem*) : kdu_params(NULL, false, false, false, false, false) { }
siz_params::~siz_params() {}
void siz_params::finalize(bool ) { }
void siz_params::copy_with_xforms(kdu_params*, int, int, bool, bool, bool) { }
int siz_params::write_marker_segment(kdu_output*, kdu_params*, int) { return 0; }
bool siz_params::check_marker_segment(kdu_uint16, int, kdu_byte a[], int&) { return false; }
bool siz_params::read_marker_segment(kdu_uint16, int, kdu_byte a[], int) { return false; }
kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*, int) { }
void kdu_codestream::create(siz_params*, kdu_compressed_target*, kdu_dims*, int, kdu_long, kdu_thread_env* ) { }
kdu_decoder::kdu_decoder(
kdu_subband subband,
kdu_sample_allocator*,
bool, float, int,
kdu_thread_env*,
kdu_thread_queue*,
int, float*) {}
kdu_sample_allocator::~kdu_sample_allocator() {}
void kdu_sample_allocator::do_finalize(kdu_codestream) {}
void (*kdu_convert_ycc_to_rgb_rev16)(kdu_int16*,kdu_int16*,kdu_int16*,int);
......@@ -205,6 +232,8 @@ void (*kdu_convert_ycc_to_rgb_rev32)(kdu_int32*,kdu_int32*,kdu_int32*,int);
void (*kdu_convert_ycc_to_rgb_irrev32)(float*,float*,float*,int);
bool kdu_core_sample_alignment_checker(int, int, int, int, bool, bool) { return false; }
void kdu_pull_ifc::destroy() {}
void kdu_sample_allocator::advance_pre_frag() {}
void kdu_params::operator delete(void *) {}
} // namespace kdu_core
// -------------------------------------------------------------------------------------------
......
......@@ -545,7 +545,7 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3
{
// Generate an n-sided "circular" path.
// 0 is (1,0), and we go counter-clockwise along a circular path from there.
const F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f };
static const F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f };
F32 scale = 0.5f;
F32 t, t_step, t_first, t_fraction, ang, ang_step;
LLVector4a pt1,pt2;
......@@ -1307,7 +1307,7 @@ S32 LLPath::getNumNGonPoints(const LLPathParams& params, S32 sides, F32 startOff
void LLPath::genNGon(const LLPathParams& params, S32 sides, F32 startOff, F32 end_scale, F32 twist_scale)
{
// Generates a circular path, starting at (1, 0, 0), counterclockwise along the xz plane.
const F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f };
static const F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f };
F32 revolutions = params.getRevolutions();
F32 skew = params.getSkew();
......@@ -1605,7 +1605,8 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
if (is_sculpted)
sides = llmax(sculpt_size, 1);
genNGon(params, sides);
if (0 < sides)
genNGon(params, sides);
}
break;
......
......@@ -1101,7 +1101,7 @@ class LLVolume : public LLRefCount
F32 mSurfaceArea; //unscaled surface area
BOOL mIsMeshAssetLoaded;
LLVolumeParams mParams;
const LLVolumeParams mParams;
LLPath *mPathp;
LLProfile *mProfilep;
LLAlignedArray<LLVector4a,64> mMesh;
......
......@@ -61,6 +61,11 @@ LLMaterialID::LLMaterialID(const LLMaterialID& pOtherMaterialID)
copyFromOtherMaterialID(pOtherMaterialID);
}
LLMaterialID::LLMaterialID(const LLUUID& lluid)
{
set(lluid.mData);
}
LLMaterialID::~LLMaterialID()
{
}
......
......@@ -40,6 +40,7 @@ class LLMaterialID
LLMaterialID(const LLSD::Binary& pMaterialID);
LLMaterialID(const void* pMemory);
LLMaterialID(const LLMaterialID& pOtherMaterialID);
LLMaterialID(const LLUUID& lluid);
~LLMaterialID();
bool operator == (const LLMaterialID& pOtherMaterialID) const;
......
......@@ -732,6 +732,16 @@ S32 face_index_from_id(LLFaceID face_ID, const std::vector<LLProfile::Face>& fac
BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume)
{
if (NO_LOD == detail)
{
// build the new object
setChanged(GEOMETRY);
sVolumeManager->unrefVolume(mVolumep);
mVolumep = new LLVolume(volume_params, 1, TRUE, TRUE);
setNumTEs(mVolumep->getNumFaces());
return FALSE;
}
LLVolume *volumep;
if (unique_volume)
{
......
......@@ -492,6 +492,11 @@ class LLPrimitive : public LLXform
public:
static LLVolumeMgr* sVolumeManager;
enum
{
NO_LOD = -1
};
};
inline BOOL LLPrimitive::isAvatar() const
......
......@@ -51,6 +51,7 @@ set(llrender_SOURCE_FILES
lltexture.cpp
lluiimage.cpp
llvertexbuffer.cpp
llglcommonfunc.cpp
)
set(llrender_HEADER_FILES
......@@ -78,6 +79,7 @@ set(llrender_HEADER_FILES
lltexture.h
lluiimage.h
llvertexbuffer.h
llglcommonfunc.h
)
set_source_files_properties(${llrender_HEADER_FILES}
......
......@@ -256,6 +256,9 @@ void clear_glerror();
if the existing GL state does not match the expected GL state.
*/
#include "boost/function.hpp"
class LLGLState
{
public:
......@@ -297,6 +300,20 @@ class LLGLEnableAlphaReject : public LLGLState
LLGLEnableAlphaReject(bool enable);
};
// Enable with functor
class LLGLEnableFunc : LLGLState
{
public:
LLGLEnableFunc(LLGLenum state, bool enable, boost::function<void()> func)
: LLGLState(state, enable)
{
if (enable)
{
func();
}
}
};
/// TODO: Being deprecated.
class LLGLEnable : public LLGLState
{
......
/**
* @file llglcommonfunc.cpp
* @brief Implementation of the LLGLCommonFunc.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llglheaders.h"
#include "llglcommonfunc.h"
namespace LLGLCommonFunc
{
void selected_stencil_test()
{
glStencilFunc(GL_ALWAYS, 2, 0xffff);
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
}
}
/**
* @file llphoenixfunc.h
* @brief File include common opengl code snippets
*
* $LicenseInfo:firstyear=2003&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
namespace LLGLCommonFunc
{
void selected_stencil_test();
}
......@@ -537,7 +537,11 @@ BOOL LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString> * attri
mAttribute.clear();
U32 numAttributes = (attributes == NULL) ? 0 : attributes->size();
#if LL_RELEASE_WITH_DEBUG_INFO
mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size() + numAttributes, { -1, NULL });
#else
mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size() + numAttributes, -1);
#endif
if (res)
{ //read back channel locations
......@@ -551,7 +555,11 @@ BOOL LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString> * attri
S32 index = glGetAttribLocationARB(mProgramObject, (const GLcharARB *)name);
if (index != -1)
{
#if LL_RELEASE_WITH_DEBUG_INFO
mAttribute[i] = { index, name };
#else
mAttribute[i] = index;
#endif
mAttributeMask |= 1 << i;
LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
}
......@@ -744,24 +752,25 @@ BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms)
, even if the "diffuseMap" will be appear and use first in shader code.
As example where this situation appear see: "Deferred Material Shader 28/29/30/31"
And tickets: MAINT-4165, MAINT-4839, MAINT-3568
And tickets: MAINT-4165, MAINT-4839, MAINT-3568, MAINT-6437
*/
S32 diffuseMap = glGetUniformLocationARB(mProgramObject, "diffuseMap");
S32 specularMap = glGetUniformLocationARB(mProgramObject, "specularMap");
S32 bumpMap = glGetUniformLocationARB(mProgramObject, "bumpMap");
S32 environmentMap = glGetUniformLocationARB(mProgramObject, "environmentMap");
std::set<S32> skip_index;
if (-1 != diffuseMap && (-1 != bumpMap || -1 != environmentMap))
if (-1 != diffuseMap && (-1 != specularMap || -1 != bumpMap || -1 != environmentMap))
{
GLenum type;
GLsizei length;
GLint size = -1;
char name[1024];
diffuseMap = bumpMap = environmentMap = -1;
diffuseMap = specularMap = bumpMap = environmentMap = -1;
for (S32 i = 0; i < activeCount; i++)
{
......@@ -775,6 +784,18 @@ BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms)
continue;
}
if (-1 == specularMap && std::string(name) == "specularMap")
{
specularMap = i;
continue;
}
if (-1 == specularMap && std::string(name) == "specularMap")
{
specularMap = i;
continue;
}
if (-1 == bumpMap && std::string(name) == "bumpMap")
{
bumpMap = i;
......@@ -788,34 +809,29 @@ BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms)
}
}
bool specularDiff = specularMap < diffuseMap && -1 != specularMap;
bool bumpLessDiff = bumpMap < diffuseMap && -1 != bumpMap;
bool envLessDiff = environmentMap < diffuseMap && -1 != environmentMap;
if (bumpLessDiff && envLessDiff)
if (specularDiff || bumpLessDiff || envLessDiff)
{
mapUniform(diffuseMap, uniforms);
mapUniform(bumpMap, uniforms);
mapUniform(environmentMap, uniforms);
skip_index.insert(diffuseMap);
skip_index.insert(bumpMap);
skip_index.insert(environmentMap);
}
else if (bumpLessDiff)
{
mapUniform(diffuseMap, uniforms);
mapUniform(bumpMap, uniforms);
skip_index.insert(diffuseMap);
skip_index.insert(bumpMap);
}
else if (envLessDiff)
{
mapUniform(diffuseMap, uniforms);
mapUniform(environmentMap, uniforms);
if (-1 != specularMap) {
mapUniform(specularMap, uniforms);
skip_index.insert(specularMap);
}
skip_index.insert(diffuseMap);
skip_index.insert(environmentMap);