}
break;
case PIPE_QUERY_OCCLUSION_PREDICATE:
- assert(svga_have_vgpu10(svga));
- sq->svga_type = SVGA3D_QUERYTYPE_OCCLUSIONPREDICATE;
- define_query_vgpu10(svga, sq, sizeof(SVGADXOcclusionPredicateQueryResult));
+ if (svga_have_vgpu10(svga)) {
+ sq->svga_type = SVGA3D_QUERYTYPE_OCCLUSIONPREDICATE;
+ define_query_vgpu10(svga, sq, sizeof(SVGADXOcclusionPredicateQueryResult));
+ } else {
+ sq->svga_type = SVGA3D_QUERYTYPE_OCCLUSION;
+ define_query_vgpu9(svga, sq);
+ }
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
case PIPE_QUERY_PRIMITIVES_EMITTED:
switch (sq->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
if (svga_have_vgpu10(svga)) {
/* make sure to also destroy any associated predicate query */
if (sq->predicate)
}
sws->fence_reference(sws, &sq->fence, NULL);
break;
- case PIPE_QUERY_OCCLUSION_PREDICATE:
- assert(svga_have_vgpu10(svga));
- destroy_query_vgpu10(svga, sq);
- sws->fence_reference(sws, &sq->fence, NULL);
- break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
case PIPE_QUERY_PRIMITIVES_EMITTED:
case PIPE_QUERY_SO_STATISTICS:
switch (sq->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
if (svga_have_vgpu10(svga)) {
ret = begin_query_vgpu10(svga, sq);
/* also need to start the associated occlusion predicate query */
assert(ret == PIPE_OK);
(void) ret;
break;
- case PIPE_QUERY_OCCLUSION_PREDICATE:
- assert(svga_have_vgpu10(svga));
- ret = begin_query_vgpu10(svga, sq);
- assert(ret == PIPE_OK);
- break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
case PIPE_QUERY_PRIMITIVES_EMITTED:
case PIPE_QUERY_SO_STATISTICS:
switch (sq->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
+ case PIPE_QUERY_OCCLUSION_PREDICATE:
if (svga_have_vgpu10(svga)) {
ret = end_query_vgpu10(svga, sq);
/* also need to end the associated occlusion predicate query */
*/
svga_context_flush(svga, NULL);
break;
- case PIPE_QUERY_OCCLUSION_PREDICATE:
- assert(svga_have_vgpu10(svga));
- ret = end_query_vgpu10(svga, sq);
- assert(ret == PIPE_OK);
- break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
case PIPE_QUERY_PRIMITIVES_EMITTED:
case PIPE_QUERY_SO_STATISTICS:
}
break;
case PIPE_QUERY_OCCLUSION_PREDICATE: {
- SVGADXOcclusionPredicateQueryResult occResult;
- assert(svga_have_vgpu10(svga));
- ret = get_query_result_vgpu10(svga, sq, wait,
- (void *)&occResult, sizeof(occResult));
- vresult->b = occResult.anySamplesRendered != 0;
+ if (svga_have_vgpu10(svga)) {
+ SVGADXOcclusionPredicateQueryResult occResult;
+ ret = get_query_result_vgpu10(svga, sq, wait,
+ (void *)&occResult, sizeof(occResult));
+ vresult->b = occResult.anySamplesRendered != 0;
+ } else {
+ uint64_t count;
+ ret = get_query_result_vgpu9(svga, sq, wait, (uint64_t *)&count);
+ vresult->b = count != 0;
+ }
break;
}
case PIPE_QUERY_SO_STATISTICS: {