Skip to content

Commit fed2719

Browse files
author
Caroline Joy Bell
authored
Merge branch 'nillerusr:master' into patch-1
2 parents d7a2277 + 3458c36 commit fed2719

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

datacache/mdlcache.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace {
8181
#if defined( _X360 )
8282
#define AsyncMdlCache() 0 // Explicitly OFF for 360 (incompatible)
8383
#else
84-
#define AsyncMdlCache() 0
84+
#define AsyncMdlCache() 1
8585
#endif
8686

8787
#define ERROR_MODEL "models/error.mdl"

public/togles/linuxwin/glmgr.h

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1
7070
#define GL_ALPHA_TEST_REF_QCOM 0x0BC2
7171

72+
#define GLSL_VERSION "#version 300 es\n"
73+
7274
extern void GLMDebugPrintf( const char *pMsg, ... );
7375

7476
extern uint g_nTotalDrawsOrClears, g_nTotalVBLockBytes, g_nTotalIBLockBytes;

togles/linuxwin/cglmtex.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ bool GLMGenTexels( GLMGenTexelParams *params )
427427
DebuggerBreak();
428428
return FALSE;
429429
}
430-
430+
431431
// verify that the amount you want to write will not exceed the limit byte count
432432
unsigned long destByteCount = chunksize * params->m_chunkCount;
433433

@@ -3828,7 +3828,7 @@ void CGLMTex::Lock( GLMTexLockParams *params, char** addressOut, int* yStrideOut
38283828
// d - the params of the lock request have been saved in the lock table (in the context)
38293829

38303830
// so step 1 is unambiguous. If there's no backing storage, make some.
3831-
if (!m_backing)
3831+
if (!m_backing && !(m_layout->m_key.m_texFlags & kGLMTexDynamic))
38323832
{
38333833
if ( gl_pow2_tempmem.GetBool() )
38343834
{
@@ -3940,7 +3940,7 @@ void CGLMTex::Lock( GLMTexLockParams *params, char** addressOut, int* yStrideOut
39403940

39413941
desc->m_sliceRegionOffset = offsetInSlice + desc->m_sliceBaseOffset;
39423942

3943-
if ( copyout && ( (m_layout->m_key.m_texFlags & kGLMTexDynamic) || params->m_readonly ) )
3943+
if ( (m_layout->m_key.m_texFlags & kGLMTexDynamic) || (params->m_readonly && copyout) )
39443944
{
39453945
// read the whole slice
39463946
// (odds are we'll never request anything but a whole slice to be read..)
@@ -4080,7 +4080,7 @@ void CGLMTex::Unlock( GLMTexLockParams *params )
40804080
// because it reuploads the whole thing each slice; we only use 3D textures
40814081
// for the 32x32x32 colorpsace conversion lookups and debugging the problem
40824082
// would not save any more memory.
4083-
if ( !m_texClientStorage && ( m_texGLTarget == GL_TEXTURE_2D ) )
4083+
if ( !m_texClientStorage && ( m_texGLTarget == GL_TEXTURE_2D ) && m_backing )
40844084
{
40854085
free(m_backing);
40864086
m_backing = NULL;

togles/linuxwin/dx9asmtogl2.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3287,13 +3287,13 @@ int D3DToGL::TranslateShader( uint32* code, CUtlBuffer *pBufDisassembledCode, bo
32873287
if ( ( dwToken & 0xFFFF0000 ) == 0xFFFF0000 )
32883288
{
32893289
// must explicitly enable extensions if emitting GLSL
3290-
V_snprintf( (char *)m_pBufHeaderCode->Base(), m_pBufHeaderCode->Size(), "#version 300 es\nprecision highp float;\n#define varying in\n\n%s", glslExtText );
3290+
V_snprintf( (char *)m_pBufHeaderCode->Base(), m_pBufHeaderCode->Size(), GLSL_VERSION "precision highp float;\n#define varying in\n\n%s", glslExtText );
32913291
m_bVertexShader = false;
32923292
}
32933293
else // vertex shader
32943294
{
32953295
m_bGenerateSRGBWriteSuffix = false;
3296-
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 );
3296+
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 );
32973297

32983298
// find that first '-xx' which is where the attrib map will be written later.
32993299
pAttribMapStart = strstr( (char *)m_pBufHeaderCode->Base(), "-xx" ) + 1;

0 commit comments

Comments
 (0)