Compare commits

...

2 Commits

Author SHA1 Message Date
Joshua Ashton 4a7686d5dc
vkd3d: Fix out of range in UpdateTileMappings
Previously this incremented and indexed before the loop checked this.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-16 18:24:40 +00:00
Joshua Ashton fd466058f0
vkd3d: Align d3d12_rtv_desc to D3D12_DESC_ALIGNMENT
Otherwise we can do an alligned_malloc with a non-aligned size as the descriptor size is 48 for a d3d12_rtv_desc otherwise.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-16 18:01:14 +00:00
2 changed files with 20 additions and 13 deletions

View File

@ -8911,6 +8911,24 @@ static void STDMETHODCALLTYPE d3d12_command_queue_UpdateTileMappings(ID3D12Comma
while (region_idx < region_count && range_idx < range_count)
{
if (range_tile == range_size)
{
if (range_flags)
range_flag = range_flags[range_idx];
range_size = range_tile_counts[range_idx];
range_offset = heap_range_offsets[range_idx];
}
if (region_tile == region_size.NumTiles)
{
if (region_coords)
region_coord = region_coords[region_idx];
if (region_sizes)
region_size = region_sizes[region_idx];
}
if (range_flag != D3D12_TILE_RANGE_FLAG_SKIP)
{
unsigned int tile_index = vkd3d_get_tile_index_from_region(sparse, &region_coord, &region_size, region_tile);
@ -8950,24 +8968,12 @@ static void STDMETHODCALLTYPE d3d12_command_queue_UpdateTileMappings(ID3D12Comma
{
range_idx += 1;
range_tile = 0;
if (range_flags)
range_flag = range_flags[range_idx];
range_size = range_tile_counts[range_idx];
range_offset = heap_range_offsets[range_idx];
}
if (++region_tile == region_size.NumTiles)
{
region_idx += 1;
region_tile = 0;
if (region_coords)
region_coord = region_coords[region_idx];
if (region_sizes)
region_size = region_sizes[region_idx];
}
}

View File

@ -1016,7 +1016,7 @@ HRESULT d3d12_create_static_sampler(struct d3d12_device *device,
struct d3d12_rtv_desc
{
VkSampleCountFlagBits sample_count;
DECLSPEC_ALIGN(D3D12_DESC_ALIGNMENT) VkSampleCountFlagBits sample_count;
const struct vkd3d_format *format;
unsigned int width;
unsigned int height;
@ -1024,6 +1024,7 @@ struct d3d12_rtv_desc
struct vkd3d_view *view;
struct d3d12_resource *resource;
};
STATIC_ASSERT(sizeof(struct d3d12_rtv_desc) == 64);
void d3d12_rtv_desc_copy(struct d3d12_rtv_desc *dst, struct d3d12_rtv_desc *src, unsigned int count);