November 26, 2019 6:07 AM, "Henri Verbeet" <hverbeet(a)gmail.com> wrote:
On Mon, 25 Nov 2019 at 10:30, Conor McCarthy <cmccarthy(a)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?
Speculative, so I can remove it, which would enable complete validation to occur in d3d12_resource_validate_desc() instead. Dimensions of block compressed textures are currently not validated either, nor are some combinations of flags with other options.
+ 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; Conor