gallium dri st: Use st_get_current() instead of GET_CURRENT_CONTEXT()
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
This commit is contained in:
parent
3d2bba0d10
commit
8cfa6546c9
|
@ -126,9 +126,7 @@ dri_unbind_context(__DRIcontextPrivate * cPriv)
|
||||||
struct dri_context *ctx = dri_context(cPriv);
|
struct dri_context *ctx = dri_context(cPriv);
|
||||||
|
|
||||||
if (--ctx->bind_count == 0) {
|
if (--ctx->bind_count == 0) {
|
||||||
GET_CURRENT_CONTEXT(curGLCtx);
|
if (ctx->st && ctx->st == st_get_current()) {
|
||||||
|
|
||||||
if (curGLCtx && ctx->st == curGLCtx->st) {
|
|
||||||
st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
|
st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
|
||||||
st_make_current(NULL, NULL, NULL);
|
st_make_current(NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
@ -148,11 +146,10 @@ dri_make_current(__DRIcontextPrivate * cPriv,
|
||||||
struct dri_screen *screen = dri_screen(cPriv->driScreenPriv);
|
struct dri_screen *screen = dri_screen(cPriv->driScreenPriv);
|
||||||
struct dri_drawable *draw = dri_drawable(driDrawPriv);
|
struct dri_drawable *draw = dri_drawable(driDrawPriv);
|
||||||
struct dri_drawable *read = dri_drawable(driReadPriv);
|
struct dri_drawable *read = dri_drawable(driReadPriv);
|
||||||
|
struct st_context *old_st = st_get_current();
|
||||||
|
|
||||||
GET_CURRENT_CONTEXT(oldGLCtx);
|
if (old_st && old_st != ctx->st)
|
||||||
|
st_flush(old_st, PIPE_FLUSH_RENDER_CACHE, NULL);
|
||||||
if (oldGLCtx && oldGLCtx->st != ctx->st)
|
|
||||||
st_flush(oldGLCtx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
|
|
||||||
|
|
||||||
++ctx->bind_count;
|
++ctx->bind_count;
|
||||||
|
|
||||||
|
|
|
@ -537,15 +537,14 @@ dri_swap_buffers(__DRIdrawablePrivate * dPriv)
|
||||||
struct dri_drawable *draw = dri_drawable(dPriv);
|
struct dri_drawable *draw = dri_drawable(dPriv);
|
||||||
struct pipe_screen *screen = dri_screen(draw->sPriv)->pipe_screen;
|
struct pipe_screen *screen = dri_screen(draw->sPriv)->pipe_screen;
|
||||||
struct pipe_fence_handle *fence;
|
struct pipe_fence_handle *fence;
|
||||||
|
struct st_context *st = st_get_current();
|
||||||
GET_CURRENT_CONTEXT(glCtx);
|
|
||||||
|
|
||||||
assert(__dri1_api_hooks != NULL);
|
assert(__dri1_api_hooks != NULL);
|
||||||
|
|
||||||
if (!glCtx)
|
if (!st)
|
||||||
return; /* For now */
|
return; /* For now */
|
||||||
|
|
||||||
ctx = (struct dri_context *)glCtx->st->pipe->priv;
|
ctx = (struct dri_context *)st->pipe->priv;
|
||||||
|
|
||||||
st_get_framebuffer_surface(draw->stfb, ST_SURFACE_BACK_LEFT, &back_surf);
|
st_get_framebuffer_surface(draw->stfb, ST_SURFACE_BACK_LEFT, &back_surf);
|
||||||
if (back_surf) {
|
if (back_surf) {
|
||||||
|
@ -571,15 +570,14 @@ dri_copy_sub_buffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h)
|
||||||
struct pipe_surface *back_surf;
|
struct pipe_surface *back_surf;
|
||||||
struct dri_drawable *draw = dri_drawable(dPriv);
|
struct dri_drawable *draw = dri_drawable(dPriv);
|
||||||
struct pipe_fence_handle *dummy_fence;
|
struct pipe_fence_handle *dummy_fence;
|
||||||
|
struct st_context *st = st_get_current();
|
||||||
GET_CURRENT_CONTEXT(glCtx);
|
|
||||||
|
|
||||||
assert(__dri1_api_hooks != NULL);
|
assert(__dri1_api_hooks != NULL);
|
||||||
|
|
||||||
if (!glCtx)
|
if (!st)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ctx = (struct dri_context *)glCtx->st->pipe->priv;
|
ctx = (struct dri_context *)st->pipe->priv;
|
||||||
|
|
||||||
sub_bbox.x1 = x;
|
sub_bbox.x1 = x;
|
||||||
sub_bbox.x2 = x + w;
|
sub_bbox.x2 = x + w;
|
||||||
|
|
Loading…
Reference in New Issue