mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
changing the cpu timer of the batch to std::chrono instead of using gl cpu time stamp
This commit is contained in:
parent
b184ad1334
commit
5e76a0c6d7
3 changed files with 9 additions and 6 deletions
|
@ -32,7 +32,8 @@ void GLBackend::do_beginQuery(const Batch& batch, size_t paramOffset) {
|
|||
PROFILE_RANGE_BEGIN(render_gpu_gl_detail, glquery->_profileRangeId, query->getName().c_str(), 0xFFFF7F00);
|
||||
|
||||
++_queryStage._rangeQueryDepth;
|
||||
glGetInteger64v(GL_TIMESTAMP, (GLint64*)&glquery->_batchElapsedTime);
|
||||
glquery->_batchElapsedTimeBegin = std::chrono::high_resolution_clock::now();
|
||||
// glGetInteger64v(GL_TIMESTAMP, (GLint64*)&glquery->_batchElapsedTime);
|
||||
|
||||
if (timeElapsed) {
|
||||
if (_queryStage._rangeQueryDepth <= MAX_RANGE_QUERY_DEPTH) {
|
||||
|
@ -61,9 +62,10 @@ void GLBackend::do_endQuery(const Batch& batch, size_t paramOffset) {
|
|||
}
|
||||
|
||||
--_queryStage._rangeQueryDepth;
|
||||
GLint64 now;
|
||||
glGetInteger64v(GL_TIMESTAMP, &now);
|
||||
glquery->_batchElapsedTime = now - glquery->_batchElapsedTime;
|
||||
// GLint64 now;
|
||||
// glGetInteger64v(GL_TIMESTAMP, &now);
|
||||
auto duration_ns = (std::chrono::high_resolution_clock::now() - glquery->_batchElapsedTimeBegin);
|
||||
glquery->_batchElapsedTime = duration_ns.count();
|
||||
|
||||
PROFILE_RANGE_END(render_gpu_gl_detail, glquery->_profileRangeId);
|
||||
|
||||
|
|
|
@ -48,7 +48,8 @@ public:
|
|||
const GLuint& _endqo = { _id };
|
||||
const GLuint _beginqo = { 0 };
|
||||
GLuint64 _result { (GLuint64)-1 };
|
||||
GLuint64 _batchElapsedTime { (GLuint64) 0 };
|
||||
GLuint64 _batchElapsedTime{ (GLuint64)0 };
|
||||
std::chrono::high_resolution_clock::time_point _batchElapsedTimeBegin;
|
||||
uint64_t _profileRangeId { 0 };
|
||||
uint32_t _rangeQueryDepth { 0 };
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ GLuint GL45Backend::getBufferID(const Buffer& buffer) {
|
|||
}
|
||||
|
||||
GLuint GL45Backend::getBufferIDUnsynced(const Buffer& buffer) {
|
||||
return GL45Buffer::getIdUnsynced<GL45Buffer>(*this, buffer);
|
||||
return GLBuffer::getIdUnsynced<GL45Buffer>(*this, buffer);
|
||||
}
|
||||
|
||||
GLBuffer* GL45Backend::syncGPUObject(const Buffer& buffer) {
|
||||
|
|
Loading…
Reference in a new issue