P4 to Git Change 2053967 by gandryey@gera-win10 on 2020/01/08 17:30:34

SWDEV-79445 - OCL generic changes and code clean-up
	- Propagate the error if flush() failed

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#159 edit
Cette révision appartient à :
foreman
2020-01-08 17:36:14 -05:00
Parent bc91a60139
révision 7bca33c5fb
+15 -7
Voir le fichier
@@ -314,12 +314,6 @@ void VirtualGPU::Queue::addCmdDoppRef(Pal::IGpuMemory* iMem, bool lastDoppCmd, b
}
bool VirtualGPU::Queue::flush() {
// Stop commands building
if (Pal::Result::Success != iCmdBuffs_[cmdBufIdSlot_]->End()) {
LogError("PAL failed to finalize a command buffer!");
return false;
}
if (palMemRefs_.size() != 0) {
if (Pal::Result::Success !=
iDev_->AddGpuMemoryReferences(palMemRefs_.size(), &palMemRefs_[0], iQueue_,
@@ -330,6 +324,12 @@ bool VirtualGPU::Queue::flush() {
palMemRefs_.clear();
}
// Stop commands building
if (Pal::Result::Success != iCmdBuffs_[cmdBufIdSlot_]->End()) {
LogError("PAL failed to finalize a command buffer!");
return false;
}
// Reset the fence. PAL will reset OS event
if (Pal::Result::Success != iDev_->ResetFences(1, &iCmdFences_[cmdBufIdSlot_])) {
LogError("PAL failed to reset a fence!");
@@ -430,6 +430,11 @@ bool VirtualGPU::Queue::waitForEvent(uint id) {
return true;
}
if (id == cmdBufIdCurrent_) {
// There is an error in the flush() and wait is bogus
return false;
}
uint slotId = id % max_command_buffers_;
constexpr bool IbReuse = true;
bool result = waifForFence<!IbReuse>(slotId);
@@ -444,7 +449,10 @@ bool VirtualGPU::Queue::isDone(uint id) {
if (id == cmdBufIdCurrent_) {
// Flush the current command buffer
flush();
if (!flush()) {
// If flush failed, then exit earlier...
return false;
}
}
if (Pal::Result::Success != iCmdFences_[id % max_command_buffers_]->GetStatus()) {