Vertex skinning compatible with old GLSL#498
Conversation
|
I successfully tested this code, compiling successfully the GLSL code and not seeing any artifacts on those three configurations: The scene was |
|
LGTM, though I liked that very fast “one multiplication, two bitwise operations” code… 😥 I would still greatly appreciate a comment around this code saying to future readers a rewrite of this code may break support for multiple configurations on various ways. 🙂 |
|
Though, for the GL error thing, I find weird to change the default according to the build… |
|
for the glerror thing, why not doing three values:
Edit: or |
Done.
This makes sense but it's a little annoying to do, since the value is checked in 6 different places. |
|
Why not something like this? commit 372dbfe7a3f36f1f1d19af788a5d27da733c6252
Author: Thomas Debesse <dev@illwieckz.net>
Date: Mon Jul 5 10:58:58 2021 +0200
renderer: seonly check for GL errors on debug build with r_ignoreGLErrors -1
diff --git a/src/engine/renderer/tr_backend.cpp b/src/engine/renderer/tr_backend.cpp
index b69f69830..418d485ec 100644
--- a/src/engine/renderer/tr_backend.cpp
+++ b/src/engine/renderer/tr_backend.cpp
@@ -1368,7 +1368,7 @@ static void RB_SetupLightForShadowing( trRefLight_t *light, int index,
tr.shadowCubeFBOImage[ light->shadowLOD ]->texnum, 0 );
}
- if ( !r_ignoreGLErrors->integer )
+ if ( !ignoreGLErrors() )
{
R_CheckFBO( tr.shadowMapFBO[ light->shadowLOD ] );
}
@@ -1488,7 +1488,7 @@ static void RB_SetupLightForShadowing( trRefLight_t *light, int index,
R_AttachFBOTexture2D( GL_TEXTURE_2D, tr.shadowMapFBOImage[ light->shadowLOD ]->texnum, 0 );
}
- if ( !r_ignoreGLErrors->integer )
+ if ( !ignoreGLErrors() )
{
R_CheckFBO( tr.shadowMapFBO[ light->shadowLOD ] );
}
@@ -1540,7 +1540,7 @@ static void RB_SetupLightForShadowing( trRefLight_t *light, int index,
R_AttachFBOTextureDepth( tr.sunShadowMapFBOImage[ splitFrustumIndex ]->texnum );
}
- if ( !r_ignoreGLErrors->integer )
+ if ( !ignoreGLErrors() )
{
R_CheckFBO( tr.sunShadowMapFBO[ splitFrustumIndex ] );
}
@@ -1983,7 +1983,7 @@ static void RB_BlurShadowMap( const trRefLight_t *light, int i )
R_BindFBO( fbos[ index ] );
R_AttachFBOTexture2D( images[ index + MAX_SHADOWMAPS ]->type, images[ index + MAX_SHADOWMAPS ]->texnum, 0 );
- if ( !r_ignoreGLErrors->integer )
+ if ( !ignoreGLErrors() )
{
R_CheckFBO( fbos[ index ] );
}
diff --git a/src/engine/renderer/tr_cmds.cpp b/src/engine/renderer/tr_cmds.cpp
index be572cce6..4226613b0 100644
--- a/src/engine/renderer/tr_cmds.cpp
+++ b/src/engine/renderer/tr_cmds.cpp
@@ -811,7 +811,7 @@ void RE_BeginFrame()
}
// check for errors
- if ( !r_ignoreGLErrors->integer )
+ if ( !ignoreGLErrors() )
{
R_SyncRenderThread();
GL_CheckErrors_( __FILE__, __LINE__ );
diff --git a/src/engine/renderer/tr_init.cpp b/src/engine/renderer/tr_init.cpp
index 0b2f93fca..3c76b461f 100644
--- a/src/engine/renderer/tr_init.cpp
+++ b/src/engine/renderer/tr_init.cpp
@@ -379,7 +379,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
int err;
char s[ 128 ];
- if ( r_ignoreGLErrors->integer )
+ if ( ignoreGLErrors() )
{
return;
}
diff --git a/src/engine/renderer/tr_local.h b/src/engine/renderer/tr_local.h
index 7d560a943..5314fb6cd 100644
--- a/src/engine/renderer/tr_local.h
+++ b/src/engine/renderer/tr_local.h
@@ -3033,6 +3033,20 @@ static inline void halfToFloat( const f16vec4_t in, vec4_t out )
//====================================================================
+/* r_ignoreGLErrors values:
+- -1: check for GL errors on debug build only
+- 0: never check for GL errors
+- 1: always check for GL errors */
+
+inline bool ignoreGLErrors ()
+{
+#ifdef DEBUG_BUILD
+ return !!r_ignoreGLErrors->integer;
+#else
+ return r_ignoreGLErrors->integer < 1;
+#endif
+}
+
#define IMAGE_FILE_HASH_SIZE 4096
extern image_t *r_imageHashTable[ IMAGE_FILE_HASH_SIZE ];
|
Fixes DaemonEngine#490 (the method using bitwise operations would not compile if someone had support for only GLSL v1.20).
OK. |
|
If the code is still the same as the one I tested in #498 (comment) then LGTM. |
Fixes #490. TODO: Test on the Nvidia driver to make sure it still works.