hacking on more naked GL

This commit is contained in:
ZappoMan 2015-07-16 16:36:48 -07:00
parent 09430b6596
commit 069620b2d9
2 changed files with 17 additions and 13 deletions

View file

@ -80,6 +80,7 @@ void ApplicationOverlay::renderOverlay(RenderArgs* renderArgs) {
// Execute the batch into our framebuffer // Execute the batch into our framebuffer
gpu::Batch batch; gpu::Batch batch;
renderArgs->_batch = &batch;
// 1) bind the framebuffer // 1) bind the framebuffer
//_overlayFramebuffer->bind(); //_overlayFramebuffer->bind();
@ -113,13 +114,17 @@ void ApplicationOverlay::renderOverlay(RenderArgs* renderArgs) {
//_overlayFramebuffer->release(); // now we're done for later composition //_overlayFramebuffer->release(); // now we're done for later composition
batch.setFramebuffer(nullptr); batch.setFramebuffer(nullptr);
renderArgs->_context->syncCache();
renderArgs->_context->render(batch);
CHECK_GL_ERROR(); CHECK_GL_ERROR();
} }
void ApplicationOverlay::renderQmlUi(RenderArgs* renderArgs) { void ApplicationOverlay::renderQmlUi(RenderArgs* renderArgs) {
PROFILE_RANGE(__FUNCTION__); PROFILE_RANGE(__FUNCTION__);
if (_uiTexture) { if (_uiTexture) {
gpu::Batch batch; gpu::Batch& batch = *renderArgs->_batch;
auto geometryCache = DependencyManager::get<GeometryCache>(); auto geometryCache = DependencyManager::get<GeometryCache>();
geometryCache->useSimpleDrawPipeline(batch); geometryCache->useSimpleDrawPipeline(batch);
@ -130,15 +135,15 @@ void ApplicationOverlay::renderQmlUi(RenderArgs* renderArgs) {
geometryCache->renderUnitQuad(batch, glm::vec4(1)); geometryCache->renderUnitQuad(batch, glm::vec4(1));
renderArgs->_context->syncCache(); //renderArgs->_context->syncCache();
renderArgs->_context->render(batch); //renderArgs->_context->render(batch);
} }
} }
void ApplicationOverlay::renderOverlays(RenderArgs* renderArgs) { void ApplicationOverlay::renderOverlays(RenderArgs* renderArgs) {
PROFILE_RANGE(__FUNCTION__); PROFILE_RANGE(__FUNCTION__);
gpu::Batch batch; gpu::Batch& batch = *renderArgs->_batch;
auto geometryCache = DependencyManager::get<GeometryCache>(); auto geometryCache = DependencyManager::get<GeometryCache>();
geometryCache->useSimpleDrawPipeline(batch); geometryCache->useSimpleDrawPipeline(batch);
auto textureCache = DependencyManager::get<TextureCache>(); auto textureCache = DependencyManager::get<TextureCache>();
@ -163,8 +168,8 @@ void ApplicationOverlay::renderOverlays(RenderArgs* renderArgs) {
DependencyManager::get<AudioScope>()->render(renderArgs, width, height); DependencyManager::get<AudioScope>()->render(renderArgs, width, height);
} }
renderArgs->_context->syncCache(); //renderArgs->_context->syncCache();
renderArgs->_context->render(batch); //renderArgs->_context->render(batch);
} }
void ApplicationOverlay::renderRearViewToFbo(RenderArgs* renderArgs) { void ApplicationOverlay::renderRearViewToFbo(RenderArgs* renderArgs) {
@ -208,7 +213,7 @@ void ApplicationOverlay::renderDomainConnectionStatusBorder(RenderArgs* renderAr
}); });
auto nodeList = DependencyManager::get<NodeList>(); auto nodeList = DependencyManager::get<NodeList>();
if (nodeList && !nodeList->getDomainHandler().isConnected()) { if (nodeList && !nodeList->getDomainHandler().isConnected()) {
gpu::Batch batch; gpu::Batch& batch = *renderArgs->_batch;
auto geometryCache = DependencyManager::get<GeometryCache>(); auto geometryCache = DependencyManager::get<GeometryCache>();
geometryCache->useSimpleDrawPipeline(batch); geometryCache->useSimpleDrawPipeline(batch);
batch.setProjectionTransform(mat4()); batch.setProjectionTransform(mat4());
@ -223,8 +228,8 @@ void ApplicationOverlay::renderDomainConnectionStatusBorder(RenderArgs* renderAr
//batch.setModelTransform(glm::scale(mat4(), vec3(scaleAmount))); //batch.setModelTransform(glm::scale(mat4(), vec3(scaleAmount)));
geometryCache->renderVertices(batch, gpu::LINE_STRIP, _domainStatusBorder); geometryCache->renderVertices(batch, gpu::LINE_STRIP, _domainStatusBorder);
renderArgs->_context->syncCache(); //renderArgs->_context->syncCache();
renderArgs->_context->render(batch); //renderArgs->_context->render(batch);
} }
} }

View file

@ -98,8 +98,7 @@ void Overlays::cleanupOverlaysToDelete() {
void Overlays::renderHUD(RenderArgs* renderArgs) { void Overlays::renderHUD(RenderArgs* renderArgs) {
PROFILE_RANGE(__FUNCTION__); PROFILE_RANGE(__FUNCTION__);
QReadLocker lock(&_lock); QReadLocker lock(&_lock);
gpu::Batch batch; gpu::Batch& batch = *renderArgs->_batch;
renderArgs->_batch = &batch;
auto geometryCache = DependencyManager::get<GeometryCache>(); auto geometryCache = DependencyManager::get<GeometryCache>();
auto textureCache = DependencyManager::get<TextureCache>(); auto textureCache = DependencyManager::get<TextureCache>();
@ -121,8 +120,8 @@ void Overlays::renderHUD(RenderArgs* renderArgs) {
thisOverlay->render(renderArgs); thisOverlay->render(renderArgs);
} }
renderArgs->_context->syncCache(); //renderArgs->_context->syncCache();
renderArgs->_context->render(batch); //renderArgs->_context->render(batch);
} }
unsigned int Overlays::addOverlay(const QString& type, const QScriptValue& properties) { unsigned int Overlays::addOverlay(const QString& type, const QScriptValue& properties) {