Enables to not wait for the worker thread for ColorFill.
Signed-off-by: Axel Davy <axel.davy@ens.fr>
const RECT *pRect,
D3DCOLOR color )
{
- struct pipe_context *pipe = NineDevice9_GetPipe(This);
struct NineSurface9 *surf = NineSurface9(pSurface);
- struct pipe_surface *psurf;
unsigned x, y, w, h;
- union pipe_color_union rgba;
DBG("This=%p pSurface=%p pRect=%p color=%08x\n", This,
pSurface, pRect, color);
w = surf->desc.Width;
h = surf->desc.Height;
}
- d3dcolor_to_pipe_color_union(&rgba, color);
if (surf->base.info.bind & PIPE_BIND_RENDER_TARGET) {
- psurf = NineSurface9_GetSurface(surf, 0);
- pipe->clear_render_target(pipe, psurf, &rgba, x, y, w, h, false);
+ nine_context_clear_render_target(This, surf, color, x, y, w, h);
} else {
D3DLOCKED_RECT lock;
union util_color uc;
context->pipe->blit(context->pipe, blit);
}
+CSMT_ITEM_NO_WAIT(nine_context_clear_render_target,
+ ARG_BIND_REF(struct NineSurface9, surface),
+ ARG_VAL(D3DCOLOR, color),
+ ARG_VAL(UINT, x),
+ ARG_VAL(UINT, y),
+ ARG_VAL(UINT, width),
+ ARG_VAL(UINT, height))
+{
+ struct nine_context *context = &device->context;
+ struct pipe_surface *surf;
+ union pipe_color_union rgba;
+
+ d3dcolor_to_pipe_color_union(&rgba, color);
+ surf = NineSurface9_GetSurface(surface, 0);
+ context->pipe->clear_render_target(context->pipe, surf, &rgba, x, y, width, height, false);
+}
+
struct pipe_query *
nine_context_create_query(struct NineDevice9 *device, unsigned query_type)
{
nine_context_blit(struct NineDevice9 *device,
struct pipe_blit_info *blit);
+void
+nine_context_clear_render_target(struct NineDevice9 *device,
+ struct NineSurface9 *surface,
+ D3DCOLOR color,
+ UINT x,
+ UINT y,
+ UINT width,
+ UINT height);
+
struct pipe_query *
nine_context_create_query(struct NineDevice9 *device, unsigned query_type);
D3DSURFACE_DESC *pDesc )
{
HRESULT hr;
- union pipe_color_union rgba = {0};
- struct pipe_surface *surf;
- struct pipe_context *pipe;
bool allocate = !pContainer && pDesc->Format != D3DFMT_NULL;
D3DMULTISAMPLE_TYPE multisample_type;
}
/* TODO: investigate what else exactly needs to be cleared */
- if (This->base.resource && (pDesc->Usage & D3DUSAGE_RENDERTARGET)) {
- surf = NineSurface9_GetSurface(This, 0);
- pipe = nine_context_get_pipe_acquire(pParams->device);
- pipe->clear_render_target(pipe, surf, &rgba, 0, 0, pDesc->Width, pDesc->Height, false);
- nine_context_get_pipe_release(pParams->device);
- }
+ if (This->base.resource && (pDesc->Usage & D3DUSAGE_RENDERTARGET))
+ nine_context_clear_render_target(pParams->device, This, 0, 0, 0, pDesc->Width, pDesc->Height);
NineSurface9_Dump(This);