[PATCH vkd3d v2 1/2] vkd3d: Return success for all valid D3D12 alignments.

Henri Verbeet hverbeet at gmail.com
Tue Nov 26 06:23:57 CST 2019


On Tue, 26 Nov 2019 at 15:04, Conor McCarthy <cmccarthy at codeweavers.com> wrote:
> November 26, 2019 6:07 AM, "Henri Verbeet" <hverbeet at gmail.com> wrote:
> > On Mon, 25 Nov 2019 at 10:30, Conor McCarthy <cmccarthy at codeweavers.com> wrote:
> >> + estimated_size = vkd3d_format_is_compressed(format)
> >> + ? desc->Width * desc->Height * format->block_byte_count / (format->block_width *
> >> format->block_height)
> >> + : desc->Width * desc->Height * format->byte_count;
> >
> > That's not how size calculations for block-based formats work. See
> > e.g. vkd3d_format_copy_data(). It also seems this is a separate
> > change.
>
> How about this:
>     estimated_size = (desc->Height / format->block_height) * (desc->Width / format->block_width)
>             * format->byte_count * format->block_byte_count;
>
That will result in a 0 estimated size for textures with any dimension
smaller than the block size. That would be fine for e.g. a 1x1 texture
since the total size would be smaller than
D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT anyway, but note that that
would also affect textures that are e.g. very wide but only 1 pixel
tall.



More information about the wine-devel mailing list