cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

cameni
Journeyman III

glGetInteger64v(GL_TIMESTAMP, ...) still broken on Vega

In old drivers there was a bug in getting the current GPU time on Vega GPUs, as described also here:

glGetInteger64v(GL_TIMESTAMP, ...) broken on Vega 

This was fixed in later drivers, but the behavior is still not correct. Using the following code fragment:

//create a query object
GLuint qry;
glGenQueries(1, &qry);

//get current GPU time on the CPU, synchronous call
GLint64 vcpu;
glGetInteger64v(GL_TIMESTAMP, &vcpu);

//push a timestamp query
glQueryCounter(qry, GL_TIMESTAMP);

//fetch the timestamp value immediately
//normally this would be done only later after a fence, but the bug shows this way too
GLuint64 v;
glGetQueryObjectui64v(qry, GL_QUERY_RESULT, &v);

//this fails on Vega, (19.10.1 checked)
assert(v >= vcpu);‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Note this technique is used to measure pipeline latency and is described also in OpenGL Superbible by Graham Sellers.
The time returned by the glGetInteger64v(GL_TIMESTAMP, ...) call should be lower than the time when the later query has been executed.

0 Likes
2 Replies
cameni
Journeyman III

Can someone please move this topic OpenGL/Vulkan?

Also, I have previous posts in OpenGL and GPU tools boards since 2008, I'd be glad if someone whitelisted me so I can get rid of this newly acquired newcomer status

Cheers

0 Likes

I've whitelisted you and moved this post to OpenGL forum.

Thanks.

0 Likes