summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/surface9.c
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-11-04 22:39:14 +0100
committerAxel Davy <[email protected]>2016-12-20 23:44:22 +0100
commite068d3afe17cb7e26d8229ee279c71a09e9a20af (patch)
treeff94bd54e5a5895b7803c70677a146a9a3abf57f /src/gallium/state_trackers/nine/surface9.c
parentbb666b0297cb81fc1b8192ba91efd2e0a69835c5 (diff)
st/nine: Create pipe_surfaces on resource creation.
Create the pipe_surfaces on renderable resources creation. This enables to avoid creating them on the fly. Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/surface9.c')
-rw-r--r--src/gallium/state_trackers/nine/surface9.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/surface9.c b/src/gallium/state_trackers/nine/surface9.c
index 8fa70a79ac6..0ce41223511 100644
--- a/src/gallium/state_trackers/nine/surface9.c
+++ b/src/gallium/state_trackers/nine/surface9.c
@@ -185,6 +185,11 @@ NineSurface9_ctor( struct NineSurface9 *This,
if (This->base.resource && (pDesc->Usage & D3DUSAGE_DYNAMIC))
This->base.resource->flags |= NINE_RESOURCE_FLAG_LOCKABLE;
+ if (This->base.resource && (pDesc->Usage & (D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL))) {
+ (void) NineSurface9_CreatePipeSurface(This, 0);
+ (void) NineSurface9_CreatePipeSurface(This, 1);
+ }
+
/* TODO: investigate what else exactly needs to be cleared */
if (This->base.resource && (pDesc->Usage & D3DUSAGE_RENDERTARGET)) {
surf = NineSurface9_GetSurface(This, 0);
@@ -748,6 +753,10 @@ NineSurface9_SetResourceResize( struct NineSurface9 *This,
pipe_surface_reference(&This->surface[0], NULL);
pipe_surface_reference(&This->surface[1], NULL);
+ if (resource) {
+ (void) NineSurface9_CreatePipeSurface(This, 0);
+ (void) NineSurface9_CreatePipeSurface(This, 1);
+ }
}