mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
Merge branch 'hasvk-unbreak-image-creation' into 'main'
hasvk: unbreak image creation See merge request mesa/mesa!39045
This commit is contained in:
commit
ccc6ec185b
2 changed files with 11 additions and 4 deletions
|
|
@ -48,7 +48,7 @@ vk_to_isl_surf_dim[] = {
|
||||||
static uint64_t MUST_CHECK UNUSED
|
static uint64_t MUST_CHECK UNUSED
|
||||||
memory_range_end(struct anv_image_memory_range memory_range)
|
memory_range_end(struct anv_image_memory_range memory_range)
|
||||||
{
|
{
|
||||||
assert(util_is_aligned(memory_range.offset, memory_range.alignment));
|
assert(anv_is_aligned(memory_range.offset, memory_range.alignment));
|
||||||
return memory_range.offset + memory_range.size;
|
return memory_range.offset + memory_range.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -131,7 +131,7 @@ image_binding_grow(const struct anv_device *device,
|
||||||
/* Offset must be validated because it comes from
|
/* Offset must be validated because it comes from
|
||||||
* VkImageDrmFormatModifierExplicitCreateInfoEXT.
|
* VkImageDrmFormatModifierExplicitCreateInfoEXT.
|
||||||
*/
|
*/
|
||||||
if (unlikely(!util_is_aligned(offset, alignment))) {
|
if (unlikely(!anv_is_aligned(offset, alignment))) {
|
||||||
return vk_errorf(device,
|
return vk_errorf(device,
|
||||||
VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT,
|
VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT,
|
||||||
"VkImageDrmFormatModifierExplicitCreateInfoEXT::"
|
"VkImageDrmFormatModifierExplicitCreateInfoEXT::"
|
||||||
|
|
@ -192,7 +192,7 @@ memory_range_merge(struct anv_image_memory_range *a,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
assert(a->offset == 0);
|
assert(a->offset == 0);
|
||||||
assert(util_is_aligned(b.offset, b.alignment));
|
assert(anv_is_aligned(b.offset, b.alignment));
|
||||||
|
|
||||||
a->alignment = MAX2(a->alignment, b.alignment);
|
a->alignment = MAX2(a->alignment, b.alignment);
|
||||||
a->size = MAX2(a->size, b.offset + b.size);
|
a->size = MAX2(a->size, b.offset + b.size);
|
||||||
|
|
@ -740,7 +740,7 @@ add_primary_surface(struct anv_device *device,
|
||||||
static bool MUST_CHECK
|
static bool MUST_CHECK
|
||||||
memory_range_is_aligned(struct anv_image_memory_range memory_range)
|
memory_range_is_aligned(struct anv_image_memory_range memory_range)
|
||||||
{
|
{
|
||||||
return util_is_aligned(memory_range.offset, memory_range.alignment);
|
return anv_is_aligned(memory_range.offset, memory_range.alignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool MUST_CHECK
|
static bool MUST_CHECK
|
||||||
|
|
|
||||||
|
|
@ -286,6 +286,13 @@ align_down_npot_u32(uint32_t v, uint32_t a)
|
||||||
return v - (v % a);
|
return v - (v % a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Alignment must be a power of 2. */
|
||||||
|
static inline bool
|
||||||
|
anv_is_aligned(uintmax_t n, uintmax_t a)
|
||||||
|
{
|
||||||
|
return a == 0 || util_is_aligned(n, a);
|
||||||
|
}
|
||||||
|
|
||||||
static inline union isl_color_value
|
static inline union isl_color_value
|
||||||
vk_to_isl_color(VkClearColorValue color)
|
vk_to_isl_color(VkClearColorValue color)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue