mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-10 23:56:36 +08:00
Fix a bug in Graphics Allocations constructors.
- There was a wrong cast in Graphics Allocation constructor resulting in wrong GPU address generation in some sporadic scenarios. - Problem appears in 32 bit applications where void* address is cast to uint64_t value, if c style cast is used it makes trailing bit to be populated to higher bits constructing wrong value 0xf000000 is being casted to 0xfffffffff0000000 while it should be casted to 0x00000000f0000000 - added special cast function for further use. Change-Id: I56d53a8e13e17cbacd127566442eea3f6a089977
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -61,3 +61,7 @@ inline void patchWithRequiredSize(void *memoryToBePatched, uint32_t patchSize, u
|
||||
*curbeAddress = (uint32_t)patchValue;
|
||||
}
|
||||
}
|
||||
|
||||
inline uint64_t castToUint64(void *address) {
|
||||
return static_cast<uint64_t>(reinterpret_cast<uintptr_t>(address));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user