summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-03-14 21:29:53 +0100
committerAxel Davy <[email protected]>2016-05-18 23:37:14 +0200
commitaeddda0c3a2294d923ba57604d9bda5cab0d0f70 (patch)
tree59af650a59fbd4e2be0b5d183ca793830046d351 /src/gallium/state_trackers
parentca7c78a88ecc828a1b08dc18667d2a70d9d0e09d (diff)
st/nine: Use correct PIPE_HANDLE_USAGE flag for frontbuffer copy
When taking screenshots we do a copy from the frontbuffer to an allocated buffer (which we then copy to a ram buffer). Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/nine/swapchain9.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c
index 12cad73d722..bc01c2dd4cf 100644
--- a/src/gallium/state_trackers/nine/swapchain9.c
+++ b/src/gallium/state_trackers/nine/swapchain9.c
@@ -79,7 +79,8 @@ NineSwapChain9_ctor( struct NineSwapChain9 *This,
static D3DWindowBuffer *
D3DWindowBuffer_create(struct NineSwapChain9 *This,
struct pipe_resource *resource,
- int depth)
+ int depth,
+ int for_frontbuffer_reading)
{
D3DWindowBuffer *ret;
struct winsys_handle whandle;
@@ -88,8 +89,10 @@ D3DWindowBuffer_create(struct NineSwapChain9 *This,
memset(&whandle, 0, sizeof(whandle));
whandle.type = DRM_API_HANDLE_TYPE_FD;
This->screen->resource_get_handle(This->screen, resource, &whandle,
- PIPE_HANDLE_USAGE_EXPLICIT_FLUSH |
- PIPE_HANDLE_USAGE_READ);
+ for_frontbuffer_reading ?
+ PIPE_HANDLE_USAGE_WRITE :
+ PIPE_HANDLE_USAGE_EXPLICIT_FLUSH |
+ PIPE_HANDLE_USAGE_READ);
stride = whandle.stride;
dmaBufFd = whandle.handle;
ID3DPresent_NewD3DWindowBufferFromDmaBuf(This->present,
@@ -344,7 +347,7 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This,
resource = This->screen->resource_create(This->screen, &tmplt);
pipe_resource_reference(&(This->present_buffers[i]), resource);
}
- This->present_handles[i] = D3DWindowBuffer_create(This, resource, depth);
+ This->present_handles[i] = D3DWindowBuffer_create(This, resource, depth, false);
pipe_resource_reference(&resource, NULL);
}
if (pParams->EnableAutoDepthStencil) {
@@ -551,7 +554,7 @@ create_present_buffer( struct NineSwapChain9 *This,
tmplt.bind |= PIPE_BIND_LINEAR;
*resource = This->screen->resource_create(This->screen, &tmplt);
- *present_handle = D3DWindowBuffer_create(This, *resource, 24);
+ *present_handle = D3DWindowBuffer_create(This, *resource, 24, true);
}
static void