mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
Add helpers to avoid offsetof usage
Change-Id: I8f0ec5240b2ec2bd99b712271d87b88ffed2c5b3 Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
74649d3f40
commit
e36d95e039
@@ -486,8 +486,7 @@ BlitProperties CommandQueueHw<GfxFamily>::processDispatchForBlitEnqueue(const Mu
|
||||
blitProperties.outputTimestampPacket = currentTimestampPacketNode;
|
||||
|
||||
if (isCacheFlushForBcsRequired()) {
|
||||
auto cacheFlushTimestampPacketGpuAddress = timestampPacketDependencies.cacheFlushNodes.peekNodes()[0]->getGpuAddress() +
|
||||
offsetof(TimestampPacketStorage, packets[0].contextEnd);
|
||||
auto cacheFlushTimestampPacketGpuAddress = TimestampPacketHelper::getContextEndGpuAddress(*timestampPacketDependencies.cacheFlushNodes.peekNodes()[0]);
|
||||
PipeControlArgs args(true);
|
||||
MemorySynchronizationCommands<GfxFamily>::addPipeControlAndProgramPostSyncOperation(
|
||||
commandStream,
|
||||
@@ -553,7 +552,7 @@ void CommandQueueHw<GfxFamily>::processDispatchForCacheFlush(Surface **surfaces,
|
||||
uint64_t postSyncAddress = 0;
|
||||
if (getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
|
||||
auto timestampPacketNodeForPostSync = timestampPacketContainer->peekNodes().at(0);
|
||||
postSyncAddress = timestampPacketNodeForPostSync->getGpuAddress() + offsetof(TimestampPacketStorage, packets[0].contextEnd);
|
||||
postSyncAddress = TimestampPacketHelper::getContextEndGpuAddress(*timestampPacketNodeForPostSync);
|
||||
}
|
||||
|
||||
submitCacheFlush(surfaces, numSurfaces, commandStream, postSyncAddress);
|
||||
|
||||
@@ -187,7 +187,7 @@ void GpgpuWalkerHelper<GfxFamily>::setupTimestampPacket(
|
||||
const RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
|
||||
if (TimestampPacketStorage::WriteOperationType::AfterWalker == writeOperationType) {
|
||||
uint64_t address = timestampPacketNode->getGpuAddress() + offsetof(TimestampPacketStorage, packets[0].contextEnd);
|
||||
uint64_t address = TimestampPacketHelper::getContextEndGpuAddress(*timestampPacketNode);
|
||||
PipeControlArgs args;
|
||||
MemorySynchronizationCommands<GfxFamily>::addPipeControlAndProgramPostSyncOperation(
|
||||
*cmdStream,
|
||||
|
||||
@@ -97,7 +97,7 @@ void HardwareInterface<GfxFamily>::dispatchWalker(
|
||||
uint64_t postSyncAddress = 0;
|
||||
if (commandQueue.getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
|
||||
auto timestampPacketNodeForPostSync = currentTimestampPacketNodes->peekNodes().at(currentDispatchIndex);
|
||||
postSyncAddress = timestampPacketNodeForPostSync->getGpuAddress() + offsetof(TimestampPacketStorage, packets[0].contextEnd);
|
||||
postSyncAddress = TimestampPacketHelper::getContextEndGpuAddress(*timestampPacketNodeForPostSync);
|
||||
}
|
||||
HardwareCommandsHelper<GfxFamily>::programCacheFlushAfterWalkerCommand(commandStream, commandQueue, mainKernel, postSyncAddress);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user