* We'll only return non-null for window system framebuffers.
* Note that this function may fail.
*/
-static INLINE struct st_framebuffer *
+static inline struct st_framebuffer *
st_ws_framebuffer(struct gl_framebuffer *fb)
{
/* FBO cannot be casted. See st_new_framebuffer */
/**
* Map an attachment to a buffer index.
*/
-static INLINE gl_buffer_index
+static inline gl_buffer_index
attachment_to_buffer_index(enum st_attachment_type statt)
{
gl_buffer_index index;
/**
* Map a buffer index to an attachment.
*/
-static INLINE enum st_attachment_type
+static inline enum st_attachment_type
buffer_index_to_attachment(gl_buffer_index index)
{
enum st_attachment_type statt;
mode->rgbBits = mode->redBits +
mode->greenBits + mode->blueBits + mode->alphaBits;
+ mode->sRGBCapable = util_format_is_srgb(visual->color_format);
}
if (visual->depth_stencil_format != PIPE_FORMAT_NONE) {
st_pipe_format_to_mesa_format(srgb_format) != MESA_FORMAT_NONE &&
screen->is_format_supported(screen, srgb_format,
PIPE_TEXTURE_2D, stfbi->visual->samples,
- PIPE_BIND_RENDER_TARGET))
+ (PIPE_BIND_DISPLAY_TARGET |
+ PIPE_BIND_RENDER_TARGET)))
mode.sRGBCapable = GL_TRUE;
}
if (attribs->flags & ST_CONTEXT_FLAG_FORWARD_COMPATIBLE)
st->ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT;
+ if (attribs->flags & ST_CONTEXT_FLAG_ROBUST_ACCESS)
+ st->ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB;
+ if (attribs->flags & ST_CONTEXT_FLAG_RESET_NOTIFICATION_ENABLED)
+ st->ctx->Const.ResetStrategy = GL_LOSE_CONTEXT_ON_RESET_ARB;
/* need to perform version check */
if (attribs->major > 1 || attribs->minor > 0) {
/* Is the actual version less than the requested version?
*/
- if (st->ctx->Version < attribs->major * 10 + attribs->minor) {
+ if (st->ctx->Version < attribs->major * 10U + attribs->minor) {
*error = ST_CONTEXT_ERROR_BAD_VERSION;
st_destroy_context(st);
return NULL;
struct gl_extensions extensions = {0};
GLuint version;
- if ((api == API_OPENGL_COMPAT || api == API_OPENGL_CORE) &&
- _mesa_override_gl_version_contextless(&consts, &api, &version)) {
+ if (_mesa_override_gl_version_contextless(&consts, &api, &version)) {
return version;
}