Repository navigation
Add Query API - #619
Add Query API#619haoxli wants to merge 1 commit into
Conversation
Add the definition of Query API and its requirements according to gpuweb#614. * Add extensions. * Define QuerySet, QuerySetDescriptor and QueryType. * Create QuerySet on GPU device. * Set query set in render pass descriptor for occlusion query. * Add separated begin/end method for occlusion query on render pass encoder. * Add begin/end method for pipeline statistics and timestamp queries on render pass encoder and compute pass encoder. * Resolve query result from query set on command encoder. * Add a new buffer usage for resolving query result.
| void setBlendColor(GPUColor color); | ||
| void setStencilReference(GPUStencilValue reference); | ||
|
|
||
| void beginOcclusionQuery(GPUSize32 queryIndex, boolean preciseOcclusion); |
There was a problem hiding this comment.
nit: preciseOcclusion = false
There was a problem hiding this comment.
Actually, I don't think we need this extra argument at all right now. We won't use it until we have an extension that needs it.
There was a problem hiding this comment.
hm... Never mind. I saw you added the extension string, but was thinking there was still more work to do on the API to add the extension (I didn't think about the fact that this is all there is).
| void beginQuery(GPUQuerySet querySet, GPUSize32 queryIndex); | ||
| void endQuery(GPUQuerySet querySet, GPUSize32 queryIndex); |
There was a problem hiding this comment.
Move to GPUProgrammablePassEncoder
| void beginQuery(GPUQuerySet querySet, GPUSize32 queryIndex); | ||
| void endQuery(GPUQuerySet querySet, GPUSize32 queryIndex); |
There was a problem hiding this comment.
Move to GPUProgrammablePassEncoder
| <script type=idl> | ||
| enum GPUQueryType { | ||
| "occlusion", | ||
| "pipelinestatistics", |
There was a problem hiding this comment.
| "pipelinestatistics", | |
| "pipeline-statistics", |
| GPUQueryType getQueryType(); | ||
| GPUSize32 getQueryCount(); |
There was a problem hiding this comment.
I don't think these are needed; they're just returning user provided values.
If we want them, they should be readonly attributes instead of methods.
There was a problem hiding this comment.
I've removed the getters in #656, will add them as internal attributes in spec. At beginning I want to get the size of query data by this method when resolving, instead of passing in a actual number.
| GPUQueryType getQueryType(); | ||
| GPUSize32 getQueryCount(); | ||
|
|
||
| void destroy(); |
There was a problem hiding this comment.
Is there a specific overhead of GPUQuerySets that means we want a destroy() method? We don't usually include them right now (we only have them on buffers and textures).
There was a problem hiding this comment.
I'm not sure if I understood correctly, QuerySet should be allocated in a continuous memory on GPU like buffers for storing query data, so I think it need the destory() method.
There was a problem hiding this comment.
I think that makes sense, though BindGroups also live in continuous memory on some backends but we don't put destroy() on them because they're small. QuerySets are probably typically a little larger.
|
I will splite this PR to small ones to make it merged easily. |
The plan mentioned a lot of test combination with indexed=true/false but this seems unnecessary since we already have different tests that check the "index" generation for indexed calls.
Add the definition of Query API and its requirements according to #614.
render pass encoder and compute pass encoder.
💥 Error: write EPROTO 140222018242432:error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version:../deps/openssl/openssl/ssl/s23_clnt.c:772:
💥 ###
PR Preview failed to build. (Last tried on Mar 17, 2020, 1:57 AM UTC).
More
PR Preview relies on a number of web services to run. There seems to be an issue with the following one:
🚨 HTML Diff Service - The HTML Diff Service is used to create HTML diffs of the spec changes suggested in a pull request.
🔗 Related URL
If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.