diff options
author | Luca Barbieri <[email protected]> | 2010-09-27 21:40:13 +0200 |
---|---|---|
committer | Luca Barbieri <[email protected]> | 2010-09-27 22:20:53 +0200 |
commit | a359eb80c5e141f625cfe42b4d97bf78cf25d128 (patch) | |
tree | 03542384f8df19e6c18e05fa183b88b908e99f1f /src/gallium/state_trackers | |
parent | f976cd0c9ead6a5e63146c11823770176c149a12 (diff) |
d3d1x: fix Map
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h | 10 |
1 files changed, 6 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 4abb4ac6b0f..36110595c20 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h @@ -1433,6 +1433,10 @@ changed: return sr; } + /* TODO: deferred contexts will need a different implementation of this, + * because we can't put the transfer info into the resource itself. + * Also, there are very different restrictions, for obvious reasons. + */ virtual HRESULT STDMETHODCALLTYPE Map( ID3D11Resource *iresource, unsigned subresource, @@ -1445,8 +1449,7 @@ changed: if(resource->transfers.count(subresource)) return E_FAIL; pipe_subresource sr = d3d11_to_pipe_subresource(resource->resource, subresource); - pipe_box box; - d3d11_to_pipe_box(resource->resource, sr.level, 0); + pipe_box box = d3d11_to_pipe_box(resource->resource, sr.level, 0); unsigned usage = 0; if(map_type == D3D11_MAP_READ) usage = PIPE_TRANSFER_READ; @@ -1470,8 +1473,7 @@ changed: return E_FAIL; } resource->transfers[subresource] = transfer; - pipe->transfer_map(pipe, transfer); - mapped_resource->pData = transfer->data; + mapped_resource->pData = pipe->transfer_map(pipe, transfer); mapped_resource->RowPitch = transfer->stride; mapped_resource->DepthPitch = transfer->slice_stride; return S_OK; |