anv,i965: Stop warning about incomplete gen11 support
[mesa.git] / src / mesa / drivers / dri / swrast / swrast.c
index ae5874f59278b74d0787ec88957e1eed849d7918..94758e60862056b0ae2489db492aa27929d52ff1 100644 (file)
@@ -272,7 +272,7 @@ swrastFillInModes(__DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor, back_buffer_modes,
                               back_buffer_factor, msaa_samples_array, 1,
-                              GL_TRUE, GL_FALSE);
+                              GL_TRUE, GL_FALSE, GL_FALSE);
     if (configs == NULL) {
        fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
                __LINE__);
@@ -470,13 +470,17 @@ swrast_map_renderbuffer(struct gl_context *ctx,
                        GLuint x, GLuint y, GLuint w, GLuint h,
                        GLbitfield mode,
                        GLubyte **out_map,
-                       GLint *out_stride)
+                       GLint *out_stride,
+                       bool flip_y)
 {
    struct dri_swrast_renderbuffer *xrb = dri_swrast_renderbuffer(rb);
    GLubyte *map = xrb->Base.Buffer;
    int cpp = _mesa_get_format_bytes(rb->Format);
    int stride = rb->Width * cpp;
 
+   /* driver does not support GL_FRAMEBUFFER_FLIP_Y_MESA */
+   assert((rb->Name == 0) == flip_y);
+
    if (rb->AllocStorage == swrast_alloc_front_storage) {
       __DRIdrawable *dPriv = xrb->dPriv;
       __DRIscreen *sPriv = dPriv->driScreenPriv;
@@ -675,6 +679,9 @@ swrast_check_and_update_window_size( struct gl_context *ctx, struct gl_framebuff
 {
     GLsizei width, height;
 
+    if (!fb)
+        return;
+
     get_window_size(fb, &width, &height);
     if (fb->Width != width || fb->Height != height) {
        _mesa_resize_framebuffer(ctx, fb, width, height);
@@ -857,32 +864,26 @@ dri_make_current(__DRIcontext * cPriv,
                 __DRIdrawable * driReadPriv)
 {
     struct gl_context *mesaCtx;
-    struct gl_framebuffer *mesaDraw;
-    struct gl_framebuffer *mesaRead;
+    struct gl_framebuffer *mesaDraw = NULL;
+    struct gl_framebuffer *mesaRead = NULL;
     TRACE;
 
     if (cPriv) {
-       struct dri_context *ctx = dri_context(cPriv);
-       struct dri_drawable *draw;
-       struct dri_drawable *read;
-
-       if (!driDrawPriv || !driReadPriv)
-           return GL_FALSE;
-
-       draw = dri_drawable(driDrawPriv);
-       read = dri_drawable(driReadPriv);
-       mesaCtx = &ctx->Base;
-       mesaDraw = &draw->Base;
-       mesaRead = &read->Base;
-
-       /* check for same context and buffer */
-       if (mesaCtx == _mesa_get_current_context()
-           && mesaCtx->DrawBuffer == mesaDraw
-           && mesaCtx->ReadBuffer == mesaRead) {
-           return GL_TRUE;
-       }
-
-       _glapi_check_multithread();
+        mesaCtx = &dri_context(cPriv)->Base;
+
+       if (driDrawPriv && driReadPriv) {
+           struct dri_drawable *draw = dri_drawable(driDrawPriv);
+           struct dri_drawable *read = dri_drawable(driReadPriv);
+           mesaDraw = &draw->Base;
+           mesaRead = &read->Base;
+        }
+
+        /* check for same context and buffer */
+        if (mesaCtx == _mesa_get_current_context()
+            && mesaCtx->DrawBuffer == mesaDraw
+            && mesaCtx->ReadBuffer == mesaRead) {
+            return GL_TRUE;
+        }
 
        swrast_check_and_update_window_size(mesaCtx, mesaDraw);
        if (mesaRead != mesaDraw)