summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_image.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-05-30 17:36:49 -0700
committerJason Ekstrand <[email protected]>2018-05-31 16:51:46 -0700
commit1029458ee32dfada4431e67a17922e1602aba6a7 (patch)
tree7174f4ed0f139af3aa7c8db5c2a40c83a439e0fc /src/intel/vulkan/anv_image.c
parentde1c5c1b503fb190e5d169654ce207777e699195 (diff)
anv: Use an anv_address in anv_buffer_view
Instead of storing a BO and offset separately, use an anv_address. This changes anv_fill_buffer_surface_state to use anv_address and we now call anv_address_physical and pass that into ISL. Reviewed-by: Scott D Phillips <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r--src/intel/vulkan/anv_image.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 52882080fd0..090d0615e41 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -1467,18 +1467,21 @@ anv_CreateBufferView(VkDevice _device,
VK_IMAGE_ASPECT_COLOR_BIT,
VK_IMAGE_TILING_LINEAR);
const uint32_t format_bs = isl_format_get_layout(view->format)->bpb / 8;
- view->bo = buffer->bo;
- view->offset = buffer->offset + pCreateInfo->offset;
view->range = anv_buffer_get_range(buffer, pCreateInfo->offset,
pCreateInfo->range);
view->range = align_down_npot_u32(view->range, format_bs);
+ view->address = (struct anv_address) {
+ .bo = buffer->bo,
+ .offset = buffer->offset + pCreateInfo->offset,
+ };
+
if (buffer->usage & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) {
view->surface_state = alloc_surface_state(device);
anv_fill_buffer_surface_state(device, view->surface_state,
view->format,
- view->offset, view->range, format_bs);
+ view->address, view->range, format_bs);
} else {
view->surface_state = (struct anv_state){ 0 };
}
@@ -1495,14 +1498,14 @@ anv_CreateBufferView(VkDevice _device,
anv_fill_buffer_surface_state(device, view->storage_surface_state,
storage_format,
- view->offset, view->range,
+ view->address, view->range,
(storage_format == ISL_FORMAT_RAW ? 1 :
isl_format_get_layout(storage_format)->bpb / 8));
/* Write-only accesses should use the original format. */
anv_fill_buffer_surface_state(device, view->writeonly_storage_surface_state,
view->format,
- view->offset, view->range,
+ view->address, view->range,
isl_format_get_layout(view->format)->bpb / 8);
isl_buffer_fill_image_param(&device->isl_dev,