From 988009d84dda645ee107232eb04549e984e609f7 Mon Sep 17 00:00:00 2001 From: Andros Baphomet Date: Sat, 5 Oct 2013 17:32:42 -0400 Subject: [PATCH 01/51] Don't explicitly set LIBGL_DRIVERS_PATH by default; breaks autodetection --- indra/newview/linux_tools/wrapper.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index d6a266240..188f6ad18 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -77,7 +77,9 @@ fi export SDL_VIDEO_X11_DGAMOUSE=0 ## - Works around a problem with misconfigured 64-bit systems not finding GL -export LIBGL_DRIVERS_PATH="${LIBGL_DRIVERS_PATH}":/usr/lib64/dri:/usr/lib32/dri:/usr/lib/dri +# This is less needed nowadays; don't uncomment this unless LibGL can't find your +# drivers automatically. +#export LIBGL_DRIVERS_PATH="${LIBGL_DRIVERS_PATH}":/usr/lib64/dri:/usr/lib32/dri:/usr/lib/dri ## - The 'scim' GTK IM module widely crashes the viewer. Avoid it. if [ "$GTK_IM_MODULE" = "scim" ]; then From f6861cd5baecaf12daddde818db56edabed5ebfb Mon Sep 17 00:00:00 2001 From: Andros Baphomet Date: Sat, 5 Oct 2013 17:33:34 -0400 Subject: [PATCH 02/51] Fix shader compilation/out-of-spec issues --- indra/llrender/llshadermgr.cpp | 18 +- .../shaders/class1/deferred/alphaF.glsl | 2 +- .../class1/deferred/alphaNonIndexedF.glsl | 2 +- .../deferred/alphaNonIndexedNoColorF.glsl | 2 +- .../shaders/class1/deferred/blurLightF.glsl | 2 +- .../shaders/class1/deferred/cofF.glsl | 2 +- .../shaders/class1/deferred/dofCombineF.glsl | 2 +- .../shaders/class1/deferred/emissiveF.glsl | 2 +- .../shaders/class1/deferred/fullbrightF.glsl | 2 +- .../shaders/class1/deferred/fxaaF.glsl | 470 +++++++++--------- .../shaders/class1/deferred/giF.glsl | 2 +- .../class1/deferred/multiPointLightF.glsl | 2 +- .../class1/deferred/multiSpotLightF.glsl | 2 +- .../shaders/class1/deferred/normgenF.glsl | 2 +- .../shaders/class1/deferred/pointLightF.glsl | 2 +- .../class1/deferred/postDeferredF.glsl | 2 +- .../class1/deferred/postDeferredNoDoFF.glsl | 2 +- .../shaders/class1/deferred/softenLightF.glsl | 2 +- .../shaders/class1/deferred/spotLightF.glsl | 2 +- .../shaders/class1/deferred/sunLightF.glsl | 2 +- .../class1/deferred/sunLightSSAOF.glsl | 2 +- .../shaders/class1/deferred/waterF.glsl | 2 +- .../shaders/class1/effects/MotionBlurF.glsl | 2 +- .../shaders/class1/effects/PosterizeF.glsl | 2 +- .../shaders/class1/effects/VignetteF.glsl | 2 +- .../shaders/class1/effects/colorFilterF.glsl | 2 +- .../shaders/class1/effects/gaussBlurF.glsl | 2 +- .../shaders/class1/effects/glowExtractF.glsl | 2 +- .../shaders/class1/effects/nightVisionF.glsl | 2 +- .../class1/interface/glowcombineF.glsl | 2 +- .../class1/interface/glowcombineFXAAF.glsl | 2 +- .../class1/interface/splattexturerectF.glsl | 2 +- .../shaders/class2/deferred/alphaF.glsl | 2 +- .../class2/deferred/alphaNonIndexedF.glsl | 2 +- .../deferred/alphaNonIndexedNoColorF.glsl | 2 +- .../class2/deferred/multiSpotLightF.glsl | 2 +- .../shaders/class2/deferred/softenLightF.glsl | 2 +- .../shaders/class2/deferred/spotLightF.glsl | 2 +- .../shaders/class2/deferred/sunLightF.glsl | 2 +- .../class2/deferred/sunLightSSAOF.glsl | 2 +- 40 files changed, 289 insertions(+), 275 deletions(-) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 7b890c57a..baf48298d 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -56,14 +56,14 @@ LLShaderMgr::LLShaderMgr() { { const std::string dumpdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"shader_dump")+gDirUtilp->getDirDelimiter(); - try + /*try { boost::filesystem::remove_all(dumpdir); } catch(const boost::filesystem::filesystem_error& e) { llinfos << "boost::filesystem::remove_all(\""+dumpdir+"\") failed: '" + e.code().message() + "'" << llendl; - } + }*/ } } @@ -614,6 +614,9 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade text[count++] = strdup("#define ATTRIBUTE attribute\n"); text[count++] = strdup("#define VARYING varying\n"); text[count++] = strdup("#define VARYING_FLAT varying\n"); + // Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files, + // before any non-preprocessor directives (per spec) + text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n"); } else if (minor_version <= 29) { @@ -624,6 +627,9 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade text[count++] = strdup("#define ATTRIBUTE attribute\n"); text[count++] = strdup("#define VARYING varying\n"); text[count++] = strdup("#define VARYING_FLAT varying\n"); + // Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files, + // before any non-preprocessor directives (per spec) + text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n"); } } else @@ -632,6 +638,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade { //set version to 1.30 text[count++] = strdup("#version 130\n"); + + // Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files, + // before any non-preprocessor directives (per spec) + text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n"); //some implementations of GLSL 1.30 require integer precision be explicitly declared text[count++] = strdup("precision mediump int;\n"); @@ -640,7 +650,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade else { //set version to 400 text[count++] = strdup("#version 400\n"); + // Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files, + // before any non-preprocessor directives (per spec) + text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n"); } + text[count++] = strdup("#define DEFINE_GL_FRAGCOLOR 1\n"); text[count++] = strdup("#define FXAA_GLSL_130 1\n"); diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index dd87ddb33..704f3f3c5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl index beb329018..846ce6a91 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl index 1113a9845..d19092ed9 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index 9a9b889da..3e9a63086 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl index ccbc3c557..bf04caba5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl index a425e5062..9ddeae18d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl index 6aa4d7b4e..574d944a1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 36433a582..80d77b4dc 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl index e02a7b405..2371eed3b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; @@ -33,7 +33,7 @@ out vec4 frag_color; #define FXAA_PC 1 //#define FXAA_GLSL_130 1 -#define FXAA_QUALITY__PRESET 12 +#define FXAA_QUALITY_M_PRESET 12 /*============================================================================ @@ -66,7 +66,7 @@ Example, #define FXAA_PC 1 #define FXAA_HLSL_5 1 - #define FXAA_QUALITY__PRESET 12 + #define FXAA_QUALITY_M_PRESET 12 Or, @@ -365,7 +365,7 @@ A. Or use FXAA_GREEN_AS_LUMA. /*============================================================================ FXAA CONSOLE PS3 - TUNING KNOBS ============================================================================*/ -#ifndef FXAA_CONSOLE__PS3_EDGE_SHARPNESS +#ifndef FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS // // Consoles the sharpness of edges on PS3 only. // Non-PS3 tuning is done with shader input. @@ -379,17 +379,17 @@ A. Or use FXAA_GREEN_AS_LUMA. // 2.0 is really soft (good for vector graphics inputs) // #if 1 - #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 8.0 + #define FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS 8.0 #endif #if 0 - #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 4.0 + #define FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS 4.0 #endif #if 0 - #define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 2.0 + #define FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS 2.0 #endif #endif /*--------------------------------------------------------------------------*/ -#ifndef FXAA_CONSOLE__PS3_EDGE_THRESHOLD +#ifndef FXAA_CONSOLE_M_PS3_EDGE_THRESHOLD // // Only effects PS3. // Non-PS3 tuning is done with shader input. @@ -407,9 +407,9 @@ A. Or use FXAA_GREEN_AS_LUMA. // 0.25 leaves more aliasing, and is sharper // #if 1 - #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.125 + #define FXAA_CONSOLE_M_PS3_EDGE_THRESHOLD 0.125 #else - #define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.25 + #define FXAA_CONSOLE_M_PS3_EDGE_THRESHOLD 0.25 #endif #endif @@ -418,7 +418,7 @@ A. Or use FXAA_GREEN_AS_LUMA. ------------------------------------------------------------------------------ NOTE the other tuning knobs are now in the shader function inputs! ============================================================================*/ -#ifndef FXAA_QUALITY__PRESET +#ifndef FXAA_QUALITY_M_PRESET // // Choose the quality preset. // This needs to be compiled into the shader as it effects code. @@ -439,7 +439,7 @@ NOTE the other tuning knobs are now in the shader function inputs! // _ = the lowest digit is directly related to performance // _ = the highest digit is directly related to style // - #define FXAA_QUALITY__PRESET 12 + #define FXAA_QUALITY_M_PRESET 12 #endif @@ -452,198 +452,198 @@ NOTE the other tuning knobs are now in the shader function inputs! /*============================================================================ FXAA QUALITY - MEDIUM DITHER PRESETS ============================================================================*/ -#if (FXAA_QUALITY__PRESET == 10) - #define FXAA_QUALITY__PS 3 - #define FXAA_QUALITY__P0 1.5 - #define FXAA_QUALITY__P1 3.0 - #define FXAA_QUALITY__P2 12.0 +#if (FXAA_QUALITY_M_PRESET == 10) + #define FXAA_QUALITY_M_PS 3 + #define FXAA_QUALITY_M_P0 1.5 + #define FXAA_QUALITY_M_P1 3.0 + #define FXAA_QUALITY_M_P2 12.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 11) - #define FXAA_QUALITY__PS 4 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 3.0 - #define FXAA_QUALITY__P3 12.0 +#if (FXAA_QUALITY_M_PRESET == 11) + #define FXAA_QUALITY_M_PS 4 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 3.0 + #define FXAA_QUALITY_M_P3 12.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 12) - #define FXAA_QUALITY__PS 5 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 4.0 - #define FXAA_QUALITY__P4 12.0 +#if (FXAA_QUALITY_M_PRESET == 12) + #define FXAA_QUALITY_M_PS 5 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 4.0 + #define FXAA_QUALITY_M_P4 12.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 13) - #define FXAA_QUALITY__PS 6 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 2.0 - #define FXAA_QUALITY__P4 4.0 - #define FXAA_QUALITY__P5 12.0 +#if (FXAA_QUALITY_M_PRESET == 13) + #define FXAA_QUALITY_M_PS 6 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 2.0 + #define FXAA_QUALITY_M_P4 4.0 + #define FXAA_QUALITY_M_P5 12.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 14) - #define FXAA_QUALITY__PS 7 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 2.0 - #define FXAA_QUALITY__P4 2.0 - #define FXAA_QUALITY__P5 4.0 - #define FXAA_QUALITY__P6 12.0 +#if (FXAA_QUALITY_M_PRESET == 14) + #define FXAA_QUALITY_M_PS 7 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 2.0 + #define FXAA_QUALITY_M_P4 2.0 + #define FXAA_QUALITY_M_P5 4.0 + #define FXAA_QUALITY_M_P6 12.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 15) - #define FXAA_QUALITY__PS 8 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 2.0 - #define FXAA_QUALITY__P4 2.0 - #define FXAA_QUALITY__P5 2.0 - #define FXAA_QUALITY__P6 4.0 - #define FXAA_QUALITY__P7 12.0 +#if (FXAA_QUALITY_M_PRESET == 15) + #define FXAA_QUALITY_M_PS 8 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 2.0 + #define FXAA_QUALITY_M_P4 2.0 + #define FXAA_QUALITY_M_P5 2.0 + #define FXAA_QUALITY_M_P6 4.0 + #define FXAA_QUALITY_M_P7 12.0 #endif /*============================================================================ FXAA QUALITY - LOW DITHER PRESETS ============================================================================*/ -#if (FXAA_QUALITY__PRESET == 20) - #define FXAA_QUALITY__PS 3 - #define FXAA_QUALITY__P0 1.5 - #define FXAA_QUALITY__P1 2.0 - #define FXAA_QUALITY__P2 8.0 +#if (FXAA_QUALITY_M_PRESET == 20) + #define FXAA_QUALITY_M_PS 3 + #define FXAA_QUALITY_M_P0 1.5 + #define FXAA_QUALITY_M_P1 2.0 + #define FXAA_QUALITY_M_P2 8.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 21) - #define FXAA_QUALITY__PS 4 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 8.0 +#if (FXAA_QUALITY_M_PRESET == 21) + #define FXAA_QUALITY_M_PS 4 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 8.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 22) - #define FXAA_QUALITY__PS 5 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 2.0 - #define FXAA_QUALITY__P4 8.0 +#if (FXAA_QUALITY_M_PRESET == 22) + #define FXAA_QUALITY_M_PS 5 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 2.0 + #define FXAA_QUALITY_M_P4 8.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 23) - #define FXAA_QUALITY__PS 6 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 2.0 - #define FXAA_QUALITY__P4 2.0 - #define FXAA_QUALITY__P5 8.0 +#if (FXAA_QUALITY_M_PRESET == 23) + #define FXAA_QUALITY_M_PS 6 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 2.0 + #define FXAA_QUALITY_M_P4 2.0 + #define FXAA_QUALITY_M_P5 8.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 24) - #define FXAA_QUALITY__PS 7 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 2.0 - #define FXAA_QUALITY__P4 2.0 - #define FXAA_QUALITY__P5 3.0 - #define FXAA_QUALITY__P6 8.0 +#if (FXAA_QUALITY_M_PRESET == 24) + #define FXAA_QUALITY_M_PS 7 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 2.0 + #define FXAA_QUALITY_M_P4 2.0 + #define FXAA_QUALITY_M_P5 3.0 + #define FXAA_QUALITY_M_P6 8.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 25) - #define FXAA_QUALITY__PS 8 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 2.0 - #define FXAA_QUALITY__P4 2.0 - #define FXAA_QUALITY__P5 2.0 - #define FXAA_QUALITY__P6 4.0 - #define FXAA_QUALITY__P7 8.0 +#if (FXAA_QUALITY_M_PRESET == 25) + #define FXAA_QUALITY_M_PS 8 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 2.0 + #define FXAA_QUALITY_M_P4 2.0 + #define FXAA_QUALITY_M_P5 2.0 + #define FXAA_QUALITY_M_P6 4.0 + #define FXAA_QUALITY_M_P7 8.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 26) - #define FXAA_QUALITY__PS 9 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 2.0 - #define FXAA_QUALITY__P4 2.0 - #define FXAA_QUALITY__P5 2.0 - #define FXAA_QUALITY__P6 2.0 - #define FXAA_QUALITY__P7 4.0 - #define FXAA_QUALITY__P8 8.0 +#if (FXAA_QUALITY_M_PRESET == 26) + #define FXAA_QUALITY_M_PS 9 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 2.0 + #define FXAA_QUALITY_M_P4 2.0 + #define FXAA_QUALITY_M_P5 2.0 + #define FXAA_QUALITY_M_P6 2.0 + #define FXAA_QUALITY_M_P7 4.0 + #define FXAA_QUALITY_M_P8 8.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 27) - #define FXAA_QUALITY__PS 10 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 2.0 - #define FXAA_QUALITY__P4 2.0 - #define FXAA_QUALITY__P5 2.0 - #define FXAA_QUALITY__P6 2.0 - #define FXAA_QUALITY__P7 2.0 - #define FXAA_QUALITY__P8 4.0 - #define FXAA_QUALITY__P9 8.0 +#if (FXAA_QUALITY_M_PRESET == 27) + #define FXAA_QUALITY_M_PS 10 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 2.0 + #define FXAA_QUALITY_M_P4 2.0 + #define FXAA_QUALITY_M_P5 2.0 + #define FXAA_QUALITY_M_P6 2.0 + #define FXAA_QUALITY_M_P7 2.0 + #define FXAA_QUALITY_M_P8 4.0 + #define FXAA_QUALITY_M_P9 8.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 28) - #define FXAA_QUALITY__PS 11 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 2.0 - #define FXAA_QUALITY__P4 2.0 - #define FXAA_QUALITY__P5 2.0 - #define FXAA_QUALITY__P6 2.0 - #define FXAA_QUALITY__P7 2.0 - #define FXAA_QUALITY__P8 2.0 - #define FXAA_QUALITY__P9 4.0 - #define FXAA_QUALITY__P10 8.0 +#if (FXAA_QUALITY_M_PRESET == 28) + #define FXAA_QUALITY_M_PS 11 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 2.0 + #define FXAA_QUALITY_M_P4 2.0 + #define FXAA_QUALITY_M_P5 2.0 + #define FXAA_QUALITY_M_P6 2.0 + #define FXAA_QUALITY_M_P7 2.0 + #define FXAA_QUALITY_M_P8 2.0 + #define FXAA_QUALITY_M_P9 4.0 + #define FXAA_QUALITY_M_P10 8.0 #endif /*--------------------------------------------------------------------------*/ -#if (FXAA_QUALITY__PRESET == 29) - #define FXAA_QUALITY__PS 12 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.5 - #define FXAA_QUALITY__P2 2.0 - #define FXAA_QUALITY__P3 2.0 - #define FXAA_QUALITY__P4 2.0 - #define FXAA_QUALITY__P5 2.0 - #define FXAA_QUALITY__P6 2.0 - #define FXAA_QUALITY__P7 2.0 - #define FXAA_QUALITY__P8 2.0 - #define FXAA_QUALITY__P9 2.0 - #define FXAA_QUALITY__P10 4.0 - #define FXAA_QUALITY__P11 8.0 +#if (FXAA_QUALITY_M_PRESET == 29) + #define FXAA_QUALITY_M_PS 12 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.5 + #define FXAA_QUALITY_M_P2 2.0 + #define FXAA_QUALITY_M_P3 2.0 + #define FXAA_QUALITY_M_P4 2.0 + #define FXAA_QUALITY_M_P5 2.0 + #define FXAA_QUALITY_M_P6 2.0 + #define FXAA_QUALITY_M_P7 2.0 + #define FXAA_QUALITY_M_P8 2.0 + #define FXAA_QUALITY_M_P9 2.0 + #define FXAA_QUALITY_M_P10 4.0 + #define FXAA_QUALITY_M_P11 8.0 #endif /*============================================================================ FXAA QUALITY - EXTREME QUALITY ============================================================================*/ -#if (FXAA_QUALITY__PRESET == 39) - #define FXAA_QUALITY__PS 12 - #define FXAA_QUALITY__P0 1.0 - #define FXAA_QUALITY__P1 1.0 - #define FXAA_QUALITY__P2 1.0 - #define FXAA_QUALITY__P3 1.0 - #define FXAA_QUALITY__P4 1.0 - #define FXAA_QUALITY__P5 1.5 - #define FXAA_QUALITY__P6 2.0 - #define FXAA_QUALITY__P7 2.0 - #define FXAA_QUALITY__P8 2.0 - #define FXAA_QUALITY__P9 2.0 - #define FXAA_QUALITY__P10 4.0 - #define FXAA_QUALITY__P11 8.0 +#if (FXAA_QUALITY_M_PRESET == 39) + #define FXAA_QUALITY_M_PS 12 + #define FXAA_QUALITY_M_P0 1.0 + #define FXAA_QUALITY_M_P1 1.0 + #define FXAA_QUALITY_M_P2 1.0 + #define FXAA_QUALITY_M_P3 1.0 + #define FXAA_QUALITY_M_P4 1.0 + #define FXAA_QUALITY_M_P5 1.5 + #define FXAA_QUALITY_M_P6 2.0 + #define FXAA_QUALITY_M_P7 2.0 + #define FXAA_QUALITY_M_P8 2.0 + #define FXAA_QUALITY_M_P9 2.0 + #define FXAA_QUALITY_M_P10 4.0 + #define FXAA_QUALITY_M_P11 8.0 #endif @@ -868,7 +868,7 @@ FxaaFloat4 FxaaPixelShader( // This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define. // It is here now to allow easier tuning. // This does not effect PS3, as this needs to be compiled in. - // Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3. + // Use FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS for PS3. // Due to the PS3 being ALU bound, // there are only three safe values here: 2 and 4 and 8. // These options use the shaders ability to a free *|/ by 2|4|8. @@ -882,7 +882,7 @@ FxaaFloat4 FxaaPixelShader( // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define. // It is here now to allow easier tuning. // This does not effect PS3, as this needs to be compiled in. - // Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3. + // Use FXAA_CONSOLE_M_PS3_EDGE_THRESHOLD for PS3. // Due to the PS3 being ALU bound, // there are only two safe values here: 1/4 and 1/8. // These options use the shaders ability to a free *|/ by 2|4|8. @@ -1040,11 +1040,11 @@ FxaaFloat4 FxaaPixelShader( if( horzSpan) posB.y += lengthSign * 0.5; /*--------------------------------------------------------------------------*/ FxaaFloat2 posN; - posN.x = posB.x - offNP.x * FXAA_QUALITY__P0; - posN.y = posB.y - offNP.y * FXAA_QUALITY__P0; + posN.x = posB.x - offNP.x * FXAA_QUALITY_M_P0; + posN.y = posB.y - offNP.y * FXAA_QUALITY_M_P0; FxaaFloat2 posP; - posP.x = posB.x + offNP.x * FXAA_QUALITY__P0; - posP.y = posB.y + offNP.y * FXAA_QUALITY__P0; + posP.x = posB.x + offNP.x * FXAA_QUALITY_M_P0; + posP.y = posB.y + offNP.y * FXAA_QUALITY_M_P0; FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); FxaaFloat subpixE = subpixC * subpixC; @@ -1060,11 +1060,11 @@ FxaaFloat4 FxaaPixelShader( lumaEndP -= lumaNN * 0.5; FxaaBool doneN = abs(lumaEndN) >= gradientScaled; FxaaBool doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P1; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P1; FxaaBool doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P1; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P1; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P1; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P1; /*--------------------------------------------------------------------------*/ if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); @@ -1073,13 +1073,13 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P2; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P2; doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P2; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P2; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P2; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P2; /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY__PS > 3) + #if (FXAA_QUALITY_M_PS > 3) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); @@ -1087,13 +1087,13 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P3; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P3; doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P3; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P3; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P3; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P3; /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY__PS > 4) + #if (FXAA_QUALITY_M_PS > 4) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); @@ -1101,13 +1101,13 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P4; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P4; doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P4; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P4; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P4; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P4; /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY__PS > 5) + #if (FXAA_QUALITY_M_PS > 5) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); @@ -1115,13 +1115,13 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P5; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P5; doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P5; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P5; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P5; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P5; /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY__PS > 6) + #if (FXAA_QUALITY_M_PS > 6) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); @@ -1129,13 +1129,13 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P6; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P6; doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P6; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P6; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P6; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P6; /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY__PS > 7) + #if (FXAA_QUALITY_M_PS > 7) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); @@ -1143,13 +1143,13 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P7; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P7; doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P7; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P7; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P7; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P7; /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY__PS > 8) + #if (FXAA_QUALITY_M_PS > 8) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); @@ -1157,13 +1157,13 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P8; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P8; doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P8; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P8; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P8; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P8; /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY__PS > 9) + #if (FXAA_QUALITY_M_PS > 9) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); @@ -1171,13 +1171,13 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P9; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P9; doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P9; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P9; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P9; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P9; /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY__PS > 10) + #if (FXAA_QUALITY_M_PS > 10) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); @@ -1185,13 +1185,13 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P10; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P10; doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P10; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P10; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P10; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P10; /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY__PS > 11) + #if (FXAA_QUALITY_M_PS > 11) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); @@ -1199,13 +1199,13 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P11; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P11; doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P11; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P11; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P11; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P11; /*--------------------------------------------------------------------------*/ - #if (FXAA_QUALITY__PS > 12) + #if (FXAA_QUALITY_M_PS > 12) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); @@ -1213,11 +1213,11 @@ FxaaFloat4 FxaaPixelShader( if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; - if(!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12; - if(!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12; + if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_M_P12; + if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_M_P12; doneNP = (!doneN) || (!doneP); - if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P12; - if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P12; + if(!doneP) posP.x += offNP.x * FXAA_QUALITY_M_P12; + if(!doneP) posP.y += offNP.y * FXAA_QUALITY_M_P12; /*--------------------------------------------------------------------------*/ } #endif @@ -1290,9 +1290,9 @@ FxaaFloat4 FxaaPixelShader( ------------------------------------------------------------------------------ Instead of using this on PC, I'd suggest just using FXAA Quality with - #define FXAA_QUALITY__PRESET 10 + #define FXAA_QUALITY_M_PRESET 10 Or - #define FXAA_QUALITY__PRESET 20 + #define FXAA_QUALITY_M_PRESET 20 Either are higher qualilty and almost as fast as this on modern PC GPUs. ============================================================================*/ #if (FXAA_PC_CONSOLE == 1) @@ -1703,7 +1703,7 @@ half4 FxaaPixelShader( // (5) half4 dir1_pos; dir1_pos.xy = normalize(dir.xyz).xz; - half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS); + half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS); /*--------------------------------------------------------------------------*/ // (6) half4 dir2_pos; @@ -2018,7 +2018,7 @@ half4 FxaaPixelShader( // (6) half4 dir1_pos; dir1_pos.xy = normalize(dir).xz; - half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS); + half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE_M_PS3_EDGE_SHARPNESS); /*--------------------------------------------------------------------------*/ // (7) half4 dir2_pos; @@ -2060,7 +2060,7 @@ half4 FxaaPixelShader( temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0)); half4 rgby2; rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw; - half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__PS3_EDGE_THRESHOLD; + half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE_M_PS3_EDGE_THRESHOLD; /*--------------------------------------------------------------------------*/ // (12) rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0)); diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl index da1b23424..acd3c1798 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 26aa34107..28b363d6d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index a82ba899a..fa74995d5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -31,7 +31,7 @@ out vec4 frag_color; //class 1 -- no shadows -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl index 62cfa5c31..1291cfe97 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 6c1ff1660..14e935f2c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl index bf362e21a..46ab281fd 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl index eb5beeef3..b4e2ecfcc 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 066cdd348..d879c76db 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index ae64d8937..7a6954f89 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -32,7 +32,7 @@ out vec4 frag_color; //class 1 -- no shadows -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl index 5ca817aff..bc7837291 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl @@ -25,7 +25,7 @@ //class 1, no shadow, no SSAO, should never be called -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl index 24a827e91..3b553078f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl @@ -23,7 +23,7 @@ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index b27822814..db15dad4d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_data[3]; diff --git a/indra/newview/app_settings/shaders/class1/effects/MotionBlurF.glsl b/indra/newview/app_settings/shaders/class1/effects/MotionBlurF.glsl index efa1265a1..f2b4900b4 100644 --- a/indra/newview/app_settings/shaders/class1/effects/MotionBlurF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/MotionBlurF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/effects/PosterizeF.glsl b/indra/newview/app_settings/shaders/class1/effects/PosterizeF.glsl index 0f8b2f8f2..fe983c258 100644 --- a/indra/newview/app_settings/shaders/class1/effects/PosterizeF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/PosterizeF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/effects/VignetteF.glsl b/indra/newview/app_settings/shaders/class1/effects/VignetteF.glsl index ad989e1a0..f3a6f4324 100644 --- a/indra/newview/app_settings/shaders/class1/effects/VignetteF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/VignetteF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class1/effects/colorFilterF.glsl index 6acd277bb..8a948b119 100644 --- a/indra/newview/app_settings/shaders/class1/effects/colorFilterF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/colorFilterF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/effects/gaussBlurF.glsl b/indra/newview/app_settings/shaders/class1/effects/gaussBlurF.glsl index 6c56e2108..db12800a3 100644 --- a/indra/newview/app_settings/shaders/class1/effects/gaussBlurF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/gaussBlurF.glsl @@ -1,4 +1,4 @@ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl index 0f5eb288f..4f3690383 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class1/effects/nightVisionF.glsl index 6257c4e9b..998d8eb18 100644 --- a/indra/newview/app_settings/shaders/class1/effects/nightVisionF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/nightVisionF.glsl @@ -5,7 +5,7 @@ * $License$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index ed803de27..891b971f1 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -29,7 +29,7 @@ out vec4 frag_color; #define frag_color gl_FragColor #endif -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable uniform sampler2D glowMap; uniform sampler2DRect screenMap; diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index 59520bb99..147de39c4 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl index 772bb374e..2e47c0023 100644 --- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 8db4cb58c..cc04e8ecd 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl index 33958a501..e0a229d8c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl index 2093fc37d..2a38361f8 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 7f6a31ef7..a4007600f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index d490b5d46..39249bd44 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 3a556e913..4a1bf07c7 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index f8f57e5e7..ca895b341 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index ddcb024a9..3ca7067a5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -22,7 +22,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; From 997fdebb9f5fea0c89188d94c3251fc15a2383fa Mon Sep 17 00:00:00 2001 From: Andros Baphomet Date: Sun, 3 Nov 2013 13:12:27 -0500 Subject: [PATCH 03/51] Re-fix shader compilation errors --- indra/llrender/llshadermgr.cpp | 14 +++++++++----- .../shaders/class1/deferred/fxaaF.glsl | 4 ++-- .../shaders/class1/deferred/multiSpotLightF.glsl | 4 ++-- .../class1/deferred/postDeferredGammaCorrect.glsl | 2 +- .../shaders/class1/deferred/softenLightF.glsl | 4 ++-- .../class1/interface/downsampleDepthRectF.glsl | 2 +- .../shaders/class2/deferred/multiSpotLightF.glsl | 4 ++-- .../shaders/class2/deferred/spotLightF.glsl | 4 ++-- 8 files changed, 21 insertions(+), 17 deletions(-) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index ebe68607f..b9abb48ef 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -610,9 +610,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade text[count++] = strdup("#define ATTRIBUTE attribute\n"); text[count++] = strdup("#define VARYING varying\n"); text[count++] = strdup("#define VARYING_FLAT varying\n"); - // Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files, + // Need to enable extensions here instead of in the shader files, // before any non-preprocessor directives (per spec) text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n"); + text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n"); } else if (minor_version <= 29) { @@ -623,9 +624,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade text[count++] = strdup("#define ATTRIBUTE attribute\n"); text[count++] = strdup("#define VARYING varying\n"); text[count++] = strdup("#define VARYING_FLAT varying\n"); - // Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files, + // Need to enable extensions here instead of in the shader files, // before any non-preprocessor directives (per spec) text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n"); + text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n"); } } else @@ -634,10 +636,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade { //set version to 1.30 text[count++] = strdup("#version 130\n"); - - // Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files, + // Need to enable extensions here instead of in the shader files, // before any non-preprocessor directives (per spec) text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n"); + text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n"); + //some implementations of GLSL 1.30 require integer precision be explicitly declared text[count++] = strdup("precision mediump int;\n"); @@ -646,9 +649,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade else { //set version to 400 text[count++] = strdup("#version 400\n"); - // Need to enable the GL_ARB_texture_rectangle extension here instead of in the shader files, + // Need to enable extensions here instead of in the shader files, // before any non-preprocessor directives (per spec) text[count++] = strdup("#extension GL_ARB_texture_rectangle : enable\n"); + text[count++] = strdup("#extension GL_ARB_shader_texture_lod : enable\n"); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl index 5eb9db585..13409832a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl @@ -23,8 +23,8 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_shader_texture_lod : enable +//#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 0e6ab80d4..2e01174e3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -31,8 +31,8 @@ out vec4 frag_color; //class 1 -- no shadows -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_shader_texture_lod : enable +//#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_shader_texture_lod : enable uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index 126f17fab..690744352 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index edab4d4e8..d64cc4c1a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -23,8 +23,8 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_shader_texture_lod : enable +//#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl index 942c5888e..e7a59af2f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index ac5b7d676..fdb10b151 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -23,8 +23,8 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_shader_texture_lod : enable +//#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 7689b72d2..09881d9d7 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -23,8 +23,8 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_shader_texture_lod : enable +//#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; From 14c43aa9a249e0498a43713f82cd89360194381b Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Thu, 14 Nov 2013 20:36:07 +0100 Subject: [PATCH 04/51] Fixed camera pan --- indra/newview/llviewerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 7ea6c9890..1a2013e27 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2798,7 +2798,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) case KEY_RIGHT: case KEY_UP: case KEY_DOWN: - if (mask & MASK_CONTROL) + if (mask == MASK_CONTROL) break; case KEY_PAGE_UP: case KEY_PAGE_DOWN: From a8cded0cf6b3a69ad365d998efe99e7efa3d0b06 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 15 Nov 2013 17:52:52 +0100 Subject: [PATCH 05/51] Allow calling LLNotificationsUtil::add from any thread. This makes LLStringUtil thread-safe by removing a rather unnecessary LLFastTimer from LLStringUtil::format. Same thing for LLTrans::getString and LLTrans::findString, where even a comment stated that the author wasn't interested in measuring cpu time at all. In this case I added some code back to make sure that we're not calling LLTrans::getString() in an inner loop, which was the reason that the LLFastTimer was added. Made one string static to avoid 45000 look ups during login, which kinda triggered the above test. Finally, LLNotificationsUtil::add is made thread-safe by making LLNotificationChannelBase::mItems thread-safe and defering a call to LLNotifications::updateItem to the main thread when called from another thread (using a little statemachine). --- indra/llcommon/llstring.cpp | 5 - indra/llui/llnotifications.cpp | 144 ++++++++++++++++++++++++++++- indra/llui/llnotifications.h | 9 +- indra/llui/lltrans.cpp | 31 ++++--- indra/newview/llfolderviewitem.cpp | 2 +- 5 files changed, 167 insertions(+), 24 deletions(-) diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 8953a1089..d5bc65a63 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -36,9 +36,6 @@ #include // for WideCharToMultiByte #endif -LLFastTimer::DeclareTimer FT_STRING_FORMAT("String Format"); - - std::string ll_safe_string(const char* in) { if(in) return std::string(in); @@ -1190,7 +1187,6 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, template<> S32 LLStringUtil::format(std::string& s, const format_map_t& substitutions) { - LLFastTimer ft(FT_STRING_FORMAT); S32 res = 0; std::string output; @@ -1263,7 +1259,6 @@ S32 LLStringUtil::format(std::string& s, const format_map_t& substitutions) template<> S32 LLStringUtil::format(std::string& s, const LLSD& substitutions) { - LLFastTimer ft(FT_STRING_FORMAT); S32 res = 0; if (!substitutions.isMap()) diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index b8fab0994..400d80d64 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -41,6 +41,7 @@ #include "llnotifications.h" #include "aialert.h" +#include "aistatemachine.h" #include "../newview/hippogridmanager.h" @@ -50,6 +51,9 @@ #endif #include +// Two macros, used to make access to mItems thread-safe, to keep the diff to a minimum. +#define AILOCK_mItems mItems_wat mItems_w(mItems_sf); LLNotificationSet& mItems(*mItems_w) +#define AILOCK_const_mItems mItems_crat mItems_r(mItems_sf); LLNotificationSet const& mItems(*mItems_r) const std::string NOTIFICATION_PERSIST_VERSION = "0.93"; @@ -99,6 +103,7 @@ private: output["version"] = NOTIFICATION_PERSIST_VERSION; LLSD& data = output["data"]; + AILOCK_mItems; for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it) { if (!LLNotificationTemplates::instance().templateExists((*it)->getName())) continue; @@ -156,6 +161,7 @@ private: void onDelete(LLNotificationPtr pNotification) { // we want to keep deleted notifications in our log + AILOCK_mItems; mItems.insert(pNotification); return; @@ -757,6 +763,7 @@ void LLNotificationChannelBase::connectChanged(const LLStandardSignal::slot_type // all of the notifications that are already in the channel // we use a special signal called "load" in case the channel wants to care // only about new notifications + AILOCK_mItems; for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it) { slot(LLSD().with("sigtype", "load").with("id", (*it)->id())); @@ -795,8 +802,11 @@ bool LLNotificationChannelBase::updateItem(const LLSD& payload) // internal call, for use in avoiding lookup bool LLNotificationChannelBase::updateItem(const LLSD& payload, LLNotificationPtr pNotification) -{ +{ + llassert(AIThreadID::in_main_thread()); + std::string cmd = payload["sigtype"]; + AILOCK_mItems; LLNotificationSet::iterator foundItem = mItems.find(pNotification); bool wasFound = (foundItem != mItems.end()); bool passesFilter = mFilter(pNotification); @@ -943,6 +953,7 @@ void LLNotificationChannel::setComparator(LLNotificationComparator comparator) { mComparator = comparator; LLNotificationSet s2(mComparator); + AILOCK_mItems; s2.insert(mItems.begin(), mItems.end()); mItems.swap(s2); @@ -952,16 +963,19 @@ void LLNotificationChannel::setComparator(LLNotificationComparator comparator) bool LLNotificationChannel::isEmpty() const { + AILOCK_const_mItems; return mItems.empty(); } LLNotificationChannel::Iterator LLNotificationChannel::begin() { + AILOCK_const_mItems; return mItems.begin(); } LLNotificationChannel::Iterator LLNotificationChannel::end() { + AILOCK_const_mItems; return mItems.end(); } @@ -1488,40 +1502,158 @@ LLNotificationPtr LLNotifications::add(AIAlert::Error const& error, int type, un return add(LLNotification::Params((type == AIAlert::modal || error.is_modal()) ? "AIAlertModal" : "AIAlert").substitutions(substitutions)); } +//-------------------------------------------------------------------------------- +// class UpdateItem +// +// Allow LLNotifications::add, LLNotifications::cancel and LLNotifications::update +// to be called from any thread. + +struct UpdateItem +{ + char const* sigtype; + LLNotificationPtr pNotif; + UpdateItem(char const* st, LLNotificationPtr const& np) : sigtype(st), pNotif(np) { } + void doit(void) const; +}; + +void UpdateItem::doit(void) const +{ + LLNotifications::getInstance()->updateItem(LLSD().with("sigtype", sigtype).with("id", pNotif->id()), pNotif); + if (!strcmp(sigtype, "delete")) + { + pNotif->cancel(); + } +} + +class UpdateItemSM : public AIStateMachine +{ + protected: + typedef AIStateMachine direct_base_type; + + enum update_item_state_type { + UpdateItem_idle = direct_base_type::max_state, + UpdateItem_doit + }; + + public: + static state_type const max_state = UpdateItem_doit + 1; + + public: + UpdateItemSM(void) : AIStateMachine(CWD_ONLY(true)) { } + + static void add(UpdateItem const& ui); + + private: + static UpdateItemSM* sSelf; + typedef std::deque updateQueue_type; + AIThreadSafeSimpleDC mUpdateQueue; + typedef AIAccess mUpdateQueue_wat; + typedef AIAccess mUpdateQueue_rat; + typedef AIAccessConst mUpdateQueue_crat; + + protected: + /*virtual*/ ~UpdateItemSM() { } + + protected: + /*virtual*/ void initialize_impl(void) { set_state(UpdateItem_idle); } + /*virtual*/ void multiplex_impl(state_type run_state); + /*virtual*/ void abort_impl(void) { } + /*virtual*/ void finish_impl(void) { } + /*virtual*/ char const* state_str_impl(state_type run_state) const; +}; + +//static +UpdateItemSM* UpdateItemSM::sSelf; + +void UpdateItemSM::add(UpdateItem const& ui) +{ + if (!sSelf) + { + sSelf = new UpdateItemSM; + sSelf->run(NULL, 0, false, true, &gMainThreadEngine); + } + if (AIThreadID::in_main_thread()) + { + ui.doit(); + return; + } + mUpdateQueue_wat mUpdateQueue_w(sSelf->mUpdateQueue); + mUpdateQueue_w->push_back(ui); + sSelf->advance_state(UpdateItem_doit); +} + +char const* UpdateItemSM::state_str_impl(state_type run_state) const +{ + switch(run_state) + { + // A complete listing of hello_world_state_type. + AI_CASE_RETURN(UpdateItem_idle); + AI_CASE_RETURN(UpdateItem_doit); + } + llassert(false); + return "UNKNOWN STATE"; +} + +void UpdateItemSM::multiplex_impl(state_type run_state) +{ + switch(run_state) + { + case UpdateItem_idle: + idle(); + break; + case UpdateItem_doit: + { + mUpdateQueue_wat mUpdateQueue_w(sSelf->mUpdateQueue); + while (!mUpdateQueue_w->empty()) + { + UpdateItem const& ui(mUpdateQueue_w->front()); + ui.doit(); + mUpdateQueue_w->pop_front(); + } + set_state(UpdateItem_idle); + break; + } + } +} + +// end of UpdateItemSM +//-------------------------------------------------------------------------------- void LLNotifications::add(const LLNotificationPtr pNotif) { if (pNotif == NULL) return; // first see if we already have it -- if so, that's a problem + AILOCK_mItems; LLNotificationSet::iterator it=mItems.find(pNotif); if (it != mItems.end()) { llerrs << "Notification added a second time to the master notification channel." << llendl; } - updateItem(LLSD().with("sigtype", "add").with("id", pNotif->id()), pNotif); + UpdateItemSM::add(UpdateItem("add", pNotif)); } void LLNotifications::cancel(LLNotificationPtr pNotif) { if (pNotif == NULL || pNotif->isCancelled()) return; + AILOCK_mItems; LLNotificationSet::iterator it=mItems.find(pNotif); if (it == mItems.end()) { llerrs << "Attempted to delete nonexistent notification " << pNotif->getName() << llendl; } - updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif); - pNotif->cancel(); + UpdateItemSM::add(UpdateItem("delete", pNotif)); } void LLNotifications::update(const LLNotificationPtr pNotif) { + AILOCK_mItems; LLNotificationSet::iterator it=mItems.find(pNotif); if (it != mItems.end()) { - updateItem(LLSD().with("sigtype", "change").with("id", pNotif->id()), pNotif); + UpdateItemSM::add(UpdateItem("change", pNotif)); } } @@ -1529,6 +1661,7 @@ void LLNotifications::update(const LLNotificationPtr pNotif) LLNotificationPtr LLNotifications::find(LLUUID const& uuid) { LLNotificationPtr target = LLNotificationPtr(new LLNotification(uuid)); + AILOCK_mItems; LLNotificationSet::iterator it=mItems.find(target); if (it == mItems.end()) { @@ -1543,6 +1676,7 @@ LLNotificationPtr LLNotifications::find(LLUUID const& uuid) void LLNotifications::forEachNotification(NotificationProcess process) { + AILOCK_mItems; std::for_each(mItems.begin(), mItems.end(), process); } diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index bb769cae7..df0168ae7 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -107,6 +107,7 @@ #include "llxmlnode.h" #include "llnotificationptr.h" #include "llnotificationcontext.h" +#include "aithreadsafe.h" namespace AIAlert { class Error; } @@ -196,6 +197,7 @@ class LLNotification : { LOG_CLASS(LLNotification); friend class LLNotifications; +friend class UpdateItem; public: // parameter object used to instantiate a new notification @@ -566,9 +568,10 @@ class LLNotificationChannelBase : public boost::signals2::trackable { LOG_CLASS(LLNotificationChannelBase); + friend class UpdateItem; public: LLNotificationChannelBase(LLNotificationFilter filter, LLNotificationComparator comp) : - mFilter(filter), mItems(comp) + mFilter(filter), mItems_sf(comp) {} virtual ~LLNotificationChannelBase() {} // you can also connect to a Channel, so you can be notified of @@ -582,7 +585,9 @@ public: const LLNotificationFilter& getFilter() { return mFilter; } protected: - LLNotificationSet mItems; + AIThreadSafeSimpleDC mItems_sf; + typedef AIAccess mItems_wat; + typedef AIAccessConst mItems_crat; LLStandardSignal mChanged; LLStandardSignal mPassedFilter; LLStandardSignal mFailedFilter; diff --git a/indra/llui/lltrans.cpp b/indra/llui/lltrans.cpp index fa9550055..be15bd406 100644 --- a/indra/llui/lltrans.cpp +++ b/indra/llui/lltrans.cpp @@ -91,15 +91,20 @@ bool LLTrans::parseStrings(const std::string& xml_filename, const std::setrenderUTF8(load_string, 0, right_x, y, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &right_x, FALSE); From 924908f2add7df2f64b1e58a672041b949555ac0 Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Fri, 15 Nov 2013 19:51:21 -0500 Subject: [PATCH 06/51] Imported new revoke anim perms code and refactored related bits --- indra/newview/app_settings/settings.xml | 11 ++++ indra/newview/llagent.cpp | 75 ++++++++++++++++++++++++- indra/newview/llagent.h | 5 +- indra/newview/llvoavatar.cpp | 11 +--- 4 files changed, 90 insertions(+), 12 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6f1a98444..54f0eef85 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13785,6 +13785,17 @@ This should be as low as possible, but too low may break functionality Value 1 + RevokePermsOnStopAnimation + + Comment + Clear animation permssions when choosing "Stop Animating Me" + Persist + 1 + Type + Boolean + Value + 1 + RotateRight Comment diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index d6188bcc0..081e3b65f 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -84,6 +84,7 @@ #include "llworld.h" #include "llworldmap.h" #include "llworldmapmessage.h" +#include "../lscript/lscript_byteformat.h" //Misc non-standard includes #include "llurldispatcher.h" @@ -3061,7 +3062,7 @@ LLQuaternion LLAgent::getHeadRotation() return rot; } -void LLAgent::sendAnimationRequests(LLDynamicArray &anim_ids, EAnimRequest request) +void LLAgent::sendAnimationRequests(const std::vector &anim_ids, EAnimRequest request) { if (gAgentID.isNull()) { @@ -3076,7 +3077,7 @@ void LLAgent::sendAnimationRequests(LLDynamicArray &anim_ids, EAnimReque msg->addUUIDFast(_PREHASH_AgentID, getID()); msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); - for (S32 i = 0; i < anim_ids.count(); i++) + for (U32 i = 0; i < anim_ids.size(); i++) { if (anim_ids[i].isNull()) { @@ -3118,6 +3119,55 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request) sendReliableMessage(); } +// Send a message to the region to stop the NULL animation state +// This will reset animation state overrides for the agent. +void LLAgent::sendAnimationStateReset() +{ + if (gAgentID.isNull() || !mRegionp) + { + return; + } + + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_AgentAnimation); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, getID()); + msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); + + msg->nextBlockFast(_PREHASH_AnimationList); + msg->addUUIDFast(_PREHASH_AnimID, LLUUID::null ); + msg->addBOOLFast(_PREHASH_StartAnim, FALSE); + + msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList); + msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0); + sendReliableMessage(); +} + + +// Send a message to the region to revoke sepecified permissions on ALL scripts in the region +// If the target is an object in the region, permissions in scripts on that object are cleared. +// If it is the region ID, all scripts clear the permissions for this agent +void LLAgent::sendRevokePermissions(const LLUUID & target, U32 permissions) +{ + // Currently only the bits for SCRIPT_PERMISSION_TRIGGER_ANIMATION and SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS + // are supported by the server. Sending any other bits will cause the message to be dropped without changing permissions + + if (gAgentID.notNull() && gMessageSystem) + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_RevokePermissions); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, getID()); // Must be our ID + msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); + + msg->nextBlockFast(_PREHASH_Data); + msg->addUUIDFast(_PREHASH_ObjectID, target); // Must be in the region + msg->addU32Fast(_PREHASH_ObjectPermissions, permissions); + + sendReliableMessage(); + } +} + // [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i void LLAgent::setAlwaysRun() { @@ -4338,6 +4388,8 @@ void LLAgent::stopCurrentAnimations() // avatar, propagating this change back to the server. if (isAgentAvatarValid()) { + std::vector anim_ids; + for ( LLVOAvatar::AnimIterator anim_it = gAgentAvatarp->mPlayingAnimations.begin(); anim_it != gAgentAvatarp->mPlayingAnimations.end(); @@ -4355,7 +4407,24 @@ void LLAgent::stopCurrentAnimations() // stop this animation locally gAgentAvatarp->stopMotion(anim_it->first, TRUE); // ...and tell the server to tell everyone. - sendAnimationRequest(anim_it->first, ANIM_REQUEST_STOP); + anim_ids.push_back(anim_it->first); + } + } + + sendAnimationRequests(anim_ids, ANIM_REQUEST_STOP); + + // Tell the region to clear any animation state overrides + sendAnimationStateReset(); + + // Revoke all animation permissions + if (mRegionp && + gSavedSettings.getBOOL("RevokePermsOnStopAnimation")) + { + U32 permissions = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TRIGGER_ANIMATION] | LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS]; + sendRevokePermissions(mRegionp->getRegionID(), permissions); + if (gAgentAvatarp->isSitting()) + { // Also stand up, since auto-granted sit animation permission has been revoked + gAgent.standUp(); } } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 8a01093bf..26501953a 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -464,8 +464,11 @@ public: void stopCurrentAnimations(); void requestStopMotion(LLMotion* motion); void onAnimStop(const LLUUID& id); - void sendAnimationRequests(LLDynamicArray &anim_ids, EAnimRequest request); + void sendAnimationRequests(const std::vector &anim_ids, EAnimRequest request); void sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request); + void sendAnimationStateReset(); + void sendRevokePermissions(const LLUUID & target, U32 permissions); + void endAnimationUpdateUI(); void unpauseAnimation() { mPauseRequest = NULL; } BOOL getCustomAnim() const { return mCustomAnim; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a3b3ee524..ae0b13470 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -116,6 +116,7 @@ #include "aifile.h" #include "llavatarname.h" +#include "../lscript/lscript_byteformat.h" #include "hippogridmanager.h" @@ -6606,14 +6607,8 @@ void LLVOAvatar::getOffObject() if (sit_object && !sit_object->permYouOwner() && gSavedSettings.getBOOL("RevokePermsOnStandUp")) { - gMessageSystem->newMessageFast(_PREHASH_RevokePermissions); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_Data); - gMessageSystem->addUUIDFast(_PREHASH_ObjectID, sit_object->getID()); - gMessageSystem->addU32Fast(_PREHASH_ObjectPermissions, 0xFFFFFFFF); - gAgent.sendReliableMessage(); + U32 permissions = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TRIGGER_ANIMATION] | LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS]; + gAgent.sendRevokePermissions(sit_object->getID(), permissions); } } } From 7fa5abd4d1cc3f15bbc26e4bbd6e609558487e42 Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Sat, 16 Nov 2013 14:01:09 -0500 Subject: [PATCH 07/51] Added NVAPI support on windows --- indra/cmake/CMakeLists.txt | 1 + indra/cmake/NVAPI.cmake | 21 +++++ indra/newview/CMakeLists.txt | 2 + indra/newview/llappviewerwin32.cpp | 121 +++++++++++++++++++++++++++++ install.xml | 31 ++++++++ 5 files changed, 176 insertions(+) create mode 100644 indra/cmake/NVAPI.cmake diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 5ff1b0399..d2e9f2249 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -81,6 +81,7 @@ set(cmake_SOURCE_FILES Linking.cmake MediaPluginBase.cmake NDOF.cmake + NVAPI.cmake OPENAL.cmake OpenGL.cmake OpenJPEG.cmake diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake new file mode 100644 index 000000000..d60e42c87 --- /dev/null +++ b/indra/cmake/NVAPI.cmake @@ -0,0 +1,21 @@ +# -*- cmake -*- +include(Prebuilt) +include(Variables) + +set(NVAPI ON CACHE BOOL "Use NVAPI.") + +if (NVAPI) + if (WINDOWS) + use_prebuilt_binary(nvapi) + if (WORD_SIZE EQUAL 32) + set(NVAPI_LIBRARY nvapi) + elseif (WORD_SIZE EQUAL 64) + set(NVAPI_LIBRARY nvapi64) + endif (WORD_SIZE EQUAL 32) + else (WINDOWS) + set(NVAPI_LIBRARY "") + endif (WINDOWS) +else (NVAPI) + set(NVAPI_LIBRARY "") +endif (NVAPI) + diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5d7091261..525f0be17 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -38,6 +38,7 @@ include(LLXML) #include(LScript) include(Linking) include(NDOF) +include(NVAPI) include(StateMachine) include(TemplateCheck) include(UI) @@ -1598,6 +1599,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLMATH_LIBRARIES} ${LLCOMMON_LIBRARIES} ${NDOF_LIBRARY} + ${NVAPI_LIBRARY} ${viewer_LIBRARIES} ${Boost_CONTEXT_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 8630ed1f9..ee775932f 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -52,6 +52,11 @@ #include "llviewercontrol.h" #include "lldxhardware.h" +#include "nvapi/nvapi.h" +#include "nvapi/NvApiDriverSettings.h" + +#include + #include "llweb.h" #include "llsecondlifeurls.h" @@ -79,6 +84,19 @@ extern "C" { const std::string LLAppViewerWin32::sWindowClass = "Second Life"; +/* + This function is used to print to the command line a text message + describing the nvapi error and quits +*/ +void nvapi_error(NvAPI_Status status) +{ + NvAPI_ShortString szDesc = {0}; + NvAPI_GetErrorMessage(status, szDesc); + llwarns << szDesc << llendl; + + //should always trigger when asserts are enabled + //llassert(status == NVAPI_OK); +} // Create app mutex creates a unique global windows object. // If the object can be created it returns true, otherwise @@ -101,6 +119,79 @@ bool create_app_mutex() return result; } +void ll_nvapi_init(NvDRSSessionHandle hSession) +{ + // (2) load all the system settings into the session + NvAPI_Status status = NvAPI_DRS_LoadSettings(hSession); + if (status != NVAPI_OK) + { + nvapi_error(status); + return; + } + + NvAPI_UnicodeString profile_name; + //std::string app_name = LLTrans::getString("APP_NAME"); + std::string app_name("Second Life"); // + llutf16string w_app_name = utf8str_to_utf16str(app_name); + wsprintf(profile_name, L"%s", w_app_name.c_str()); + status = NvAPI_DRS_SetCurrentGlobalProfile(hSession, profile_name); + if (status != NVAPI_OK) + { + nvapi_error(status); + return; + } + + // (3) Obtain the current profile. + NvDRSProfileHandle hProfile = 0; + status = NvAPI_DRS_GetCurrentGlobalProfile(hSession, &hProfile); + if (status != NVAPI_OK) + { + nvapi_error(status); + return; + } + + // load settings for querying + status = NvAPI_DRS_LoadSettings(hSession); + if (status != NVAPI_OK) + { + nvapi_error(status); + return; + } + + //get the preferred power management mode for Second Life + NVDRS_SETTING drsSetting = {0}; + drsSetting.version = NVDRS_SETTING_VER; + status = NvAPI_DRS_GetSetting(hSession, hProfile, PREFERRED_PSTATE_ID, &drsSetting); + if (status == NVAPI_SETTING_NOT_FOUND) + { //only override if the user hasn't specifically set this setting + // (4) Specify that we want the VSYNC disabled setting + // first we fill the NVDRS_SETTING struct, then we call the function + drsSetting.version = NVDRS_SETTING_VER; + drsSetting.settingId = PREFERRED_PSTATE_ID; + drsSetting.settingType = NVDRS_DWORD_TYPE; + drsSetting.u32CurrentValue = PREFERRED_PSTATE_PREFER_MAX; + status = NvAPI_DRS_SetSetting(hSession, hProfile, &drsSetting); + if (status != NVAPI_OK) + { + nvapi_error(status); + return; + } + + // (5) Now we apply (or save) our changes to the system + status = NvAPI_DRS_SaveSettings(hSession); + if (status != NVAPI_OK) + { + nvapi_error(status); + return; + } + } + else if (status != NVAPI_OK) + { + nvapi_error(status); + return; + } +} + //#define DEBUGGING_SEH_FILTER 1 #if DEBUGGING_SEH_FILTER # define WINMAIN DebuggingWinMain @@ -157,6 +248,27 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, return -1; } + NvAPI_Status status; + + // Initialize NVAPI + status = NvAPI_Initialize(); + NvDRSSessionHandle hSession = 0; + + if (status == NVAPI_OK) + { + // Create the session handle to access driver settings + status = NvAPI_DRS_CreateSession(&hSession); + if (status != NVAPI_OK) + { + nvapi_error(status); + } + else + { + //override driver setting as needed + ll_nvapi_init(hSession); + } + } + // Have to wait until after logging is initialized to display LFH info if (num_heaps > 0) { @@ -224,6 +336,15 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, LLAppViewer::sUpdaterInfo = NULL ; } + + + // (NVAPI) (6) We clean up. This is analogous to doing a free() + if (hSession) + { + NvAPI_DRS_DestroySession(hSession); + hSession = 0; + } + return 0; } diff --git a/install.xml b/install.xml index 2c02e94ba..cd0bedaee 100644 --- a/install.xml +++ b/install.xml @@ -1061,6 +1061,32 @@ + nvapi + + copyright + Copyright (C) NVIDIA + description + NVAPI is the library suite to access nvidia profiles and performance options on windows + license + NVAPI + packages + + windows + + md5sum + 99d1b70c1305257d521edfbd34587187 + url + https://bitbucket.org/SingularityViewer/libraries/downloads/nvapi-304-windows-20121116-singu.tar.bz2 + + windows64 + + md5sum + 5578017f13783fb7279dd39537d1e0fd + url + https://bitbucket.org/SingularityViewer/libraries/downloads/nvapi-304-windows64-20131116-singu.tar.bz2 + + + ndofdev copyright @@ -1873,6 +1899,11 @@ Cass Everitt - cass@r3.nu text http://www.jclark.com/xml/copying.txt + NVAPI + + url + Licenes dir + ogg-vorbis url From 3e2f1a8fd908ae8b7166efd9ccb69c9750efc97c Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Sat, 16 Nov 2013 14:28:25 -0500 Subject: [PATCH 08/51] Changed singularity prebuilt cache dir to sg.install.cache --- scripts/install.py | 4 ++-- scripts/public_fetch_tarballs.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install.py b/scripts/install.py index e027c7322..288b19b90 100755 --- a/scripts/install.py +++ b/scripts/install.py @@ -835,10 +835,10 @@ def _default_installable_cache(): """In general, the installable files do not change much, so find a host/user specific location to cache files.""" user = _getuser() - cache_dir = "/var/tmp/%s/install.cache" % user + cache_dir = "/var/tmp/%s/sg.install.cache" % user if _get_platform() == 'windows': cache_dir = os.path.join(tempfile.gettempdir(), \ - 'install.cache.%s' % user) + 'sg.install.cache.%s' % user) return cache_dir def parse_args(): diff --git a/scripts/public_fetch_tarballs.py b/scripts/public_fetch_tarballs.py index 455a42549..45eb4c5a8 100755 --- a/scripts/public_fetch_tarballs.py +++ b/scripts/public_fetch_tarballs.py @@ -173,10 +173,10 @@ def _default_installable_cache(): """In general, the installable files do not change much, so find a host/user specific location to cache files.""" user = _getuser() - cache_dir = "/var/tmp/%s/install.cache" % user + cache_dir = "/var/tmp/%s/sg.install.cache" % user if _get_platform() == 'windows': cache_dir = os.path.join(tempfile.gettempdir(), \ - 'install.cache.%s' % user) + 'sg.install.cache.%s' % user) return cache_dir # For status messages (e.g. "Loading..."). May come in handy if From c6ec2a531fdc961d475a4e9ddd0e42b8aa90d88f Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sun, 17 Nov 2013 12:28:06 +0100 Subject: [PATCH 09/51] Alow alt-camming and terrian parcel selection from farther away. Thanks to Liru for finding the sport --- indra/newview/llviewerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1a2013e27..94af94a36 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4231,7 +4231,7 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d LLVector3 probe_point_region; // walk forwards to find the point - for (mouse_dir_scale = FIRST_PASS_STEP; mouse_dir_scale < gAgentCamera.mDrawDistance; mouse_dir_scale += FIRST_PASS_STEP) + for (mouse_dir_scale = FIRST_PASS_STEP; mouse_dir_scale < gAgentCamera.mDrawDistance * 4; mouse_dir_scale += FIRST_PASS_STEP) { LLVector3d mouse_direction_global_d; mouse_direction_global_d.setVec(mouse_direction_global * mouse_dir_scale); From 97c505f94134c22b58773b659ecf29a398baf27d Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sun, 17 Nov 2013 12:45:14 +0100 Subject: [PATCH 10/51] Reset 'MotionResetsCamera' on camera reset --- indra/newview/llviewermenu.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c009980e1..48fe25ce7 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4150,6 +4150,7 @@ void reset_view_final( BOOL proceed ) } gAgentCamera.resetView(TRUE, TRUE); gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR); + gSavedSettings.setBOOL("SinguMotionResetsCamera", true); if(gAgentCamera.cameraCustomizeAvatar() && LLFloaterCustomize::instanceExists()) LLFloaterCustomize::getInstance()->close(); From a5103a1fc1205ce2823b1a5885bd2d124412a54f Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Mon, 18 Nov 2013 04:22:21 +0100 Subject: [PATCH 11/51] Sprinkle some Intel GPU support on Linux --- indra/llrender/llgl.cpp | 2 ++ indra/llrender/llshadermgr.cpp | 2 +- .../shaders/class1/deferred/spotLightF.glsl | 4 ++-- indra/newview/featuretable_linux.txt | 4 ++-- indra/newview/gpu_table.txt | 11 +++++++++++ indra/newview/llfeaturemanager.cpp | 4 ++++ indra/newview/llviewertexturelist.cpp | 6 ++++++ 7 files changed, 28 insertions(+), 5 deletions(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index ae78758b4..8b5310beb 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -755,10 +755,12 @@ bool LLGLManager::initGL() #endif stop_glerror(); +#if LL_WINDOWS if (mIsIntel && mGLVersion <= 3.f) { //never try to use framebuffer objects on older intel drivers (crashy) mHasFramebufferObject = FALSE; } +#endif stop_glerror(); diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index fe63bc0c5..843789ae1 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -550,7 +550,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade LL_WARNS("ShaderLoading") << "GL ERROR entering loadShaderFile(): " << error << LL_ENDL; } } - + LL_DEBUGS("ShaderLoading") << "Loading shader file: " << filename << " class " << shader_level << LL_ENDL; if (filename.empty()) diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 8d8a6c9dd..f9fbca47f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -23,8 +23,8 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_shader_texture_lod : enable +//#extension GL_ARB_texture_rectangle : enable +//#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index bcc930a44..90b788f4f 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -1,4 +1,4 @@ -version 27 +version 28 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -301,7 +301,7 @@ RenderObjectBump 0 0 list OpenGLPre15 RenderVBOEnable 1 0 -list Intel +list IntelPre30 RenderAnisotropic 1 0 // Avoid some Intel crashes on Linux RenderCubeMap 0 0 diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 7fa0e9531..af1a861ca 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -301,7 +301,11 @@ Intel Eaglelake .*Intel.*Eaglelake.* 0 1 Intel Graphics Media HD .*Intel.*Graphics Media.*HD.* 0 1 Intel HD Graphics 2000 .*Intel.*HD Graphics 2000.* 1 1 Intel HD Graphics 3000 .*Intel.*HD Graphics 3000.* 2 1 +Intel HD Graphics 3000 .*Intel.*Sandybridge.* 2 1 Intel HD Graphics 4000 .*Intel.*HD Graphics 4000.* 2 1 +Intel HD Graphics 4000 .*Intel.*Ivybridge.* 2 1 +Intel HD Graphics 5000 .*Intel.*HD Graphics 5.* 2 1 +Intel HD Graphics 5000 .*Intel.*Haswell.* 2 1 Intel HD Graphics .*Intel.*HD Graphics.* 2 1 Intel Mobile 4 Series .*Intel.*Mobile.* 4 Series.* 0 1 Intel Media Graphics HD .*Intel.*Media Graphics HD.* 0 1 @@ -312,6 +316,7 @@ Intel HD Graphics 2000 .*Intel.*HD2000.* 1 1 Intel HD Graphics 3000 .*Intel.*HD3000.* 2 1 Matrox .*Matrox.* 0 0 Mesa .*Mesa.* 0 0 +Gallium .*Gallium.* 1 1 NVIDIA 205 .*NVIDIA .*GeForce 205.* 2 1 NVIDIA 210 .*NVIDIA .*GeForce 210.* 2 1 NVIDIA 310M .*NVIDIA .*GeForce 310M.* 1 1 @@ -407,6 +412,12 @@ NVIDIA GTX 670 .*NVIDIA .*GTX *67.* 3 1 NVIDIA GTX 680M .*NVIDIA .*GTX *680M.* 3 1 NVIDIA GTX 680 .*NVIDIA .*GTX *68.* 3 1 NVIDIA GTX 690 .*NVIDIA .*GTX *69.* 3 1 +NVIDIA GTX 750 .*NVIDIA .*GTX *75.* 3 1 +NVIDIA GTX 760 .*NVIDIA .*GTX *76.* 3 1 +NVIDIA GTX 770 .*NVIDIA .*GTX *77.* 3 1 +NVIDIA GTX 780 .*NVIDIA .*GTX *78.* 3 1 +NVIDIA GTX TITAN .*NVIDIA .*GTX *TITAN.* 3 1 +NVIDIA GT 7xxM .*NVIDIA .*GT *7.* 3 1 NVIDIA C51 .*NVIDIA .*C51.* 0 1 NVIDIA G72 .*NVIDIA .*G72.* 1 1 NVIDIA G73 .*NVIDIA .*G73.* 1 1 diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 1551744bd..c3d0bc8a6 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -626,6 +626,10 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("GeForceFX"); } + if (gGLManager.mIsIntel && gGLManager.mGLVersion<3.0f) + { + maskFeatures("IntelPre30"); + } if (gGLManager.mIsIntel) { maskFeatures("Intel"); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index e86dbfd21..8c52fe762 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1219,6 +1219,12 @@ S32 LLViewerTextureList::getMinVideoRamSetting() // Returns max setting for TextureMemory (in MB) S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) { +#if LL_LINUX + if (gGLManager.mIsIntel && gGLManager.mGLVersion >= 3.f && !gGLManager.mVRAM) + { + gGLManager.mVRAM = 512; + } +#endif S32 max_texmem; if (gGLManager.mVRAM != 0) { From 3b8fbbc827859f6a2392c5c1f52bb723e6e5071b Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Mon, 18 Nov 2013 07:45:25 +0100 Subject: [PATCH 12/51] Clean up shaders on package and no longer final-package by default on Linux --- indra/newview/CMakeLists.txt | 8 +------- indra/newview/viewer_manifest.py | 4 ++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 525f0be17..9238802f0 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1434,13 +1434,7 @@ if (!DISABLE_TEMPLATE_CHECK) check_message_template(${VIEWER_BINARY_NAME}) endif (!DISABLE_TEMPLATE_CHECK) -# We package by default on Linux so we can run from newview/packaged. -if (LINUX) - set(PACKAGE_DEFAULT ON) -else (LINUX) - set(PACKAGE_DEFAULT OFF) -endif (LINUX) -set(PACKAGE ${PACKAGE_DEFAULT} CACHE BOOL +set(PACKAGE OFF CACHE BOOL "Add a package target that builds an installer package.") if (WINDOWS) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 083a01887..1cd5b6407 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -715,7 +715,11 @@ class DarwinManifest(ViewerManifest): class LinuxManifest(ViewerManifest): def construct(self): + import shutil + shutil.rmtree("./packaged/app_settings/shaders", ignore_errors=True); + super(LinuxManifest, self).construct() + self.path("licenses-linux.txt","licenses.txt") self.path("res/"+self.icon_name(),self.icon_name()) From 2badc1c79c873b2d4682328c8b305315b3ae026b Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 18 Nov 2013 09:55:15 -0600 Subject: [PATCH 13/51] Initialize LLListener_OpenAL::mRolloffFactor just to be safe. --- indra/llaudio/lllistener_openal.cpp | 7 +++++++ indra/llaudio/lllistener_openal.h | 1 + 2 files changed, 8 insertions(+) diff --git a/indra/llaudio/lllistener_openal.cpp b/indra/llaudio/lllistener_openal.cpp index b3d4b02f0..41a40caf7 100644 --- a/indra/llaudio/lllistener_openal.cpp +++ b/indra/llaudio/lllistener_openal.cpp @@ -39,6 +39,13 @@ LLListener_OpenAL::~LLListener_OpenAL() { } +LLListener_OpenAL::init() +{ + // do inherited + LLListener::init(); + mRolloffFactor = 1.0f; +} + void LLListener_OpenAL::translate(LLVector3 offset) { //llinfos << "LLListener_OpenAL::translate() : " << offset << llendl; diff --git a/indra/llaudio/lllistener_openal.h b/indra/llaudio/lllistener_openal.h index cb163b11a..96af86d99 100644 --- a/indra/llaudio/lllistener_openal.h +++ b/indra/llaudio/lllistener_openal.h @@ -38,6 +38,7 @@ class LLListener_OpenAL : public LLListener public: LLListener_OpenAL(); virtual ~LLListener_OpenAL(); + virtual void init(); virtual void translate(LLVector3 offset); virtual void setPosition(LLVector3 pos); From be249ac8a18a3d02a8971e0509a12de55ba5b28f Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 18 Nov 2013 09:56:49 -0600 Subject: [PATCH 14/51] Font update. Minor refactor, and removed some pointless code that was leaking. --- indra/llrender/llfontfreetype.cpp | 208 +++++++++++++++++------------ indra/llrender/llfontfreetype.h | 131 ++++++++---------- indra/llrender/llfontgl.cpp | 161 +++++++++++----------- indra/llrender/llfontgl.h | 33 ++--- indra/llrender/llfontregistry.cpp | 22 +-- indra/llui/llresmgr.cpp | 1 + indra/llui/llstyle.cpp | 2 + indra/newview/llappviewerwin32.cpp | 3 +- indra/newview/llviewerwindow.cpp | 1 + 9 files changed, 298 insertions(+), 264 deletions(-) diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 36515c48a..a0322846a 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -2,37 +2,32 @@ * @file llfontfreetype.cpp * @brief Freetype font library wrapper * - * $LicenseInfo:firstyear=2002&license=viewergpl$ - * - * Copyright (c) 2002-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * 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. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * 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. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * 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 "linden_common.h" #include "llfontfreetype.h" +#include "llfontgl.h" // Freetype stuff #include @@ -103,36 +98,18 @@ LLFontGlyphInfo::LLFontGlyphInfo(U32 index) mYBitmapOffset(0), // Offset to the origin in the bitmap mXBearing(0), // Distance from baseline to left in pixels mYBearing(0), // Distance from baseline to top in pixels + mBitmapNum(0), // Which bitmap in the bitmap cache contains this glyph mIsRendered(FALSE), mMetricsValid(FALSE) -{} - -LLFontList::LLFontList() { } -LLFontList::~LLFontList() -{ - LLFontList::iterator iter; - for(iter = this->begin(); iter != this->end(); iter++) - { - delete *iter; - // The (now dangling) pointers in the vector will be cleaned up when the vector is deleted by the superclass destructor. - } -} -void LLFontList::addAtEnd(LLFontFreetype *font) -{ - // Purely a convenience function - this->push_back(font); -} - LLFontFreetype::LLFontFreetype() : mFontBitmapCachep(new LLFontBitmapCache), mValid(FALSE), mAscender(0.f), mDescender(0.f), mLineHeight(0.f), - mFallbackFontp(NULL), mIsFallback(FALSE), mFTFace(NULL), mRenderGlyphCount(0), @@ -222,8 +199,8 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, const F32 point_size, if (!mIsFallback || !sOpenGLcrashOnRestart) // because this often crashes under Linux... { - // Add the empty glyph`5 - addGlyph(0, 0); + // Add the default glyph + addGlyphFromFont(this, 0, 0); } mName = filename; @@ -232,19 +209,26 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, const F32 point_size, return TRUE; } -//virtual +void LLFontFreetype::setFallbackFonts(const font_vector_t &font) +{ + mFallbackFonts = font; +} + +const LLFontFreetype::font_vector_t &LLFontFreetype::getFallbackFonts() const +{ + return mFallbackFonts; +} + F32 LLFontFreetype::getLineHeight() const { return mLineHeight; } -//virtual F32 LLFontFreetype::getAscenderHeight() const { return mAscender; } -//virtual F32 LLFontFreetype::getDescenderHeight() const { return mDescender; @@ -256,7 +240,7 @@ F32 LLFontFreetype::getXAdvance(const llwchar wch) const return 0.0; llassert(!mIsFallback); - U32 glyph_index; + //U32 glyph_index; // Return existing info only if it is current LLFontGlyphInfo* gi = getGlyphInfo(wch); @@ -264,18 +248,26 @@ F32 LLFontFreetype::getXAdvance(const llwchar wch) const { return gi->mXAdvance; } - - const LLFontFreetype* fontp = this; + //new + else + { + char_glyph_info_map_t::iterator found_it = mCharGlyphInfoMap.find((llwchar)0); + if (found_it != mCharGlyphInfoMap.end()) + { + return found_it->second->mXAdvance; + } + } + /*const LLFontFreetype* fontp = this; // Initialize char to glyph map glyph_index = FT_Get_Char_Index(mFTFace, wch); - if (glyph_index == 0 && mFallbackFontp) + if (glyph_index == 0) { - LLFontList::iterator iter; - for(iter = mFallbackFontp->begin(); (iter != mFallbackFontp->end()) && (glyph_index == 0); iter++) + font_vector_t::const_iterator iter; + for(iter = mFallbackFonts.begin(); iter != mFallbackFonts.end(); iter++) { glyph_index = FT_Get_Char_Index((*iter)->mFTFace, wch); - if(glyph_index) + if (glyph_index) { fontp = *iter; } @@ -306,6 +298,7 @@ F32 LLFontFreetype::getXAdvance(const llwchar wch) const gi->mXAdvance = fontp->mFTFace->glyph->advance.x / 64.f; gi->mYAdvance = fontp->mFTFace->glyph->advance.y / 64.f; gi->mMetricsValid = TRUE; + //gi->mIsRendered = TRUE; return gi->mXAdvance; } else @@ -315,7 +308,7 @@ F32 LLFontFreetype::getXAdvance(const llwchar wch) const { return gi->mXAdvance; } - } + }*/ // Last ditch fallback - no glyphs defined at all. return (F32)mFontBitmapCachep->getMaxCharWidth(); @@ -343,7 +336,8 @@ F32 LLFontFreetype::getXKerning(const llwchar char_left, const llwchar char_righ BOOL LLFontFreetype::hasGlyph(const llwchar wch) const { llassert(!mIsFallback); - const LLFontGlyphInfo* gi = getGlyphInfo(wch); + return(mCharGlyphInfoMap.find(wch) != mCharGlyphInfoMap.end()); + /*const LLFontGlyphInfo* gi = getGlyphInfo(wch); if (gi && gi->mIsRendered) { return TRUE; @@ -351,10 +345,10 @@ BOOL LLFontFreetype::hasGlyph(const llwchar wch) const else { return FALSE; - } + }*/ } -BOOL LLFontFreetype::addChar(const llwchar wch) const +BOOL LLFontFreetype::addGlyph(const llwchar wch) const { if (mFTFace == NULL) return FALSE; @@ -368,19 +362,15 @@ BOOL LLFontFreetype::addChar(const llwchar wch) const glyph_index = FT_Get_Char_Index(mFTFace, wch); if (glyph_index == 0) { - // Try looking it up in the backup Unicode font - if (mFallbackFontp) + //llinfos << "Trying to add glyph from fallback font!" << llendl; + font_vector_t::const_iterator iter; + for(iter = mFallbackFonts.begin(); iter != mFallbackFonts.end(); iter++) { - //llinfos << "Trying to add glyph from fallback font!" << llendl; - LLFontList::iterator iter; - for(iter = mFallbackFontp->begin(); iter != mFallbackFontp->end(); iter++) + glyph_index = FT_Get_Char_Index((*iter)->mFTFace, wch); + if (glyph_index) { - glyph_index = FT_Get_Char_Index((*iter)->mFTFace, wch); - if (glyph_index) - { - addGlyphFromFont(*iter, wch, glyph_index); - return TRUE; - } + addGlyphFromFont(*iter, wch, glyph_index); + return TRUE; } } } @@ -388,8 +378,7 @@ BOOL LLFontFreetype::addChar(const llwchar wch) const char_glyph_info_map_t::iterator iter = mCharGlyphInfoMap.find(wch); if (iter == mCharGlyphInfoMap.end() || !(iter->second->mIsRendered)) { - BOOL result = addGlyph(wch, glyph_index); - return result; + return addGlyphFromFont(this, wch, glyph_index); } return FALSE; } @@ -492,6 +481,11 @@ BOOL LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, const llwchar // omit it from the font-image. } + //new + LLImageGL *image_gl = mFontBitmapCachep->getImageGL(bitmap_num); + LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_num); + image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight()); + return TRUE; } @@ -502,6 +496,15 @@ LLFontGlyphInfo* LLFontFreetype::getGlyphInfo(const llwchar wch) const { return iter->second; } + else if(addGlyph(wch))//new + { + // this glyph doesn't yet exist, so render it and return the result + char_glyph_info_map_t::iterator iter = mCharGlyphInfoMap.find(wch); + if (iter != mCharGlyphInfoMap.end()) + { + return iter->second; + } + } return NULL; } @@ -519,11 +522,6 @@ void LLFontFreetype::insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const } } -BOOL LLFontFreetype::addGlyph(const llwchar wch, const U32 glyph_index) const -{ - return addGlyphFromFont(this, wch, glyph_index); -} - void LLFontFreetype::renderGlyph(const U32 glyph_index) const { if (mFTFace == NULL) @@ -536,34 +534,74 @@ void LLFontFreetype::renderGlyph(const U32 glyph_index) const mRenderGlyphCount++; } +void LLFontFreetype::reset(F32 vert_dpi, F32 horz_dpi) +{ + //new + resetBitmapCache(); + loadFace(mName,mPointSize,vert_dpi,horz_dpi,mFontBitmapCachep->getNumComponents(),mIsFallback); + if (!mIsFallback) + { + // This is the head of the list - need to rebuild ourself and all fallbacks. + //loadFace(mName,mPointSize,vert_dpi,horz_dpi,mFontBitmapCachep->getNumComponents(),mIsFallback); + if (mFallbackFonts.empty()) + { + llwarns << "LLFontGL::reset(), no fallback fonts present" << llendl; + } + else + { + for(font_vector_t::iterator it = mFallbackFonts.begin(); + it != mFallbackFonts.end(); + ++it) + { + (*it)->reset(vert_dpi, horz_dpi); + } + } + } + //resetBitmapCache(); +} + void LLFontFreetype::resetBitmapCache() { // Iterate through glyphs and clear the mIsRendered flag - for (char_glyph_info_map_t::iterator iter = mCharGlyphInfoMap.begin(); + /*for (char_glyph_info_map_t::iterator iter = mCharGlyphInfoMap.begin(); iter != mCharGlyphInfoMap.end(); ++iter) { iter->second->mIsRendered = FALSE; //FIXME: this is only strictly necessary when resetting the entire font, //not just flushing the bitmap iter->second->mMetricsValid = FALSE; - } + }*/ + //new + for_each(mCharGlyphInfoMap.begin(), mCharGlyphInfoMap.end(), DeletePairedPointer()); + mCharGlyphInfoMap.clear(); + mFontBitmapCachep->reset(); + // Adding default glyph is skipped for fallback fonts here as well as in loadFace(). + // This if was added as fix for EXT-4971. if (!mIsFallback || !sOpenGLcrashOnRestart) // because this often crashes under Linux... { - // Add the empty glyph`5 - addGlyph(0, 0); + // Add the empty glyph + addGlyphFromFont(this, 0, 0); } } +void LLFontFreetype::destroyGL() +{ + mFontBitmapCachep->destroyGL(); +} -void LLFontFreetype::setSubImageLuminanceAlpha(const U32 x, - const U32 y, - const U32 bitmap_num, - const U32 width, - const U32 height, - const U8 *data, - S32 stride) const +const std::string &LLFontFreetype::getName() const +{ + return mName; +} + +const LLPointer LLFontFreetype::getFontBitmapCache() const +{ + return mFontBitmapCachep; +} + +void LLFontFreetype::setSubImageLuminanceAlpha(const U32 x, const U32 y, const U32 bitmap_num, const U32 width, const U32 height, const U8 *data, S32 stride) const { LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_num); diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h index 1a7dfb9ad..5e29e3fbb 100644 --- a/indra/llrender/llfontfreetype.h +++ b/indra/llrender/llfontfreetype.h @@ -1,32 +1,26 @@ /** - * @file llfont.h + * @file llfontfreetype.h * @brief Font library wrapper * - * $LicenseInfo:firstyear=2002&license=viewergpl$ - * - * Copyright (c) 2002-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * 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. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * 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. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * 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$ */ @@ -34,7 +28,7 @@ #define LL_LLFONTFREETYPE_H #include -#include "llmemory.h" +#include "llpointer.h" #include "llstl.h" #include "llimagegl.h" @@ -51,25 +45,23 @@ class LLFontFreetype; struct FT_FaceRec_; typedef struct FT_FaceRec_* LLFT_Face; -extern LLFontManager *gFontManagerp; - class LLFontManager { public: static void initClass(); static void cleanupClass(); -public: +private: LLFontManager(); - virtual ~LLFontManager(); + ~LLFontManager(); }; -class LLFontGlyphInfo +struct LLFontGlyphInfo { -public: LLFontGlyphInfo(U32 index); -public: + U32 mGlyphIndex; + // Metrics S32 mWidth; // In pixels S32 mHeight; // In pixels @@ -86,37 +78,29 @@ public: S32 mBitmapNum; // Which bitmap in the bitmap cache contains this glyph }; -// Used for lists of fallback fonts -class LLFontList : public std::vector -{ -public: - LLFontList(); - ~LLFontList(); - void addAtEnd(LLFontFreetype *font); -}; +extern LLFontManager *gFontManagerp; -class LLFontFreetype +class LLFontFreetype : public LLRefCount { public: LLFontFreetype(); - virtual ~LLFontFreetype(); + ~LLFontFreetype(); // is_fallback should be true for fallback fonts that aren't used // to render directly (Unicode backup, primarily) - virtual BOOL loadFace(const std::string& filename, - const F32 point_size, - const F32 vert_dpi, - const F32 horz_dpi, - const S32 components, - BOOL is_fallback); - void setFallbackFont(LLFontList *fontp) { mFallbackFontp = fontp; } + BOOL loadFace(const std::string& filename, const F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback); + + typedef std::vector > font_vector_t; + + void setFallbackFonts(const font_vector_t &font); + const font_vector_t &getFallbackFonts() const; void setCharToGlyphMap(llwchar wch, U32 glyph_index) const; // Global font metrics - in units of pixels - virtual F32 getLineHeight() const; - virtual F32 getAscenderHeight() const; - virtual F32 getDescenderHeight() const; + F32 getLineHeight() const; + F32 getAscenderHeight() const; + F32 getDescenderHeight() const; // For a lowercase "g": @@ -148,48 +132,49 @@ public: const LLFontGlyphInfo &getMetrics(const llwchar wc) const; F32 getXAdvance(const llwchar wc) const; F32 getXKerning(const llwchar char_left, const llwchar char_right) const; // Get the kerning between the two characters - virtual void reset() = 0; + LLFontGlyphInfo* getGlyphInfo(const llwchar wch) const; + + void reset(F32 vert_dpi, F32 horz_dpi); + + void destroyGL(); + + const std::string& getName() const; + + const LLPointer getFontBitmapCache() const; static bool sOpenGLcrashOnRestart; -protected: - virtual BOOL hasGlyph(const llwchar wch) const; // Has a glyph for this character - virtual BOOL addChar(const llwchar wch) const; // Add a new character to the font if necessary - virtual BOOL addGlyph(const llwchar wch, const U32 glyph_index) const; // Add a new glyph to the existing font - virtual BOOL addGlyphFromFont(const LLFontFreetype *fontp, const llwchar wch, const U32 glyph_index) const; // Add a glyph from this font to the other (returns the glyph_index, 0 if not found) - - virtual LLFontGlyphInfo* getGlyphInfo(const llwchar wch) const; - - void insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const; +private: + void resetBitmapCache(); + void setSubImageLuminanceAlpha(const U32 x, const U32 y, const U32 bitmap_num, const U32 width, const U32 height, const U8 *data, S32 stride = 0) const; +public: + BOOL hasGlyph(const llwchar wch) const; // Has a glyph for this character + BOOL addGlyph(const llwchar wch) const; // Add a new character to the font if necessary +private: + BOOL addGlyphFromFont(const LLFontFreetype *fontp, const llwchar wch, const U32 glyph_index) const; // Add a glyph from this font to the other (returns the glyph_index, 0 if not found) void renderGlyph(const U32 glyph_index) const; - void resetBitmapCache(); + void insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const; -protected: std::string mName; + F32 mPointSize; F32 mAscender; F32 mDescender; F32 mLineHeight; - mutable LLPointer mFontBitmapCachep; - LLFT_Face mFTFace; BOOL mIsFallback; - LLFontList *mFallbackFontp; // A list of fallback fonts to look for glyphs in (for Unicode chars) + font_vector_t mFallbackFonts; // A list of fallback fonts to look for glyphs in (for Unicode chars) + + BOOL mValid; typedef std::map char_glyph_info_map_t; mutable char_glyph_info_map_t mCharGlyphInfoMap; // Information about glyph location in bitmap - BOOL mValid; - void setSubImageLuminanceAlpha(const U32 x, - const U32 y, - const U32 bitmap_num, - const U32 width, - const U32 height, - const U8 *data, - S32 stride = 0) const; + mutable LLPointer mFontBitmapCachep; + mutable S32 mRenderGlyphCount; mutable S32 mAddGlyphCount; }; diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 010dcf940..d3cac8628 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -84,7 +84,6 @@ F32 llfont_round_y(F32 y) } LLFontGL::LLFontGL() - : LLFontFreetype() { clearEmbeddedChars(); } @@ -96,66 +95,22 @@ LLFontGL::~LLFontGL() void LLFontGL::reset() { - if (!mIsFallback) - { - // This is the head of the list - need to rebuild ourself and all fallbacks. - loadFace(mName,mPointSize,sVertDPI,sHorizDPI,mFontBitmapCachep->getNumComponents(),mIsFallback); - if (mFallbackFontp==NULL) - { - llwarns << "LLFontGL::reset(), no fallback fonts present" << llendl; - } - else - { - for (LLFontList::iterator it = mFallbackFontp->begin(); - it != mFallbackFontp->end(); - ++it) - { - (*it)->reset(); - } - } - } - resetBitmapCache(); + mFontFreetype->reset(sVertDPI, sHorizDPI); } -bool findOrCreateFont(LLFontGL*& fontp, const LLFontDescriptor& desc) -{ - // Don't delete existing fonts, if any, here, because they've - // already been deleted by LLFontRegistry::clear() - fontp = LLFontGL::getFont(desc); - return (fontp != NULL); -} - - void LLFontGL::destroyGL() { - mFontBitmapCachep->destroyGL(); + mFontFreetype->destroyGL(); } BOOL LLFontGL::loadFace(const std::string& filename, const F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback) { - if (!LLFontFreetype::loadFace(filename, point_size, vert_dpi, horz_dpi, components, is_fallback)) + if(mFontFreetype == reinterpret_cast(NULL)) { - return FALSE; - } - return TRUE; -} - - -BOOL LLFontGL::addChar(const llwchar wch) const -{ - if (!LLFontFreetype::addChar(wch)) - { - return FALSE; + mFontFreetype = new LLFontFreetype; } - stop_glerror(); - - LLFontGlyphInfo *glyph_info = getGlyphInfo(wch); - U32 bitmap_num = glyph_info->mBitmapNum; - LLImageGL *image_gl = mFontBitmapCachep->getImageGL(bitmap_num); - LLImageRaw *image_raw = mFontBitmapCachep->getImageRaw(bitmap_num); - image_gl->setSubImage(image_raw, 0, 0, image_gl->getWidth(), image_gl->getHeight()); - return TRUE; + return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, components, is_fallback); } static LLFastTimer::DeclareTimer FTM_RENDER_FONTS("Fonts"); @@ -255,13 +210,13 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons switch (valign) { case TOP: - cur_y -= llceil(mAscender); + cur_y -= llceil(mFontFreetype->getAscenderHeight()); break; case BOTTOM: - cur_y += llceil(mDescender); + cur_y += llceil(mFontFreetype->getDescenderHeight()); break; case VCENTER: - cur_y -= llceil((llceil(mAscender) - llceil(mDescender))/2.f); + cur_y -= llceil((llceil(mFontFreetype->getAscenderHeight()) - llceil(mFontFreetype->getDescenderHeight())) / 2.f); break; case BASELINE: // Baseline, do nothing. @@ -289,7 +244,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons F32 start_x = (F32)llround(cur_x); - const LLFontBitmapCache* font_bitmap_cache = mFontBitmapCachep; + const LLFontBitmapCache* font_bitmap_cache = mFontFreetype->getFontBitmapCache(); F32 inv_width = 1.f / font_bitmap_cache->getBitmapWidth(); F32 inv_height = 1.f / font_bitmap_cache->getBitmapHeight(); @@ -351,7 +306,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons // snap origin to whole screen pixel const F32 ext_x = (F32)llround(cur_render_x + (EXT_X_BEARING * sScaleX)); - const F32 ext_y = (F32)llround(cur_render_y + (EXT_Y_BEARING * sScaleY + mAscender - mLineHeight)); + const F32 ext_y = (F32)llround(cur_render_y + (EXT_Y_BEARING * sScaleY + mFontFreetype->getAscenderHeight() - mFontFreetype->getLineHeight())); LLRectf uv_rect(0.f, 1.f, 1.f, 0.f); LLRectf screen_rect(ext_x, ext_y + ext_height, ext_x + ext_width, ext_y); @@ -381,19 +336,20 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons } else { - if (!hasGlyph(wch)) + //new + /*if (!mFontFreetype->hasGlyph(wch)) { addChar(wch); - } + }*/ - const LLFontGlyphInfo* fgi= getGlyphInfo(wch); + const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch); if (!fgi) { llerrs << "Missing Glyph Info" << llendl; break; } // Per-glyph bitmap texture. - LLImageGL *image_gl = mFontBitmapCachep->getImageGL(fgi->mBitmapNum); + LLImageGL *image_gl = font_bitmap_cache->getImageGL(fgi->mBitmapNum); if (last_bound_texture != image_gl) { gGL.getTexUnit(0)->bind(image_gl); @@ -428,11 +384,13 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons if (next_char && (next_char < LAST_CHARACTER)) { // Kern this puppy. - if (!hasGlyph(next_char)) + //new + /*if (!mFontFreetype->hasGlyph(next_char)) { addChar(next_char); - } - cur_x += getXKerning(wch, next_char); + }*/ + mFontFreetype->getGlyphInfo(next_char); + cur_x += mFontFreetype->getXKerning(wch, next_char); } // Round after kerning. @@ -454,7 +412,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons if (style & UNDERLINE) { - F32 descender = (F32)llfloor(mDescender); + F32 descender = (F32)llfloor(mFontFreetype->getDescenderHeight()); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.begin(LLRender::LINES); @@ -507,6 +465,22 @@ S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y return renderUTF8(text, begin_offset, (F32)x, (F32)y, color, halign, valign, style, shadow, S32_MAX, S32_MAX, NULL, FALSE); } +// font metrics - override for LLFontFreetype that returns units of virtual pixels +F32 LLFontGL::getAscenderHeight() const +{ + return mFontFreetype->getAscenderHeight() / sScaleY; +} + +F32 LLFontGL::getDescenderHeight() const +{ + return mFontFreetype->getDescenderHeight() / sScaleY; +} + +F32 LLFontGL::getLineHeight() const +{ + return (F32)llround(mFontFreetype->getLineHeight() / sScaleY); +} + S32 LLFontGL::getWidth(const std::string& utf8text) const { LLWString wtext = utf8str_to_wstring(utf8text); @@ -573,7 +547,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, const S32 begin_offset, const S } else { - cur_x += getXAdvance(wch); + cur_x += mFontFreetype->getXAdvance(wch); llwchar next_char = wchars[i+1]; if (((i + 1) < begin_offset + max_chars) @@ -581,7 +555,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, const S32 begin_offset, const S && (next_char < LAST_CHARACTER)) { // Kern this puppy. - cur_x += getXKerning(wch, next_char); + cur_x += mFontFreetype->getXKerning(wch, next_char); } } // Round after kerning. @@ -677,7 +651,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch } } - cur_x += getXAdvance(wch); + cur_x += mFontFreetype->getXAdvance(wch); if (scaled_max_pixels < cur_x) { @@ -688,7 +662,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch if (((i+1) < max_chars) && wchars[i+1]) { // Kern this puppy. - cur_x += getXKerning(wch, wchars[i+1]); + cur_x += mFontFreetype->getXKerning(wch, wchars[i+1]); } } // Round after kerning. @@ -743,7 +717,27 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_ llwchar wch = wchars[i]; const embedded_data_t* ext_data = getEmbeddedCharData(wch); - F32 char_width = ext_data ? getEmbeddedCharAdvance(ext_data) : getXAdvance(wch); + F32 char_width = 0; + + if(ext_data) + { + char_width = getEmbeddedCharAdvance(ext_data); + } + else + { + //new + const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch); + + // last character uses character width, since the whole character needs to be visible + // other characters just use advance + char_width = (i == start) + ? (F32)(fgi->mWidth + fgi->mXBearing) // use actual width for last character + : fgi->mXAdvance; // use advance for all other characters + + //old + //const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch); + //mFontFreetype->getXAdvance(wch); + } if( scaled_max_pixels < (total_width + char_width) ) { @@ -761,7 +755,7 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_ if ( i > 0 ) { // kerning - total_width += ext_data ? (EXT_KERNING * sScaleX) : getXKerning(wchars[i-1], wch); + total_width += ext_data ? (EXT_KERNING * sScaleX) : mFontFreetype->getXKerning(wchars[i-1], wch); } // Round after kerning. @@ -780,7 +774,6 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset, } F32 cur_x = 0; - S32 pos = 0; target_x *= sScaleX; @@ -789,9 +782,10 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset, F32 scaled_max_pixels = max_pixels * sScaleX; - for (S32 i = begin_offset; (i < max_index); i++) + S32 pos; + for (pos = begin_offset; pos < max_index; pos++) { - llwchar wch = wchars[i]; + llwchar wch = wchars[pos]; if (!wch) { break; // done @@ -826,8 +820,8 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset, pos++; cur_x += ext_advance; - if (((i + 1) < max_index) - && (wchars[(i + 1)])) + if (((pos + 1) < max_index) + && (wchars[(pos + 1)])) { cur_x += EXT_KERNING * sScaleX; } @@ -836,7 +830,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset, } else { - F32 char_width = getXAdvance(wch); + F32 char_width = mFontFreetype->getXAdvance(wch); if (round) { @@ -860,12 +854,11 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset, pos++; cur_x += char_width; - if (((i + 1) < max_index) - && (wchars[(i + 1)])) + if (((pos + 1) < max_index) + && (wchars[(pos + 1)])) { - llwchar next_char = wchars[i + 1]; // Kern this puppy. - cur_x += getXKerning(wch, next_char); + cur_x += mFontFreetype->getXKerning(wch, wchars[pos + 1]); } // Round after kerning. @@ -876,6 +869,10 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, const S32 begin_offset, return pos; } +const LLFontDescriptor& LLFontGL::getFontDesc() const +{ + return mFontDescriptor; +} const LLFontGL::embedded_data_t* LLFontGL::getEmbeddedCharData(const llwchar wch) const { @@ -1041,9 +1038,11 @@ std::string LLFontGL::getStringFromStyle(U8 style) } return style_string; } + +// static std::string LLFontGL::nameFromFont(const LLFontGL* fontp) { - return fontp->getFontDesc().getName(); + return fontp->mFontDescriptor.getName(); } // static @@ -1249,7 +1248,7 @@ void LLFontGL::renderQuad(const LLRectf& screen_rect, const LLRectf& uv_rect, F3 void LLFontGL::drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4& color, U8 style, ShadowType shadow, F32 drop_shadow_strength) const { F32 slant_offset; - slant_offset = ((style & ITALIC) ? ( -mAscender * 0.2f) : 0.f); + slant_offset = ((style & ITALIC) ? ( -mFontFreetype->getAscenderHeight() * 0.2f) : 0.f); gGL.begin(LLRender::QUADS); { diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index 9476382eb..d7c47995d 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -28,23 +28,24 @@ #ifndef LL_LLFONTGL_H #define LL_LLFONTGL_H -#include "llfontfreetype.h" -#include "lltexture.h" -#include "v2math.h" #include "llcoord.h" -#include "llrect.h" - #include "llfontregistry.h" +#include "lltexture.h" +#include "llpointer.h" +#include "llrect.h" +#include "v2math.h" + +class LLImageGL; class LLColor4; - // Key used to request a font. class LLFontDescriptor; +class LLFontFreetype; // Structure used to store previously requested fonts. class LLFontRegistry; -class LLFontGL : public LLFontFreetype +class LLFontGL { public: enum HAlign @@ -88,7 +89,7 @@ public: void destroyGL(); - /* virtual*/ BOOL loadFace(const std::string& filename, const F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback); + BOOL loadFace(const std::string& filename, const F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback); S32 render(const LLWString &text, S32 begin_offset, const LLRect& rect, @@ -118,9 +119,9 @@ public: S32 renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style = NORMAL, ShadowType shadow = NO_SHADOW) const; // font metrics - override for LLFont that returns units of virtual pixels - /*virtual*/ F32 getLineHeight() const { return (F32)llround(mLineHeight / sScaleY); } - /*virtual*/ F32 getAscenderHeight() const { return (F32)llround(mAscender / sScaleY); } - /*virtual*/ F32 getDescenderHeight() const { return (F32)llround(mDescender / sScaleY); } + F32 getAscenderHeight() const; + F32 getDescenderHeight() const; + F32 getLineHeight() const; S32 getWidth(const std::string& utf8text) const; S32 getWidth(const llwchar* wchars) const; @@ -151,8 +152,7 @@ public: // Returns the index of the character closest to pixel position x (ignoring text to the right of max_pixels and max_chars) S32 charFromPixelOffset(const llwchar* wchars, const S32 char_offset, F32 x, F32 max_pixels=F32_MAX, S32 max_chars = S32_MAX, BOOL round = TRUE, BOOL use_embedded = FALSE) const; - const LLFontDescriptor &getFontDesc() const { return mFontDesc; } - void setFontDesc(const LLFontDescriptor& font_desc) { mFontDesc = font_desc; } + const LLFontDescriptor& getFontDesc() const; LLTexture *getTexture() const; @@ -217,19 +217,20 @@ public: static F32 sScaleY; static BOOL sDisplayFont ; static std::string sAppDir; // For loading fonts +private: + friend class LLFontRegistry; friend class LLTextBillboard; friend class LLHUDText; LLFontGL(const LLFontGL &source); LLFontGL &operator=(const LLFontGL &source); -protected: - /*virtual*/ BOOL addChar(const llwchar wch) const; protected: typedef std::map embedded_map_t; mutable embedded_map_t mEmbeddedChars; - LLFontDescriptor mFontDesc; + LLFontDescriptor mFontDescriptor; + LLPointer mFontFreetype; void renderQuad(const LLRectf& screen_rect, const LLRectf& uv_rect, F32 slant_amt) const; void drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4& color, U8 style, ShadowType shadow, F32 drop_shadow_fade) const; diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index fcfbc4c84..6f56a463e 100644 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp @@ -421,7 +421,8 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) llwarns << "createFont failed, no file names specified" << llendl; return NULL; } - LLFontList *fontlistp = new LLFontList; + + LLFontFreetype::font_vector_t fontlist; LLFontGL *result = NULL; // Snarf all fonts we can into fontlistp. First will get pulled @@ -466,19 +467,24 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc) is_first_found = false; } else - fontlistp->addAtEnd(fontp); + { + fontlist.push_back(fontp->mFontFreetype); + delete fontp; + fontp = NULL; + } } } - if (result && !fontlistp->empty()) + + if (result && !fontlist.empty()) { - result->setFallbackFont(fontlistp); + result->mFontFreetype->setFallbackFonts(fontlist); } - norm_desc.setStyle(match_desc->getStyle()); if (result) - result->setFontDesc(norm_desc); - - if (!result) + { + result->mFontDescriptor = desc; + } + else { llwarns << "createFont failed in some way" << llendl; } diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index 334ead62a..76cd4a5e3 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -36,6 +36,7 @@ #include "linden_common.h" #include "llresmgr.h" +#include "llimagegl.h" #include "llfontgl.h" #include "llerror.h" #include "llstring.h" diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp index 90e538807..9551c98b8 100644 --- a/indra/llui/llstyle.cpp +++ b/indra/llui/llstyle.cpp @@ -33,6 +33,8 @@ #include "linden_common.h" #include "llstyle.h" + +#include "llfontgl.h" #include "llstring.h" #include "llui.h" diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 5758fb5c4..a61f617c0 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -40,7 +40,8 @@ #include "llappviewerwin32.h" -#include "llwindowwin32.cpp" // *FIX: for setting gIconResource. +#include "llwindowwin32.h" // *FIX: for setting gIconResource. +#include "llgl.h" #include "res/resource.h" // *FIX: for setting gIconResource. #include //_O_APPEND diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 894b01b79..2a03092e1 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -60,6 +60,7 @@ #include "llaudioengine.h" // mute on minimize #include "llassetstorage.h" #include "llfontgl.h" +#include "llfontfreetype.h" #include "llmousehandler.h" #include "llrect.h" #include "llsky.h" From 030588caafa092e4f15532ba9cd25cac5355b4b8 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 18 Nov 2013 09:57:35 -0600 Subject: [PATCH 15/51] Underwater shadows. --- .../shaders/class1/deferred/underWaterF.glsl | 2 +- indra/newview/llviewerdisplay.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl index 78f841c73..692df8b10 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl @@ -151,7 +151,7 @@ void main() vec4 fb = texture2D(screenTex, distort); - frag_data[0] = vec4(linear_to_srgb(fb.rgb), 1.0); // diffuse + frag_data[0] = vec4(/*linear_to_srgb*/(fb.rgb), 1.0); // diffuse frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec frag_data[2] = vec4(encode_normal(wavef), 0.0, 0.0); // normalxyz, displace } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 92278c941..093f61d4f 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -725,6 +725,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo static LLCullResult result; LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; + LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE; gPipeline.updateCull(*LLViewerCamera::getInstance(), result, water_clip); stop_glerror(); @@ -949,7 +950,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo { gGL.setColorMask(true, true); - if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) + if (LLPipeline::sRenderDeferred) { gPipeline.mDeferredScreen.bindTarget(); glClearColor(1,0,1,1); @@ -1035,7 +1036,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo } gGL.setColorMask(true, false); - if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) + if (LLPipeline::sRenderDeferred) { gPipeline.renderGeomDeferred(*LLViewerCamera::getInstance()); } @@ -1071,7 +1072,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo if (to_texture) { - if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) + if (LLPipeline::sRenderDeferred) { gPipeline.mDeferredScreen.flush(); if(gPipeline.mDeferredScreen.getFBO()) @@ -1098,7 +1099,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo } //gGL.flush(); - if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) + if (LLPipeline::sRenderDeferred) { gPipeline.renderDeferredLighting(); } From 8aa4d0fd27a5cfeec6d6b4203e3b4925dca20df1 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 18 Nov 2013 09:58:21 -0600 Subject: [PATCH 16/51] Removed fasttimer that was hurting perf a tiny bit. --- indra/llrender/llvertexbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 0c59d99c0..6b60481eb 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -2109,7 +2109,7 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind) if (useVBOs() && (force_bind || (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive)))) { - LLFastTimer t(FTM_BIND_GL_BUFFER); + //LLFastTimer t(FTM_BIND_GL_BUFFER); /*if (sMapped) { llerrs << "VBO bound while another VBO mapped!" << llendl; From 7b9f854c66ff9b67f5ff6df1053008b754957ad4 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 18 Nov 2013 18:07:51 +0100 Subject: [PATCH 17/51] Fix for 'with active responder' llerrs crash. This fixes at least one case (crash report 8407), which comes down to not cleanly informing a responder of failure when the request url is empty (or so badly formed that it isn't a valid url). As a result, the statemachine would abort() without informing the responder - which is bad, sort of. The previous cases where the responder needed to be informed of a failure, namely "statemachine timed_out()" and "bad_socket()" when a socket suddenly becomes bad for unknown reason, have been replaced with the more general 'aborted()' function, which must be called before the statemachine calls abort(). Clearly this has been done for all cases of abort() now, so that if the llerrs fires again in the future then that would have to be after the statemachine calls finish(), which is still as "impossible" as it was - hence the llerrs is still there to make sure. The reason that this seldom happened on SL, and more often on opensim, even more often on home-brew test grids, seems plausible: malformed urls happen more in those cases. I also took the opportunity to improve the robustness of cases where the curl error code is checked: it makes no sense to check what curl gives as error code when an internal error occurred. --- indra/llmessage/aicurl.cpp | 31 +++++++------------ .../aicurleasyrequeststatemachine.cpp | 13 ++++---- indra/llmessage/aicurlprivate.h | 9 ++---- indra/llmessage/llhttpclient.cpp | 2 +- indra/newview/lluserauth.cpp | 5 +++ indra/newview/llxmlrpcresponder.cpp | 2 +- 6 files changed, 28 insertions(+), 34 deletions(-) diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index 246371aab..1364b4e38 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/aicurl.cpp @@ -52,7 +52,6 @@ #include "llsdserialize.h" #include "aithreadsafe.h" #include "llqueuedthread.h" -#include "lltimer.h" // ms_sleep #include "llproxy.h" #include "llhttpstatuscodes.h" #include "aihttpheaders.h" @@ -1287,8 +1286,9 @@ BufferedCurlEasyRequest::~BufferedCurlEasyRequest() // If the responder is still alive, then that means that BufferedCurlEasyRequest::processOutput was // never called, which means that the removed_from_multi_handle event never happened. // This is definitely an internal error as it can only happen when libcurl is too slow, - // in which case AICurlEasyRequestStateMachine::mTimer times out, but that already - // calls BufferedCurlEasyRequest::timed_out(). + // in which case AICurlEasyRequestStateMachine::mTimer times out, a socket goes bad, or + // the state machine is aborted, but those already call BufferedCurlEasyRequest::aborted() + // which sets mResponder to NULL. llmaybeerrs << "Calling ~BufferedCurlEasyRequest() with active responder!" << llendl; if (!LLApp::isRunning()) { @@ -1298,30 +1298,23 @@ BufferedCurlEasyRequest::~BufferedCurlEasyRequest() else { // User chose to continue. - timed_out(); + aborted(HTTP_INTERNAL_ERROR_OTHER, "BufferedCurlEasyRequest destructed with active responder"); } } --AICurlInterface::Stats::BufferedCurlEasyRequest_count; } -void BufferedCurlEasyRequest::timed_out(void) +void BufferedCurlEasyRequest::aborted(U32 http_status, std::string const& reason) { - mResponder->finished(CURLE_OK, HTTP_INTERNAL_ERROR_CURL_LOCKUP, "Request timeout, aborted.", sChannels, mOutput); - if (mResponder->needsHeaders()) + if (mResponder) { - send_buffer_events_to(NULL); // Revoke buffer events: we send them to the responder. + mResponder->finished(CURLE_OK, http_status, reason, sChannels, mOutput); + if (mResponder->needsHeaders()) + { + send_buffer_events_to(NULL); // Revoke buffer events: we send them to the responder. + } + mResponder = NULL; } - mResponder = NULL; -} - -void BufferedCurlEasyRequest::bad_socket(void) -{ - mResponder->finished(CURLE_OK, HTTP_INTERNAL_ERROR_CURL_BADSOCKET, "File descriptor went bad! Aborted.", sChannels, mOutput); - if (mResponder->needsHeaders()) - { - send_buffer_events_to(NULL); // Revoke buffer events: we send them to the responder. - } - mResponder = NULL; } #if defined(CWDEBUG) || defined(DEBUG_CURLIO) diff --git a/indra/llmessage/aicurleasyrequeststatemachine.cpp b/indra/llmessage/aicurleasyrequeststatemachine.cpp index 294f41586..6b7bcf654 100644 --- a/indra/llmessage/aicurleasyrequeststatemachine.cpp +++ b/indra/llmessage/aicurleasyrequeststatemachine.cpp @@ -121,6 +121,7 @@ void AICurlEasyRequestStateMachine::multiplex_impl(state_type run_state) bool empty_url = AICurlEasyRequest_rat(*mCurlEasyRequest)->getLowercaseServicename().empty(); if (empty_url) { + AICurlEasyRequest_wat(*mCurlEasyRequest)->aborted(HTTP_INTERNAL_ERROR_OTHER, "Not a valid URL."); abort(); break; } @@ -195,16 +196,14 @@ void AICurlEasyRequestStateMachine::multiplex_impl(state_type run_state) case AICurlEasyRequestStateMachine_removed: { // The request was removed from the multi handle. - if (mTimedOut) - { - AICurlEasyRequest_wat easy_request_w(*mCurlEasyRequest); - easy_request_w->timed_out(); - } // We're done. If we timed out, abort -- or else the application will // think that getResult() will return a valid error code from libcurl. if (mTimedOut) + { + AICurlEasyRequest_wat(*mCurlEasyRequest)->aborted(HTTP_INTERNAL_ERROR_CURL_LOCKUP, "Request timeout, aborted."); abort(); + } else finish(); @@ -212,7 +211,7 @@ void AICurlEasyRequestStateMachine::multiplex_impl(state_type run_state) } case AICurlEasyRequestStateMachine_bad_file_descriptor: { - AICurlEasyRequest_wat(*mCurlEasyRequest)->bad_socket(); + AICurlEasyRequest_wat(*mCurlEasyRequest)->aborted(HTTP_INTERNAL_ERROR_CURL_BADSOCKET, "File descriptor went bad! Aborted."); abort(); } } @@ -224,7 +223,7 @@ void AICurlEasyRequestStateMachine::abort_impl(void) // Revert call to addRequest() if that was already called (and the request wasn't removed again already). if (mAdded) { - // Note that it's safe to call this even if the curl thread already removed it, or will removes it + // Note that it's safe to call this even if the curl thread already removed it, or will remove it // after we called this, before processing the remove command; only the curl thread calls // MultiHandle::remove_easy_request, which is a no-op when called twice for the same easy request. mAdded = false; diff --git a/indra/llmessage/aicurlprivate.h b/indra/llmessage/aicurlprivate.h index c5e3514a7..ddf685aca 100644 --- a/indra/llmessage/aicurlprivate.h +++ b/indra/llmessage/aicurlprivate.h @@ -385,11 +385,8 @@ class BufferedCurlEasyRequest : public CurlEasyRequest { buffer_ptr_t& getInput(void) { return mInput; } buffer_ptr_t& getOutput(void) { return mOutput; } - // Called if libcurl doesn't deliver within AIHTTPTimeoutPolicy::mMaximumTotalDelay seconds. - void timed_out(void); - - // Called if the underlaying socket went bad (ie, when accidently closed by a buggy library). - void bad_socket(void); + // Called if the state machine is (about to be) aborted due to some error. + void aborted(U32 http_status, std::string const& reason); // Called after removed_from_multi_handle was called. void processOutput(void); @@ -462,7 +459,7 @@ class BufferedCurlEasyRequest : public CurlEasyRequest { bool success(void) const { return mResult == CURLE_OK && mStatus >= 200 && mStatus < 400; } // Return true when prepRequest was already called and the object has not been - // invalidated as a result of calling timed_out(). + // invalidated as a result of calling aborted(). bool isValid(void) const { return mResponder; } // Return the capability type of this request. diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 749c5df6f..533469d93 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -636,7 +636,7 @@ static LLSD blocking_request( response["body"] = responder->getLLSD(); } } - else if (result == CURLE_OK) + else if (result == CURLE_OK && !is_internal_http_error(http_status)) { // We expect 404s, don't spam for them. if (http_status != 404) diff --git a/indra/newview/lluserauth.cpp b/indra/newview/lluserauth.cpp index 8c2d359a1..c2f00bb68 100644 --- a/indra/newview/lluserauth.cpp +++ b/indra/newview/lluserauth.cpp @@ -298,6 +298,11 @@ LLUserAuth::UserAuthcode LLUserAuth::authResponse() // if curl was ok, parse the download area. CURLcode result = mResponder->result_code(); + if (is_internal_http_error(mResponder->http_status())) + { + // result can be a meaningless CURLE_OK in the case of an internal error. + result = CURLE_FAILED_INIT; // Just some random error to get the default case below. + } switch (result) { case CURLE_OK: diff --git a/indra/newview/llxmlrpcresponder.cpp b/indra/newview/llxmlrpcresponder.cpp index dac69a7f1..6fbc05ca1 100644 --- a/indra/newview/llxmlrpcresponder.cpp +++ b/indra/newview/llxmlrpcresponder.cpp @@ -168,7 +168,7 @@ void XMLRPCResponder::completed_headers(U32 status, std::string const& reason, A void XMLRPCResponder::completedRaw(U32 status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer) { - if (mCode == CURLE_OK) + if (mCode == CURLE_OK && !is_internal_http_error(status)) { mBufferSize = buffer->count(channels.in()); if (200 <= status && status < 400) From 7183797e05050a832321df6338cf270071289fe0 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Mon, 18 Nov 2013 23:40:19 +0100 Subject: [PATCH 18/51] Autogenerated versioned windows resource files --- .gitignore | 2 ++ indra/cmake/BuildVersion.cmake | 12 ++++++++++++ indra/newview/res/{viewerRes.rc => viewerRes.rc.in} | 8 ++++---- .../res/{viewerRes_bc.rc => viewerRes_bc.rc.in} | 8 ++++---- 4 files changed, 22 insertions(+), 8 deletions(-) rename indra/newview/res/{viewerRes.rc => viewerRes.rc.in} (95%) rename indra/newview/res/{viewerRes_bc.rc => viewerRes_bc.rc.in} (95%) diff --git a/.gitignore b/.gitignore index 4f9405a16..29e8fd76f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ qtcreator-build/ /.pc /build-* /viewer-* +/indra/newview/res/viewerRes.rc +/indra/newview/res/viewerRes_bc.rc \ No newline at end of file diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index 041927f10..b85f77198 100644 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -33,6 +33,18 @@ configure_file( ${CMAKE_SOURCE_DIR}/llcommon/llversionviewer.h ) +if (WINDOWS) + configure_file( + ${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc.in + ${CMAKE_SOURCE_DIR}/newview/res/viewerRes.rc + ) + + configure_file( + ${CMAKE_SOURCE_DIR}/newview/res/viewerRes_bc.rc.in + ${CMAKE_SOURCE_DIR}/newview/res/viewerRes_bc.rc + ) +endif (WINDOWS) + # Compose the version. set(viewer_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}") if (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$") diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc.in similarity index 95% rename from indra/newview/res/viewerRes.rc rename to indra/newview/res/viewerRes.rc.in index 6e492ae15..0ca054f5a 100644 --- a/indra/newview/res/viewerRes.rc +++ b/indra/newview/res/viewerRes.rc.in @@ -138,8 +138,8 @@ TOOLMEDIAOPEN CURSOR "toolmediaopen.cur" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,8,4,5433 - PRODUCTVERSION 1,8,4,5433 + FILEVERSION ${vMAJOR},${vMINOR},${vPATCH},${vBUILD} + PRODUCTVERSION ${vMAJOR},${vMINOR},${vPATCH},${vBUILD} FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -156,12 +156,12 @@ BEGIN BEGIN VALUE "CompanyName", "Siana Gearz" VALUE "FileDescription", "Singularity Viewer" - VALUE "FileVersion", "1.8.4.5433" + VALUE "FileVersion", "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}" VALUE "InternalName", "Second Life" VALUE "LegalCopyright", "Copyright 2001-2010, Linden Research, Inc., Copyright 2010 Siana Gearz" VALUE "OriginalFilename", "SingularityViewer.exe" VALUE "ProductName", "Singularity Viewer" - VALUE "ProductVersion", "1.8.4.5433" + VALUE "ProductVersion", "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}" END END BLOCK "VarFileInfo" diff --git a/indra/newview/res/viewerRes_bc.rc b/indra/newview/res/viewerRes_bc.rc.in similarity index 95% rename from indra/newview/res/viewerRes_bc.rc rename to indra/newview/res/viewerRes_bc.rc.in index 7827f7ded..a9bdd7c8d 100644 --- a/indra/newview/res/viewerRes_bc.rc +++ b/indra/newview/res/viewerRes_bc.rc.in @@ -138,8 +138,8 @@ TOOLMEDIAOPEN CURSOR "toolmediaopen.cur" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,8,4,5433 - PRODUCTVERSION 1,8,4,5433 + FILEVERSION ${vMAJOR},${vMINOR},${vPATCH},${vBUILD} + PRODUCTVERSION ${vMAJOR},${vMINOR},${vPATCH},${vBUILD} FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -156,12 +156,12 @@ BEGIN BEGIN VALUE "CompanyName", "Siana Gearz" VALUE "FileDescription", "Singularity Viewer" - VALUE "FileVersion", "1.8.4.5433" + VALUE "FileVersion", "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}" VALUE "InternalName", "Second Life" VALUE "LegalCopyright", "Copyright 2001-2010, Linden Research, Inc., Copyright 2010 Siana Gearz" VALUE "OriginalFilename", "SingularityViewer.exe" VALUE "ProductName", "Singularity Viewer" - VALUE "ProductVersion", "1.8.4.5433" + VALUE "ProductVersion", "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}" END END BLOCK "VarFileInfo" From cce3809a260f11881ea54d9166f5ae59ec46097a Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 19 Nov 2013 00:25:52 +0100 Subject: [PATCH 19/51] Autogenerate version numbers on Mac too --- .gitignore | 3 ++- indra/cmake/BuildVersion.cmake | 7 +++++++ indra/newview/English.lproj/InfoPlist.strings | 7 ------- indra/newview/English.lproj/InfoPlist.strings.in | 6 ++++++ 4 files changed, 15 insertions(+), 8 deletions(-) delete mode 100644 indra/newview/English.lproj/InfoPlist.strings create mode 100644 indra/newview/English.lproj/InfoPlist.strings.in diff --git a/.gitignore b/.gitignore index 29e8fd76f..ead4b749f 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,5 @@ qtcreator-build/ /build-* /viewer-* /indra/newview/res/viewerRes.rc -/indra/newview/res/viewerRes_bc.rc \ No newline at end of file +/indra/newview/res/viewerRes_bc.rc +/indra/newview/English.lproj/InfoPlist.strings diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index b85f77198..d2981fcd3 100644 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -45,6 +45,13 @@ if (WINDOWS) ) endif (WINDOWS) +if (DARWIN) + configure_file( + ${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings.in + ${CMAKE_SOURCE_DIR}/newview/English.lproj/InfoPlist.strings + ) +endif (DARWIN) + # Compose the version. set(viewer_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}") if (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$") diff --git a/indra/newview/English.lproj/InfoPlist.strings b/indra/newview/English.lproj/InfoPlist.strings deleted file mode 100644 index ca5535951..000000000 --- a/indra/newview/English.lproj/InfoPlist.strings +++ /dev/null @@ -1,7 +0,0 @@ -/* Localized versions of Info.plist keys */ - -CFBundleName = "Singularity"; - -CFBundleShortVersionString = "Singularity Viewer 1.7.0.0"; -CFBundleGetInfoString = "Singularity Viewer 1.7.0.0, Copyright 2012 Siana Gearz"; - diff --git a/indra/newview/English.lproj/InfoPlist.strings.in b/indra/newview/English.lproj/InfoPlist.strings.in new file mode 100644 index 000000000..e190849bf --- /dev/null +++ b/indra/newview/English.lproj/InfoPlist.strings.in @@ -0,0 +1,6 @@ +/* Localized versions of Info.plist keys */ + +CFBundleName = "Singularity"; + +CFBundleShortVersionString = "Singularity Viewer ${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}"; +CFBundleGetInfoString = "Singularity Viewer ${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}, Copyright 2012 Siana Gearz"; From c6ec03ab19b55e92018cfd15f3ff554205c59758 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 19 Nov 2013 00:52:59 +0100 Subject: [PATCH 20/51] Re-enable generating tarballs when packaging on Linux --- indra/newview/viewer_manifest.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 1cd5b6407..f11d0485d 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -806,12 +806,11 @@ class LinuxManifest(ViewerManifest): try: # --numeric-owner hides the username of the builder for # security etc. - # I'm leaving this disabled for speed - #self.run_command("tar -C '%(dir)s' --numeric-owner -cjf " - # "'%(inst_path)s.tar.bz2' %(inst_name)s" % { - # 'dir': self.get_build_prefix(), - # 'inst_name': installer_name, - # 'inst_path':self.build_path_of(installer_name)}) + self.run_command("tar -C '%(dir)s' --numeric-owner -cjf " + "'%(inst_path)s.tar.bz2' %(inst_name)s" % { + 'dir': self.get_build_prefix(), + 'inst_name': installer_name, + 'inst_path':self.build_path_of(installer_name)}) print '' finally: self.run_command("mv '%(inst)s' '%(dst)s'" % { From c99f54367dc130c5670c87a2e7a2672fc9fdd72e Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 19 Nov 2013 00:50:06 +0100 Subject: [PATCH 21/51] Use viewer channel as the basis for installer file names --- indra/cmake/Variables.cmake | 7 ++++--- indra/newview/CMakeLists.txt | 2 +- .../{Info-Singularity.plist => Info-singularity.plist} | 0 3 files changed, 5 insertions(+), 4 deletions(-) rename indra/newview/{Info-Singularity.plist => Info-singularity.plist} (100%) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 187412b4a..5848b8934 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -140,12 +140,13 @@ endif(WINDOWS AND WORD_SIZE EQUAL 32) set(GRID agni CACHE STRING "Target Grid") set(VIEWER_CHANNEL "Singularity" CACHE STRING "Viewer Channel Name") -set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing") +set(VIEWER_LOGIN_CHANNEL "${VIEWER_CHANNEL}" CACHE STRING "Fake login channel for A/B Testing") set(VIEWER_BRANDING_ID "singularity" CACHE STRING "Viewer branding id (currently secondlife|snowglobe)") # *TODO: break out proper Branding-secondlife.cmake, Branding-snowglobe.cmake, etc -set(VIEWER_BRANDING_NAME "Singularity") -set(VIEWER_BRANDING_NAME_CAMELCASE "Singularity") +string(REGEX REPLACE " +" "" VIEWER_CHANNEL_ONE_WORD "${VIEWER_CHANNEL}") +set(VIEWER_BRANDING_NAME "${VIEWER_CHANNEL_ONE_WORD}") +set(VIEWER_BRANDING_NAME_CAMELCASE "${VIEWER_CHANNEL_ONE_WORD}") set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.") diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 9238802f0..ad2fc39e5 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1141,7 +1141,7 @@ if (DARWIN) ${VIEWER_BRANDING_ID}.icns macview.r gpu_table.txt - Info-${VIEWER_BRANDING_NAME_CAMELCASE}.plist + Info-${VIEWER_BRANDING_ID}.plist SecondLife.nib/ # CMake doesn't seem to support Xcode language variants well just yet English.lproj/InfoPlist.strings diff --git a/indra/newview/Info-Singularity.plist b/indra/newview/Info-singularity.plist similarity index 100% rename from indra/newview/Info-Singularity.plist rename to indra/newview/Info-singularity.plist From e6977de12f26d8c7bca304bd452953cae04ea9e8 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 19 Nov 2013 04:19:48 +0100 Subject: [PATCH 22/51] Mac build changes to create specific channel installers --- indra/newview/CMakeLists.txt | 27 +------------ .../English.lproj/InfoPlist.strings.in | 6 +-- indra/newview/Info-singularity.plist | 39 ------------------- indra/newview/viewer_manifest.py | 12 +----- 4 files changed, 7 insertions(+), 77 deletions(-) delete mode 100644 indra/newview/Info-singularity.plist diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index ad2fc39e5..f56efbccb 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1141,7 +1141,6 @@ if (DARWIN) ${VIEWER_BRANDING_ID}.icns macview.r gpu_table.txt - Info-${VIEWER_BRANDING_ID}.plist SecondLife.nib/ # CMake doesn't seem to support Xcode language variants well just yet English.lproj/InfoPlist.strings @@ -1707,7 +1706,7 @@ if (DARWIN) MACOSX_BUNDLE_BUNDLE_NAME "${VIEWER_BRANDING_NAME}" MACOSX_BUNDLE_SHORT_VERSION_STRING "${viewer_VERSION}" MACOSX_BUNDLE_BUNDLE_VERSION "${viewer_VERSION}" - MACOSX_BUNDLE_COPYRIGHT "Copyright 2010 Balseraph Software Group" + MACOSX_BUNDLE_COPYRIGHT "Copyright 2013 Siana Gearz" ) add_custom_command( @@ -1756,32 +1755,10 @@ if (DARWIN) --grid=${GRID} --login_channel=${VIEWER_LOGIN_CHANNEL} --source=${CMAKE_CURRENT_SOURCE_DIR} - --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched + --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${Product}.touched DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) -# Viewer-Development doesn't have this duplicate of the above command, here.. -# this may be a botched merge, but Mac seems to be picky, so I'm leaving it ~Liru - add_custom_command( - TARGET package POST_BUILD - COMMAND ${PYTHON_EXECUTABLE} - ARGS - ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - --artwork=${ARTWORK_DIR} - --branding_id=${VIEWER_BRANDING_ID} - --build=${CMAKE_CURRENT_BINARY_DIR} - --buildtype=${CMAKE_BUILD_TYPE} - --channel=${VIEWER_CHANNEL} - --configuration=${CMAKE_CFG_INTDIR} - --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app - --grid=${GRID} - --login_channel=${VIEWER_LOGIN_CHANNEL} - --source=${CMAKE_CURRENT_SOURCE_DIR} - --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched - DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - ) - endif (PACKAGE) endif (DARWIN) diff --git a/indra/newview/English.lproj/InfoPlist.strings.in b/indra/newview/English.lproj/InfoPlist.strings.in index e190849bf..e10c86335 100644 --- a/indra/newview/English.lproj/InfoPlist.strings.in +++ b/indra/newview/English.lproj/InfoPlist.strings.in @@ -1,6 +1,6 @@ /* Localized versions of Info.plist keys */ -CFBundleName = "Singularity"; +CFBundleName = "${VIEWER_CHANNEL_ONE_WORD}"; -CFBundleShortVersionString = "Singularity Viewer ${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}"; -CFBundleGetInfoString = "Singularity Viewer ${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}, Copyright 2012 Siana Gearz"; +CFBundleShortVersionString = "${VIEWER_CHANNEL} Viewer ${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}"; +CFBundleGetInfoString = "${VIEWER_CHANNEL} Viewer ${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}, Copyright 2012 Siana Gearz"; diff --git a/indra/newview/Info-singularity.plist b/indra/newview/Info-singularity.plist deleted file mode 100644 index 06a83b2fb..000000000 --- a/indra/newview/Info-singularity.plist +++ /dev/null @@ -1,39 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - Singularity - CFBundleIconFile - singularity.icns - CFBundleIdentifier - org.singularityviewer.singularity - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Singularity - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleURLTypes - - - CFBundleURLName - Second Life URL - CFBundleURLSchemes - - secondlife - - LSIsAppleDefaultForScheme - - - - CFBundleVersion - 1.0.0.0 - CSResourcesFileMapped - - - diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index f11d0485d..04d2e3fbe 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -139,10 +139,7 @@ class ViewerManifest(LLManifest): def viewer_branding_id(self): return self.args['branding_id'] def installer_prefix(self): - mapping={"secondlife":'SecondLife_', - "snowglobe":'Snowglobe_', - "singularity":'Singularity_'} - return mapping[self.viewer_branding_id()] + return self.channel_oneword() + "_" def flags_list(self): """ Convenience function that returns the command-line flags @@ -496,8 +493,6 @@ class DarwinManifest(ViewerManifest): self.path(self.args['configuration'] + "/" + self.app_name() + ".app", dst="") if self.prefix(src="", dst="Contents"): # everything goes in Contents - self.path(self.info_plist_name(), dst="Info.plist") - # copy additional libs in /Contents/MacOS/ self.path("../../libraries/universal-darwin/lib/release/libndofdev.dylib", dst="Resources/libndofdev.dylib") self.path("../../libraries/universal-darwin/lib/release/libhunspell-1.3.0.dylib", dst="Resources/libhunspell-1.3.0.dylib") @@ -618,10 +613,7 @@ class DarwinManifest(ViewerManifest): { 'viewer_binary' : self.dst_path_of('Contents/MacOS/'+self.app_name())}) def app_name(self): - return "Singularity" - - def info_plist_name(self): - return "Info-Singularity.plist" + return self.channel_oneword() def package_finish(self): channel_standin = self.app_name() From 503e5287cd73e892ade2bc7e12b4cc09d9ff889c Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 18 Nov 2013 23:27:29 -0600 Subject: [PATCH 23/51] Fix minor oversight that broke openal audio impl. --- indra/llaudio/lllistener_openal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llaudio/lllistener_openal.cpp b/indra/llaudio/lllistener_openal.cpp index 41a40caf7..7c8fd852f 100644 --- a/indra/llaudio/lllistener_openal.cpp +++ b/indra/llaudio/lllistener_openal.cpp @@ -39,7 +39,7 @@ LLListener_OpenAL::~LLListener_OpenAL() { } -LLListener_OpenAL::init() +void LLListener_OpenAL::init() { // do inherited LLListener::init(); From 26ca140e4b16754af795d4361ddd390ea2b97b39 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 19 Nov 2013 08:47:18 +0100 Subject: [PATCH 24/51] Fixed symbol generation on Mac with channel specific packages --- indra/newview/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f56efbccb..41f172981 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1786,7 +1786,7 @@ if (PACKAGE) list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}") set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin.tar.bz2") - set(VIEWER_EXE_GLOBS "'Singularity' SLPlugin") + set(VIEWER_EXE_GLOBS "'${VIEWER_BRANDING_NAME}' SLPlugin") set(VIEWER_LIB_GLOB "*.dylib") endif (DARWIN) if (LINUX) From 63a6ed4f43c990ad5ccb8783d8e983ae075da5dc Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 19 Nov 2013 20:26:55 +0100 Subject: [PATCH 25/51] Fix floater xmls: tooltip must be tool_tip. --- indra/newview/skins/default/xui/de/floater_directory2.xml | 2 +- indra/newview/skins/default/xui/de/floater_directory3.xml | 2 +- indra/newview/skins/default/xui/en-us/floater_directory2.xml | 2 +- indra/newview/skins/default/xui/en-us/floater_directory3.xml | 2 +- indra/newview/skins/default/xui/en-us/floater_image_preview.xml | 2 +- indra/newview/skins/default/xui/es/floater_directory3.xml | 2 +- indra/newview/skins/default/xui/fr/floater_image_preview.xml | 2 +- indra/newview/skins/default/xui/fr/floater_snapshot.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/skins/default/xui/de/floater_directory2.xml b/indra/newview/skins/default/xui/de/floater_directory2.xml index 2e4dfe5ee..a99292f04 100644 --- a/indra/newview/skins/default/xui/de/floater_directory2.xml +++ b/indra/newview/skins/default/xui/de/floater_directory2.xml @@ -237,7 +237,7 @@ Um direkt zu kaufen, klicken Sie auf dem betreffenden Land in der Titelleiste au -