mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 15:47:55 +00:00
gl2shim: fix broken matrix update when fog attribute enabled (32 bit shift overflow)
This commit is contained in:
parent
ea55e78855
commit
f2c080e736
@ -57,6 +57,7 @@ typedef uint64_t longtime_t;
|
|||||||
#define MAX_USERMSG_LENGTH 2048 // don't modify it's relies on a client-side definitions
|
#define MAX_USERMSG_LENGTH 2048 // don't modify it's relies on a client-side definitions
|
||||||
|
|
||||||
#define BIT( n ) ( 1U << ( n ))
|
#define BIT( n ) ( 1U << ( n ))
|
||||||
|
#define BIT64( n ) ( 1ULL << ( n ))
|
||||||
#define GAMMA ( 2.2f ) // Valve Software gamma
|
#define GAMMA ( 2.2f ) // Valve Software gamma
|
||||||
#define INVGAMMA ( 1.0f / 2.2f ) // back to 1.0
|
#define INVGAMMA ( 1.0f / 2.2f ) // back to 1.0
|
||||||
#define TEXGAMMA ( 0.9f ) // compensate dim textures
|
#define TEXGAMMA ( 0.9f ) // compensate dim textures
|
||||||
|
@ -1309,9 +1309,9 @@ static void GL2_Mul4x4( const GLfloat *in0, const GLfloat *in1, GLfloat *out )
|
|||||||
static void GL2_UpdateMVP( gl2wrap_prog_t *prog )
|
static void GL2_UpdateMVP( gl2wrap_prog_t *prog )
|
||||||
{
|
{
|
||||||
// use bitset to determine if need update matrix for this prog
|
// use bitset to determine if need update matrix for this prog
|
||||||
if( FBitSet( gl2wrap_matrix.update, BIT( prog->flags )))
|
if( FBitSet( gl2wrap_matrix.update, BIT64( prog->flags )))
|
||||||
{
|
{
|
||||||
ClearBits( gl2wrap_matrix.update, BIT( prog->flags ));
|
ClearBits( gl2wrap_matrix.update, BIT64( prog->flags ));
|
||||||
GL2_Mul4x4( gl2wrap_matrix.mv, gl2wrap_matrix.pr, gl2wrap_matrix.mvp );
|
GL2_Mul4x4( gl2wrap_matrix.mv, gl2wrap_matrix.pr, gl2wrap_matrix.mvp );
|
||||||
pglUniformMatrix4fvARB( prog->uMVP, 1, false, (void *)gl2wrap_matrix.mvp );
|
pglUniformMatrix4fvARB( prog->uMVP, 1, false, (void *)gl2wrap_matrix.mvp );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user