mesa: split struct gl_config into it's own header.

avoids context.h/mtypes.h deps.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14437>
This commit is contained in:
Dave Airlie 2022-01-07 16:31:03 +10:00 committed by Marge Bot
parent 4346f39299
commit 16fa442057
6 changed files with 44 additions and 32 deletions

View file

@ -30,7 +30,8 @@
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#include "main/context.h"
#include "main/glconfig.h"
#include "main/formats.h"
struct __DRIconfigRec {
struct gl_config modes;

View file

@ -40,6 +40,7 @@
#include "xm_api.h"
#include "main/errors.h"
#include "main/config.h"
#include "util/u_math.h"
#include "util/u_memory.h"

View file

@ -71,6 +71,7 @@
#include "hud/hud_context.h"
#include "main/errors.h"
#include "main/mtypes.h"
#include "xm_public.h"
#include <GL/glx.h>

View file

@ -57,7 +57,8 @@ and create a window, you must do the following to use the X/Mesa interface:
#define XM_API_H
#include "main/mtypes.h" /* for gl_config */
#include <stdbool.h>
#include "main/glconfig.h" /* for gl_config */
#include "frontend/api.h"
#include "os/os_thread.h"

37
src/mesa/main/glconfig.h Normal file
View file

@ -0,0 +1,37 @@
#ifndef __GL_CONFIG_H__
#define __GL_CONFIG_H__
#include "main/glheader.h"
/**
* Framebuffer configuration (aka visual / pixelformat)
* Note: some of these fields should be boolean, but it appears that
* code in drivers/dri/common/util.c requires int-sized fields.
*/
struct gl_config
{
GLboolean floatMode;
GLuint doubleBufferMode;
GLuint stereoMode;
GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
GLuint redMask, greenMask, blueMask, alphaMask;
GLint redShift, greenShift, blueShift, alphaShift;
GLint rgbBits; /* total bits for rgb */
GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
GLint depthBits;
GLint stencilBits;
/* ARB_multisample / SGIS_multisample */
GLuint samples;
/* OML_swap_method */
GLint swapMethod;
/* EXT_framebuffer_sRGB */
GLint sRGBCapable;
};
#endif

View file

@ -42,6 +42,7 @@
#include "main/glthread.h"
#include "main/consts_exts.h"
#include "main/shader_types.h"
#include "main/glconfig.h"
#include "main/menums.h"
#include "main/config.h"
#include "glapi/glapi.h"
@ -132,36 +133,6 @@ struct shader_includes;
/* Mask of bits for depth+stencil buffers */
#define BUFFER_BITS_DEPTH_STENCIL (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)
/**
* Framebuffer configuration (aka visual / pixelformat)
* Note: some of these fields should be boolean, but it appears that
* code in drivers/dri/common/util.c requires int-sized fields.
*/
struct gl_config
{
GLboolean floatMode;
GLuint doubleBufferMode;
GLuint stereoMode;
GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
GLuint redMask, greenMask, blueMask, alphaMask;
GLint redShift, greenShift, blueShift, alphaShift;
GLint rgbBits; /* total bits for rgb */
GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
GLint depthBits;
GLint stencilBits;
/* ARB_multisample / SGIS_multisample */
GLuint samples;
/* OML_swap_method */
GLint swapMethod;
/* EXT_framebuffer_sRGB */
GLint sRGBCapable;
};
#define FRONT_MATERIAL_BITS (MAT_BIT_FRONT_EMISSION | \
MAT_BIT_FRONT_AMBIENT | \