d3d1x: fix Map
authorLuca Barbieri <luca@luca-barbieri.com>
Mon, 27 Sep 2010 19:40:13 +0000 (21:40 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Mon, 27 Sep 2010 20:20:53 +0000 (22:20 +0200)
src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h

index 4abb4ac6b0f6c6b73c78693634ed07a3d4f3ec26..36110595c206fb4288741cb6a180c79def4780d7 100644 (file)
@@ -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;