From: "Conor McCarthy" Subject: Re: [PATCH vkd3d v2 1/2] vkd3d: Return success for all valid D3D12 alignments. Message-Id: <749d54c8278ec0d4a1f1e2478389ba36@codeweavers.com> Date: Tue, 26 Nov 2019 11:34:28 +0000 In-Reply-To: References: <20191125065944.13942-1-cmccarthy@codeweavers.com> November 26, 2019 6:07 AM, "Henri Verbeet" wrote: > On Mon, 25 Nov 2019 at 10:30, Conor McCarthy 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