mesa/st: Check for successful framebuffer allocation in st_api_make_current
Ran into this while trying to rework fbconfig setup, due to a bug I ended up trying to allocate a PIPE_FORMAT_NONE framebuffer, which failed like you'd hope, but which we weren't converting into an error in st_api_make_current. Instead we'd treat it like binding no drawable to the context, which is really not what was asked for, so let's go ahead and make this an error. Reviewed-by: Eric Faye-Lund <kusmabite@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9956>
This commit is contained in:
@@ -1094,6 +1094,10 @@ st_api_make_current(struct st_api *stapi, struct st_context_iface *stctxi,
|
||||
st_framebuffer_reference(&stread, stdraw);
|
||||
}
|
||||
|
||||
/* If framebuffers were asked for, we'd better have allocated them */
|
||||
if ((stdrawi && !stdraw) || (streadi && !stread))
|
||||
return false;
|
||||
|
||||
if (stdraw && stread) {
|
||||
st_framebuffer_validate(stdraw, st);
|
||||
if (stread != stdraw)
|
||||
|
Reference in New Issue
Block a user