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

Henri Verbeet hverbeet at gmail.com
Mon Nov 25 14:07:25 CST 2019


On Mon, 25 Nov 2019 at 10:30, Conor McCarthy <cmccarthy at codeweavers.com> wrote:
> +        if (requested_alignment != D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT)
> +            goto invalid;
Should this be in d3d12_resource_validate_desc() instead? Likewise for images.

> +        /* Validate the alignment in the resource description. Also allow the Vulkan alignment in case the caller
> +         * specifies it in future calls.
Did you observe that happening, or is this speculative?

> +            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.

> -    if (desc->SampleDesc.Count != 1)
> -        info->Alignment = D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT;
> -    else
> -        info->Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
> +    /* Theoretically we should return D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT if
> +     * (desc->SampleDesc.Count != 1 && !device->feature_options4.MSAA64KBAlignedTextureSupported)
> +     * but Vulkan has no such requirement and it may prove unnecessary. */
> +    info->Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
>
Separate change?



More information about the wine-devel mailing list