uint32_t pbe_cs_words[static const ROGUE_NUM_PBESTATE_STATE_WORDS],
uint64_t pbe_reg_words[static const ROGUE_NUM_PBESTATE_REG_WORDS])
{
- const struct pvr_image *image = iview->image;
+ const struct pvr_image *image = vk_to_pvr_image(iview->vk.image);
uint32_t level_pitch = image->mip_levels[iview->vk.base_mip_level].pitch;
struct pvr_pbe_surf_params surface_params;
if (hw_render->ds_surface_id != -1) {
struct pvr_image_view *iview =
render_pass_info->attachments[hw_render->ds_surface_id];
- const struct pvr_image *image = iview->image;
+ const struct pvr_image *image = vk_to_pvr_image(iview->vk.image);
if (vk_format_has_depth(image->vk.format)) {
uint32_t level_pitch =
iview->vk.view_type == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY;
if (!PVR_HAS_FEATURE(dev_info, tpu_array_textures)) {
- uint64_t addr = iview->image->dev_addr.addr +
- iview->vk.base_array_layer * iview->image->layer_size;
+ const struct pvr_image *image = vk_to_pvr_image(iview->vk.image);
+ uint64_t addr =
+ image->dev_addr.addr + iview->vk.base_array_layer * image->layer_size;
secondary[PVR_DESC_IMAGE_SECONDARY_OFFSET_ARRAYBASE] = (uint32_t)addr;
secondary[PVR_DESC_IMAGE_SECONDARY_OFFSET_ARRAYBASE + 1U] =
(uint32_t)(addr >> 32U);
secondary[PVR_DESC_IMAGE_SECONDARY_OFFSET_ARRAYSTRIDE] =
- cube_array_adjust ? iview->image->layer_size * 6
- : iview->image->layer_size;
+ cube_array_adjust ? image->layer_size * 6 : image->layer_size;
}
if (cube_array_adjust) {
const VkAllocationCallbacks *pAllocator,
VkImageView *pView)
{
- PVR_FROM_HANDLE(pvr_image, image, pCreateInfo->image);
PVR_FROM_HANDLE(pvr_device, device, _device);
struct pvr_texture_state_info info;
unsigned char input_swizzle[4];
const uint8_t *format_swizzle;
+ const struct pvr_image *image;
struct pvr_image_view *iview;
VkResult result;
if (!iview)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
- iview->image = image;
+ image = vk_to_pvr_image(iview->vk.image);
info.type = iview->vk.view_type;
info.base_level = iview->vk.base_mip_level;
struct pvr_image_view {
struct vk_image_view vk;
- /* Saved information from pCreateInfo. */
- const struct pvr_image *image;
-
/* Prepacked Texture Image dword 0 and 1. It will be copied to the
* descriptor info during pvr_UpdateDescriptorSets().
*
return container_of(pipeline, struct pvr_graphics_pipeline, base);
}
+static inline const struct pvr_image *
+vk_to_pvr_image(const struct vk_image *image)
+{
+ return container_of(image, const struct pvr_image, vk);
+}
+
static enum pvr_pipeline_stage_bits
pvr_stage_mask(VkPipelineStageFlags2 stage_mask)
{
/* Get any imported buffers used in framebuffer attachments. */
for (uint32_t i = 0U; i < framebuffer->attachment_count; i++) {
- if (!framebuffer->attachments[i]->image->vma->bo->is_imported)
+ const struct pvr_image *image =
+ vk_to_pvr_image(framebuffer->attachments[i]->vk.image);
+
+ if (!image->vma->bo->is_imported)
continue;
- bos[bo_count].bo = framebuffer->attachments[i]->image->vma->bo;
+ bos[bo_count].bo = image->vma->bo;
bos[bo_count].flags = PVR_WINSYS_JOB_BO_FLAG_WRITE;
bo_count++;
}