summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/d3d1x/gd3d11
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-10-08 04:06:42 +0200
committerMarek Olšák <[email protected]>2012-10-11 21:12:16 +0200
commit369e46888904c6d379b8b477d9242cff1608e30e (patch)
tree528b10f900f23af3acd22a0edcf50fde0eeee86e /src/gallium/state_trackers/d3d1x/gd3d11
parentec4c74a9dc10039d97ad24c4f16bd2400517991d (diff)
gallium: unify transfer functions
"get_transfer + transfer_map" becomes "transfer_map". "transfer_unmap + transfer_destroy" becomes "transfer_unmap". transfer_map must create and return the transfer object and transfer_unmap must destroy it. transfer_map is successful if the returned buffer pointer is not NULL. If transfer_map fails, the pointer to the transfer object remains unchanged (i.e. doesn't have to be NULL). Acked-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/d3d1x/gd3d11')
-rw-r--r--src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
index 07612bd5f9a..8c387e3a2bc 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
+++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h
@@ -1506,15 +1506,16 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
return E_INVALIDARG;
if(map_type & D3D10_MAP_FLAG_DO_NOT_WAIT)
usage |= PIPE_TRANSFER_DONTBLOCK;
- struct pipe_transfer* transfer = pipe->get_transfer(pipe, resource->resource, level, usage, &box);
- if(!transfer) {
+ struct pipe_transfer* transfer;
+ void *map = pipe->transfer_map(pipe, resource->resource, level, usage, &box, &transfer);
+ if(!map) {
if(map_type & D3D10_MAP_FLAG_DO_NOT_WAIT)
return DXGI_ERROR_WAS_STILL_DRAWING;
else
return E_FAIL;
}
resource->transfers[subresource] = transfer;
- mapped_resource->pData = pipe->transfer_map(pipe, transfer);
+ mapped_resource->pData = map;
mapped_resource->RowPitch = transfer->stride;
mapped_resource->DepthPitch = transfer->layer_stride;
return S_OK;
@@ -1530,7 +1531,6 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe>
if(i != resource->transfers.end())
{
pipe->transfer_unmap(pipe, i->second);
- pipe->transfer_destroy(pipe, i->second);
resource->transfers.erase(i);
}
}