From c9dc5e62d2bc5c3aa39637708d0bd08856e43c11 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 2 Nov 2013 22:46:56 +0100 Subject: [PATCH] (RGL PS3) Reimplement glpixelStorei --- gfx/gl.c | 4 ---- ps3/rgl/src/ps3/rgl_ps3_raster.cpp | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/gfx/gl.c b/gfx/gl.c index 1ab4465da9..ac1f4cecc3 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -2445,9 +2445,7 @@ static bool gl_overlay_load(void *data, const struct video_overlay_image *images glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -#ifndef HAVE_PSGL glPixelStorei(GL_UNPACK_ALIGNMENT, get_alignment(images[i].width * sizeof(uint32_t))); -#endif glTexImage2D(GL_TEXTURE_2D, 0, driver.gfx_use_rgba ? GL_RGBA : RARCH_GL_INTERNAL_FORMAT32, images[i].width, images[i].height, 0, driver.gfx_use_rgba ? GL_RGBA : RARCH_GL_TEXTURE_TYPE32, RARCH_GL_FORMAT32, images[i].image); @@ -2630,10 +2628,8 @@ static void gl_set_texture_frame(void *data, gl->rgui_texture_alpha = alpha; -#ifndef HAVE_PSGL unsigned base_size = rgb32 ? sizeof(uint32_t) : sizeof(uint16_t); glPixelStorei(GL_UNPACK_ALIGNMENT, get_alignment(width * base_size)); -#endif if (rgb32) { diff --git a/ps3/rgl/src/ps3/rgl_ps3_raster.cpp b/ps3/rgl/src/ps3/rgl_ps3_raster.cpp index 27a5a0e729..e87e0b6fe2 100644 --- a/ps3/rgl/src/ps3/rgl_ps3_raster.cpp +++ b/ps3/rgl/src/ps3/rgl_ps3_raster.cpp @@ -2872,3 +2872,18 @@ void rglGcmFifoGlSetRenderTarget (const void *data) uint32_t log2Height = 31 - ({__asm__("cntlzw %0,%1" : "=r" (log2Height) : "r" (grt->height)); log2Height;}); rglGcmSetSurface(thisContext, grt, CELL_GCM_WINDOW_ORIGIN_BOTTOM, CELL_GCM_WINDOW_PIXEL_CENTER_HALF, log2Width, log2Height); } + +GLAPI void APIENTRY glPixelStorei( GLenum pname, GLint param ) +{ + RGLcontext* LContext = _CurrentContext; + + switch ( pname ) + { + case GL_PACK_ALIGNMENT: + LContext->packAlignment = param; + break; + case GL_UNPACK_ALIGNMENT: + LContext->unpackAlignment = param; + break; + } +}