GL_QUERY_RESULT_AVAILABLE_EXT calls disable, as on PowerVR SGX / iOS, glGetQueryObjectuivEXT seems to be blocking. (Will need to change to asynchronous logic in the future to maintain performance and follow the "spec")
This commit is contained in:
@@ -286,10 +286,12 @@ void KRLight::render(KRCamera *pCamera, std::vector<KRLight *> &lights, const KR
|
||||
if(m_flareTexture.size() && m_flareSize > 0.0f) {
|
||||
|
||||
if(m_occlusionQuery) {
|
||||
/*
|
||||
GLuint hasBeenTested = 0;
|
||||
while(!hasBeenTested) {
|
||||
GLDEBUG(glGetQueryObjectuivEXT(m_occlusionQuery, GL_QUERY_RESULT_AVAILABLE_EXT, &hasBeenTested)); // FINDME, HACK!! This needs to be replaced with asynchonous logic
|
||||
}
|
||||
*/
|
||||
GLuint params = 0;
|
||||
GLDEBUG(glGetQueryObjectuivEXT(m_occlusionQuery, GL_QUERY_RESULT_EXT, ¶ms));
|
||||
GLDEBUG(glDeleteQueriesEXT(1, &m_occlusionQuery));
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include "KRPointLight.h"
|
||||
#include "KRQuaternion.h"
|
||||
|
||||
const long KRENGINE_OCCLUSION_TEST_EXPIRY = 60;
|
||||
const long KRENGINE_OCCLUSION_TEST_EXPIRY = 10;
|
||||
|
||||
KRScene::KRScene(KRContext &context, std::string name) : KRResource(context, name) {
|
||||
m_pFirstLight = NULL;
|
||||
@@ -165,10 +165,17 @@ void KRScene::render(KROctreeNode *pOctreeNode, std::map<KRAABB, int> &visibleBo
|
||||
if(bOcclusionResultsPass) {
|
||||
// ----====---- Occlusion results pass ----====----
|
||||
if(pOctreeNode->m_occlusionTested) {
|
||||
/*
|
||||
GLuint hasBeenTested = 0;
|
||||
int c =0;
|
||||
while(!hasBeenTested) {
|
||||
GLDEBUG(glGetQueryObjectuivEXT(pOctreeNode->m_occlusionQuery, GL_QUERY_RESULT_AVAILABLE_EXT, &hasBeenTested)); // FINDME, HACK!! This needs to be replaced with asynchonous logic
|
||||
c++;
|
||||
}
|
||||
if(c > 1) {
|
||||
fprintf(stderr, "GL_QUERY_RESULT_AVAILABLE_EXT count = %i\n", c);
|
||||
}
|
||||
*/
|
||||
|
||||
GLuint params = 0;
|
||||
GLDEBUG(glGetQueryObjectuivEXT(pOctreeNode->m_occlusionQuery, GL_QUERY_RESULT_EXT, ¶ms));
|
||||
@@ -282,6 +289,7 @@ void KRScene::render(KROctreeNode *pOctreeNode, std::map<KRAABB, int> &visibleBo
|
||||
|
||||
if(getContext().getShaderManager()->selectShader("occlusion_test", *pCamera, lights, 0, viewport, matModel, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, KRNode::RENDER_PASS_FORWARD_TRANSPARENT)) {
|
||||
GLDEBUG(glDrawArrays(GL_TRIANGLE_STRIP, 0, 14));
|
||||
m_pContext->getModelManager()->log_draw_call(renderPass, "octree", "occlusion_test", 14);
|
||||
}
|
||||
|
||||
if(renderPass == KRNode::RENDER_PASS_FORWARD_OPAQUE ||
|
||||
|
||||
Reference in New Issue
Block a user