summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_context.cpp
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2017-06-29 14:03:43 -0500
committerTim Rowley <[email protected]>2017-07-11 13:38:20 -0500
commit50cd222116b40e4df2462cb25a92960d557c9144 (patch)
treed80f494a6d0fdd90069cd3901ef6c9a14246daf1 /src/gallium/drivers/swr/swr_context.cpp
parent27c5568de3674ec95f02816a06b13180bad0838b (diff)
swr: switch to using SwrGetInterface api table
Use the SWR rasterizer API through the table returned from SwrGetInterface rather than referencing the functions directly. This will allow us to move to a model of having the driver dynamically load the appropriate swr architecture library. Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_context.cpp')
-rw-r--r--src/gallium/drivers/swr/swr_context.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gallium/drivers/swr/swr_context.cpp b/src/gallium/drivers/swr/swr_context.cpp
index f2d971a22e8..9648278c691 100644
--- a/src/gallium/drivers/swr/swr_context.cpp
+++ b/src/gallium/drivers/swr/swr_context.cpp
@@ -311,8 +311,8 @@ swr_blit(struct pipe_context *pipe, const struct pipe_blit_info *blit_info)
}
if (ctx->active_queries) {
- SwrEnableStatsFE(ctx->swrContext, FALSE);
- SwrEnableStatsBE(ctx->swrContext, FALSE);
+ ctx->api.pfnSwrEnableStatsFE(ctx->swrContext, FALSE);
+ ctx->api.pfnSwrEnableStatsBE(ctx->swrContext, FALSE);
}
util_blitter_save_vertex_buffer_slot(ctx->blitter, ctx->vertex_buffer);
@@ -349,8 +349,8 @@ swr_blit(struct pipe_context *pipe, const struct pipe_blit_info *blit_info)
util_blitter_blit(ctx->blitter, &info);
if (ctx->active_queries) {
- SwrEnableStatsFE(ctx->swrContext, TRUE);
- SwrEnableStatsBE(ctx->swrContext, TRUE);
+ ctx->api.pfnSwrEnableStatsFE(ctx->swrContext, TRUE);
+ ctx->api.pfnSwrEnableStatsBE(ctx->swrContext, TRUE);
}
}
@@ -383,10 +383,10 @@ swr_destroy(struct pipe_context *pipe)
/* Idle core after destroying buffer resources, but before deleting
* context. Destroying resources has potentially called StoreTiles.*/
- SwrWaitForIdle(ctx->swrContext);
+ ctx->api.pfnSwrWaitForIdle(ctx->swrContext);
if (ctx->swrContext)
- SwrDestroyContext(ctx->swrContext);
+ ctx->api.pfnSwrDestroyContext(ctx->swrContext);
delete ctx->blendJIT;
@@ -467,6 +467,9 @@ swr_create_context(struct pipe_screen *p_screen, void *priv, unsigned flags)
AlignedMalloc(sizeof(struct swr_context), KNOB_SIMD_BYTES);
memset(ctx, 0, sizeof(struct swr_context));
+ SwrGetInterface(ctx->api);
+ ctx->swrDC.pAPI = &ctx->api;
+
ctx->blendJIT =
new std::unordered_map<BLEND_COMPILE_STATE, PFN_BLEND_JIT_FUNC>;
@@ -478,9 +481,9 @@ swr_create_context(struct pipe_screen *p_screen, void *priv, unsigned flags)
createInfo.pfnClearTile = swr_StoreHotTileClear;
createInfo.pfnUpdateStats = swr_UpdateStats;
createInfo.pfnUpdateStatsFE = swr_UpdateStatsFE;
- ctx->swrContext = SwrCreateContext(&createInfo);
+ ctx->swrContext = ctx->api.pfnSwrCreateContext(&createInfo);
- SwrInit();
+ ctx->api.pfnSwrInit();
if (ctx->swrContext == NULL)
goto fail;