In the latest test version of our mod, I occasionally get this message in the console:
"R_GetShaderByHandle: out of range hShader '1970169165' "
But I can't see any graphics anomalies, and there are no other problems reported in the console. Or maybe I saw something weird the first time, which made me open the console and look, can't quite remember now. The messages always seems to show up maybe 4 to 10 times in a row, with the same number. The number is different each session.
I haven't noticed this message in the earlier test versions. That's odd, because there are no shader-related changes. And the map I saw it first on was an old one.
I read something about this error that led me to the icculus.org svn repository. What I read there suggested that it might just be a bug in the engine. But it's a peculiar that I haven't seen in the older version of our mod. Should I just ignore this? Is it just random, or can it be fixed in a mod?
out of range hShader
out of range hShader
[url=http://www.smokin-guns.org]Smokin' Guns[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
well i see two places where this message is occuring,,,
R_GetShaderByHandle: (tr_shader.c)
R_GetShaderByHandle: (tr_shader.c)
Code: Select all
shader_t *R_GetShaderByHandle( qhandle_t hShader ) {
if ( hShader < 0 ) {
ri.Printf( PRINT_WARNING, "R_GetShaderByHandle: out of range hShader '%d'\n", hShader ); // bk: FIXME name
return tr.defaultShader;
}
if ( hShader >= tr.numShaders ) {
ri.Printf( PRINT_WARNING, "R_GetShaderByHandle: out of range hShader '%d'\n", hShader );
return tr.defaultShader;
}
return tr.shaders[hShader];
}
I don't quite know how the shader stuff works yet. But I tried playing the map where I got the error message, with a breakpoint set on trap_R_RemapShader, and it was never called. But I didn't get the error either.^misantropia^ wrote:Does your mod remap shaders?
There are no remapShader commands issued from anywhere in the mod code. I don't know if a remap can be triggered by the map itself.
I've fixed the dubious call to trap_R_RemapShader in cg.servercmds.c, by just copying the code from UI_ConsoleCommand:
Code: Select all
@@ -1036,7 +1036,11 @@ static void CG_ServerCommand( void ) {
if ( Q_stricmp (cmd, "remapShader") == 0 ) {
if (trap_Argc() == 4) {
- trap_R_RemapShader(CG_Argv(1), CG_Argv(2), CG_Argv(3));
+ char shader1[MAX_QPATH];
+ char shader2[MAX_QPATH];
+ Q_strncpyz(shader1, CG_Argv(1), sizeof(shader1));
+ Q_strncpyz(shader2, CG_Argv(2), sizeof(shader2));
+ trap_R_RemapShader(shader1, shader2, CG_Argv(3));
}
}
Does that help?
[url=http://www.smokin-guns.org]Smokin' Guns[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Sorry if I was unclear. I meant to ask if it helps you to help me, not if it helps with the bug. Because that fix is in the code of the version I'm getting the error message with. So it doesn't seem to matter. :icon26:^misantropia^ wrote:I should hope so. Does the problem persist?torhu wrote:Does that help?
[url=http://www.smokin-guns.org]Smokin' Guns[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
[url=https://sites.google.com/site/monsterbrowser//]Monster Browser[/url]
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Build a debug version from the icculus.org SVN repository, run it with a breakpoint set on R_GetShaderByHandle (or even better, at the ri.Printf() lines) and do a backtrace. That should tell you where the error originates from - if it doesn't, post the backtrace here. Set in_nograb to 1 if you're using Linux.