@ -14,15 +14,15 @@
void
void
xr_glx_sync ( session_t * ps , Drawable d , XSyncFence * pfence ) {
xr_glx_sync ( session_t * ps , Drawable d , XSyncFence * pfence ) {
if ( * pfence ) {
if ( * pfence ) {
// GLsync sync = ps-> glFenceSyncProc(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
// GLsync sync = ps-> psglx-> glFenceSyncProc(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
GLsync sync = ps - > glImportSyncEXT ( GL_SYNC_X11_FENCE_EXT , * pfence , 0 ) ;
GLsync sync = ps - > psglx - > glImportSyncEXT ( GL_SYNC_X11_FENCE_EXT , * pfence , 0 ) ;
/* GLenum ret = ps-> glClientWaitSyncProc(sync, GL_SYNC_FLUSH_COMMANDS_BIT,
/* GLenum ret = ps-> psglx-> glClientWaitSyncProc(sync, GL_SYNC_FLUSH_COMMANDS_BIT,
1000 ) ;
1000 ) ;
assert ( GL_CONDITION_SATISFIED = = ret ) ; */
assert ( GL_CONDITION_SATISFIED = = ret ) ; */
XSyncTriggerFence ( ps - > dpy , * pfence ) ;
XSyncTriggerFence ( ps - > dpy , * pfence ) ;
XFlush ( ps - > dpy ) ;
XFlush ( ps - > dpy ) ;
ps - > glWaitSyncProc ( sync , 0 , GL_TIMEOUT_IGNORED ) ;
ps - > psglx - > glWaitSyncProc ( sync , 0 , GL_TIMEOUT_IGNORED ) ;
// ps-> glDeleteSyncProc(sync);
// ps-> psglx-> glDeleteSyncProc(sync);
// XSyncResetFence(ps->dpy, *pfence);
// XSyncResetFence(ps->dpy, *pfence);
}
}
glx_check_err ( ps ) ;
glx_check_err ( ps ) ;
@ -98,10 +98,26 @@ glx_init(session_t *ps, bool need_render) {
if ( need_render & & ! glx_hasglxext ( ps , " GLX_EXT_texture_from_pixmap " ) )
if ( need_render & & ! glx_hasglxext ( ps , " GLX_EXT_texture_from_pixmap " ) )
goto glx_init_end ;
goto glx_init_end ;
if ( ! ps - > glx_context ) {
// Initialize GLX data structure
if ( ! ps - > psglx ) {
static const glx_session_t CGLX_SESSION_DEF = CGLX_SESSION_INIT ;
ps - > psglx = cmalloc ( 1 , glx_session_t ) ;
memcpy ( ps - > psglx , & CGLX_SESSION_DEF , sizeof ( glx_session_t ) ) ;
for ( int i = 0 ; i < MAX_BLUR_PASS ; + + i ) {
glx_blur_pass_t * ppass = & ps - > psglx - > blur_passes [ i ] ;
ppass - > unifm_factor_center = - 1 ;
ppass - > unifm_offset_x = - 1 ;
ppass - > unifm_offset_y = - 1 ;
}
}
glx_session_t * psglx = ps - > psglx ;
if ( ! psglx - > context ) {
// Get GLX context
// Get GLX context
# ifndef DEBUG_GLX_DEBUG_CONTEXT
# ifndef DEBUG_GLX_DEBUG_CONTEXT
ps - > glx_context = glXCreateContext ( ps - > dpy , pvis , None , GL_TRUE ) ;
ps glx - > context = glXCreateContext ( ps - > dpy , pvis , None , GL_TRUE ) ;
# else
# else
{
{
GLXFBConfig fbconfig = get_fbconfig_from_visualinfo ( ps , pvis ) ;
GLXFBConfig fbconfig = get_fbconfig_from_visualinfo ( ps , pvis ) ;
@ -123,18 +139,18 @@ glx_init(session_t *ps, bool need_render) {
GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_DEBUG_BIT_ARB ,
GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_DEBUG_BIT_ARB ,
None
None
} ;
} ;
ps - > glx_ context = p_glXCreateContextAttribsARB ( ps - > dpy , fbconfig , NULL ,
ps glx - > context = p_glXCreateContextAttribsARB ( ps - > dpy , fbconfig , NULL ,
GL_TRUE , attrib_list ) ;
GL_TRUE , attrib_list ) ;
}
}
# endif
# endif
if ( ! ps - > glx_ context) {
if ( ! ps glx - > context) {
printf_errf ( " (): Failed to get GLX context. " ) ;
printf_errf ( " (): Failed to get GLX context. " ) ;
goto glx_init_end ;
goto glx_init_end ;
}
}
// Attach GLX context
// Attach GLX context
if ( ! glXMakeCurrent ( ps - > dpy , get_tgt_window ( ps ) , ps - > glx_ context) ) {
if ( ! glXMakeCurrent ( ps - > dpy , get_tgt_window ( ps ) , ps glx - > context) ) {
printf_errf ( " (): Failed to attach GLX context. " ) ;
printf_errf ( " (): Failed to attach GLX context. " ) ;
goto glx_init_end ;
goto glx_init_end ;
}
}
@ -169,52 +185,52 @@ glx_init(session_t *ps, bool need_render) {
// Check GL_ARB_texture_non_power_of_two, requires a GLX context and
// Check GL_ARB_texture_non_power_of_two, requires a GLX context and
// must precede FBConfig fetching
// must precede FBConfig fetching
if ( need_render )
if ( need_render )
ps - > glx_ has_texture_non_power_of_two = glx_hasglext ( ps ,
ps glx - > has_texture_non_power_of_two = glx_hasglext ( ps ,
" GL_ARB_texture_non_power_of_two " ) ;
" GL_ARB_texture_non_power_of_two " ) ;
// Acquire function addresses
// Acquire function addresses
if ( need_render ) {
if ( need_render ) {
# ifdef DEBUG_GLX_MARK
# ifdef DEBUG_GLX_MARK
ps - > glStringMarkerGREMEDY = ( f_StringMarkerGREMEDY )
ps glx - > glStringMarkerGREMEDY = ( f_StringMarkerGREMEDY )
glXGetProcAddress ( ( const GLubyte * ) " glStringMarkerGREMEDY " ) ;
glXGetProcAddress ( ( const GLubyte * ) " glStringMarkerGREMEDY " ) ;
ps - > glFrameTerminatorGREMEDY = ( f_FrameTerminatorGREMEDY )
ps glx - > glFrameTerminatorGREMEDY = ( f_FrameTerminatorGREMEDY )
glXGetProcAddress ( ( const GLubyte * ) " glFrameTerminatorGREMEDY " ) ;
glXGetProcAddress ( ( const GLubyte * ) " glFrameTerminatorGREMEDY " ) ;
# endif
# endif
ps - > glXBindTexImageProc = ( f_BindTexImageEXT )
ps glx - > glXBindTexImageProc = ( f_BindTexImageEXT )
glXGetProcAddress ( ( const GLubyte * ) " glXBindTexImageEXT " ) ;
glXGetProcAddress ( ( const GLubyte * ) " glXBindTexImageEXT " ) ;
ps - > glXReleaseTexImageProc = ( f_ReleaseTexImageEXT )
ps glx - > glXReleaseTexImageProc = ( f_ReleaseTexImageEXT )
glXGetProcAddress ( ( const GLubyte * ) " glXReleaseTexImageEXT " ) ;
glXGetProcAddress ( ( const GLubyte * ) " glXReleaseTexImageEXT " ) ;
if ( ! ps - > glXBindTexImageProc | | ! ps - > glXReleaseTexImageProc ) {
if ( ! ps glx - > glXBindTexImageProc | | ! ps glx - > glXReleaseTexImageProc ) {
printf_errf ( " (): Failed to acquire glXBindTexImageEXT() / glXReleaseTexImageEXT(). " ) ;
printf_errf ( " (): Failed to acquire glXBindTexImageEXT() / glXReleaseTexImageEXT(). " ) ;
goto glx_init_end ;
goto glx_init_end ;
}
}
if ( ps - > o . glx_use_copysubbuffermesa ) {
if ( ps - > o . glx_use_copysubbuffermesa ) {
ps - > glXCopySubBufferProc = ( f_CopySubBuffer )
ps glx - > glXCopySubBufferProc = ( f_CopySubBuffer )
glXGetProcAddress ( ( const GLubyte * ) " glXCopySubBufferMESA " ) ;
glXGetProcAddress ( ( const GLubyte * ) " glXCopySubBufferMESA " ) ;
if ( ! ps - > glXCopySubBufferProc ) {
if ( ! ps glx - > glXCopySubBufferProc ) {
printf_errf ( " (): Failed to acquire glXCopySubBufferMESA(). " ) ;
printf_errf ( " (): Failed to acquire glXCopySubBufferMESA(). " ) ;
goto glx_init_end ;
goto glx_init_end ;
}
}
}
}
# ifdef CONFIG_GLX_SYNC
# ifdef CONFIG_GLX_SYNC
ps - > glFenceSyncProc = ( f_FenceSync )
ps glx - > glFenceSyncProc = ( f_FenceSync )
glXGetProcAddress ( ( const GLubyte * ) " glFenceSync " ) ;
glXGetProcAddress ( ( const GLubyte * ) " glFenceSync " ) ;
ps - > glIsSyncProc = ( f_IsSync )
ps glx - > glIsSyncProc = ( f_IsSync )
glXGetProcAddress ( ( const GLubyte * ) " glIsSync " ) ;
glXGetProcAddress ( ( const GLubyte * ) " glIsSync " ) ;
ps - > glDeleteSyncProc = ( f_DeleteSync )
ps glx - > glDeleteSyncProc = ( f_DeleteSync )
glXGetProcAddress ( ( const GLubyte * ) " glDeleteSync " ) ;
glXGetProcAddress ( ( const GLubyte * ) " glDeleteSync " ) ;
ps - > glClientWaitSyncProc = ( f_ClientWaitSync )
ps glx - > glClientWaitSyncProc = ( f_ClientWaitSync )
glXGetProcAddress ( ( const GLubyte * ) " glClientWaitSync " ) ;
glXGetProcAddress ( ( const GLubyte * ) " glClientWaitSync " ) ;
ps - > glWaitSyncProc = ( f_WaitSync )
ps glx - > glWaitSyncProc = ( f_WaitSync )
glXGetProcAddress ( ( const GLubyte * ) " glWaitSync " ) ;
glXGetProcAddress ( ( const GLubyte * ) " glWaitSync " ) ;
ps - > glImportSyncEXT = ( f_ImportSyncEXT )
ps glx - > glImportSyncEXT = ( f_ImportSyncEXT )
glXGetProcAddress ( ( const GLubyte * ) " glImportSyncEXT " ) ;
glXGetProcAddress ( ( const GLubyte * ) " glImportSyncEXT " ) ;
if ( ! ps - > glFenceSyncProc | | ! ps - > glIsSyncProc | | ! ps - > glDeleteSyncProc
if ( ! ps glx - > glFenceSyncProc | | ! ps glx - > glIsSyncProc | | ! ps glx - > glDeleteSyncProc
| | ! ps - > glClientWaitSyncProc | | ! ps - > glWaitSyncProc
| | ! ps glx - > glClientWaitSyncProc | | ! ps glx - > glWaitSyncProc
| | ! ps - > glImportSyncEXT ) {
| | ! ps glx - > glImportSyncEXT ) {
printf_errf ( " (): Failed to acquire GLX sync functions. " ) ;
printf_errf ( " (): Failed to acquire GLX sync functions. " ) ;
goto glx_init_end ;
goto glx_init_end ;
}
}
@ -281,10 +297,17 @@ glx_free_prog_main(session_t *ps, glx_prog_main_t *pprogram) {
*/
*/
void
void
glx_destroy ( session_t * ps ) {
glx_destroy ( session_t * ps ) {
if ( ! ps - > psglx )
return ;
// Free all GLX resources of windows
for ( win * w = ps - > list ; w ; w = w - > next )
free_win_res_glx ( ps , w ) ;
# ifdef CONFIG_VSYNC_OPENGL_GLSL
# ifdef CONFIG_VSYNC_OPENGL_GLSL
// Free GLSL shaders/programs
// Free GLSL shaders/programs
for ( int i = 0 ; i < MAX_BLUR_PASS ; + + i ) {
for ( int i = 0 ; i < MAX_BLUR_PASS ; + + i ) {
glx_blur_pass_t * ppass = & ps - > glx_blur_passes [ i ] ;
glx_blur_pass_t * ppass = & ps - > psglx- > blur_passes[ i ] ;
if ( ppass - > frag_shader )
if ( ppass - > frag_shader )
glDeleteShader ( ppass - > frag_shader ) ;
glDeleteShader ( ppass - > frag_shader ) ;
if ( ppass - > prog )
if ( ppass - > prog )
@ -298,15 +321,40 @@ glx_destroy(session_t *ps) {
// Free FBConfigs
// Free FBConfigs
for ( int i = 0 ; i < = OPENGL_MAX_DEPTH ; + + i ) {
for ( int i = 0 ; i < = OPENGL_MAX_DEPTH ; + + i ) {
free ( ps - > glx_ fbconfigs[ i ] ) ;
free ( ps - > psglx- > fbconfigs[ i ] ) ;
ps - > glx_ fbconfigs[ i ] = NULL ;
ps - > psglx- > fbconfigs[ i ] = NULL ;
}
}
// Destroy GLX context
// Destroy GLX context
if ( ps - > glx_context ) {
if ( ps - > psglx - > context ) {
glXDestroyContext ( ps - > dpy , ps - > glx_context ) ;
glXDestroyContext ( ps - > dpy , ps - > psglx - > context ) ;
ps - > glx_context = NULL ;
ps - > psglx - > context = NULL ;
}
free ( ps - > psglx ) ;
ps - > psglx = NULL ;
}
/**
* Reinitialize GLX .
*/
bool
glx_reinit ( session_t * ps , bool need_render ) {
// Reinitialize VSync as well
vsync_deinit ( ps ) ;
glx_destroy ( ps ) ;
if ( ! glx_init ( ps , need_render ) ) {
printf_errf ( " (): Failed to initialize GLX. " ) ;
return false ;
}
if ( ! vsync_init ( ps ) ) {
printf_errf ( " (): Failed to initialize VSync. " ) ;
return false ;
}
}
return true ;
}
}
/**
/**
@ -376,7 +424,7 @@ glx_init_blur(session_t *ps) {
" gl_FragColor = sum / (factor_center + float(%.7g)); \n "
" gl_FragColor = sum / (factor_center + float(%.7g)); \n "
" } \n " ;
" } \n " ;
const bool use_texture_rect = ! ps - > glx_ has_texture_non_power_of_two;
const bool use_texture_rect = ! ps - > psglx- > has_texture_non_power_of_two;
const char * sampler_type = ( use_texture_rect ?
const char * sampler_type = ( use_texture_rect ?
" sampler2DRect " : " sampler2D " ) ;
" sampler2DRect " : " sampler2D " ) ;
const char * texture_func = ( use_texture_rect ?
const char * texture_func = ( use_texture_rect ?
@ -395,7 +443,7 @@ glx_init_blur(session_t *ps) {
if ( ! kern )
if ( ! kern )
break ;
break ;
glx_blur_pass_t * ppass = & ps - > glx_ blur_passes[ i ] ;
glx_blur_pass_t * ppass = & ps - > psglx- > blur_passes[ i ] ;
// Build shader
// Build shader
{
{
@ -527,15 +575,15 @@ glx_update_fbconfig_bydepth(session_t *ps, int depth, glx_fbconfig_t *pfbcfg) {
return ;
return ;
// Compare new FBConfig with current one
// Compare new FBConfig with current one
if ( glx_cmp_fbconfig ( ps , ps - > glx_ fbconfigs[ depth ] , pfbcfg ) < 0 ) {
if ( glx_cmp_fbconfig ( ps , ps - > psglx- > fbconfigs[ depth ] , pfbcfg ) < 0 ) {
# ifdef DEBUG_GLX
# ifdef DEBUG_GLX
printf_dbgf ( " (%d): %#x overrides %#x, target %#x. \n " , depth , ( unsigned ) pfbcfg - > cfg , ( ps - > glx_ fbconfigs[ depth ] ? ( unsigned ) ps - > glx_ fbconfigs[ depth ] - > cfg : 0 ) , pfbcfg - > texture_tgts ) ;
printf_dbgf ( " (%d): %#x overrides %#x, target %#x. \n " , depth , ( unsigned ) pfbcfg - > cfg , ( ps - > psglx- > fbconfigs[ depth ] ? ( unsigned ) ps - > psglx- > fbconfigs[ depth ] - > cfg : 0 ) , pfbcfg - > texture_tgts ) ;
# endif
# endif
if ( ! ps - > glx_ fbconfigs[ depth ] ) {
if ( ! ps - > psglx- > fbconfigs[ depth ] ) {
ps - > glx_ fbconfigs[ depth ] = malloc ( sizeof ( glx_fbconfig_t ) ) ;
ps - > psglx- > fbconfigs[ depth ] = malloc ( sizeof ( glx_fbconfig_t ) ) ;
allocchk ( ps - > glx_ fbconfigs[ depth ] ) ;
allocchk ( ps - > psglx- > fbconfigs[ depth ] ) ;
}
}
( * ps - > glx_ fbconfigs[ depth ] ) = * pfbcfg ;
( * ps - > psglx- > fbconfigs[ depth ] ) = * pfbcfg ;
}
}
}
}
@ -617,19 +665,19 @@ glx_update_fbconfig(session_t *ps) {
cxfree ( pfbcfgs ) ;
cxfree ( pfbcfgs ) ;
// Sanity checks
// Sanity checks
if ( ! ps - > glx_ fbconfigs[ ps - > depth ] ) {
if ( ! ps - > psglx- > fbconfigs[ ps - > depth ] ) {
printf_errf ( " (): No FBConfig found for default depth %d. " , ps - > depth ) ;
printf_errf ( " (): No FBConfig found for default depth %d. " , ps - > depth ) ;
return false ;
return false ;
}
}
if ( ! ps - > glx_ fbconfigs[ 32 ] ) {
if ( ! ps - > psglx- > fbconfigs[ 32 ] ) {
printf_errf ( " (): No FBConfig found for depth 32. Expect crazy things. " ) ;
printf_errf ( " (): No FBConfig found for depth 32. Expect crazy things. " ) ;
}
}
# ifdef DEBUG_GLX
# ifdef DEBUG_GLX
printf_dbgf ( " (): %d-bit: %#3x, 32-bit: %#3x \n " ,
printf_dbgf ( " (): %d-bit: %#3x, 32-bit: %#3x \n " ,
ps - > depth , ( int ) ps - > glx_ fbconfigs[ ps - > depth ] - > cfg ,
ps - > depth , ( int ) ps - > psglx- > fbconfigs[ ps - > depth ] - > cfg ,
( int ) ps - > glx_ fbconfigs[ 32 ] - > cfg ) ;
( int ) ps - > psglx- > fbconfigs[ 32 ] - > cfg ) ;
# endif
# endif
return true ;
return true ;
@ -733,7 +781,7 @@ glx_bind_pixmap(session_t *ps, glx_texture_t **pptex, Pixmap pixmap,
}
}
}
}
const glx_fbconfig_t * pcfg = ps - > glx_ fbconfigs[ depth ] ;
const glx_fbconfig_t * pcfg = ps - > psglx- > fbconfigs[ depth ] ;
if ( ! pcfg ) {
if ( ! pcfg ) {
printf_errf ( " (%d): Couldn't find FBConfig with requested depth. " , depth ) ;
printf_errf ( " (%d): Couldn't find FBConfig with requested depth. " , depth ) ;
return false ;
return false ;
@ -744,7 +792,7 @@ glx_bind_pixmap(session_t *ps, glx_texture_t **pptex, Pixmap pixmap,
// pixmap-specific parameters, and this may change in the future
// pixmap-specific parameters, and this may change in the future
GLenum tex_tgt = 0 ;
GLenum tex_tgt = 0 ;
if ( GLX_TEXTURE_2D_BIT_EXT & pcfg - > texture_tgts
if ( GLX_TEXTURE_2D_BIT_EXT & pcfg - > texture_tgts
& & ps - > glx_ has_texture_non_power_of_two)
& & ps - > psglx- > has_texture_non_power_of_two)
tex_tgt = GLX_TEXTURE_2D_EXT ;
tex_tgt = GLX_TEXTURE_2D_EXT ;
else if ( GLX_TEXTURE_RECTANGLE_BIT_EXT & pcfg - > texture_tgts )
else if ( GLX_TEXTURE_RECTANGLE_BIT_EXT & pcfg - > texture_tgts )
tex_tgt = GLX_TEXTURE_RECTANGLE_EXT ;
tex_tgt = GLX_TEXTURE_RECTANGLE_EXT ;
@ -809,9 +857,9 @@ glx_bind_pixmap(session_t *ps, glx_texture_t **pptex, Pixmap pixmap,
// The specification requires rebinding whenever the content changes...
// The specification requires rebinding whenever the content changes...
// We can't follow this, too slow.
// We can't follow this, too slow.
if ( need_release )
if ( need_release )
ps - > glXReleaseTexImageProc ( ps - > dpy , ptex - > glpixmap , GLX_FRONT_LEFT_EXT ) ;
ps - > psglx - > glXReleaseTexImageProc ( ps - > dpy , ptex - > glpixmap , GLX_FRONT_LEFT_EXT ) ;
ps - > glXBindTexImageProc ( ps - > dpy , ptex - > glpixmap , GLX_FRONT_LEFT_EXT , NULL ) ;
ps - > psglx - > glXBindTexImageProc ( ps - > dpy , ptex - > glpixmap , GLX_FRONT_LEFT_EXT , NULL ) ;
// Cleanup
// Cleanup
glBindTexture ( ptex - > target , 0 ) ;
glBindTexture ( ptex - > target , 0 ) ;
@ -830,7 +878,7 @@ glx_release_pixmap(session_t *ps, glx_texture_t *ptex) {
// Release binding
// Release binding
if ( ptex - > glpixmap & & ptex - > texture ) {
if ( ptex - > glpixmap & & ptex - > texture ) {
glBindTexture ( ptex - > target , ptex - > texture ) ;
glBindTexture ( ptex - > target , ptex - > texture ) ;
ps - > glXReleaseTexImageProc ( ps - > dpy , ptex - > glpixmap , GLX_FRONT_LEFT_EXT ) ;
ps - > psglx - > glXReleaseTexImageProc ( ps - > dpy , ptex - > glpixmap , GLX_FRONT_LEFT_EXT ) ;
glBindTexture ( ptex - > target , 0 ) ;
glBindTexture ( ptex - > target , 0 ) ;
}
}
@ -848,7 +896,7 @@ glx_release_pixmap(session_t *ps, glx_texture_t *ptex) {
*/
*/
void
void
glx_paint_pre ( session_t * ps , XserverRegion * preg ) {
glx_paint_pre ( session_t * ps , XserverRegion * preg ) {
ps - > glx_ z = 0.0 ;
ps - > psglx- > z = 0.0 ;
// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Get buffer age
// Get buffer age
@ -1116,8 +1164,8 @@ glx_blur_dst(session_t *ps, int dx, int dy, int width, int height, float z,
GLfloat factor_center ,
GLfloat factor_center ,
XserverRegion reg_tgt , const reg_data_t * pcache_reg ,
XserverRegion reg_tgt , const reg_data_t * pcache_reg ,
glx_blur_cache_t * pbc ) {
glx_blur_cache_t * pbc ) {
assert ( ps - > glx_ blur_passes[ 0 ] . prog ) ;
assert ( ps - > psglx- > blur_passes[ 0 ] . prog ) ;
const bool more_passes = ps - > glx_ blur_passes[ 1 ] . prog ;
const bool more_passes = ps - > psglx- > blur_passes[ 1 ] . prog ;
const bool have_scissors = glIsEnabled ( GL_SCISSOR_TEST ) ;
const bool have_scissors = glIsEnabled ( GL_SCISSOR_TEST ) ;
const bool have_stencil = glIsEnabled ( GL_STENCIL_TEST ) ;
const bool have_stencil = glIsEnabled ( GL_STENCIL_TEST ) ;
bool ret = false ;
bool ret = false ;
@ -1154,7 +1202,7 @@ glx_blur_dst(session_t *ps, int dx, int dy, int width, int height, float z,
*/
*/
GLenum tex_tgt = GL_TEXTURE_RECTANGLE ;
GLenum tex_tgt = GL_TEXTURE_RECTANGLE ;
if ( ps - > glx_ has_texture_non_power_of_two)
if ( ps - > psglx- > has_texture_non_power_of_two)
tex_tgt = GL_TEXTURE_2D ;
tex_tgt = GL_TEXTURE_2D ;
// Free textures if size inconsistency discovered
// Free textures if size inconsistency discovered
@ -1217,9 +1265,9 @@ glx_blur_dst(session_t *ps, int dx, int dy, int width, int height, float z,
bool last_pass = false ;
bool last_pass = false ;
for ( int i = 0 ; ! last_pass ; + + i ) {
for ( int i = 0 ; ! last_pass ; + + i ) {
last_pass = ! ps - > glx_ blur_passes[ i + 1 ] . prog ;
last_pass = ! ps - > psglx- > blur_passes[ i + 1 ] . prog ;
assert ( i < MAX_BLUR_PASS - 1 ) ;
assert ( i < MAX_BLUR_PASS - 1 ) ;
const glx_blur_pass_t * ppass = & ps - > glx_ blur_passes[ i ] ;
const glx_blur_pass_t * ppass = & ps - > psglx- > blur_passes[ i ] ;
assert ( ppass - > prog ) ;
assert ( ppass - > prog ) ;
assert ( tex_scr ) ;
assert ( tex_scr ) ;
@ -1392,7 +1440,7 @@ glx_render_(session_t *ps, const glx_texture_t *ptex,
# endif
# endif
argb = argb | | ( GLX_TEXTURE_FORMAT_RGBA_EXT = =
argb = argb | | ( GLX_TEXTURE_FORMAT_RGBA_EXT = =
ps - > glx_ fbconfigs[ ptex - > depth ] - > texture_fmt ) ;
ps - > psglx- > fbconfigs[ ptex - > depth ] - > texture_fmt ) ;
# ifdef CONFIG_VSYNC_OPENGL_GLSL
# ifdef CONFIG_VSYNC_OPENGL_GLSL
const bool has_prog = pprogram & & pprogram - > prog ;
const bool has_prog = pprogram & & pprogram - > prog ;
# endif
# endif
@ -1695,7 +1743,7 @@ glx_swap_copysubbuffermesa(session_t *ps, XserverRegion reg) {
# ifdef DEBUG_GLX
# ifdef DEBUG_GLX
printf_dbgf ( " (): %d, %d, %d, %d \n " , x , y , wid , hei ) ;
printf_dbgf ( " (): %d, %d, %d, %d \n " , x , y , wid , hei ) ;
# endif
# endif
ps - > glXCopySubBufferProc ( ps - > dpy , get_tgt_window ( ps ) , x , y , wid , hei ) ;
ps - > psglx - > glXCopySubBufferProc ( ps - > dpy , get_tgt_window ( ps ) , x , y , wid , hei ) ;
}
}
}
}