Browse Source

togl/togles: fix PBO usage

pull/133/head
nillerusr 2 years ago
parent
commit
091b49e29c
  1. 4
      togl/linuxwin/cglmtex.cpp
  2. 2
      togl/linuxwin/dxabstract.cpp
  3. 4
      togles/linuxwin/cglmtex.cpp
  4. 2
      togles/linuxwin/dxabstract.cpp

4
togl/linuxwin/cglmtex.cpp

@ -1670,7 +1670,7 @@ void CGLMTex::Lock( GLMTexLockParams *params, char** addressOut, int* yStrideOut @@ -1670,7 +1670,7 @@ void CGLMTex::Lock( GLMTexLockParams *params, char** addressOut, int* yStrideOut
{
*addressOut = (char*)ReadTexels( desc, true, params->m_readonly );
if( !params->m_readonly )
if( params->m_readonly == false )
m_mapped = (GLubyte*)*addressOut;
}
else
@ -1763,7 +1763,7 @@ void CGLMTex::Unlock( GLMTexLockParams *params ) @@ -1763,7 +1763,7 @@ void CGLMTex::Unlock( GLMTexLockParams *params )
// fullyDirty |= (m_sliceFlags[ desc->m_sliceIndex ] & kSliceStorageValid);
if( m_layout->m_key.m_texFlags & kGLMTexDynamic )
if( m_layout->m_key.m_texFlags & kGLMTexDynamic && m_mapped )
{
gGL->glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);

2
togl/linuxwin/dxabstract.cpp

@ -1041,7 +1041,7 @@ HRESULT IDirect3DSurface9::LockRect(D3DLOCKED_RECT* pLockedRect,CONST RECT* pRec @@ -1041,7 +1041,7 @@ HRESULT IDirect3DSurface9::LockRect(D3DLOCKED_RECT* pLockedRect,CONST RECT* pRec
lockreq.m_readback = true;
}
lockreq.m_readonly = Flags & D3DLOCK_READONLY;
lockreq.m_readonly = (Flags & D3DLOCK_READONLY) ? true : false;
char *lockAddress;
int yStride;

4
togles/linuxwin/cglmtex.cpp

@ -3946,7 +3946,7 @@ void CGLMTex::Lock( GLMTexLockParams *params, char** addressOut, int* yStrideOut @@ -3946,7 +3946,7 @@ void CGLMTex::Lock( GLMTexLockParams *params, char** addressOut, int* yStrideOut
// (odds are we'll never request anything but a whole slice to be read..)
*addressOut = (char*)ReadTexels( desc, true, params->m_readonly );
if( !params->m_readonly )
if( params->m_readonly == false )
m_mapped = (GLubyte*)*addressOut;
}
else
@ -4039,7 +4039,7 @@ void CGLMTex::Unlock( GLMTexLockParams *params ) @@ -4039,7 +4039,7 @@ void CGLMTex::Unlock( GLMTexLockParams *params )
// fullyDirty |= (m_sliceFlags[ desc->m_sliceIndex ] & kSliceStorageValid);
if( m_layout->m_key.m_texFlags & kGLMTexDynamic )
if( m_layout->m_key.m_texFlags & kGLMTexDynamic && m_mapped )
{
gGL->glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);

2
togles/linuxwin/dxabstract.cpp

@ -1041,7 +1041,7 @@ HRESULT IDirect3DSurface9::LockRect(D3DLOCKED_RECT* pLockedRect,CONST RECT* pRec @@ -1041,7 +1041,7 @@ HRESULT IDirect3DSurface9::LockRect(D3DLOCKED_RECT* pLockedRect,CONST RECT* pRec
lockreq.m_readback = true;
}
lockreq.m_readonly = Flags & D3DLOCK_READONLY;
lockreq.m_readonly = (Flags & D3DLOCK_READONLY) ? true : false;
char *lockAddress;
int yStride;

Loading…
Cancel
Save