Marek Olšák <mar...@gmail.com> writes: > This is adds a new driver function to retrieve the timestamp.
> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c > index a83d367..7a507ce 100644 > --- a/src/mesa/main/get.c > +++ b/src/mesa/main/get.c > @@ -1807,7 +1811,18 @@ find_custom_value(struct gl_context *ctx, const struct > value_desc *d, union valu > case GL_UNIFORM_BUFFER_BINDING: > v->value_int = ctx->UniformBuffer->Name; > break; > - } > + /* GL_ARB_timer_query */ > + case GL_TIMESTAMP: > + if (ctx->Driver.GetTimestamp) { > + /* Discard the last bit to convert it to a signed integer. */ > + v->value_int64 = > + ctx->Driver.GetTimestamp(ctx) & 0x7fffffffffffffffull; > + } Why wouldn't you just leave the top bit in place? Otherwise, the driver will have to truncate its query results to 63 bits and advertise 63 for QUERY_COUNTER_BITS as well, so that correspondence is maintained. .
pgp5GbxYw3Sm1.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev