Skip to content

Commit

Permalink
Fix 64-bit atomic operations for 32-bit CTS
Browse files Browse the repository at this point in the history
In 32-bit CTS versions size_t have 32 bit width.

Fix tests:
 - dEQP-VK.image.atomic_operations.compare_exchange.*64*intermediate_values

Affect tests:
 - dEQP-VK.image.atomic_operations.*

VK-GL-CTS issue: 5209

Components: Vulkan

Change-Id: I9b227558d08f505f9e29e6b3f838b0387be16b58
  • Loading branch information
archimedus authored and lordalcol committed Aug 1, 2024
1 parent 83f79c8 commit 5f1eb99
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ class Half
Half(int value) : Half((float)value)
{
}
Half(size_t value) : Half((float)value)
Half(uint32_t value) : Half((float)value)
{
}
Half(uint64_t value) : Half((float)value)
{
}
Half() : Half(0)
Expand Down Expand Up @@ -179,7 +182,10 @@ class F16Vec2 : public tcu::Vector<Half, 2>
F16Vec2(int i) : F16Vec2((float)i)
{
}
F16Vec2(size_t i) : F16Vec2((float)i)
F16Vec2(uint32_t i) : F16Vec2((float)i)
{
}
F16Vec2(uint64_t i) : F16Vec2((float)i)
{
}
F16Vec2(float f) : F16Vec2(f, f)
Expand Down Expand Up @@ -211,7 +217,10 @@ class F16Vec4 : public tcu::Vector<Half, 4>
F16Vec4(int i) : F16Vec4((float)i)
{
}
F16Vec4(size_t i) : F16Vec4((float)i)
F16Vec4(uint32_t i) : F16Vec4((float)i)
{
}
F16Vec4(uint64_t i) : F16Vec4((float)i)
{
}
F16Vec4(float f) : F16Vec4(f, f, f, f)
Expand Down Expand Up @@ -772,7 +781,7 @@ static T computeBinaryAtomicOperationResult(const AtomicOperation op, const T a,
return b;
case ATOMIC_OPERATION_COMPARE_EXCHANGE:
{
constexpr size_t val = (size_t)(sizeof(T) == 8 ? 0xBEFFFFFF18 : 18);
constexpr uint64_t val = (uint64_t)(sizeof(T) == 8 ? 0xBEFFFFFF18 : 18);
return (a == T(val)) ? b : a;
}
default:
Expand Down

0 comments on commit 5f1eb99

Please sign in to comment.