i965/bufmgr: Add a helper to mark a BO as external
[mesa.git] / src / mesa / state_tracker / st_cb_bitmap.c
index 30e23fa259f3ec33a260ade2189699b8bbf24ea8..a5c7ed0ee66d27bcae6d662a25d916361e9c0349 100644 (file)
@@ -249,8 +249,8 @@ setup_render_state(struct gl_context *ctx,
    }
 
    /* viewport state: viewport matching window dims */
-   cso_set_viewport_dims(cso, st->state.framebuffer.width,
-                         st->state.framebuffer.height,
+   cso_set_viewport_dims(cso, st->state.fb_width,
+                         st->state.fb_height,
                          st->state.fb_orientation == Y_0_TOP);
 
    cso_set_vertex_elements(cso, 3, st->util_velems);
@@ -283,8 +283,8 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
 {
    struct st_context *st = st_context(ctx);
    struct pipe_context *pipe = st->pipe;
-   const float fb_width = (float) st->state.framebuffer.width;
-   const float fb_height = (float) st->state.framebuffer.height;
+   const float fb_width = (float) st->state.fb_width;
+   const float fb_height = (float) st->state.fb_height;
    const float x0 = (float) x;
    const float x1 = (float) (x + width);
    const float y0 = (float) y;
@@ -301,8 +301,9 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
       /* XXX if the bitmap is larger than the max texture size, break
        * it up into chunks.
        */
-      GLuint maxSize = 1 << (pipe->screen->get_param(pipe->screen,
-                                    PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1);
+      GLuint MAYBE_UNUSED maxSize =
+         1 << (pipe->screen->get_param(pipe->screen,
+                                       PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1);
       assert(width <= (GLsizei) maxSize);
       assert(height <= (GLsizei) maxSize);
    }
@@ -666,8 +667,8 @@ st_DrawAtlasBitmaps(struct gl_context *ctx,
    /* convert Z from [0,1] to [-1,-1] to match viewport Z scale/bias */
    const float z = ctx->Current.RasterPos[2] * 2.0f - 1.0f;
    const float *color = ctx->Current.RasterColor;
-   const float clip_x_scale = 2.0f / st->state.framebuffer.width;
-   const float clip_y_scale = 2.0f / st->state.framebuffer.height;
+   const float clip_x_scale = 2.0f / st->state.fb_width;
+   const float clip_y_scale = 2.0f / st->state.fb_height;
    const unsigned num_verts = count * 4;
    const unsigned num_vert_bytes = num_verts * sizeof(struct st_util_vertex);
    struct st_util_vertex *verts;
@@ -694,7 +695,7 @@ st_DrawAtlasBitmaps(struct gl_context *ctx,
    vb.stride = sizeof(struct st_util_vertex);
 
    u_upload_alloc(pipe->stream_uploader, 0, num_vert_bytes, 4,
-                  &vb.buffer_offset, &vb.buffer, (void **) &verts);
+                  &vb.buffer_offset, &vb.buffer.resource, (void **) &verts);
 
    if (unlikely(!verts)) {
       _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCallLists(bitmap text)");
@@ -781,7 +782,7 @@ st_DrawAtlasBitmaps(struct gl_context *ctx,
 out:
    restore_render_state(ctx);
 
-   pipe_resource_reference(&vb.buffer, NULL);
+   pipe_resource_reference(&vb.buffer.resource, NULL);
 
    pipe_sampler_view_reference(&sv, NULL);