From 52121396c55e6100316f006c87b4fdaa8b5a0719 Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Tue, 5 Jul 2016 16:58:13 +0200 Subject: Renamed files quniformvalue* to shaderparameterpack These files contains a class named ShaderParameterPack so filenames needed to be adjusted. Change-Id: I8735c753e2a741a6238780b40fb42143d4439e09 Reviewed-by: Paul Lemire Reviewed-by: Sean Harmer --- src/render/backend/quniformvalue.cpp | 100 ------------------ src/render/backend/quniformvalue_p.h | 141 ------------------------- src/render/backend/render-backend.pri | 8 +- src/render/backend/rendercommand_p.h | 2 +- src/render/backend/renderer_p.h | 2 +- src/render/backend/shaderparameterpack.cpp | 100 ++++++++++++++++++ src/render/backend/shaderparameterpack_p.h | 141 +++++++++++++++++++++++++ src/render/graphicshelpers/graphicscontext_p.h | 2 +- src/render/materialsystem/material_p.h | 2 +- src/render/materialsystem/shader_p.h | 2 +- 10 files changed, 250 insertions(+), 250 deletions(-) delete mode 100644 src/render/backend/quniformvalue.cpp delete mode 100644 src/render/backend/quniformvalue_p.h create mode 100644 src/render/backend/shaderparameterpack.cpp create mode 100644 src/render/backend/shaderparameterpack_p.h diff --git a/src/render/backend/quniformvalue.cpp b/src/render/backend/quniformvalue.cpp deleted file mode 100644 index b7eaf2023..000000000 --- a/src/render/backend/quniformvalue.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt3D module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "quniformvalue_p.h" - -#include -#include - -#include - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace Qt3DRender { -namespace Render { - -ShaderParameterPack::~ShaderParameterPack() -{ - m_uniforms.clear(); -} - -void ShaderParameterPack::setUniform(const int glslNameId, const UniformValue &val) -{ - m_uniforms.insert(glslNameId, val); -} - -void ShaderParameterPack::setTexture(const int glslNameId, Qt3DCore::QNodeId texId) -{ - for (int t=0; t -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QOpenGLShaderProgram; - -namespace Qt3DCore { -class QFrameAllocator; -} - -namespace Qt3DRender { -namespace Render { - -class GraphicsContext; - -struct BlockToUBO { - int m_blockIndex; - Qt3DCore::QNodeId m_bufferID; - bool m_needsUpdate; - QHash m_updatedProperties; -}; -QT3D_DECLARE_TYPEINFO_2(Qt3DRender, Render, BlockToUBO, Q_MOVABLE_TYPE) - -struct BlockToSSBO { - int m_blockIndex; - Qt3DCore::QNodeId m_bufferID; -}; -QT3D_DECLARE_TYPEINFO_2(Qt3DRender, Render, BlockToSSBO, Q_PRIMITIVE_TYPE) - - -typedef QHash PackUniformHash; - -class ShaderParameterPack -{ -public: - ~ShaderParameterPack(); - - void setUniform(const int glslNameId, const UniformValue &val); - void setTexture(const int glslNameId, Qt3DCore::QNodeId id); - void setUniformBuffer(BlockToUBO blockToUBO); - void setShaderStorageBuffer(BlockToSSBO blockToSSBO); - void setSubmissionUniform(const ShaderUniform &uniform); - - inline PackUniformHash &uniforms() { return m_uniforms; } - inline const PackUniformHash &uniforms() const { return m_uniforms; } - UniformValue uniform(const int glslNameId) const { return m_uniforms.value(glslNameId); } - - struct NamedTexture - { - NamedTexture() {} - NamedTexture(const int nm, Qt3DCore::QNodeId t) - : glslNameId(nm) - , texId(t) - { } - - int glslNameId; - Qt3DCore::QNodeId texId; - }; - - inline QVector textures() const { return m_textures; } - inline QVector uniformBuffers() const { return m_uniformBuffers; } - inline QVector shaderStorageBuffers() const { return m_shaderStorageBuffers; } - inline QVector submissionUniforms() const { return m_submissionUniforms; } -private: - PackUniformHash m_uniforms; - - QVector m_textures; - QVector m_uniformBuffers; - QVector m_shaderStorageBuffers; - QVector m_submissionUniforms; - - friend class RenderView; -}; -QT3D_DECLARE_TYPEINFO_2(Qt3DRender, Render, ShaderParameterPack::NamedTexture, Q_PRIMITIVE_TYPE) - -} // namespace Render -} // namespace Qt3DRender - -QT_END_NAMESPACE - -#endif // QT3DRENDER_RENDER_QUNIFORMVALUE_H diff --git a/src/render/backend/render-backend.pri b/src/render/backend/render-backend.pri index 0d7d9e57e..a55a72d8b 100644 --- a/src/render/backend/render-backend.pri +++ b/src/render/backend/render-backend.pri @@ -7,7 +7,6 @@ HEADERS += \ $$PWD/renderthread_p.h \ $$PWD/renderconfiguration_p.h \ $$PWD/renderer_p.h \ - $$PWD/quniformvalue_p.h \ $$PWD/renderview_p.h \ $$PWD/rendercommand_p.h \ $$PWD/renderqueue_p.h \ @@ -37,13 +36,13 @@ HEADERS += \ $$PWD/backendnode_p.h \ $$PWD/rendertargetoutput_p.h \ $$PWD/commandexecuter_p.h \ - $$PWD/uniform_p.h + $$PWD/uniform_p.h \ + $$PWD/shaderparameterpack_p.h SOURCES += \ $$PWD/renderthread.cpp \ $$PWD/renderconfiguration.cpp \ $$PWD/renderer.cpp \ - $$PWD/quniformvalue.cpp \ $$PWD/renderview.cpp \ $$PWD/rendercommand.cpp \ $$PWD/renderqueue.cpp \ @@ -68,5 +67,6 @@ SOURCES += \ $$PWD/attachmentpack.cpp \ $$PWD/commandexecuter.cpp \ $$PWD/openglvertexarrayobject.cpp \ - $$PWD/uniform.cpp + $$PWD/uniform.cpp \ + $$PWD/shaderparameterpack.cpp diff --git a/src/render/backend/rendercommand_p.h b/src/render/backend/rendercommand_p.h index dc65ac7ed..012cdbe9a 100644 --- a/src/render/backend/rendercommand_p.h +++ b/src/render/backend/rendercommand_p.h @@ -53,7 +53,7 @@ // #include -#include +#include #include #include #include diff --git a/src/render/backend/renderer_p.h b/src/render/backend/renderer_p.h index da3d4e1e9..ffc60273a 100644 --- a/src/render/backend/renderer_p.h +++ b/src/render/backend/renderer_p.h @@ -54,7 +54,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/render/backend/shaderparameterpack.cpp b/src/render/backend/shaderparameterpack.cpp new file mode 100644 index 000000000..01a977aee --- /dev/null +++ b/src/render/backend/shaderparameterpack.cpp @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "shaderparameterpack_p.h" + +#include +#include + +#include + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { +namespace Render { + +ShaderParameterPack::~ShaderParameterPack() +{ + m_uniforms.clear(); +} + +void ShaderParameterPack::setUniform(const int glslNameId, const UniformValue &val) +{ + m_uniforms.insert(glslNameId, val); +} + +void ShaderParameterPack::setTexture(const int glslNameId, Qt3DCore::QNodeId texId) +{ + for (int t=0; t +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QOpenGLShaderProgram; + +namespace Qt3DCore { +class QFrameAllocator; +} + +namespace Qt3DRender { +namespace Render { + +class GraphicsContext; + +struct BlockToUBO { + int m_blockIndex; + Qt3DCore::QNodeId m_bufferID; + bool m_needsUpdate; + QHash m_updatedProperties; +}; +QT3D_DECLARE_TYPEINFO_2(Qt3DRender, Render, BlockToUBO, Q_MOVABLE_TYPE) + +struct BlockToSSBO { + int m_blockIndex; + Qt3DCore::QNodeId m_bufferID; +}; +QT3D_DECLARE_TYPEINFO_2(Qt3DRender, Render, BlockToSSBO, Q_PRIMITIVE_TYPE) + + +typedef QHash PackUniformHash; + +class ShaderParameterPack +{ +public: + ~ShaderParameterPack(); + + void setUniform(const int glslNameId, const UniformValue &val); + void setTexture(const int glslNameId, Qt3DCore::QNodeId id); + void setUniformBuffer(BlockToUBO blockToUBO); + void setShaderStorageBuffer(BlockToSSBO blockToSSBO); + void setSubmissionUniform(const ShaderUniform &uniform); + + inline PackUniformHash &uniforms() { return m_uniforms; } + inline const PackUniformHash &uniforms() const { return m_uniforms; } + UniformValue uniform(const int glslNameId) const { return m_uniforms.value(glslNameId); } + + struct NamedTexture + { + NamedTexture() {} + NamedTexture(const int nm, Qt3DCore::QNodeId t) + : glslNameId(nm) + , texId(t) + { } + + int glslNameId; + Qt3DCore::QNodeId texId; + }; + + inline QVector textures() const { return m_textures; } + inline QVector uniformBuffers() const { return m_uniformBuffers; } + inline QVector shaderStorageBuffers() const { return m_shaderStorageBuffers; } + inline QVector submissionUniforms() const { return m_submissionUniforms; } +private: + PackUniformHash m_uniforms; + + QVector m_textures; + QVector m_uniformBuffers; + QVector m_shaderStorageBuffers; + QVector m_submissionUniforms; + + friend class RenderView; +}; +QT3D_DECLARE_TYPEINFO_2(Qt3DRender, Render, ShaderParameterPack::NamedTexture, Q_PRIMITIVE_TYPE) + +} // namespace Render +} // namespace Qt3DRender + +QT_END_NAMESPACE + +#endif // QT3DRENDER_RENDER_SHADERPARAMETERPACK_P_H diff --git a/src/render/graphicshelpers/graphicscontext_p.h b/src/render/graphicshelpers/graphicscontext_p.h index bfe5a4be9..647db9e47 100644 --- a/src/render/graphicshelpers/graphicscontext_p.h +++ b/src/render/graphicshelpers/graphicscontext_p.h @@ -60,7 +60,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/render/materialsystem/material_p.h b/src/render/materialsystem/material_p.h index b415e2975..fe2707549 100644 --- a/src/render/materialsystem/material_p.h +++ b/src/render/materialsystem/material_p.h @@ -54,7 +54,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/render/materialsystem/shader_p.h b/src/render/materialsystem/shader_p.h index 1382e287e..283e5a94c 100644 --- a/src/render/materialsystem/shader_p.h +++ b/src/render/materialsystem/shader_p.h @@ -52,7 +52,7 @@ // #include -#include +#include #include #include #include -- cgit v1.2.3