Browse Source

Merge branch 'nillerusr:master' into patch-1

pull/170/head
Caroline Joy Bell 2 years ago committed by GitHub
parent
commit
fed2719657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      datacache/mdlcache.cpp
  2. 2
      public/togles/linuxwin/glmgr.h
  3. 8
      togles/linuxwin/cglmtex.cpp
  4. 4
      togles/linuxwin/dx9asmtogl2.cpp

2
datacache/mdlcache.cpp vendored

@ -81,7 +81,7 @@ namespace {
#if defined( _X360 ) #if defined( _X360 )
#define AsyncMdlCache() 0 // Explicitly OFF for 360 (incompatible) #define AsyncMdlCache() 0 // Explicitly OFF for 360 (incompatible)
#else #else
#define AsyncMdlCache() 0 #define AsyncMdlCache() 1
#endif #endif
#define ERROR_MODEL "models/error.mdl" #define ERROR_MODEL "models/error.mdl"

2
public/togles/linuxwin/glmgr.h

@ -69,6 +69,8 @@
#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 #define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1
#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 #define GL_ALPHA_TEST_REF_QCOM 0x0BC2
#define GLSL_VERSION "#version 300 es\n"
extern void GLMDebugPrintf( const char *pMsg, ... ); extern void GLMDebugPrintf( const char *pMsg, ... );
extern uint g_nTotalDrawsOrClears, g_nTotalVBLockBytes, g_nTotalIBLockBytes; extern uint g_nTotalDrawsOrClears, g_nTotalVBLockBytes, g_nTotalIBLockBytes;

8
togles/linuxwin/cglmtex.cpp

@ -427,7 +427,7 @@ bool GLMGenTexels( GLMGenTexelParams *params )
DebuggerBreak(); DebuggerBreak();
return FALSE; return FALSE;
} }
// verify that the amount you want to write will not exceed the limit byte count // verify that the amount you want to write will not exceed the limit byte count
unsigned long destByteCount = chunksize * params->m_chunkCount; unsigned long destByteCount = chunksize * params->m_chunkCount;
@ -3828,7 +3828,7 @@ void CGLMTex::Lock( GLMTexLockParams *params, char** addressOut, int* yStrideOut
// d - the params of the lock request have been saved in the lock table (in the context) // d - the params of the lock request have been saved in the lock table (in the context)
// so step 1 is unambiguous. If there's no backing storage, make some. // so step 1 is unambiguous. If there's no backing storage, make some.
if (!m_backing) if (!m_backing && !(m_layout->m_key.m_texFlags & kGLMTexDynamic))
{ {
if ( gl_pow2_tempmem.GetBool() ) if ( gl_pow2_tempmem.GetBool() )
{ {
@ -3940,7 +3940,7 @@ void CGLMTex::Lock( GLMTexLockParams *params, char** addressOut, int* yStrideOut
desc->m_sliceRegionOffset = offsetInSlice + desc->m_sliceBaseOffset; desc->m_sliceRegionOffset = offsetInSlice + desc->m_sliceBaseOffset;
if ( copyout && ( (m_layout->m_key.m_texFlags & kGLMTexDynamic) || params->m_readonly ) ) if ( (m_layout->m_key.m_texFlags & kGLMTexDynamic) || (params->m_readonly && copyout) )
{ {
// read the whole slice // read the whole slice
// (odds are we'll never request anything but a whole slice to be read..) // (odds are we'll never request anything but a whole slice to be read..)
@ -4080,7 +4080,7 @@ void CGLMTex::Unlock( GLMTexLockParams *params )
// because it reuploads the whole thing each slice; we only use 3D textures // because it reuploads the whole thing each slice; we only use 3D textures
// for the 32x32x32 colorpsace conversion lookups and debugging the problem // for the 32x32x32 colorpsace conversion lookups and debugging the problem
// would not save any more memory. // would not save any more memory.
if ( !m_texClientStorage && ( m_texGLTarget == GL_TEXTURE_2D ) ) if ( !m_texClientStorage && ( m_texGLTarget == GL_TEXTURE_2D ) && m_backing )
{ {
free(m_backing); free(m_backing);
m_backing = NULL; m_backing = NULL;

4
togles/linuxwin/dx9asmtogl2.cpp

@ -3287,13 +3287,13 @@ int D3DToGL::TranslateShader( uint32* code, CUtlBuffer *pBufDisassembledCode, bo
if ( ( dwToken & 0xFFFF0000 ) == 0xFFFF0000 ) if ( ( dwToken & 0xFFFF0000 ) == 0xFFFF0000 )
{ {
// must explicitly enable extensions if emitting GLSL // must explicitly enable extensions if emitting GLSL
V_snprintf( (char *)m_pBufHeaderCode->Base(), m_pBufHeaderCode->Size(), "#version 300 es\nprecision highp float;\n#define varying in\n\n%s", glslExtText ); V_snprintf( (char *)m_pBufHeaderCode->Base(), m_pBufHeaderCode->Size(), GLSL_VERSION "precision highp float;\n#define varying in\n\n%s", glslExtText );
m_bVertexShader = false; m_bVertexShader = false;
} }
else // vertex shader else // vertex shader
{ {
m_bGenerateSRGBWriteSuffix = false; m_bGenerateSRGBWriteSuffix = false;
V_snprintf( (char *)m_pBufHeaderCode->Base(), m_pBufHeaderCode->Size(), "#version 300 es\nprecision highp float;\n#define attribute in\n#define varying out\n%s//ATTRIBMAP-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx\n", glslExtText ); V_snprintf( (char *)m_pBufHeaderCode->Base(), m_pBufHeaderCode->Size(), GLSL_VERSION "precision highp float;\n#define attribute in\n#define varying out\n%s//ATTRIBMAP-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx-xx\n", glslExtText );
// find that first '-xx' which is where the attrib map will be written later. // find that first '-xx' which is where the attrib map will be written later.
pAttribMapStart = strstr( (char *)m_pBufHeaderCode->Base(), "-xx" ) + 1; pAttribMapStart = strstr( (char *)m_pBufHeaderCode->Base(), "-xx" ) + 1;

Loading…
Cancel
Save