mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-11 03:40:22 +01:00
st/mesa: fix crash when DrawBuffer->_ColorDrawBuffers[0] is NULL
This fixes the game Tiny and Big.
(cherry picked from commit 7942e6a5ae)
This commit is contained in:
parent
3ed9054cc5
commit
3a02a2bf25
1 changed files with 10 additions and 6 deletions
|
|
@ -297,9 +297,11 @@ clear_with_quad(struct gl_context *ctx,
|
|||
cso_set_fragment_shader_handle(st->cso_context, st->clear.fs);
|
||||
cso_set_vertex_shader_handle(st->cso_context, st->clear.vs);
|
||||
|
||||
st_translate_color(ctx->Color.ClearColor,
|
||||
ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
|
||||
clearColor);
|
||||
if (ctx->DrawBuffer->_ColorDrawBuffers[0]) {
|
||||
st_translate_color(ctx->Color.ClearColor,
|
||||
ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
|
||||
clearColor);
|
||||
}
|
||||
|
||||
/* draw quad matching scissor rect */
|
||||
draw_quad(st, x0, y0, x1, y1, (GLfloat) ctx->Depth.Clear, clearColor);
|
||||
|
|
@ -551,9 +553,11 @@ st_Clear(struct gl_context *ctx, GLbitfield mask)
|
|||
ctx->DrawBuffer->Visual.stencilBits == 0))
|
||||
clear_buffers |= PIPE_CLEAR_DEPTHSTENCIL;
|
||||
|
||||
st_translate_color(ctx->Color.ClearColor,
|
||||
ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
|
||||
clearColor);
|
||||
if (ctx->DrawBuffer->_ColorDrawBuffers[0]) {
|
||||
st_translate_color(ctx->Color.ClearColor,
|
||||
ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat,
|
||||
clearColor);
|
||||
}
|
||||
|
||||
st->pipe->clear(st->pipe, clear_buffers, ctx->Color.ClearColor,
|
||||
ctx->Depth.Clear, ctx->Stencil.Clear);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue