st/dri: use stapi flush instead of pipe flush when creating fences
There may be pending operations (e.g. vertices) that need to be flushed by the state tracker. Found by inspection. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
@@ -90,13 +90,13 @@ static unsigned dri2_fence_get_caps(__DRIscreen *_screen)
|
|||||||
static void *
|
static void *
|
||||||
dri2_create_fence(__DRIcontext *_ctx)
|
dri2_create_fence(__DRIcontext *_ctx)
|
||||||
{
|
{
|
||||||
struct pipe_context *ctx = dri_context(_ctx)->st->pipe;
|
struct st_context_iface *stapi = dri_context(_ctx)->st;
|
||||||
struct dri2_fence *fence = CALLOC_STRUCT(dri2_fence);
|
struct dri2_fence *fence = CALLOC_STRUCT(dri2_fence);
|
||||||
|
|
||||||
if (!fence)
|
if (!fence)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ctx->flush(ctx, &fence->pipe_fence, 0);
|
stapi->flush(stapi, 0, &fence->pipe_fence);
|
||||||
|
|
||||||
if (!fence->pipe_fence) {
|
if (!fence->pipe_fence) {
|
||||||
FREE(fence);
|
FREE(fence);
|
||||||
@@ -110,13 +110,14 @@ dri2_create_fence(__DRIcontext *_ctx)
|
|||||||
static void *
|
static void *
|
||||||
dri2_create_fence_fd(__DRIcontext *_ctx, int fd)
|
dri2_create_fence_fd(__DRIcontext *_ctx, int fd)
|
||||||
{
|
{
|
||||||
struct pipe_context *ctx = dri_context(_ctx)->st->pipe;
|
struct st_context_iface *stapi = dri_context(_ctx)->st;
|
||||||
|
struct pipe_context *ctx = stapi->pipe;
|
||||||
struct dri2_fence *fence = CALLOC_STRUCT(dri2_fence);
|
struct dri2_fence *fence = CALLOC_STRUCT(dri2_fence);
|
||||||
|
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
/* exporting driver created fence, flush: */
|
/* exporting driver created fence, flush: */
|
||||||
ctx->flush(ctx, &fence->pipe_fence,
|
stapi->flush(stapi, PIPE_FLUSH_DEFERRED | PIPE_FLUSH_FENCE_FD,
|
||||||
PIPE_FLUSH_DEFERRED | PIPE_FLUSH_FENCE_FD);
|
&fence->pipe_fence);
|
||||||
} else {
|
} else {
|
||||||
/* importing a foreign fence fd: */
|
/* importing a foreign fence fd: */
|
||||||
ctx->create_fence_fd(ctx, &fence->pipe_fence, fd);
|
ctx->create_fence_fd(ctx, &fence->pipe_fence, fd);
|
||||||
|
|||||||
Reference in New Issue
Block a user