diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-05-28 13:10:37 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-05-28 13:12:52 +0300 |
commit | 41f9c0dde9f68e0c3fde7d491c0ebfafef7b7cfc (patch) | |
tree | ec6e92f06fd3bdf46abc37659f2e20f9acaef72a | |
parent | 0c7102e79591c84135c617085df3d19c5bd8e81b (diff) | |
parent | 85fa4499b6be02ca1bfb3d920fd4dec090237b80 (diff) |
Merge "Merge branch 'master' into 2.4"
3 files changed, 128 insertions, 7 deletions
diff --git a/src/Runtime/Source/runtime/Qt3DSApplication.cpp b/src/Runtime/Source/runtime/Qt3DSApplication.cpp index ed74b33f..20e3fd57 100644 --- a/src/Runtime/Source/runtime/Qt3DSApplication.cpp +++ b/src/Runtime/Source/runtime/Qt3DSApplication.cpp @@ -1024,6 +1024,7 @@ struct SApp : public IApplication // Notify @timeline attribute changes and store latest value to notified DataOutputDef QMutableMapIterator<QString, DataOutputDef> iter(m_dataOutputDefs); while (iter.hasNext()) { + iter.next(); DataOutputDef &outDef = iter.value(); if (outDef.observedAttribute.propertyType == ATTRIBUTETYPE_DATAINPUT_TIMELINE && outDef.timelineComponent) { @@ -1046,7 +1047,6 @@ struct SApp : public IApplication outDef.name, outDef.value); } } - iter.next(); } } // End SStackPerfTimer scope } @@ -2034,3 +2034,109 @@ bool IApplication::isPickingEvent(TEventCommandHash event) || event == ON_GROUPEDMOUSEOVER || event == ON_GROUPEDMOUSEOUT); } + +QDebug operator<<(QDebug debug, const DataInOutAttribute &value) +{ + QDebugStateSaver saver(debug); + debug.nospace() << "DataInOutAttribute("; + debug.nospace() << "elementPath:" << value.elementPath; + debug.nospace() << ", attributeNames: {"; + for (auto name : value.attributeName) + debug << QString::fromUtf8(name); + + debug.nospace() << "}, propertyType:" << value.propertyType; + return debug; +} + +QDebug operator<<(QDebug debug, const DataInOutType &value) +{ + QDebugStateSaver saver(debug); + debug.nospace() << "DataInOutType::"; + switch (value) { + case DataInOutType::DataInOutTypeInvalid: + debug.nospace() << "DataInOutTypeInvalid"; + break; + case DataInOutType::DataInOutTypeRangedNumber: + debug.nospace() << "DataInOutTypeRangedNumber"; + break; + case DataInOutType::DataInOutTypeString: + debug.nospace() << "DataInOutTypeString"; + break; + case DataInOutType::DataInOutTypeFloat: + debug.nospace() << "DataInOutTypeFloat"; + break; + case DataInOutType::DataInOutTypeEvaluator: + debug.nospace() << "DataInOutTypeEvaluator"; + break; + case DataInOutType::DataInOutTypeBoolean: + debug.nospace() << "DataInOutTypeBoolean"; + break; + case DataInOutType::DataInOutTypeVector4: + debug.nospace() << "DataInOutTypeVector4"; + break; + case DataInOutType::DataInOutTypeVector3: + debug.nospace() << "DataInOutTypeVector3"; + break; + case DataInOutType::DataInOutTypeVector2: + debug.nospace() << "DataInOutTypeVector2"; + break; + case DataInOutType::DataInOutTypeVariant: + debug.nospace() << "DataInOutTypeVariant"; + break; + default: + debug.nospace() << "UNKNOWN"; + } + return debug; +} + +QDebug operator<<(QDebug debug, const DataInputValueRole &value) +{ + QDebugStateSaver saver(debug); + debug.nospace() << "DataInputValueRole::"; + switch (value) { + case DataInputValueRole::Value: + debug.nospace() << "Value"; + break; + case DataInputValueRole::Min: + debug.nospace() << "Min"; + break; + case DataInputValueRole::Max: + debug.nospace() << "Max"; + break; + default: + debug.nospace() << "UNKNOWN"; + } + return debug; +} + +QDebug operator<<(QDebug debug, const DataInputDef &value) +{ + QDebugStateSaver saver(debug); + debug.nospace() << "DataInputDef("; + debug.nospace() << "type:" << value.type; + debug.nospace() << ", controlledAttributes: {"; + for (auto attr : value.controlledAttributes) + debug << attr; + + debug.nospace() << "}, min:" << value.min; + debug.nospace() << ", min:" << value.min << ", max:" << value.max; + debug.nospace() << ", evaluator:" << value.evaluator; + debug.nospace() << ", value:" << value.value; + debug.nospace() << ", dependents:{"; + for (auto dep : value.dependents) + debug << dep; + + debug.nospace() << "})"; + return debug; +} + +QDebug operator<<(QDebug debug, const DataOutputDef &value) +{ + QDebugStateSaver saver(debug); + debug.nospace() << "DataOutputDef("; + debug.nospace() << "name:" << value.name << ", type:" << value.type; + debug.nospace() << ", observedHandle:" << value.observedHandle; + debug.nospace() << ", min:" << value.min << ", max:" << value.max; + debug.nospace() << ", timelineComponent:" << value.timelineComponent << ")"; + return debug; +} diff --git a/src/Runtime/Source/runtimerender/Qt3DSRenderShaderCache.cpp b/src/Runtime/Source/runtimerender/Qt3DSRenderShaderCache.cpp index 9782ccd2..1d947459 100644 --- a/src/Runtime/Source/runtimerender/Qt3DSRenderShaderCache.cpp +++ b/src/Runtime/Source/runtimerender/Qt3DSRenderShaderCache.cpp @@ -282,10 +282,6 @@ struct ShaderCache : public IShaderCache if (m_RenderContext.IsAdvancedBlendHwSupportedKHR()) m_InsertStr += "layout(blend_support_all_equations) out;\n"; - - m_InsertStr += "#ifndef NO_FRAG_OUTPUT\n"; - m_InsertStr += "out vec4 fragOutput;\n"; - m_InsertStr += "#endif\n"; } } @@ -439,6 +435,7 @@ struct ShaderCache : public IShaderCache m_InsertStr += "#define TESSELLATION_EVALUATION_SHADER 1\n"; } + int fragOutputIndex = int(m_InsertStr.size()); str.insert(0, m_InsertStr); if (inFeatures.size()) { eastl::string::size_type insertPos = int(m_InsertStr.size()); @@ -452,6 +449,16 @@ struct ShaderCache : public IShaderCache m_InsertStr.append("\n"); } str.insert(insertPos, m_InsertStr); + fragOutputIndex = insertPos + int(m_InsertStr.size()); + } + + // Add fragOutput for desktop OpenGL and OpenGL ES 3.x after feature defines + if (!isGlES || IQt3DSRenderer::IsGlEs3Context(m_RenderContext.GetRenderContextType())) { + m_InsertStr.clear(); + m_InsertStr += "#ifndef NO_FRAG_OUTPUT\n"; + m_InsertStr += "out vec4 fragOutput;\n"; + m_InsertStr += "#endif\n"; + str.insert(fragOutputIndex, m_InsertStr); } } // Compile this program overwriting any existing ones. diff --git a/src/Runtime/Source/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp b/src/Runtime/Source/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp index 95d0776b..a3d3fab5 100644 --- a/src/Runtime/Source/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp +++ b/src/Runtime/Source/runtimerender/rendererimpl/Qt3DSRendererImplShaders.cpp @@ -2569,8 +2569,12 @@ namespace render { fragmentGenerator.Append("}"); + CRegisteredString featureName(m_StringTable->RegisterStr("NO_FRAG_OUTPUT")); + SShaderPreprocessorFeature noFragOutputFeature(featureName, true); + NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader( - "cubemap shadow blur X shader", SShaderCacheProgramFlags(), TShaderFeatureSet()); + "cubemap shadow blur X shader", SShaderCacheProgramFlags(), + TShaderFeatureSet(&noFragOutputFeature, 1)); NVScopedRefCounted<SShadowmapPreblurShader> retval; if (theShader) retval = QT3DS_NEW(m_Context->GetAllocator(), SShadowmapPreblurShader)(*theShader); @@ -2700,8 +2704,12 @@ namespace render { fragmentGenerator.Append("}"); + CRegisteredString featureName(m_StringTable->RegisterStr("NO_FRAG_OUTPUT")); + SShaderPreprocessorFeature noFragOutputFeature(featureName, true); + NVRenderShaderProgram *theShader = GetProgramGenerator().CompileGeneratedShader( - "cubemap shadow blur Y shader", SShaderCacheProgramFlags(), TShaderFeatureSet()); + "cubemap shadow blur Y shader", SShaderCacheProgramFlags(), + TShaderFeatureSet(&noFragOutputFeature, 1)); NVScopedRefCounted<SShadowmapPreblurShader> retval; if (theShader) retval = QT3DS_NEW(m_Context->GetAllocator(), SShadowmapPreblurShader)(*theShader); |