summaryrefslogtreecommitdiffstats
path: root/src/render/backend/resourceaccessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/backend/resourceaccessor.cpp')
-rw-r--r--src/render/backend/resourceaccessor.cpp114
1 files changed, 56 insertions, 58 deletions
diff --git a/src/render/backend/resourceaccessor.cpp b/src/render/backend/resourceaccessor.cpp
index 4f70df436..af19546b7 100644
--- a/src/render/backend/resourceaccessor.cpp
+++ b/src/render/backend/resourceaccessor.cpp
@@ -42,9 +42,7 @@
#include <private/nodemanagers_p.h>
#include <private/texture_p.h>
#include <private/rendertargetoutput_p.h>
-#include <private/gltexturemanager_p.h>
#include <private/managers_p.h>
-#include <private/gltexture_p.h>
#include <QtCore/qmutex.h>
@@ -59,10 +57,10 @@ RenderBackendResourceAccessor::~RenderBackendResourceAccessor()
}
ResourceAccessor::ResourceAccessor(NodeManagers *mgr)
- : m_glTextureManager(mgr->glTextureManager())
- , m_textureManager(mgr->textureManager())
- , m_attachmentManager(mgr->attachmentManager())
- , m_entityManager(mgr->renderNodesManager())
+// : m_glTextureManager(mgr->glTextureManager())
+// , m_textureManager(mgr->textureManager())
+// , m_attachmentManager(mgr->attachmentManager())
+// , m_entityManager(mgr->renderNodesManager())
{
}
@@ -70,58 +68,58 @@ ResourceAccessor::ResourceAccessor(NodeManagers *mgr)
// called by render plugins from arbitrary thread
bool ResourceAccessor::accessResource(ResourceType type, Qt3DCore::QNodeId nodeId, void **handle, QMutex **lock)
{
- switch (type) {
-
- case RenderBackendResourceAccessor::OGLTextureWrite:
- Q_FALLTHROUGH();
- case RenderBackendResourceAccessor::OGLTextureRead:
- {
- Texture *tex = m_textureManager->lookupResource(nodeId);
- if (!tex)
- return false;
-
- GLTexture *glTex = m_glTextureManager->lookupResource(tex->peerId());
- if (!glTex)
- return false;
-
- if (glTex->isDirty())
- return false;
-
- if (type == RenderBackendResourceAccessor::OGLTextureWrite)
- glTex->setExternalRenderingEnabled(true);
-
- QOpenGLTexture **glTextureHandle = reinterpret_cast<QOpenGLTexture **>(handle);
- *glTextureHandle = glTex->getGLTexture();
-
- if (type == RenderBackendResourceAccessor::OGLTextureWrite)
- *lock = glTex->externalRenderingLock();
-
- return true;
- }
-
- case RenderBackendResourceAccessor::OutputAttachment: {
- RenderTargetOutput *output = m_attachmentManager->lookupResource(nodeId);
- if (output) {
- Attachment **attachmentData = reinterpret_cast<Attachment **>(handle);
- *attachmentData = output->attachment();
- return true;
- }
- break;
- }
-
- case RenderBackendResourceAccessor::EntityHandle: {
- Entity *entity = m_entityManager->lookupResource(nodeId);
- if (entity) {
- Entity **pEntity = reinterpret_cast<Entity **>(handle);
- *pEntity = entity;
- return true;
- }
- break;
- }
-
- default:
- break;
- }
+// switch (type) {
+
+// case RenderBackendResourceAccessor::OGLTextureWrite:
+// Q_FALLTHROUGH();
+// case RenderBackendResourceAccessor::OGLTextureRead:
+// {
+// Texture *tex = m_textureManager->lookupResource(nodeId);
+// if (!tex)
+// return false;
+
+// GLTexture *glTex = m_glTextureManager->lookupResource(tex->peerId());
+// if (!glTex)
+// return false;
+
+// if (glTex->isDirty())
+// return false;
+
+// if (type == RenderBackendResourceAccessor::OGLTextureWrite)
+// glTex->setExternalRenderingEnabled(true);
+
+// QOpenGLTexture **glTextureHandle = reinterpret_cast<QOpenGLTexture **>(handle);
+// *glTextureHandle = glTex->getGLTexture();
+
+// if (type == RenderBackendResourceAccessor::OGLTextureWrite)
+// *lock = glTex->externalRenderingLock();
+
+// return true;
+// }
+
+// case RenderBackendResourceAccessor::OutputAttachment: {
+// RenderTargetOutput *output = m_attachmentManager->lookupResource(nodeId);
+// if (output) {
+// Attachment **attachmentData = reinterpret_cast<Attachment **>(handle);
+// *attachmentData = output->attachment();
+// return true;
+// }
+// break;
+// }
+
+// case RenderBackendResourceAccessor::EntityHandle: {
+// Entity *entity = m_entityManager->lookupResource(nodeId);
+// if (entity) {
+// Entity **pEntity = reinterpret_cast<Entity **>(handle);
+// *pEntity = entity;
+// return true;
+// }
+// break;
+// }
+
+// default:
+// break;
+// }
return false;
}