On Tue, 6 Apr 2021 at 17:44, Jan Sikorski jsikorski@codeweavers.com wrote:
dlls/wined3d/texture.c | 214 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 190 insertions(+), 24 deletions(-)
I think these are generally fine, just a couple of small comments:
@@ -6499,30 +6504,191 @@ static DWORD vk_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_ dst_texture_vk->layout, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, dst_texture_vk->image.vk_image, &vk_dst_range);
- if (resolve)
Superfluous whitespace.
const struct wined3d_format_vk *src_format_vk = wined3d_format_vk(src_texture->resource.format);
const struct wined3d_format_vk *dst_format_vk = wined3d_format_vk(dst_texture->resource.format);
const unsigned int usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT
| VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
const struct wined3d_format_vk *resolve_format_vk = NULL;
VkImage src_vk_image, dst_vk_image;
VkImageSubresourceRange vk_range;
VkImageResolve resolve_region;
VkImageType vk_image_type;
VkImageCopy copy_region;
VkFormat vk_format;
...
resolve_format_vk = wined3d_format_vk(resolve_format);
VK_CALL(vkCmdResolveImage(vk_command_buffer, src_texture_vk->image.vk_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
dst_texture_vk->image.vk_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion));
vk_format = resolve_format_vk->vk_format;
"resolve_format" may be NULL, right?
switch (src_texture->resource.type)
{
case WINED3D_RTYPE_TEXTURE_1D:
vk_image_type = VK_IMAGE_TYPE_1D;
break;
case WINED3D_RTYPE_TEXTURE_2D:
vk_image_type = VK_IMAGE_TYPE_2D;
break;
case WINED3D_RTYPE_TEXTURE_3D:
vk_image_type = VK_IMAGE_TYPE_3D;
break;
default:
ERR("Unexpected resource type: %s\n", debug_d3dresourcetype(src_texture->resource.type));
goto next;
}
The "goto next;" above leaves the source texture in the TRANSFER_SRC_OPTIMAL layout, and the destination texture in the TRANSFER_DST_OPTIMAL layout.
if (!wined3d_context_vk_create_image(context_vk, vk_image_type, usage, vk_format,
resolve_region.extent.width, resolve_region.extent.height, 1,
src_sample_count, 1, 1, 0, &src_image))
goto next;
Likewise.
if (!wined3d_context_vk_create_image(context_vk, vk_image_type, usage, vk_format,
resolve_region.extent.width, resolve_region.extent.height, 1,
VK_SAMPLE_COUNT_1_BIT, 1, 1, 0, &dst_image))
goto next;
Likewise.