diff --git a/rocclr/device/blit.cpp b/rocclr/device/blit.cpp index 2798ff9719..4bd854219f 100644 --- a/rocclr/device/blit.cpp +++ b/rocclr/device/blit.cpp @@ -678,15 +678,15 @@ uint32_t HostBlitManager::sRGBmap(float fc) const { return (uint32_t)(c * 255.0 + 0.5); } -bool HostBlitManager::FillBufferInfo::ExpandPattern64(size_t pattern, size_t pattern_size, - size_t& pattern64) { +bool HostBlitManager::FillBufferInfo::ExpandPattern64(uint64_t pattern, size_t pattern_size, + uint64_t& pattern64) { bool retval = true; do { // If the pattern is 0 or if the pattern_size is same as max size. - if (pattern == 0 || pattern_size == sizeof(size_t)) { + if (pattern == 0 || pattern_size == sizeof(uint64_t)) { pattern64 = pattern; break; } @@ -696,7 +696,7 @@ bool HostBlitManager::FillBufferInfo::ExpandPattern64(size_t pattern, size_t pat pattern64 = 0; if (pattern_size == sizeof(uint8_t)) { - pattern64 = pattern & 0xff; + pattern = pattern & 0xff; pattern64 = ((pattern << 56) | (pattern << 48) | (pattern << 40) | (pattern << 32) | (pattern << 24) | (pattern << 16) | (pattern << 8) | (pattern)); } else if (pattern_size == sizeof(uint16_t)) { @@ -737,8 +737,8 @@ bool HostBlitManager::FillBufferInfo::PackInfo(const device::Memory& memory, siz size_t tail_size = (fill_size - head_size) % sizeof(size_t); // 4. Clear unwanted bytes from the pattern if the pattern size is < sizeof(size_t). - size_t pattern = *(reinterpret_cast(const_cast(pattern_ptr))); - if (pattern_size < sizeof(size_t)) { + uint64_t pattern = *(reinterpret_cast(const_cast(pattern_ptr))); + if (pattern_size < sizeof(uint64_t)) { ClearBits64(pattern, (pattern_size * 8)); } @@ -757,7 +757,7 @@ bool HostBlitManager::FillBufferInfo::PackInfo(const device::Memory& memory, siz // Offsetted ptrs should align with pattern size. Runtime not responsible for rotating pattern. guarantee((aligned_size % pattern_size) == 0, "Offseted ptr should align with pattern_size"); - if (pattern_size < sizeof(size_t)) { + if (pattern_size < sizeof(uint64_t)) { if (!ExpandPattern64(pattern, pattern_size, fill_info.expanded_pattern_)) { DevLogPrintfError("Failed Expanding the pattern for pattern:%u, pattern_size: %u", pattern, pattern_size); diff --git a/rocclr/device/blit.hpp b/rocclr/device/blit.hpp index fce6f503ef..d9ac765550 100644 --- a/rocclr/device/blit.hpp +++ b/rocclr/device/blit.hpp @@ -361,10 +361,10 @@ class HostBlitManager : public device::BlitManager { std::vector& packed_info); private: - static bool ExpandPattern64(size_t pattern, size_t pattern_size, size_t& pattern64); + static bool ExpandPattern64(uint64_t pattern, size_t pattern_size, uint64_t& pattern64); - static inline void ClearBits64(size_t& pattern, size_t num_bits) { - pattern &= ~(~(static_cast(0)) << num_bits); + static inline void ClearBits64(uint64_t& pattern, uint64_t num_bits) { + pattern &= ~(~(static_cast(0)) << num_bits); } @@ -376,7 +376,7 @@ class HostBlitManager : public device::BlitManager { public: size_t fill_size_; // Fill size for this command - size_t expanded_pattern_; // Pattern for this command + uint64_t expanded_pattern_; // Pattern for this command bool pattern_expanded_; // Boolean to check if pattern is expanded };