diff options
author | Axel Davy <[email protected]> | 2019-04-10 23:05:58 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2019-04-30 19:18:51 +0200 |
commit | 7dcc85b46e2253c1efd425e55749e1714a260a21 (patch) | |
tree | 6187032af270ab390abec1725031fdd4f4c081ea /src/gallium/state_trackers/nine | |
parent | 1b0a7d05575bccaf73f0e558c0ea4cf5aae0a76a (diff) |
st/nine: Support internal compressed format for volumes
Reuse the generic path to support compressed formats.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine')
-rw-r--r-- | src/gallium/state_trackers/nine/volume9.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/gallium/state_trackers/nine/volume9.c b/src/gallium/state_trackers/nine/volume9.c index 1d562f5dd8d..ab0a82e288d 100644 --- a/src/gallium/state_trackers/nine/volume9.c +++ b/src/gallium/state_trackers/nine/volume9.c @@ -315,19 +315,22 @@ NineVolume9_LockBox( struct NineVolume9 *This, if (p_atomic_read(&This->pending_uploads_counter)) nine_csmt_process(This->base.device); - if (This->data_internal) { - /* For now we only have uncompressed formats here */ - pLockedVolume->RowPitch = This->stride_internal; - pLockedVolume->SlicePitch = This->layer_stride_internal; - pLockedVolume->pBits = This->data_internal + box.z * This->layer_stride_internal + - box.y * This->stride_internal + - util_format_get_stride(This->format_internal, box.x); - } else if (This->data) { - pLockedVolume->RowPitch = This->stride; - pLockedVolume->SlicePitch = This->layer_stride; - pLockedVolume->pBits = This->data + - NineVolume9_GetSystemMemOffset(This->info.format, This->stride, - This->layer_stride, + if (This->data_internal || This->data) { + enum pipe_format format = This->info.format; + unsigned stride = This->stride; + unsigned layer_stride = This->layer_stride; + uint8_t *data = This->data; + if (This->data_internal) { + format = This->format_internal; + stride = This->stride_internal; + layer_stride = This->layer_stride_internal; + data = This->data_internal; + } + pLockedVolume->RowPitch = stride; + pLockedVolume->SlicePitch = layer_stride; + pLockedVolume->pBits = data + + NineVolume9_GetSystemMemOffset(format, stride, + layer_stride, box.x, box.y, box.z); } else { bool no_refs = !p_atomic_read(&This->base.bind) && |