IDirect3DQuery9 occasionally returns incorrect results.

Discussion created by billw2012 on Sep 27, 2011
Latest reply on Sep 29, 2011 by billw2012

Title pretty much sums it up. About 1 time out of 30 it returns a totally incorrect result. Our query method works like so:

1) Draw 4 screen space rects at 0 depth to cover all but 1 pixel of the viewport. This effectively blocks rendering of anything else when z test is turned on except for that one pixel area.

2) Draw the whole scene, depth only. This fills the depth buffer with final values.

3) Draw the whole scene again, with z func set to Z_EQUAL and queries around each set of draw primitive calls we want to test. The queries should return a 1 for the foremost object that is visible through the 1 pixel window.

It works most of the time, but seemingly at random will return erroneous results. 

If it helps with diagnosis, this problem is much worse on 6850 card than on 4850. On the 4850 a reset of the machine will cause the problem to abate for a while, until it slowly creeps back in. On a 6850 restarting doesn't help.

It seems to like to return 23975 for the erroneous query result. Resizing the viewport and changing the camera position/distance from geometry don't effect this. 90% of the time it returns this value. I can't think of any error we could be making that would consistently return this result even under viewport and camera transform.

This code works fine on all our nVidia cards, so we are fairly confident it is a driver problem, or at least a driver difference.


P.S. I really don't have time to make a full reproducible example of this, but if you want more info or code samples I can provide them.


Win7 64bit.



Driver Packaging Version 8.881-110728a-124445C-ATI

Catalyst Version 11.8

Provider ATI Technologies Inc.

2D Driver Version

2D Driver File Path /REGISTRY/MACHINE/SYSTEM/ControlSet001/Control/CLASS/{4D36E968-E325-11CE-BFC1-08002BE10318}/0001

Direct3D Version

OpenGL Version

Catalyst Control Center Version 2011.0728.1756.30366

AMD Audio Driver Version

Primary Adapter
Graphics Card Manufacturer Powered by AMD
Graphics Chipset AMD Radeon HD 6800 Series
Device ID 6739
Vendor 1002
Subsystem ID 3110
Subsystem Vendor ID 1682
Graphics Bus Capability PCI Express 2.0
Maximum Bus Setting PCI Express 2.0 x16
BIOS Version
BIOS Part Number 113-HD685ZNF63.SB
BIOS Date 2010/10/28
Memory Size 1024 MB
Memory Type GDDR5
Core Clock in MHz 775 MHz
Memory Clock in MHz 1000 MHz
Total Memory Bandwidth in GByte/s 128.0 GByte/s