mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 05:50:11 +01:00
fix segfault with i915 drivers in swrast drawpixels path when resizing windows
This commit is contained in:
parent
d895c5a08f
commit
fb3b9060d4
2 changed files with 12 additions and 0 deletions
|
|
@ -450,10 +450,16 @@ intelDrawPixels( GLcontext *ctx,
|
|||
* wise happily run the fragment program on each pixel in the image).
|
||||
*/
|
||||
struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current;
|
||||
/* can't just set current frag prog to 0 here as on buffer resize
|
||||
we'll get new state checks which will segfault. Remains a hack. */
|
||||
ctx->FragmentProgram._Current = NULL;
|
||||
ctx->FragmentProgram._UseTexEnvProgram = GL_FALSE;
|
||||
ctx->FragmentProgram._Active = GL_FALSE;
|
||||
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
|
||||
unpack, pixels );
|
||||
ctx->FragmentProgram._Current = fpSave;
|
||||
ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
|
||||
ctx->FragmentProgram._Active = GL_TRUE;
|
||||
}
|
||||
else {
|
||||
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
|
||||
|
|
|
|||
|
|
@ -370,10 +370,16 @@ intelDrawPixels(GLcontext * ctx,
|
|||
* wise happily run the fragment program on each pixel in the image).
|
||||
*/
|
||||
struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current;
|
||||
/* can't just set current frag prog to 0 here as on buffer resize
|
||||
we'll get new state checks which will segfault. Remains a hack. */
|
||||
ctx->FragmentProgram._Current = NULL;
|
||||
ctx->FragmentProgram._UseTexEnvProgram = GL_FALSE;
|
||||
ctx->FragmentProgram._Active = GL_FALSE;
|
||||
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
|
||||
unpack, pixels );
|
||||
ctx->FragmentProgram._Current = fpSave;
|
||||
ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
|
||||
ctx->FragmentProgram._Active = GL_TRUE;
|
||||
}
|
||||
else {
|
||||
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue