summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_image.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-09-19 15:28:43 -0700
committerJason Ekstrand <[email protected]>2016-10-14 15:39:41 -0700
commit29e289fa655938f7814bdbb3de7996a8a0f04b60 (patch)
tree63f1334dd21d2db0222f7272801e472da48b7293 /src/intel/vulkan/anv_image.c
parent0340548c8e89d724fe6752fe7a665787c4adf361 (diff)
anv/image: Add an isl_view to anv_image_view
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r--src/intel/vulkan/anv_image.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index c40768405fa..eb20b717937 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -485,10 +485,7 @@ anv_image_view_init(struct anv_image_view *iview,
struct anv_format format = anv_get_format(&device->info, pCreateInfo->format,
range->aspectMask, image->tiling);
- iview->base_layer = range->baseArrayLayer;
- iview->base_mip = range->baseMipLevel;
-
- struct isl_view isl_view = {
+ iview->isl = (struct isl_view) {
.format = format.isl_format,
.base_level = range->baseMipLevel,
.levels = anv_get_levelCount(image, range),
@@ -520,26 +517,26 @@ anv_image_view_init(struct anv_image_view *iview,
* detect the one case where we actually want an array range used for
* 3-D textures.
*/
- isl_view.base_array_layer = 0;
- isl_view.array_len = iview->extent.depth;
+ iview->isl.base_array_layer = 0;
+ iview->isl.array_len = iview->extent.depth;
}
- isl_surf_usage_flags_t cube_usage;
if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE ||
pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) {
- cube_usage = ISL_SURF_USAGE_CUBE_BIT;
+ iview->isl.usage = ISL_SURF_USAGE_CUBE_BIT;
} else {
- cube_usage = 0;
+ iview->isl.usage = 0;
}
if (image->usage & usage_mask & VK_IMAGE_USAGE_SAMPLED_BIT) {
iview->sampler_surface_state = alloc_surface_state(device, cmd_buffer);
- isl_view.usage = cube_usage | ISL_SURF_USAGE_TEXTURE_BIT;
+ struct isl_view view = iview->isl;
+ view.usage |= ISL_SURF_USAGE_TEXTURE_BIT;
isl_surf_fill_state(&device->isl_dev,
iview->sampler_surface_state.map,
.surf = &surface->isl,
- .view = &isl_view,
+ .view = &view,
.mocs = device->default_mocs);
if (!device->info.has_llc)
@@ -559,14 +556,15 @@ anv_image_view_init(struct anv_image_view *iview,
* remove a lot of hacks.
*/
if ((image->usage & usage_mask & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) &&
- isl_format_supports_rendering(&device->info, isl_view.format)) {
+ isl_format_supports_rendering(&device->info, format.isl_format)) {
iview->color_rt_surface_state = alloc_surface_state(device, cmd_buffer);
- isl_view.usage = cube_usage | ISL_SURF_USAGE_RENDER_TARGET_BIT;
+ struct isl_view view = iview->isl;
+ view.usage |= ISL_SURF_USAGE_RENDER_TARGET_BIT;
isl_surf_fill_state(&device->isl_dev,
iview->color_rt_surface_state.map,
.surf = &surface->isl,
- .view = &isl_view,
+ .view = &view,
.mocs = device->default_mocs);
if (!device->info.has_llc)
@@ -581,13 +579,14 @@ anv_image_view_init(struct anv_image_view *iview,
if (isl_has_matching_typed_storage_image_format(&device->info,
format.isl_format)) {
- isl_view.usage = cube_usage | ISL_SURF_USAGE_STORAGE_BIT;
- isl_view.format = isl_lower_storage_image_format(&device->info,
- isl_view.format);
+ struct isl_view view = iview->isl;
+ view.usage |= ISL_SURF_USAGE_STORAGE_BIT;
+ view.format = isl_lower_storage_image_format(&device->info,
+ format.isl_format);
isl_surf_fill_state(&device->isl_dev,
iview->storage_surface_state.map,
.surf = &surface->isl,
- .view = &isl_view,
+ .view = &view,
.mocs = device->default_mocs);
} else {
anv_fill_buffer_surface_state(device, iview->storage_surface_state,
@@ -598,7 +597,7 @@ anv_image_view_init(struct anv_image_view *iview,
isl_surf_fill_image_param(&device->isl_dev,
&iview->storage_image_param,
- &surface->isl, &isl_view);
+ &surface->isl, &iview->isl);
if (!device->info.has_llc)
anv_state_clflush(iview->storage_surface_state);