ANV_FENCE_TYPE_SYNCOBJ,
};
-enum anv_fence_state {
+enum anv_bo_fence_state {
/** Indicates that this is a new (or newly reset fence) */
- ANV_FENCE_STATE_RESET,
+ ANV_BO_FENCE_STATE_RESET,
/** Indicates that this fence has been submitted to the GPU but is still
* (as far as we know) in use by the GPU.
*/
- ANV_FENCE_STATE_SUBMITTED,
+ ANV_BO_FENCE_STATE_SUBMITTED,
- ANV_FENCE_STATE_SIGNALED,
+ ANV_BO_FENCE_STATE_SIGNALED,
};
struct anv_fence_impl {
*/
struct {
struct anv_bo bo;
- enum anv_fence_state state;
+ enum anv_bo_fence_state state;
} bo;
};
};
return result;
if (pCreateInfo->flags & VK_FENCE_CREATE_SIGNALED_BIT) {
- fence->permanent.bo.state = ANV_FENCE_STATE_SIGNALED;
+ fence->permanent.bo.state = ANV_BO_FENCE_STATE_SIGNALED;
} else {
- fence->permanent.bo.state = ANV_FENCE_STATE_RESET;
+ fence->permanent.bo.state = ANV_BO_FENCE_STATE_RESET;
}
*pFence = anv_fence_to_handle(fence);
switch (impl->type) {
case ANV_FENCE_TYPE_BO:
- impl->bo.state = ANV_FENCE_STATE_RESET;
+ impl->bo.state = ANV_BO_FENCE_STATE_RESET;
break;
default:
switch (impl->type) {
case ANV_FENCE_TYPE_BO:
switch (impl->bo.state) {
- case ANV_FENCE_STATE_RESET:
+ case ANV_BO_FENCE_STATE_RESET:
/* If it hasn't even been sent off to the GPU yet, it's not ready */
return VK_NOT_READY;
- case ANV_FENCE_STATE_SIGNALED:
+ case ANV_BO_FENCE_STATE_SIGNALED:
/* It's been signaled, return success */
return VK_SUCCESS;
- case ANV_FENCE_STATE_SUBMITTED: {
+ case ANV_BO_FENCE_STATE_SUBMITTED: {
VkResult result = anv_device_bo_busy(device, &impl->bo.bo);
if (result == VK_SUCCESS) {
- impl->bo.state = ANV_FENCE_STATE_SIGNALED;
+ impl->bo.state = ANV_BO_FENCE_STATE_SIGNALED;
return VK_SUCCESS;
} else {
return result;
struct anv_fence_impl *impl = &fence->permanent;
switch (impl->bo.state) {
- case ANV_FENCE_STATE_RESET:
+ case ANV_BO_FENCE_STATE_RESET:
/* This fence hasn't been submitted yet, we'll catch it the next
* time around. Yes, this may mean we dead-loop but, short of
* lots of locking and a condition variable, there's not much that
pending_fences++;
continue;
- case ANV_FENCE_STATE_SIGNALED:
+ case ANV_BO_FENCE_STATE_SIGNALED:
/* This fence is not pending. If waitAll isn't set, we can return
* early. Otherwise, we have to keep going.
*/
}
continue;
- case ANV_FENCE_STATE_SUBMITTED:
+ case ANV_BO_FENCE_STATE_SUBMITTED:
/* These are the fences we really care about. Go ahead and wait
* on it until we hit a timeout.
*/
result = anv_device_wait(device, &impl->bo.bo, timeout);
switch (result) {
case VK_SUCCESS:
- impl->bo.state = ANV_FENCE_STATE_SIGNALED;
+ impl->bo.state = ANV_BO_FENCE_STATE_SIGNALED;
signaled_fences = true;
if (!waitAll)
goto done;
uint32_t now_pending_fences = 0;
for (uint32_t i = 0; i < fenceCount; i++) {
ANV_FROM_HANDLE(anv_fence, fence, pFences[i]);
- if (fence->permanent.bo.state == ANV_FENCE_STATE_RESET)
+ if (fence->permanent.bo.state == ANV_BO_FENCE_STATE_RESET)
now_pending_fences++;
}
assert(now_pending_fences <= pending_fences);