This commit is contained in:
Siana Gearz
2011-11-07 02:36:24 +01:00
14 changed files with 138 additions and 48 deletions

View File

@@ -153,10 +153,10 @@ const char LAND_LAYER_CODE = 'L';
const char WATER_LAYER_CODE = 'W';
const char WIND_LAYER_CODE = '7';
const char CLOUD_LAYER_CODE = '8';
// Extended land layer for Aurora Sim
// Extended land layer for Aurora Sim
const char AURORA_LAND_LAYER_CODE = 'M';
const char AURORA_WATER_LAYER_CODE = 'X';
const char AURORA_WIND_LAYER_CODE = '9';
const char AURORA_WATER_LAYER_CODE = 'X';
const char AURORA_WIND_LAYER_CODE = '9';
const char AURORA_CLOUD_LAYER_CODE = ':';
// keys

View File

@@ -36,6 +36,8 @@
#include "llfile.h"
#include "llrender.h"
#include "llcontrol.h" //for LLCachedControl
#include "lldir.h" //for gDirUtilp
#if LL_DARWIN
#include "OpenGL/OpenGL.h"
@@ -606,7 +608,8 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
text[count++] = strdup(decl.c_str());
}
text[count++] = strdup("varying float vary_texture_index;\n");
if(texture_index_channels != 1)
text[count++] = strdup("varying float vary_texture_index;\n");
text[count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n");
text[count++] = strdup("{\n");
@@ -701,6 +704,8 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
}
}
std::string error_str;
if (error == GL_NO_ERROR)
{
//check for errors
@@ -714,6 +719,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
//an error occured, print log
LL_WARNS("ShaderLoading") << "GLSL Compilation Error: (" << error << ") in " << filename << LL_ENDL;
dumpObjectLog(ret);
error_str = get_object_log(ret);
std::stringstream ostr;
//dump shader source for debugging
@@ -732,6 +738,32 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
{
ret = 0;
}
static const LLCachedControl<bool> dump_raw_shaders("ShyotlDumpRawShaders",false);
if(dump_raw_shaders || ret)
{
std::stringstream ostr;
for (GLuint i = 0; i < count; i++)
{
ostr << text[i];
}
std::string delim = gDirUtilp->getDirDelimiter();
std::string shader_name = filename.substr(filename.find_last_of("/")+1); //shader_name.glsl
shader_name = shader_name.substr(0,shader_name.find_last_of(".")); //shader_name
std::string maindir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"shader_dump"+delim);
//mkdir is NOT recursive. Step through the folders one by one.
LLFile::mkdir(maindir); //..Roaming/SecondLife/logs/shader_dump/
LLFile::mkdir(maindir+="class" + llformat("%i",gpu_class) + delim); //..shader_dump/class1/
LLFile::mkdir(maindir+=filename.substr(0,filename.find_last_of("/")+1)); //..shader_dump/class1/windlight/
LLAPRFile file(maindir + shader_name + (ret ? "" : llformat("_FAILED(%i)",error)) + ".glsl", LL_APR_W);
file.write(ostr.str().c_str(),ostr.str().length());
if(!error_str.empty())
{
LLAPRFile file2(maindir + shader_name + "_ERROR" + ".txt", LL_APR_W);
file.write(error_str.c_str(),error_str.length());
}
}
stop_glerror();
//free memory

View File

@@ -474,42 +474,7 @@
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShyotlRenderVBOStrideMode</key>
<map>
<key>Comment</key>
<string>0 = Standard behavior
1 = Force strided VBOs
2 = Force unstrided(dense) VBOs</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShyotlUseLegacyRenderPath</key>
<map>
<key>Comment</key>
<string>Use deprecated pre-3.x OpenGL api calls.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShyotlUseLegacyTextureBatching</key>
<map>
<key>Comment</key>
<string>Disable usage of extra samplers in shaders. Decreases batch sizes, however also reduces branching in shaders drastcially.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
<key>ResetFocusOnSelfClick</key>
<map>
<key>Comment</key>

View File

