From 50ff9922a6f2723dc1f236cbe9d9461a6730aa54 Mon Sep 17 00:00:00 2001 From: nillerusr Date: Wed, 3 Aug 2022 16:21:23 +0300 Subject: [PATCH] togles: use sampler objects by default --- public/pixelwriter.h | 12 ++++++++++++ togles/linuxwin/cglmtex.cpp | 4 ++-- togles/linuxwin/glmgr.cpp | 19 +++---------------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/public/pixelwriter.h b/public/pixelwriter.h index 11c023c5..c9e25ebe 100644 --- a/public/pixelwriter.h +++ b/public/pixelwriter.h @@ -320,6 +320,18 @@ FORCEINLINE_PIXEL void CPixelWriter::SetPixelMemory( ImageFormat format, void* p m_BMask = 0x00; m_AMask = 0x00; break; + + case IMAGE_FORMAT_RGB888: + m_Size = 3; + m_RShift = 0; + m_GShift = 8; + m_BShift = 16; + m_AShift = 0; + m_RMask = 0xFF; + m_GMask = 0xFF; + m_BMask = 0xFF; + m_AMask = 0x0; + break; // FIXME: Add more color formats as need arises default: { diff --git a/togles/linuxwin/cglmtex.cpp b/togles/linuxwin/cglmtex.cpp index 962fce7c..5230ad11 100644 --- a/togles/linuxwin/cglmtex.cpp +++ b/togles/linuxwin/cglmtex.cpp @@ -3649,9 +3649,9 @@ void CGLMTex::WriteTexels( GLMTexLockDesc *desc, bool writeWholeSlice, bool noDa Assert( writeWholeSlice ); //subimage not implemented in this path yet // compressed path // http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexImage2D.xml -/* if( gGL->m_bHave_GL_EXT_texture_compression_dxt1 ) + if( gGL->m_bHave_GL_EXT_texture_compression_dxt1 ) gGL->glCompressedTexImage2D( target, desc->m_req.m_mip, intformat, slice->m_xSize, slice->m_ySize, 0, slice->m_storageSize, sliceAddress ); - else*/ + else CompressedTexImage2D( target, desc->m_req.m_mip, intformat, slice->m_xSize, slice->m_ySize, 0, slice->m_storageSize, sliceAddress ); } else diff --git a/togles/linuxwin/glmgr.cpp b/togles/linuxwin/glmgr.cpp index a2c00b20..83bcf2e3 100644 --- a/togles/linuxwin/glmgr.cpp +++ b/togles/linuxwin/glmgr.cpp @@ -2359,22 +2359,9 @@ static uint gPersistentBufferSize[kGLMNumBufferTypes] = GLMContext::GLMContext( IDirect3DDevice9 *pDevice, GLMDisplayParams *params ) { -// m_bUseSamplerObjects = true; -// -// // On most AMD drivers (like the current latest, 12.10 Windows), the PCF depth comparison mode doesn't work on sampler objects, so just punt them. -// if ( gGL->m_nDriverProvider == cGLDriverProviderAMD ) -// { -// m_bUseSamplerObjects = false; -// } - -// if ( CommandLine()->CheckParm( "-gl_disablesamplerobjects" ) ) -// { - // Disable sampler object usage for now since ScaleForm isn't aware of them - // and doesn't know how to push/pop their binding state. It seems we don't - // really use them in this codebase anyhow, except to preload textures. - m_bUseSamplerObjects = false; - if ( CommandLine()->CheckParm( "-gl_enablesamplerobjects" ) ) - m_bUseSamplerObjects = true; + m_bUseSamplerObjects = true; + if ( CommandLine()->CheckParm( "-gl_disablesamplerobjects" ) ) + m_bUseSamplerObjects = false; // Try to get some more free memory by relying on driver host copies instead of ours. // In some cases the driver will be able to discard their own host copy and rely on GPU