[PATCH 1/2] wined3d: Support stretching compressed format surfaces in surface_cpu_blt().

Henri Verbeet hverbeet at gmail.com
Mon Dec 2 06:59:10 CST 2019


On Fri, 29 Nov 2019 at 17:58, Paul Gofman <gofmanp at gmail.com> wrote:
>  release:
> -    wined3d_context_unmap_bo_address(context, &dst_data, 0, 1, &dst_range);
> +    if (upload)
> +    {
> +        struct wined3d_bo_address data;
> +
> +        data.buffer_object = 0;
> +        data.addr = dst_map.data;
> +
> +        texture_level = dst_sub_resource_idx % dst_texture->level_count;
> +
> +        wined3d_texture_prepare_location(dst_texture, texture_level, context, WINED3D_LOCATION_TEXTURE_RGB);
> +        dst_texture->texture_ops->texture_upload_data(context, wined3d_const_bo_address(&data), dst_format,
> +                dst_box, dst_map.row_pitch, dst_map.slice_pitch, dst_texture, texture_level,
> +                WINED3D_LOCATION_TEXTURE_RGB, dst_box->left, dst_box->top, 0);
> +
> +        wined3d_texture_validate_location(dst_texture, texture_level, WINED3D_LOCATION_TEXTURE_RGB);
> +        wined3d_texture_invalidate_location(dst_texture, texture_level, ~WINED3D_LOCATION_TEXTURE_RGB);
> +
> +        heap_free(dst_map.data);
> +    }
> +    else
> +    {
> +        wined3d_context_unmap_bo_address(context, &dst_data, 0, 1, &dst_range);
> +    }
> +
>
It probably works out in practice because we only jump to "release:"
from error paths when "upload" is FALSE, but it doesn't seem right to
depend on that. I.e., we should probably explicitly check for success
before uploading here.



More information about the wine-devel mailing list