@@ -168,5 +168,84 @@
<key>Value</key>
<real>10.0</real>
</map>
<key>ShyotlRenderVBOStrideMode</key>
<map>
<key>Comment</key>
<string>0 = Standard behavior
1 = Force strided VBOs
2 = Force unstrided(dense) VBOs</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShyotlUseLegacyRenderPath</key>
<map>
<key>Comment</key>
<string>Use deprecated pre-3.x OpenGL api calls.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShyotlUseLegacyTextureBatching</key>
<map>
<key>Comment</key>
<string>Disable usage of extra samplers in shaders. Decreases batch sizes, however also reduces branching in shaders drastically.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShyotlUseLegacyDynamicTexture</key>
<map>
<key>Comment</key>
<string>Disable shader path when rendering dynamic textures.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShyotlUseLegacyTextureBaking</key>
<map>
<key>Comment</key>
<string>Disable shader path when generating baked textures.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ShyotlDumpRawShaders</key>
<map>
<key>Comment</key>
<string>Dump shader data being passed to glShaderSourceARB.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShyotlDrawOrphanAttachments</key>
<map>
<key>Comment</key>
<string>Render attachments lacking an 'alive' owner.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@@ -77,6 +77,8 @@ void LLToolComposite::setCurrentTool( LLTool* new_tool )
{
if( mCur != new_tool )
{
if(new_tool)
lldebugs << "Current Tool: " << new_tool->getName() << llendl;
if( mSelected )
{
mCur->handleDeselect();

View File

@@ -738,6 +738,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
}
// HACK to avoid assert: error checking system makes sure that the cursor is set during every handleHover. This is actually a no-op since the cursor is hidden.
gViewerWindow->hideCursor();
gViewerWindow->setCursor(UI_CURSOR_ARROW);
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (active) [cursor hidden]" << llendl;

View File

@@ -80,11 +80,11 @@ LLToolMgr::LLToolMgr()
gToolNull = new LLTool(LLStringUtil::null); // Does nothing
setCurrentTool(gToolNull);
gBasicToolset = new LLToolset();
gCameraToolset = new LLToolset();
// gLandToolset = new LLToolset();
gMouselookToolset = new LLToolset();
gFaceEditToolset = new LLToolset();
gBasicToolset = new LLToolset("Basic");
gCameraToolset = new LLToolset("Camera");
// gLandToolset = new LLToolset("Land");
gMouselookToolset = new LLToolset("MouseLook");
gFaceEditToolset = new LLToolset("FaceEdit");
}
void LLToolMgr::initTools()
@@ -149,6 +149,7 @@ void LLToolMgr::setCurrentToolset(LLToolset* current)
{
mSelectedTool->handleDeselect();
}
lldebugs << "Current tool set: " << current->getName() << llendl;
mCurrentToolset = current;
// select first tool of new toolset only if toolset changed
mCurrentToolset->selectFirstTool();
@@ -164,6 +165,8 @@ LLToolset* LLToolMgr::getCurrentToolset()
void LLToolMgr::setCurrentTool( LLTool* tool )
{
if(tool && mBaseTool!=tool)
lldebugs << "Current Tool: " << tool->getName() << llendl;
if (mTransientTool)
{
mTransientTool = NULL;

View File

@@ -93,7 +93,7 @@ protected:
class LLToolset
{
public:
LLToolset() : mSelectedTool(NULL) {}
LLToolset(const char *name) : mSelectedTool(NULL), mName(name) {}
LLTool* getSelectedTool() { return mSelectedTool; }
@@ -109,7 +109,9 @@ public:
BOOL isToolSelected( S32 index );
const char* getName() const {return mName;}
protected:
const char* mName;
LLTool* mSelectedTool;
typedef std::vector<LLTool*> tool_list_t;
tool_list_t mToolList;

View File

@@ -32,6 +32,7 @@
#include "llviewerprecompiledheaders.h"
#include <boost/filesystem.hpp> //First, because glh_linear #defines equivalent.. which boost uses internally
#include "llfeaturemanager.h"
#include "llviewershadermgr.h"
@@ -351,6 +352,11 @@ void LLViewerShaderMgr::setShaders()
return;
}
{
const std::string dumpdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"shader_dump")+gDirUtilp->getDirDelimiter();
boost::filesystem::remove_all(dumpdir);
}
LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) gSavedSettings.getU32("RenderMaxTextureIndex")), 1);
static const LLCachedControl<bool> no_texture_indexing("ShyotlUseLegacyTextureBatching",false);
static const LLCachedControl<bool> use_legacy_path("ShyotlUseLegacyRenderPath", false); //Legacy does not jive with new batching.

View File

@@ -159,7 +159,7 @@ void LLViewerTextureList::doPreloadImages()
image->setAddressMode(LLTexUnit::TAM_WRAP);
mImagePreloads.insert(image);
}
image = LLViewerTextureManager::getFetchedTextureFromFile("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903.j2c"/*"transparent.j2c"*/, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE,
image = LLViewerTextureManager::getFetchedTextureFromFile("transparent.j2c", MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE,
0,0,LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"));
if (image)
{

View File

@@ -4481,7 +4481,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
gPipeline.resetDrawOrders();
}
if (high_res && (show_ui || !hide_hud))
if (high_res)
{
send_agent_resume();
}