diff --git a/src/mantle/mantle_image_view.c b/src/mantle/mantle_image_view.c index 1a90e43e..59ac911d 100644 --- a/src/mantle/mantle_image_view.c +++ b/src/mantle/mantle_image_view.c @@ -103,6 +103,7 @@ GR_RESULT GR_STDCALL grCreateImageView( GrImageView* grImageView = malloc(sizeof(GrImageView)); *grImageView = (GrImageView) { .grObj = { GR_OBJ_TYPE_IMAGE_VIEW, grDevice }, + .grParentImage = grImage, .imageView = vkImageView, .format = createInfo.format, }; @@ -166,6 +167,7 @@ GR_RESULT GR_STDCALL grCreateColorTargetView( GrColorTargetView* grColorTargetView = malloc(sizeof(GrColorTargetView)); *grColorTargetView = (GrColorTargetView) { .grObj = { GR_OBJ_TYPE_COLOR_TARGET_VIEW, grDevice }, + .grParentImage = grImage, .imageView = vkImageView, .extent = { MIP(grImage->extent.width, pCreateInfo->mipLevel), @@ -173,6 +175,7 @@ GR_RESULT GR_STDCALL grCreateColorTargetView( pCreateInfo->arraySize, }, .format = createInfo.format, + .subresourceRange = createInfo.subresourceRange, }; *pView = (GR_COLOR_TARGET_VIEW)grColorTargetView; @@ -252,6 +255,7 @@ GR_RESULT GR_STDCALL grCreateDepthStencilView( GrDepthStencilView* grDepthStencilView = malloc(sizeof(GrDepthStencilView)); *grDepthStencilView = (GrDepthStencilView) { .grObj = { GR_OBJ_TYPE_DEPTH_STENCIL_VIEW, grDevice }, + .grParentImage = grImage, .imageView = vkImageView, .extent = { MIP(grImage->extent.width, pCreateInfo->mipLevel), @@ -259,6 +263,7 @@ GR_RESULT GR_STDCALL grCreateDepthStencilView( pCreateInfo->arraySize, }, .format = createInfo.format, + .subresourceRange = createInfo.subresourceRange, }; *pView = (GR_DEPTH_STENCIL_VIEW)grDepthStencilView; diff --git a/src/mantle/mantle_object.h b/src/mantle/mantle_object.h index 4960ba4c..90d291dc 100644 --- a/src/mantle/mantle_object.h +++ b/src/mantle/mantle_object.h @@ -180,11 +180,15 @@ typedef struct _GrColorBlendStateObject { float blendConstants[4]; } GrColorBlendStateObject; +typedef struct _GrImage GrImage; + typedef struct _GrColorTargetView { GrObject grObj; + GrImage* grParentImage; VkImageView imageView; VkExtent3D extent; VkFormat format; + VkImageSubresourceRange subresourceRange; } GrColorTargetView; typedef struct _GrDepthStencilStateObject { @@ -202,9 +206,11 @@ typedef struct _GrDepthStencilStateObject { typedef struct _GrDepthStencilView { GrObject grObj; + GrImage* grParentImage; VkImageView imageView; VkExtent3D extent; VkFormat format; + VkImageSubresourceRange subresourceRange; } GrDepthStencilView; typedef struct _GrDescriptorSet { @@ -262,6 +268,7 @@ typedef struct _GrImage { typedef struct _GrImageView { GrObject grObj; + GrImage* grParentImage; VkImageView imageView; VkFormat format; } GrImageView;