Skip to content

Commit

Permalink
Vulkan: Fix the unit test failure due to nil query pool object (#2034)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qining authored Jul 4, 2018
1 parent 015842f commit 509d46a
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions gapis/api/vulkan/api/query_pool.api
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ cmd VkResult vkGetQueryPoolResults(

sub void dovkCmdBeginQuery(ref!vkCmdBeginQueryArgs args) {
pool := QueryPools[args.QueryPool]
pool.Status[args.Query] = QUERY_STATUS_ACTIVE
pool.LastBoundQueue = LastBoundQueue
if pool != null {
pool.Status[args.Query] = QUERY_STATUS_ACTIVE
pool.LastBoundQueue = LastBoundQueue
}
}

@threadSafety("app")
Expand Down Expand Up @@ -164,8 +166,10 @@ vkCmdEndQueryArgs {

sub void dovkCmdEndQuery(ref!vkCmdEndQueryArgs args) {
pool := QueryPools[args.QueryPool]
pool.Status[args.Query] = QUERY_STATUS_COMPLETE
pool.LastBoundQueue = LastBoundQueue
if pool != null {
pool.Status[args.Query] = QUERY_STATUS_COMPLETE
pool.LastBoundQueue = LastBoundQueue
}
}

@threadSafety("app")
Expand Down Expand Up @@ -196,10 +200,12 @@ vkCmdResetQueryPoolArgs {

sub void dovkCmdResetQueryPool(ref!vkCmdResetQueryPoolArgs args) {
pool := QueryPools[args.QueryPool]
for i in (0 .. args.QueryCount) {
pool.Status[args.FirstQuery + i] = QUERY_STATUS_INACTIVE
if pool != null {
for i in (0 .. args.QueryCount) {
pool.Status[args.FirstQuery + i] = QUERY_STATUS_INACTIVE
}
pool.LastBoundQueue = LastBoundQueue
}
pool.LastBoundQueue = LastBoundQueue
}

@threadSafety("app")
Expand Down Expand Up @@ -230,7 +236,9 @@ cmd void vkCmdResetQueryPool(

sub void dovkCmdWriteTimestamp(ref!vkCmdWriteTimestampArgs args) {
pool := QueryPools[args.QueryPool]
pool.LastBoundQueue = LastBoundQueue
if pool != null {
pool.LastBoundQueue = LastBoundQueue
}
}

@threadSafety("app")
Expand Down Expand Up @@ -266,7 +274,9 @@ class vkCmdCopyQueryPoolResultsArgs {

sub void dovkCmdCopyQueryPoolResults(ref!vkCmdCopyQueryPoolResultsArgs args) {
pool := QueryPools[args.QueryPool]
pool.LastBoundQueue = LastBoundQueue
if pool != null {
pool.LastBoundQueue = LastBoundQueue
}
}

@threadSafety("app")
Expand Down

0 comments on commit 509d46a

Please sign in to comment.