mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
gallium: Correctly handle no config context creation
This patch fixes the following Piglit test: spec@egl_mesa_configless_context@basic It also fixes few test in a virgl guest. v2: Evaluate the value of no_config (Ilia) Suggested-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Elie Tournier <elie.tournier@collabora.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
f6e09db2e6
commit
9179c745f6
3 changed files with 13 additions and 2 deletions
|
|
@ -190,6 +190,8 @@ struct st_egl_image
|
|||
*/
|
||||
struct st_visual
|
||||
{
|
||||
bool no_config;
|
||||
|
||||
/**
|
||||
* Available buffers. Bitfield of ST_ATTACHMENT_*_MASK bits.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -308,8 +308,10 @@ dri_fill_st_visual(struct st_visual *stvis,
|
|||
{
|
||||
memset(stvis, 0, sizeof(*stvis));
|
||||
|
||||
if (!mode)
|
||||
if (!mode) {
|
||||
stvis->no_config = true;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Deduce the color format. */
|
||||
switch (mode->redMask) {
|
||||
|
|
|
|||
|
|
@ -835,6 +835,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
|
|||
struct st_context *shared_ctx = (struct st_context *) shared_stctxi;
|
||||
struct st_context *st;
|
||||
struct pipe_context *pipe;
|
||||
struct gl_config* mode_ptr;
|
||||
struct gl_config mode;
|
||||
gl_api api;
|
||||
bool no_error = false;
|
||||
|
|
@ -894,7 +895,13 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
|
|||
}
|
||||
|
||||
st_visual_to_context_mode(&attribs->visual, &mode);
|
||||
st = st_create_context(api, pipe, &mode, shared_ctx,
|
||||
|
||||
if (attribs->visual.no_config)
|
||||
mode_ptr = NULL;
|
||||
else
|
||||
mode_ptr = &mode;
|
||||
|
||||
st = st_create_context(api, pipe, mode_ptr, shared_ctx,
|
||||
&attribs->options, no_error);
|
||||
if (!st) {
|
||||
*error = ST_CONTEXT_ERROR_NO_MEMORY;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue