...
This commit is contained in:
1
.idea/codeStyles/Project.xml
generated
1
.idea/codeStyles/Project.xml
generated
@@ -140,6 +140,7 @@
|
|||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Single" type="string" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Single" type="string" />
|
||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
||||||
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGNMENT_TAB_FILL_STYLE/@EntryValue" value="USE_TABS_ONLY" type="string" />
|
||||||
</RiderCodeStyleSettings>
|
</RiderCodeStyleSettings>
|
||||||
<files>
|
<files>
|
||||||
<extensions>
|
<extensions>
|
||||||
|
|||||||
479
.idea/editor.xml
generated
479
.idea/editor.xml
generated
@@ -98,483 +98,6 @@
|
|||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Single" type="string" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Single" type="string" />
|
||||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGNMENT_TAB_FILL_STYLE/@EntryValue" value="USE_TABS_ONLY" type="string" />
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexRemoved" />
|
|
||||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexRemoved" />
|
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
5
.idea/misc.xml
generated
5
.idea/misc.xml
generated
@@ -1,5 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="BackendCodeEditorMiscSettings">
|
||||||
|
<option name="/Default/Housekeeping/GlobalSettingsUpgraded/IsUpgraded/@EntryValue" value="true" type="bool" />
|
||||||
|
<option name="/Default/Environment/Hierarchy/GeneratedFilesCacheKey/Timestamp/@EntryValue" value="69" type="long" />
|
||||||
|
<option name="/Default/Housekeeping/OptionsDialog/SelectedPageId/@EntryValue" value="CppFormatterOtherPage" type="string" />
|
||||||
|
</component>
|
||||||
<component name="CMakePythonSetting">
|
<component name="CMakePythonSetting">
|
||||||
<option name="pythonIntegrationState" value="YES" />
|
<option name="pythonIntegrationState" value="YES" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ add_executable(z3d main.cpp
|
|||||||
include/opengl/data/mesh_data.hpp
|
include/opengl/data/mesh_data.hpp
|
||||||
include/opengl/data/point_cloud_data.hpp
|
include/opengl/data/point_cloud_data.hpp
|
||||||
include/opengl/data/shader_program_data.hpp
|
include/opengl/data/shader_program_data.hpp
|
||||||
include/opengl/data/texture_data.hpp
|
|
||||||
include/scene/lighting_setup.hpp
|
include/scene/lighting_setup.hpp
|
||||||
include/rendering/batch_renderers/mesh_batch_renderer.hpp
|
include/rendering/batch_renderers/mesh_batch_renderer.hpp
|
||||||
include/opengl/error.hpp
|
include/opengl/error.hpp
|
||||||
@@ -144,7 +143,7 @@ add_executable(z3d main.cpp
|
|||||||
include/assets/dynamic_data_loaders/dynamic_texture_loader.hpp
|
include/assets/dynamic_data_loaders/dynamic_texture_loader.hpp
|
||||||
source/assets/dynamic_data_loaders/dynamic_texture_loader.cpp
|
source/assets/dynamic_data_loaders/dynamic_texture_loader.cpp
|
||||||
include/assets/dynamic_data_stores/dynamic_texture_store.hpp
|
include/assets/dynamic_data_stores/dynamic_texture_store.hpp
|
||||||
include/opengl/data_uploaders/texture_data_uploader.hpp
|
include/opengl/data_managers/texture_manager.hpp
|
||||||
include/assets/dynamic_data_stores/dynamic_vertex_store.hpp
|
include/assets/dynamic_data_stores/dynamic_vertex_store.hpp
|
||||||
include/assets/prefetch_lookups/mesh_prefetch_lookup.hpp
|
include/assets/prefetch_lookups/mesh_prefetch_lookup.hpp
|
||||||
include/assets/prefetch_lookups/point_cloud_prefetch_lookup.hpp
|
include/assets/prefetch_lookups/point_cloud_prefetch_lookup.hpp
|
||||||
@@ -178,16 +177,14 @@ add_executable(z3d main.cpp
|
|||||||
include/assets/prefetch_lookup.hpp
|
include/assets/prefetch_lookup.hpp
|
||||||
source/assets/prefetch_lookups/pose_prefetch_lookup.cpp
|
source/assets/prefetch_lookups/pose_prefetch_lookup.cpp
|
||||||
include/assets/dynamic_data_store.hpp
|
include/assets/dynamic_data_store.hpp
|
||||||
include/opengl/data_uploaders/shader_program_compiler.hpp
|
|
||||||
include/opengl/metadata/shader_source_metadata.hpp
|
include/opengl/metadata/shader_source_metadata.hpp
|
||||||
source/opengl/data_uploaders/shader_compiler.cpp
|
source/opengl/data_managers/shader_manager.cpp
|
||||||
include/opengl/shading/model_geometry.hpp
|
include/opengl/shading/model_geometry.hpp
|
||||||
include/opengl/shading/shader_stage.hpp
|
include/opengl/shading/shader_stage.hpp
|
||||||
include/opengl/shading/requirements/shader_program_requirements.hpp
|
include/opengl/shading/requirements/shader_program_requirements.hpp
|
||||||
include/opengl/shading/shader_set.hpp
|
|
||||||
include/opengl/shading/attributes/mesh_attributes.hpp
|
include/opengl/shading/attributes/mesh_attributes.hpp
|
||||||
include/opengl/data_uploaders/shader_preprocessor.hpp
|
include/opengl/data_managers/shader_source_manager.hpp
|
||||||
source/opengl/data_uploaders/shader_preprocessor.cpp
|
source/opengl/data_managers/shader_source_manager.cpp
|
||||||
include/opengl/shading/shader_metadata_language.hpp
|
include/opengl/shading/shader_metadata_language.hpp
|
||||||
include/opengl/shading/features/generic_features.hpp
|
include/opengl/shading/features/generic_features.hpp
|
||||||
include/opengl/shading/features/combined_features.hpp
|
include/opengl/shading/features/combined_features.hpp
|
||||||
@@ -198,6 +195,27 @@ add_executable(z3d main.cpp
|
|||||||
include/opengl/metadata/shader_set_metadata.hpp
|
include/opengl/metadata/shader_set_metadata.hpp
|
||||||
include/opengl/handles/shader_handle_set.hpp
|
include/opengl/handles/shader_handle_set.hpp
|
||||||
include/opengl/shading/requirements/shader_set_requirements.hpp
|
include/opengl/shading/requirements/shader_set_requirements.hpp
|
||||||
|
include/opengl/data_managers/shader_program_manager.hpp
|
||||||
|
include/opengl/metadata/shader_program_metadata.hpp
|
||||||
|
source/opengl/data_managers/shader_program_manager.cpp
|
||||||
|
source/opengl/data_managers/texture_manager.cpp
|
||||||
|
include/util/reference_counter.hpp
|
||||||
|
include/opengl/resource_management/resource_manager.hpp
|
||||||
|
source/opengl/resource_management/resource_manager.ipp
|
||||||
|
include/opengl/data_managers/buffer_manager.hpp
|
||||||
|
include/opengl/data_managers/shader_manager.hpp
|
||||||
|
include/opengl/data_managers/mesh_vertex_buffer_manager.hpp
|
||||||
|
source/opengl/data_managers/mesh_vertex_buffer_manager.cpp
|
||||||
|
include/opengl/resource_management/reference_counter.hpp
|
||||||
|
include/opengl/resource_management/reference_counter.hpp
|
||||||
|
include/opengl/resource_management/resource_handle.hpp
|
||||||
|
source/opengl/resource_management/resource_handle.ipp
|
||||||
|
include/opengl/handles/vertex_buffer_handle.hpp
|
||||||
|
source/opengl/handles/vertex_buffer_handle.ipp
|
||||||
|
include/opengl/handles/index_buffer_handle.hpp
|
||||||
|
source/opengl/handles/index_buffer_handle.ipp
|
||||||
|
include/opengl/metadata/texture_metadata.hpp
|
||||||
|
include/opengl/metadata/vertex_buffer_metadata.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(z3d PRIVATE include)
|
target_include_directories(z3d PRIVATE include)
|
||||||
|
|||||||
@@ -9,21 +9,11 @@
|
|||||||
|
|
||||||
namespace zgl
|
namespace zgl
|
||||||
{
|
{
|
||||||
class shader_program_data
|
struct shader_program_data
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
explicit shader_program_data(GLuint program_id);
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
shader_program_data() = default;
|
shader_program_data() = default;
|
||||||
|
|
||||||
[[nodiscard]] static std::error_code build_from(
|
explicit shader_program_data(GLuint program_id);
|
||||||
const shader_handle& vertex_shader,
|
|
||||||
const shader_handle& geometry_shader,
|
|
||||||
const shader_handle& fragment_shader,
|
|
||||||
shader_program_data& data
|
|
||||||
);
|
|
||||||
|
|
||||||
shader_program_data(const shader_program_data& other) = delete;
|
shader_program_data(const shader_program_data& other) = delete;
|
||||||
shader_program_data& operator=(const shader_program_data& other) = delete;
|
shader_program_data& operator=(const shader_program_data& other) = delete;
|
||||||
@@ -31,12 +21,9 @@ public:
|
|||||||
shader_program_data(shader_program_data&& other) noexcept ;
|
shader_program_data(shader_program_data&& other) noexcept ;
|
||||||
shader_program_data& operator=(shader_program_data&& other) noexcept;
|
shader_program_data& operator=(shader_program_data&& other) noexcept;
|
||||||
|
|
||||||
[[nodiscard]] shader_program_handle handle() const;
|
|
||||||
|
|
||||||
~shader_program_data();
|
~shader_program_data();
|
||||||
|
|
||||||
private:
|
shader_program_handle handle{};
|
||||||
shader_program_handle m_handle{};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "GL/glew.h"
|
|
||||||
#include "opengl/handles/texture_handle.hpp"
|
|
||||||
|
|
||||||
#include <span>
|
|
||||||
|
|
||||||
namespace zgl
|
|
||||||
{
|
|
||||||
struct texture_data
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
explicit texture_data(GLuint texture_id);
|
|
||||||
|
|
||||||
public:
|
|
||||||
texture_data() = default;
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
[[nodiscard]] static std::error_code build_from(
|
|
||||||
std::span<const T> buffer,
|
|
||||||
GLenum format,
|
|
||||||
GLenum type,
|
|
||||||
GLsizei width,
|
|
||||||
GLsizei height,
|
|
||||||
texture_data& data
|
|
||||||
);
|
|
||||||
|
|
||||||
texture_data(const texture_data&) = delete;
|
|
||||||
texture_data& operator=(const texture_data&) = delete;
|
|
||||||
|
|
||||||
texture_data(texture_data&&) noexcept;
|
|
||||||
texture_data& operator=(texture_data&&) noexcept;
|
|
||||||
|
|
||||||
~texture_data();
|
|
||||||
|
|
||||||
[[nodiscard]] texture_handle handle() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
texture_handle m_handle{};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#define INCLUDE_TEXTURE_DATA_IMPLEMENTATION
|
|
||||||
#include "opengl/data/texture_data.ipp"
|
|
||||||
#undef INCLUDE_TEXTURE_DATA_IMPLEMENTATION
|
|
||||||
36
include/opengl/data_managers/buffer_manager.hpp
Normal file
36
include/opengl/data_managers/buffer_manager.hpp
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace zgl
|
||||||
|
{
|
||||||
|
|
||||||
|
class buffer_manager
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using store_type = dynamic_texture_store;
|
||||||
|
using store_id_type = store_type::id_type;
|
||||||
|
using resource_manager_type = resource_manager<store_id_type>;
|
||||||
|
using resource_type = resource_manager_type::resource_handle;
|
||||||
|
using handle_type = texture_handle;
|
||||||
|
|
||||||
|
static constexpr std::size_t min_garbage_collection_count = 4;
|
||||||
|
|
||||||
|
void process(store_type& store);
|
||||||
|
|
||||||
|
std::optional<handle_type> get_handle(store_id_type id);
|
||||||
|
|
||||||
|
void collect_garbage(bool force = false);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
resource_manager<store_id_type> m_resource_manager;
|
||||||
|
|
||||||
|
std::vector<std::pair<dynamic_texture_store::id_type, const dynamic_texture_buffer&>> m_texture_buffer;
|
||||||
|
std::vector<GLuint> m_texture_id_buffer;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
32
include/opengl/data_managers/mesh_vertex_buffer_manager.hpp
Normal file
32
include/opengl/data_managers/mesh_vertex_buffer_manager.hpp
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
#include "assets/dynamic_data_stores/dynamic_mesh_store.hpp"
|
||||||
|
#include "opengl/resource_management/resource_manager.hpp"
|
||||||
|
#include "opengl/handles/vertex_buffer_handle.hpp"
|
||||||
|
#include "opengl/metadata/vertex_buffer_metadata.hpp"
|
||||||
|
|
||||||
|
namespace zgl
|
||||||
|
{
|
||||||
|
class mesh_vertex_buffer_manager
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using store_type = dynamic_mesh_store;
|
||||||
|
using store_id_type = store_type::id_type;
|
||||||
|
using metadata_type = vertex_buffer_metadata;
|
||||||
|
using handle_type = vertex_buffer_handle;
|
||||||
|
using resource_manager_type = resource_manager<store_id_type, metadata_type>;
|
||||||
|
using texture_entry_type = std::pair<handle_type, metadata_type>;
|
||||||
|
|
||||||
|
static constexpr std::size_t min_garbage_collection_count = 4;
|
||||||
|
|
||||||
|
void process(store_type& store);
|
||||||
|
|
||||||
|
std::optional<texture_entry_type> get_handle(store_id_type id);
|
||||||
|
|
||||||
|
void collect_garbage(bool force = false);
|
||||||
|
|
||||||
|
private:
|
||||||
|
resource_manager_type m_resource_manager;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "opengl/shader_program_lookup.hpp"
|
#include "opengl/shader_program_lookup.hpp"
|
||||||
#include "opengl/handles/shader_handle.hpp"
|
#include "opengl/handles/shader_handle.hpp"
|
||||||
#include "util/string_lookup.hpp"
|
#include "util/string_lookup.hpp"
|
||||||
#include "shader_preprocessor.hpp"
|
#include "shader_source_manager.hpp"
|
||||||
#include "opengl/metadata/shader_metadata.hpp"
|
#include "opengl/metadata/shader_metadata.hpp"
|
||||||
#include "opengl/data/shader_data.hpp"
|
#include "opengl/data/shader_data.hpp"
|
||||||
#include "opengl/handles/shader_handle_set.hpp"
|
#include "opengl/handles/shader_handle_set.hpp"
|
||||||
@@ -20,26 +20,16 @@
|
|||||||
|
|
||||||
namespace zgl
|
namespace zgl
|
||||||
{
|
{
|
||||||
class shader_program_compiler
|
class shader_manager
|
||||||
{
|
{
|
||||||
using shader_lookup_entry_type = std::pair<shader_metadata, shader_data>;
|
using shader_lookup_entry_type = std::pair<shader_metadata, shader_data>;
|
||||||
|
|
||||||
static constexpr auto gl_shader_types = std::array<GLenum, shading::stage::count>{
|
|
||||||
GL_VERTEX_SHADER,
|
|
||||||
GL_TESS_CONTROL_SHADER,
|
|
||||||
GL_TESS_EVALUATION_SHADER,
|
|
||||||
GL_GEOMETRY_SHADER,
|
|
||||||
GL_FRAGMENT_SHADER
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void preprocess(
|
void process(
|
||||||
const dynamic_shader_source_store& shader_sources
|
const dynamic_shader_source_store& shader_sources
|
||||||
);
|
);
|
||||||
|
|
||||||
void compile_shaders(
|
void get_handles(
|
||||||
const dynamic_shader_source_store& shader_sources,
|
const dynamic_shader_source_store& shader_sources,
|
||||||
std::span<const shading::shader_set_requirements> requirements,
|
std::span<const shading::shader_set_requirements> requirements,
|
||||||
std::span<shader_set_metadata> metadata,
|
std::span<shader_set_metadata> metadata,
|
||||||
@@ -47,22 +37,22 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
shader_handle find_shader(
|
std::optional<std::pair<shader_metadata, shader_handle>> find_shader(
|
||||||
const shading::shader_requirements& requirements
|
const shading::shader_requirements& requirements
|
||||||
);
|
);
|
||||||
|
|
||||||
bool compile_shader(
|
static bool compile_shader(
|
||||||
GLenum shader_type,
|
GLenum shader_type,
|
||||||
std::span<const char*> source_strings,
|
std::span<const char*> source_strings,
|
||||||
shader_data& shader
|
shader_data& shader
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
shader_preprocessor m_preprocessor{};
|
shader_source_manager m_preprocessor{};
|
||||||
|
|
||||||
std::vector<shading::shader_source_requirements> m_source_requirement_buffer{};
|
std::vector<shading::shader_source_requirements> m_source_requirement_buffer{};
|
||||||
std::vector<preprocessed_shader_source_metadata> m_preprocessed_shader_source_metadata_buffer;
|
std::vector<preprocessed_shader_source_metadata> m_preprocessed_shader_source_metadata_buffer{};
|
||||||
std::vector<const char*> m_source_strings_buffer;
|
std::vector<const char*> m_source_strings_buffer{};
|
||||||
std::vector<shader_lookup_entry_type> m_shader_lookup;
|
std::vector<shader_lookup_entry_type> m_shader_lookup{};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
50
include/opengl/data_managers/shader_program_manager.hpp
Normal file
50
include/opengl/data_managers/shader_program_manager.hpp
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "shader_manager.hpp"
|
||||||
|
#include "assets/dynamic_data_stores/dynamic_shader_source_store.hpp"
|
||||||
|
#include "opengl/data/shader_program_data.hpp"
|
||||||
|
#include "opengl/shading/requirements/shader_program_requirements.hpp"
|
||||||
|
#include "opengl/metadata/shader_program_metadata.hpp"
|
||||||
|
|
||||||
|
namespace zgl
|
||||||
|
{
|
||||||
|
|
||||||
|
class shader_program_manager
|
||||||
|
{
|
||||||
|
using shader_program_lookup_entry_type = std::pair<
|
||||||
|
shader_program_metadata,
|
||||||
|
shader_program_data
|
||||||
|
>;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void process(
|
||||||
|
const dynamic_shader_source_store& shader_sources
|
||||||
|
);
|
||||||
|
|
||||||
|
void get_handles(
|
||||||
|
const dynamic_shader_source_store& shader_sources,
|
||||||
|
std::span<const shading::shader_program_requirements> requirements,
|
||||||
|
std::span<shader_program_metadata> metadata,
|
||||||
|
std::span<shader_program_handle> shader_programs
|
||||||
|
);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::optional<std::pair<shader_program_metadata, shader_program_handle>> find_shader_program(
|
||||||
|
const shading::shader_program_requirements& requirements
|
||||||
|
);
|
||||||
|
|
||||||
|
bool link_shader_program(
|
||||||
|
const shader_handle_set& shaders
|
||||||
|
);
|
||||||
|
|
||||||
|
shader_manager m_shader_manager;
|
||||||
|
std::vector<shader_program_lookup_entry_type> m_shader_program_lookup;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
std::vector<shading::shader_set_requirements> m_shader_requirements_buffer;
|
||||||
|
std::vector<shader_set_metadata> m_shader_metadata_buffer;
|
||||||
|
std::vector<shader_handle_set> shader_set_buffer;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,21 +15,20 @@
|
|||||||
|
|
||||||
namespace zgl {
|
namespace zgl {
|
||||||
|
|
||||||
class shader_preprocessor {
|
class shader_source_manager {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void preprocess(
|
void process(
|
||||||
const dynamic_shader_source_store& shader_sources
|
const dynamic_shader_source_store& shader_sources
|
||||||
);
|
);
|
||||||
|
|
||||||
void fetch_shader_sources(
|
void get_shader_sources(
|
||||||
const dynamic_shader_source_store& shader_sources,
|
const dynamic_shader_source_store& shader_sources,
|
||||||
std::span<const shading::shader_source_requirements> requirements,
|
std::span<const shading::shader_source_requirements> requirements,
|
||||||
std::span<preprocessed_shader_source_metadata> metadata,
|
std::span<preprocessed_shader_source_metadata> metadata,
|
||||||
std::vector<const char*>& shader_strings
|
std::vector<const char*>& shader_strings
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void tokenize_declarations(std::string_view source);
|
void tokenize_declarations(std::string_view source);
|
||||||
@@ -76,28 +75,6 @@ protected:
|
|||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline static auto mesh_feature_defines = std::array{
|
|
||||||
"#define FACE\n",
|
|
||||||
"#define LINE\n",
|
|
||||||
"#define POINT\n",
|
|
||||||
"#define V_L\n",
|
|
||||||
"#define V_RGB\n",
|
|
||||||
"#define V_A\n",
|
|
||||||
"#define LIGHTING\n",
|
|
||||||
"#define TEXTURE\n",
|
|
||||||
"#define U_RGBA\n",
|
|
||||||
};
|
|
||||||
|
|
||||||
inline static auto point_cloud_feature_defines = std::array{
|
|
||||||
"#define SQUARE\n",
|
|
||||||
"#define LIGHTING\n",
|
|
||||||
"#define V_L\n",
|
|
||||||
"#define V_RGB\n",
|
|
||||||
"#define V_A\n",
|
|
||||||
"#define U_RGBA\n",
|
|
||||||
"#define RAINBOW\n"
|
|
||||||
};
|
|
||||||
|
|
||||||
std::vector<std::string_view> m_value_token_buffer;
|
std::vector<std::string_view> m_value_token_buffer;
|
||||||
std::vector<std::size_t> m_declaration_token_count_buffer;
|
std::vector<std::size_t> m_declaration_token_count_buffer;
|
||||||
std::array<std::size_t, 4> m_declaration_type_index_buffer;
|
std::array<std::size_t, 4> m_declaration_type_index_buffer;
|
||||||
41
include/opengl/data_managers/texture_manager.hpp
Normal file
41
include/opengl/data_managers/texture_manager.hpp
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "assets/dynamic_read_buffers/dynamic_texture_buffer.hpp"
|
||||||
|
#include "assets/dynamic_data_stores/dynamic_texture_store.hpp"
|
||||||
|
#include "opengl/handles/texture_handle.hpp"
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "opengl/metadata/texture_metadata.hpp"
|
||||||
|
#include "opengl/resource_management/resource_manager.hpp"
|
||||||
|
|
||||||
|
namespace zgl
|
||||||
|
{
|
||||||
|
class texture_manager
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using store_type = dynamic_texture_store;
|
||||||
|
using store_id_type = store_type::id_type;
|
||||||
|
using metadata_type = texture_metadata;
|
||||||
|
using handle_type = texture_handle;
|
||||||
|
using resource_manager_type = resource_manager<store_id_type, metadata_type>;
|
||||||
|
using texture_entry_type = std::pair<handle_type, metadata_type>;
|
||||||
|
|
||||||
|
static constexpr std::size_t min_garbage_collection_count = 4;
|
||||||
|
|
||||||
|
void process(store_type& store);
|
||||||
|
|
||||||
|
std::optional<texture_entry_type> get_handle(store_id_type id);
|
||||||
|
|
||||||
|
void collect_garbage(bool force = false);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
resource_manager_type m_resource_manager;
|
||||||
|
|
||||||
|
std::vector<std::pair<dynamic_texture_store::id_type, const dynamic_texture_buffer&>> m_texture_buffer;
|
||||||
|
std::vector<GLuint> m_texture_id_buffer;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <unordered_map>
|
|
||||||
#include "assets/dynamic_data_stores/dynamic_shader_source_store.hpp"
|
|
||||||
#include "opengl/shader_program_lookup.hpp"
|
|
||||||
#include "opengl/handles/shader_handle.hpp"
|
|
||||||
#include "opengl/handles/shader_program_handle.hpp"
|
|
||||||
#include "../metadata/shader_source_metadata.hpp"
|
|
||||||
#include "shading/shader_program_requirements.hpp"
|
|
||||||
|
|
||||||
namespace zgl
|
|
||||||
{
|
|
||||||
|
|
||||||
class shader_program_compiler
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
// compile shader programs for given requirements
|
|
||||||
// cache shader programs with their capabilities
|
|
||||||
// store sstream for creating defines
|
|
||||||
|
|
||||||
// register shader source code
|
|
||||||
// store define types for these shaders as bitmap
|
|
||||||
void register_shader_sources(
|
|
||||||
const dynamic_shader_source_store& shader_sources
|
|
||||||
);
|
|
||||||
|
|
||||||
void compile_shader_programs(
|
|
||||||
const dynamic_shader_source_store& shader_sources,
|
|
||||||
std::span<const shading::shader_program_metadata> requirements,
|
|
||||||
std::vector<shader_program_handle>& shader_handles
|
|
||||||
);
|
|
||||||
|
|
||||||
// create metadata for all sources
|
|
||||||
|
|
||||||
// get
|
|
||||||
ś
|
|
||||||
protected:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::vector<shading::compiled_shader_metadata_type, shader_handle> shader_lookup;
|
|
||||||
std::vector<shading::shader_program_metadata, shader_program_handle> shader_program_lookup;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "../../assets/dynamic_read_buffers"
|
|
||||||
#include "assets/dynamic_data_stores/dynamic_texture_store.hpp"
|
|
||||||
#include "opengl/data/texture_data.hpp"
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace zgl
|
|
||||||
{
|
|
||||||
class texture_data_uploader
|
|
||||||
{
|
|
||||||
|
|
||||||
void upload(
|
|
||||||
std::span<const dynamic_texture_data> dynamic_data,
|
|
||||||
std::span<const dynamic_texture_store::id_type> dynamic_data_ids
|
|
||||||
) {
|
|
||||||
|
|
||||||
std::vector<GLuint> texture_ids;
|
|
||||||
|
|
||||||
texture_ids.resize(dynamic_data.size());
|
|
||||||
|
|
||||||
glGenTextures(texture_ids.size(), texture_ids.data());
|
|
||||||
|
|
||||||
const auto invalid_texture_ids = std::ranges::partition(
|
|
||||||
texture_ids,
|
|
||||||
[](GLuint texture_id)
|
|
||||||
{
|
|
||||||
GLenum format;
|
|
||||||
switch (texture.components()) {
|
|
||||||
using enum components::texture::flags;
|
|
||||||
case luminance:
|
|
||||||
format = GL_LUMINANCE;
|
|
||||||
break;
|
|
||||||
case luminance | alpha:
|
|
||||||
format = GL_LUMINANCE_ALPHA;
|
|
||||||
break;
|
|
||||||
case red | green | blue:
|
|
||||||
format = GL_RGB;
|
|
||||||
break;
|
|
||||||
case red | green | blue | alpha:
|
|
||||||
format = GL_RGBA;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, texture_id);
|
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
|
||||||
|
|
||||||
|
|
||||||
glTexImage2D(
|
|
||||||
GL_TEXTURE_2D, 0,
|
|
||||||
GL_RGBA8,
|
|
||||||
texture.width(),
|
|
||||||
texture.height(),
|
|
||||||
0,
|
|
||||||
format,
|
|
||||||
GL_UNSIGNED_BYTE,
|
|
||||||
texture.data()
|
|
||||||
);
|
|
||||||
glGenerateMipmap(GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
|
|
||||||
glDeleteTextures(invalid_texture_ids.size(), invalid_texture_ids.data());
|
|
||||||
|
|
||||||
invalid_texture_ids.resize(texture_ids.size() - invalid_texture_ids.size());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -68,6 +68,11 @@ struct category : std::error_category
|
|||||||
return { static_cast<int>(e), error_category() };
|
return { static_cast<int>(e), error_category() };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] inline std::error_code get_error()
|
||||||
|
{
|
||||||
|
return make_error_code(glGetError());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace zgl
|
} // namespace zgl
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|||||||
18
include/opengl/handles/index_buffer_handle.hpp
Normal file
18
include/opengl/handles/index_buffer_handle.hpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "opengl/resource_management/resource_handle.hpp"
|
||||||
|
|
||||||
|
namespace zgl
|
||||||
|
{
|
||||||
|
|
||||||
|
struct index_buffer_handle : resource_handle
|
||||||
|
{
|
||||||
|
inline void bind() const;
|
||||||
|
inline static void unbind();
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#define INCLUDE_INDEX_BUFFER_HANDLE_IMPLEMENTATION
|
||||||
|
#include "opengl/handles/index_buffer_handle.ipp"
|
||||||
|
#undef INCLUDE_INDEX_BUFFER_HANDLE_IMPLEMENTATION
|
||||||
@@ -7,7 +7,7 @@ namespace zgl
|
|||||||
|
|
||||||
struct shader_handle_set
|
struct shader_handle_set
|
||||||
{
|
{
|
||||||
std::array<shader_handle, zgl::shading::stage::count> stages;
|
std::array<shader_handle, shading::stage::count> stages;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ struct shader_program_handle
|
|||||||
|
|
||||||
[[nodiscard]] uniform_support_type check_uniform_support(std::span<const shader_program_variable> uniforms) const;
|
[[nodiscard]] uniform_support_type check_uniform_support(std::span<const shader_program_variable> uniforms) const;
|
||||||
|
|
||||||
GLuint program_id{ 0 };
|
[[nodiscard]] bool valid() const;
|
||||||
|
|
||||||
|
GLuint id{ 0 };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "GL/glew.h"
|
#include "opengl/resource_management/resource_handle.hpp"
|
||||||
|
|
||||||
namespace zgl {
|
namespace zgl
|
||||||
struct texture_handle
|
{
|
||||||
|
|
||||||
|
struct texture_handle : resource_handle
|
||||||
{
|
{
|
||||||
inline void bind() const;
|
inline void bind() const;
|
||||||
inline static void unbind();
|
inline static void unbind();
|
||||||
|
|
||||||
GLuint texture_id{ 0 };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INCLUDE_TEXTURE_INSTANCE_IMPLEMENTATION
|
#define INCLUDE_TEXTURE_INSTANCE_IMPLEMENTATION
|
||||||
|
|||||||
19
include/opengl/handles/vertex_buffer_handle.hpp
Normal file
19
include/opengl/handles/vertex_buffer_handle.hpp
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "opengl/resource_management/resource_handle.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace zgl
|
||||||
|
{
|
||||||
|
|
||||||
|
struct vertex_buffer_handle : resource_handle
|
||||||
|
{
|
||||||
|
inline void bind() const;
|
||||||
|
inline static void unbind();
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#define INCLUDE_VERTEX_BUFFER_HANDLE_IMPLEMENTATION
|
||||||
|
#include "opengl/handles/vertex_buffer_handle.ipp"
|
||||||
|
#undef INCLUDE_VERTEX_BUFFER_HANDLE_IMPLEMENTATION
|
||||||
15
include/opengl/metadata/shader_program_metadata.hpp
Normal file
15
include/opengl/metadata/shader_program_metadata.hpp
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "opengl/shading/model_geometry.hpp"
|
||||||
|
#include "opengl/shading/features/generic_features.hpp"
|
||||||
|
|
||||||
|
namespace zgl {
|
||||||
|
|
||||||
|
struct shader_program_metadata
|
||||||
|
{
|
||||||
|
shading::model_geometry::types geometry;
|
||||||
|
shading::features::generic::type static_enabled{};
|
||||||
|
shading::features::generic::type dynamic_enable{};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "opengl/shading/model_geometry.hpp"
|
|
||||||
#include "opengl/shading/shader_stage.hpp"
|
|
||||||
#include "opengl/shading/features/generic_features.hpp"
|
#include "opengl/shading/features/generic_features.hpp"
|
||||||
|
|
||||||
namespace zgl
|
namespace zgl
|
||||||
|
|||||||
13
include/opengl/metadata/texture_metadata.hpp
Normal file
13
include/opengl/metadata/texture_metadata.hpp
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "assets/components/texture_components.hpp"
|
||||||
|
|
||||||
|
namespace zgl
|
||||||
|
{
|
||||||
|
|
||||||
|
struct texture_metadata
|
||||||
|
{
|
||||||
|
components::texture::flags components;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
26
include/opengl/metadata/vertex_buffer_metadata.hpp
Normal file
26
include/opengl/metadata/vertex_buffer_metadata.hpp
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "assets/components/texture_components.hpp"
|
||||||
|
#include <array>
|
||||||
|
|
||||||
|
#include "GL/glew.h"
|
||||||
|
|
||||||
|
namespace zgl
|
||||||
|
{
|
||||||
|
|
||||||
|
struct vertex_buffer_metadata
|
||||||
|
{
|
||||||
|
static constexpr std::size_t max_component_count = 8;
|
||||||
|
|
||||||
|
struct component
|
||||||
|
{
|
||||||
|
GLenum type{ GL_INVALID_ENUM };
|
||||||
|
GLint length{ 0 };
|
||||||
|
};
|
||||||
|
|
||||||
|
std::array<component, max_component_count> components{};
|
||||||
|
GLuint component_count{};
|
||||||
|
GLsizei stride{};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
20
include/opengl/resource_management/reference_counter.hpp
Normal file
20
include/opengl/resource_management/reference_counter.hpp
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "GL/glew.h"
|
||||||
|
|
||||||
|
namespace zgl
|
||||||
|
{
|
||||||
|
|
||||||
|
class reference_counter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using gl_id_type = GLuint;
|
||||||
|
|
||||||
|
virtual void add_reference(gl_id_type id) = 0;
|
||||||
|
|
||||||
|
virtual void remove_reference(gl_id_type id) = 0;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
36
include/opengl/resource_management/resource_handle.hpp
Normal file
36
include/opengl/resource_management/resource_handle.hpp
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "resource_manager.hpp"
|
||||||
|
|
||||||
|
namespace zgl
|
||||||
|
{
|
||||||
|
|
||||||
|
class resource_handle
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using id_type = reference_counter::gl_id_type;
|
||||||
|
|
||||||
|
resource_handle() = default;
|
||||||
|
|
||||||
|
inline resource_handle(id_type id, reference_counter* manager);
|
||||||
|
|
||||||
|
resource_handle(const resource_handle& other) = delete;
|
||||||
|
resource_handle& operator=(const resource_handle& other) = delete;
|
||||||
|
|
||||||
|
inline resource_handle(resource_handle&& other) noexcept;
|
||||||
|
inline resource_handle& operator=(resource_handle&& other) noexcept;
|
||||||
|
|
||||||
|
inline ~resource_handle();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
id_type m_id{ 0 };
|
||||||
|
|
||||||
|
private:
|
||||||
|
reference_counter* m_counter{ nullptr };
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#define INCLUDE_RESOURCE_HANDLE_IMPLEMENTATION
|
||||||
|
#include "opengl/resource_management/resource_handle.ipp"
|
||||||
|
#undef INCLUDE_RESOURCE_HANDLE_IMPLEMENTATION
|
||||||
55
include/opengl/resource_management/resource_manager.hpp
Normal file
55
include/opengl/resource_management/resource_manager.hpp
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
#include <shared_mutex>
|
||||||
|
#include <vector>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
|
#include "opengl/resource_management/reference_counter.hpp"
|
||||||
|
namespace zgl
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
template<typename StoreID, typename MetaData>
|
||||||
|
class resource_manager : public reference_counter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using gl_id_type = GLuint;
|
||||||
|
using size_type = std::uint64_t;
|
||||||
|
using resource_entry_type = std::pair<gl_id_type, MetaData>;
|
||||||
|
|
||||||
|
friend class resource_handle;
|
||||||
|
|
||||||
|
bool has_resource(StoreID store_id);
|
||||||
|
|
||||||
|
std::optional<std::pair<resource_handle, MetaData>> get_resource(StoreID store_id);
|
||||||
|
|
||||||
|
void collect_garbage();
|
||||||
|
|
||||||
|
void add_resource(StoreID store_id, gl_id_type gl_id, MetaData meta);
|
||||||
|
|
||||||
|
[[nodiscard]] size_type count_garbage();
|
||||||
|
|
||||||
|
void extract_garbage(std::vector<gl_id_type>& dst);
|
||||||
|
|
||||||
|
void add_reference(gl_id_type id) override;
|
||||||
|
|
||||||
|
void remove_reference(gl_id_type id) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static constexpr size_type unused_resource_flag = size_type{ 1 } << (sizeof(size_type) * 8 - 1);
|
||||||
|
|
||||||
|
size_type max_unused_collection_cycle_count;
|
||||||
|
|
||||||
|
std::shared_mutex m_lock;
|
||||||
|
std::unordered_map<StoreID, resource_entry_type> m_resource_lookup;
|
||||||
|
std::unordered_map<gl_id_type, size_type> m_reference_counters;
|
||||||
|
std::unordered_set<gl_id_type> m_unused_handles;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#define INCLUDE_RESOURCE_MANAGER_IMPLEMENTATION
|
||||||
|
#include "opengl/resource_management/resource_manager.ipp"
|
||||||
|
#undef INCLUDE_RESOURCE_MANAGER_IMPLEMENTATION
|
||||||
@@ -1,44 +1,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "model_geometry.hpp"
|
#include "opengl/shading/model_geometry.hpp"
|
||||||
#include "shader_stage.hpp"
|
#include "opengl/shading/features/generic_features.hpp"
|
||||||
#include "features/mesh_features.hpp"
|
|
||||||
#include "features/point_cloud_features.hpp"
|
|
||||||
#include "features/generic_features.hpp"
|
|
||||||
|
|
||||||
namespace zgl::shading
|
namespace zgl::shading
|
||||||
{
|
{
|
||||||
|
|
||||||
struct shader_program_requirements
|
struct shader_program_requirements
|
||||||
{
|
{
|
||||||
|
model_geometry::types geometry;
|
||||||
static constexpr auto geometry_bits = static_cast<std::size_t>(std::bit_width(model_geometry::names.size()));
|
features::generic::type features;
|
||||||
static constexpr auto feature_bits = sizeof(features::generic::type) * 8 - geometry_bits;
|
|
||||||
|
|
||||||
explicit shader_program_requirements(const features::mesh::flags mesh_features) :
|
|
||||||
shader_program_requirements(model_geometry::types::mesh, static_cast<features::generic::type>(mesh_features)) {}
|
|
||||||
|
|
||||||
explicit shader_program_requirements(const features::point_cloud::flags point_cloud_features) :
|
|
||||||
shader_program_requirements(model_geometry::types::point_cloud, static_cast<features::generic::type>(point_cloud_features)) {}
|
|
||||||
|
|
||||||
shader_program_requirements(const model_geometry::types geometry_type, const features::generic::type generic_features) :
|
|
||||||
geometry_type{ geometry_type }, features{ generic_features } {}
|
|
||||||
|
|
||||||
|
|
||||||
[[nodiscard]] auto operator<=>(const shader_program_requirements& other) const noexcept
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
std::tie(this->geometry_type, std::popcount(this->features)) <=>
|
|
||||||
std::tie(other.geometry_type, std::popcount(other.features))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] bool operator==(const shader_program_requirements& other) const noexcept = default;
|
|
||||||
|
|
||||||
model_geometry::types geometry_type : geometry_bits;
|
|
||||||
features::generic::type features : feature_bits;
|
|
||||||
};
|
};
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
struct shader_program_metadata
|
struct shader_program_metadata
|
||||||
{
|
{
|
||||||
@@ -83,4 +55,3 @@ struct shader_program_metadata
|
|||||||
generic_feature_type m_dynamic_enable;
|
generic_feature_type m_dynamic_enable;
|
||||||
};*/
|
};*/
|
||||||
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "opengl/handles/shader_handle.hpp"
|
|
||||||
|
|
||||||
namespace zgl
|
|
||||||
{
|
|
||||||
struct shader_set
|
|
||||||
{
|
|
||||||
shader_handle vertex_shader;
|
|
||||||
shader_handle tesselation_control_shader;
|
|
||||||
shader_handle tesselation_evaluation_shader;
|
|
||||||
shader_handle geometry_shader;
|
|
||||||
shader_handle fragment_shader;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -28,4 +28,12 @@ inline constexpr auto names = std::array<std::string_view, count>{
|
|||||||
"fragment"
|
"fragment"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static constexpr auto mandatory = std::array<bool, zgl::shading::stage::count>{
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
55
include/util/reference_counter.hpp
Normal file
55
include/util/reference_counter.hpp
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cinttypes>
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Code taken Daniel Anderson's Talk "When Lock-Free Still Isn't Enough" Slide 28:
|
||||||
|
* https://github.com/CppCon/CppCon2024/blob/main/Presentations/When_Lock-Free_Still_Isn't_Enough.pdf
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct reference_counter
|
||||||
|
{
|
||||||
|
using size_type = std::uint64_t;
|
||||||
|
|
||||||
|
static constexpr size_type bit_count = sizeof(size_type) * 8;
|
||||||
|
static constexpr size_type was_zero_flag = size_type{ 1 } << (bit_count - 1);
|
||||||
|
static constexpr size_type has_helped_flag = size_type{ 1 } << (bit_count - 2);
|
||||||
|
|
||||||
|
bool increment()
|
||||||
|
{
|
||||||
|
const auto prev_count = m_counter.fetch_add(1);
|
||||||
|
return (prev_count & was_zero_flag) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool decrement()
|
||||||
|
{
|
||||||
|
if (m_counter.fetch_sub(1) == 1)
|
||||||
|
{
|
||||||
|
auto e = size_type{};
|
||||||
|
if (m_counter.compare_exchange_strong(e, was_zero_flag))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((e & has_helped_flag) and (m_counter.exchange(was_zero_flag) & has_helped_flag))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_type count()
|
||||||
|
{
|
||||||
|
auto value = m_counter.load();
|
||||||
|
if (value == 0 and m_counter.compare_exchange_strong(value, was_zero_flag | has_helped_flag))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return value & was_zero_flag ? 0 : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::atomic<size_type> m_counter{ 1 };
|
||||||
|
};
|
||||||
@@ -11,13 +11,13 @@
|
|||||||
namespace zgl
|
namespace zgl
|
||||||
{
|
{
|
||||||
inline shader_program_data::shader_program_data(GLuint program_id)
|
inline shader_program_data::shader_program_data(GLuint program_id)
|
||||||
: m_handle{ program_id } {}
|
: handle{ program_id } {}
|
||||||
|
|
||||||
|
|
||||||
inline shader_program_data::shader_program_data(shader_program_data&& other) noexcept
|
inline shader_program_data::shader_program_data(shader_program_data&& other) noexcept
|
||||||
{
|
{
|
||||||
m_handle = other.m_handle;
|
handle = other.handle;
|
||||||
other.m_handle.program_id = 0;
|
other.handle.id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline shader_program_data& shader_program_data::operator=(shader_program_data&& other) noexcept
|
inline shader_program_data& shader_program_data::operator=(shader_program_data&& other) noexcept
|
||||||
@@ -25,21 +25,16 @@ inline shader_program_data& shader_program_data::operator=(shader_program_data&&
|
|||||||
if (&other != this)
|
if (&other != this)
|
||||||
{
|
{
|
||||||
this->~shader_program_data();
|
this->~shader_program_data();
|
||||||
m_handle = other.m_handle;
|
handle = other.handle;
|
||||||
other.m_handle.program_id = 0;
|
other.handle.id = 0;
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline shader_program_data::~shader_program_data()
|
inline shader_program_data::~shader_program_data()
|
||||||
{
|
{
|
||||||
if (m_handle.program_id) {
|
if (handle.id) {
|
||||||
glDeleteProgram(m_handle.program_id);
|
glDeleteProgram(handle.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] inline shader_program_handle shader_program_data::handle() const
|
|
||||||
{
|
|
||||||
return m_handle;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,10 @@
|
|||||||
|
|
||||||
namespace zgl
|
namespace zgl
|
||||||
{
|
{
|
||||||
inline texture_data::texture_data(const GLuint texture_id)
|
|
||||||
: m_handle{ texture_id } {}
|
|
||||||
|
|
||||||
inline texture_data::texture_data(texture_data&& other) noexcept
|
inline texture_data::texture_data(texture_data&& other) noexcept
|
||||||
: m_handle{ other.m_handle }
|
: handle{ other.handle }
|
||||||
{
|
{
|
||||||
other.m_handle.texture_id = 0;
|
other.handle.id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline texture_data& texture_data::operator=(texture_data&& other) noexcept
|
inline texture_data& texture_data::operator=(texture_data&& other) noexcept
|
||||||
@@ -19,61 +16,24 @@ inline texture_data& texture_data::operator=(texture_data&& other) noexcept
|
|||||||
{
|
{
|
||||||
this->~texture_data();
|
this->~texture_data();
|
||||||
|
|
||||||
m_handle = other.m_handle;
|
handle = other.handle;
|
||||||
|
|
||||||
other.m_handle.texture_id = 0;
|
other.handle.id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
std::error_code texture_data::build_from(
|
|
||||||
std::span<const T> buffer,
|
|
||||||
const GLenum format,
|
|
||||||
const GLenum type,
|
|
||||||
const GLsizei width,
|
|
||||||
const GLsizei height,
|
|
||||||
texture_data& data
|
|
||||||
) {
|
|
||||||
GLuint texture_id;
|
|
||||||
|
|
||||||
glGenTextures(1, &texture_id);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, texture_id);
|
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
|
||||||
|
|
||||||
glTexImage2D(
|
|
||||||
GL_TEXTURE_2D, 0,
|
|
||||||
GL_RGBA8,
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
0,
|
|
||||||
format, type,
|
|
||||||
buffer.data()
|
|
||||||
);
|
|
||||||
glGenerateMipmap(GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
|
|
||||||
data = texture_data(texture_id);
|
|
||||||
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
inline texture_data::~texture_data()
|
inline texture_data::~texture_data()
|
||||||
{
|
{
|
||||||
if (m_handle.texture_id)
|
if (handle.id)
|
||||||
{
|
{
|
||||||
glDeleteTextures(1, &m_handle.texture_id);
|
glDeleteTextures(1, &handle.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline texture_handle texture_data::handle() const
|
inline texture_handle texture_data::handle() const
|
||||||
{
|
{
|
||||||
return { m_handle.texture_id };
|
return { handle.id };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
133
source/opengl/data_managers/mesh_vertex_buffer_manager.cpp
Normal file
133
source/opengl/data_managers/mesh_vertex_buffer_manager.cpp
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
#include "opengl/data_managers/mesh_vertex_buffer_manager.hpp"
|
||||||
|
|
||||||
|
void zgl::mesh_vertex_buffer_manager::process(store_type& store)
|
||||||
|
{
|
||||||
|
for (const auto& [ id, mesh ] : store)
|
||||||
|
{
|
||||||
|
// The ireator must reutrn a pair containing the components and a tuple of spans
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename C, typename... Ts>
|
||||||
|
void dynamic_vertex_buffer<C, Ts...>::build_vertex_buffer(
|
||||||
|
std::vector<ztu::u8>& vertex_buffer,
|
||||||
|
std::size_t& component_count,
|
||||||
|
std::array<GLenum, sizeof...(Ts)>& component_types,
|
||||||
|
std::array<GLint, sizeof...(Ts)>& component_lengths,
|
||||||
|
GLsizei& stride
|
||||||
|
) const {
|
||||||
|
const auto for_all_components = [&]<typename T>(auto&& f, const T default_value)
|
||||||
|
{
|
||||||
|
return std::apply(
|
||||||
|
[&](const auto&... component_buffer)
|
||||||
|
{
|
||||||
|
std::array<T, sizeof...(component_buffer)> results{};
|
||||||
|
auto i = std::size_t{};
|
||||||
|
(
|
||||||
|
(
|
||||||
|
results[i] = [&](const auto& buffer, const auto index) -> T
|
||||||
|
{
|
||||||
|
if ((m_components & C{ 1 << index }) != C{})
|
||||||
|
{
|
||||||
|
return f(buffer, index);
|
||||||
|
}
|
||||||
|
return default_value;
|
||||||
|
}(component_buffer, i),
|
||||||
|
++i
|
||||||
|
),
|
||||||
|
...
|
||||||
|
);
|
||||||
|
return results;
|
||||||
|
},
|
||||||
|
m_component_buffers
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
component_count = 0;
|
||||||
|
component_types = for_all_components(
|
||||||
|
ztu::specialised_lambda
|
||||||
|
{
|
||||||
|
[&component_count]<numeric_type Component, std::size_t Count>(const std::vector<std::array<Component, Count>>&, std::size_t)
|
||||||
|
{
|
||||||
|
++component_count;
|
||||||
|
return zgl::type_utils::to_gl_type<Component>();
|
||||||
|
},
|
||||||
|
[&component_count]<numeric_type Component>(const std::vector<Component>&, std::size_t)
|
||||||
|
{
|
||||||
|
++component_count;
|
||||||
|
return zgl::type_utils::to_gl_type<Component>();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
GLenum{ GL_INVALID_VALUE }
|
||||||
|
);
|
||||||
|
|
||||||
|
const auto element_counts = for_all_components(
|
||||||
|
[]<class Component>(const std::vector<Component>& buffer, std::size_t)
|
||||||
|
{
|
||||||
|
return buffer.size();
|
||||||
|
},
|
||||||
|
std::numeric_limits<std::size_t>::max()
|
||||||
|
);
|
||||||
|
|
||||||
|
const auto minimum_element_count = std::ranges::min(element_counts);
|
||||||
|
|
||||||
|
component_lengths = for_all_components(
|
||||||
|
ztu::specialised_lambda
|
||||||
|
{
|
||||||
|
[]<class Component>(const std::vector<Component>&, std::size_t)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
},
|
||||||
|
[]<class Component, std::size_t Count>(const std::vector<std::array<Component, Count>>&, std::size_t)
|
||||||
|
{
|
||||||
|
return Count;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
GLsizei{ 0 }
|
||||||
|
);
|
||||||
|
|
||||||
|
auto component_sizes = std::array<GLsizei, sizeof...(Ts)>{};
|
||||||
|
for (std::size_t i{}; i != component_sizes.size(); ++i)
|
||||||
|
{
|
||||||
|
component_sizes[i] = component_lengths[i] * zgl::type_utils::size_of(component_types[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto total_size = minimum_element_count * std::accumulate(
|
||||||
|
component_sizes.begin(),
|
||||||
|
component_sizes.end(),
|
||||||
|
GLsizei{ 0 }
|
||||||
|
);
|
||||||
|
|
||||||
|
vertex_buffer.resize(total_size);
|
||||||
|
|
||||||
|
// Calculate offsets and stride
|
||||||
|
auto component_offsets = component_sizes;
|
||||||
|
stride = 0;
|
||||||
|
for (std::size_t i{}; i != component_offsets.size(); ++i) {
|
||||||
|
component_offsets[i] = stride;
|
||||||
|
stride += component_sizes[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy all the components over one by one
|
||||||
|
for_all_components(
|
||||||
|
[&]<class Component>(const std::vector<Component>& buffer, std::size_t index)
|
||||||
|
{
|
||||||
|
std::size_t pos = component_offsets[index];
|
||||||
|
for (std::size_t i{}; i != minimum_element_count; ++i)
|
||||||
|
{
|
||||||
|
std::memcpy(
|
||||||
|
&vertex_buffer[pos],
|
||||||
|
buffer[i].data(),
|
||||||
|
component_sizes[index]
|
||||||
|
);
|
||||||
|
pos += stride;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
// remove values of unused components
|
||||||
|
std::ignore = std::ranges::remove(component_lengths, 0);
|
||||||
|
std::ignore = std::ranges::remove(component_types, GL_INVALID_VALUE);
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
#include "opengl/data_uploaders/shader_compiler.hpp"
|
#include "opengl/data_managers/shader_manager.hpp"
|
||||||
|
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <bits/ranges_algobase.h>
|
#include <bits/ranges_algobase.h>
|
||||||
|
|
||||||
|
#include "opengl/error.hpp"
|
||||||
#include "util/logger.hpp"
|
#include "util/logger.hpp"
|
||||||
|
|
||||||
|
|
||||||
@@ -33,13 +35,17 @@ struct prioritized_metadata_comparator
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static constexpr auto gl_shader_types = std::array<GLenum, zgl::shading::stage::count>{
|
||||||
|
GL_VERTEX_SHADER,
|
||||||
|
GL_TESS_CONTROL_SHADER,
|
||||||
|
GL_TESS_EVALUATION_SHADER,
|
||||||
|
GL_GEOMETRY_SHADER,
|
||||||
|
GL_FRAGMENT_SHADER
|
||||||
|
};
|
||||||
|
|
||||||
zgl::shader_handle zgl::shader_program_compiler::find_shader(
|
std::optional<std::pair<zgl::shader_metadata, zgl::shader_handle>> zgl::shader_manager::find_shader(
|
||||||
const shading::shader_requirements& requirements
|
const shading::shader_requirements& requirements
|
||||||
) {
|
) {
|
||||||
|
|
||||||
auto handle = shader_handle{};
|
|
||||||
|
|
||||||
auto shader_it = std::ranges::lower_bound(
|
auto shader_it = std::ranges::lower_bound(
|
||||||
m_shader_lookup,
|
m_shader_lookup,
|
||||||
std::pair{ requirements.geometry, requirements.stage },
|
std::pair{ requirements.geometry, requirements.stage },
|
||||||
@@ -51,9 +57,6 @@ zgl::shader_handle zgl::shader_program_compiler::find_shader(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
dynamic_shader_source_store::id_type source_id{};
|
|
||||||
shading::features::generic::type to_be_enabled{};
|
|
||||||
|
|
||||||
while (
|
while (
|
||||||
shader_it != m_shader_lookup.end() and
|
shader_it != m_shader_lookup.end() and
|
||||||
shader_it->first.geometry == requirements.geometry and
|
shader_it->first.geometry == requirements.geometry and
|
||||||
@@ -67,36 +70,16 @@ zgl::shader_handle zgl::shader_program_compiler::find_shader(
|
|||||||
|
|
||||||
if (unwanted_static_features == 0 and missing_dynamic_features == 0)
|
if (unwanted_static_features == 0 and missing_dynamic_features == 0)
|
||||||
{
|
{
|
||||||
to_be_enabled = req.features & static_enable;
|
return std::pair{ meta, data.handle };
|
||||||
source_id = id;
|
|
||||||
|
|
||||||
res.static_enabled = features & ~dynamic_enable & ~unwanted_features;
|
|
||||||
res.dynamic_enable = dynamic_enable;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
++shader_it;
|
++shader_it;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source_id)
|
return std::nullopt;
|
||||||
{
|
|
||||||
const auto [ shader_source_it, source_found ] = shader_sources.find(source_id);
|
|
||||||
if (source_found)
|
|
||||||
{
|
|
||||||
get_define_strings(
|
|
||||||
req.geometry,
|
|
||||||
to_be_enabled,
|
|
||||||
res.string_count,
|
|
||||||
shader_strings
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return handle;
|
void zgl::shader_manager::get_handles(
|
||||||
}
|
|
||||||
|
|
||||||
void zgl::shader_program_compiler::compile_shaders(
|
|
||||||
const dynamic_shader_source_store& shader_sources,
|
const dynamic_shader_source_store& shader_sources,
|
||||||
std::span<const shading::shader_set_requirements> requirements,
|
std::span<const shading::shader_set_requirements> requirements,
|
||||||
std::span<shader_set_metadata> metadata,
|
std::span<shader_set_metadata> metadata,
|
||||||
@@ -119,8 +102,15 @@ void zgl::shader_program_compiler::compile_shaders(
|
|||||||
for (auto [ stage_index, handle ] : std::ranges::views::enumerate(shader_set.stages))
|
for (auto [ stage_index, handle ] : std::ranges::views::enumerate(shader_set.stages))
|
||||||
{
|
{
|
||||||
shader_req.stage = static_cast<shading::stage::types>(stage_index);
|
shader_req.stage = static_cast<shading::stage::types>(stage_index);
|
||||||
handle = find_shader(shader_req);
|
|
||||||
if (not handle.valid())
|
if (auto shader_match = find_shader(shader_req))
|
||||||
|
{
|
||||||
|
const auto& [ shader_meta, shader_handle ] = *shader_match;
|
||||||
|
shader_set_meta.static_enabled |= shader_meta.static_enabled;
|
||||||
|
shader_set_meta.dynamic_enable |= shader_meta.dynamic_enable;
|
||||||
|
handle = shader_handle;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
m_source_requirement_buffer.push_back(shader_req);
|
m_source_requirement_buffer.push_back(shader_req);
|
||||||
}
|
}
|
||||||
@@ -132,7 +122,7 @@ void zgl::shader_program_compiler::compile_shaders(
|
|||||||
m_preprocessed_shader_source_metadata_buffer.resize(m_source_requirement_buffer.size());
|
m_preprocessed_shader_source_metadata_buffer.resize(m_source_requirement_buffer.size());
|
||||||
m_source_strings_buffer.clear();
|
m_source_strings_buffer.clear();
|
||||||
|
|
||||||
m_preprocessor.fetch_shader_sources(
|
m_preprocessor.get_shader_sources(
|
||||||
shader_sources,
|
shader_sources,
|
||||||
m_source_requirement_buffer,
|
m_source_requirement_buffer,
|
||||||
m_preprocessed_shader_source_metadata_buffer,
|
m_preprocessed_shader_source_metadata_buffer,
|
||||||
@@ -147,9 +137,13 @@ void zgl::shader_program_compiler::compile_shaders(
|
|||||||
|
|
||||||
for (auto [ shader_set_meta, shader_set ] : std::ranges::views::zip( metadata, shader_sets))
|
for (auto [ shader_set_meta, shader_set ] : std::ranges::views::zip( metadata, shader_sets))
|
||||||
{
|
{
|
||||||
|
auto shader_missing = false;
|
||||||
|
|
||||||
for (auto [ stage_index, handle ] : std::ranges::views::enumerate(shader_set.stages))
|
for (auto [ stage_index, handle ] : std::ranges::views::enumerate(shader_set.stages))
|
||||||
{
|
{
|
||||||
if (not handle.valid())
|
if (not handle.valid())
|
||||||
|
{
|
||||||
|
if (not shader_missing)
|
||||||
{
|
{
|
||||||
if (source_meta_it->string_count > 0)
|
if (source_meta_it->string_count > 0)
|
||||||
{
|
{
|
||||||
@@ -175,11 +169,19 @@ void zgl::shader_program_compiler::compile_shaders(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shader_missing = not handle.valid() and shading::stage::mandatory[stage_index];
|
||||||
|
}
|
||||||
|
|
||||||
source_strings_it += source_meta_it->string_count;
|
source_strings_it += source_meta_it->string_count;
|
||||||
++source_meta_it;
|
++source_meta_it;
|
||||||
++source_req_it;
|
++source_req_it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shader_missing)
|
||||||
|
{
|
||||||
|
shader_set.stages = {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto new_shaders = std::span(m_shader_lookup).subspan(prev_shader_count);
|
const auto new_shaders = std::span(m_shader_lookup).subspan(prev_shader_count);
|
||||||
@@ -196,16 +198,20 @@ void zgl::shader_program_compiler::compile_shaders(
|
|||||||
prioritized_metadata_comparator{},
|
prioritized_metadata_comparator{},
|
||||||
&shader_lookup_entry_type::first
|
&shader_lookup_entry_type::first
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool zgl::shader_program_compiler::compile_shader(
|
bool zgl::shader_manager::compile_shader(
|
||||||
GLenum shader_type,
|
GLenum shader_type,
|
||||||
std::span<const char*> source_strings,
|
std::span<const char*> source_strings,
|
||||||
shader_data& shader
|
shader_data& shader
|
||||||
) {
|
) {
|
||||||
|
|
||||||
shader = shader_data(glCreateShader(shader_type));
|
shader = shader_data(glCreateShader(shader_type));
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while creating shader: %", e.message());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
glShaderSource(
|
glShaderSource(
|
||||||
shader.handle.id,
|
shader.handle.id,
|
||||||
@@ -213,13 +219,29 @@ bool zgl::shader_program_compiler::compile_shader(
|
|||||||
source_strings.data(),
|
source_strings.data(),
|
||||||
nullptr
|
nullptr
|
||||||
);
|
);
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while setting shader source: %", e.message());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
glCompileShader(shader.handle.id);
|
glCompileShader(shader.handle.id);
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while compiling shader: %", e.message());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
GLint success;
|
auto status = GLint{ GL_FALSE };
|
||||||
glGetShaderiv(shader.handle.id, GL_COMPILE_STATUS, &success);
|
glGetShaderiv(shader.handle.id, GL_COMPILE_STATUS, &status);
|
||||||
|
|
||||||
if (not success)
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while retrieving shader compilation status: %", e.message());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status == GL_FALSE)
|
||||||
{
|
{
|
||||||
GLint log_length{};
|
GLint log_length{};
|
||||||
glGetShaderiv(shader.handle.id, GL_INFO_LOG_LENGTH, &log_length);
|
glGetShaderiv(shader.handle.id, GL_INFO_LOG_LENGTH, &log_length);
|
||||||
@@ -235,8 +257,8 @@ bool zgl::shader_program_compiler::compile_shader(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void zgl::shader_program_compiler::preprocess(
|
void zgl::shader_manager::process(
|
||||||
const dynamic_shader_source_store& shader_sources
|
const dynamic_shader_source_store& shader_sources
|
||||||
) {
|
) {
|
||||||
m_preprocessor.preprocess(shader_sources);
|
m_preprocessor.process(shader_sources);
|
||||||
}
|
}
|
||||||
252
source/opengl/data_managers/shader_program_manager.cpp
Normal file
252
source/opengl/data_managers/shader_program_manager.cpp
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
#include "opengl/data_managers/shader_program_manager.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
struct prioritized_metadata_comparator
|
||||||
|
{
|
||||||
|
using type = zgl::shader_program_metadata;
|
||||||
|
|
||||||
|
bool operator()(const type& a, const type& b) const noexcept
|
||||||
|
{
|
||||||
|
if (a.geometry != b.geometry)
|
||||||
|
{
|
||||||
|
return a.geometry > b.geometry;
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr auto more_features = std::popcount<zgl::shading::features::generic::type>;
|
||||||
|
|
||||||
|
return std::ranges::lexicographical_compare(
|
||||||
|
std::array{ a.dynamic_enable, a.static_enabled },
|
||||||
|
std::array{ b.dynamic_enable, b.static_enabled },
|
||||||
|
std::greater{},
|
||||||
|
more_features,
|
||||||
|
more_features
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void zgl::shader_program_manager::process(
|
||||||
|
const dynamic_shader_source_store& shader_sources
|
||||||
|
) {
|
||||||
|
m_shader_manager.preprocess(shader_sources);
|
||||||
|
}
|
||||||
|
|
||||||
|
void zgl::shader_program_manager::get_handles(
|
||||||
|
const dynamic_shader_source_store& shader_sources,
|
||||||
|
std::span<const shading::shader_program_requirements> requirements,
|
||||||
|
std::span<shader_program_metadata> metadata,
|
||||||
|
std::span<shader_program_handle> shader_programs
|
||||||
|
) {
|
||||||
|
m_shader_requirements_buffer.clear();
|
||||||
|
|
||||||
|
for (auto [ req, program_meta, program_handle ] : std::ranges::views::zip(
|
||||||
|
requirements,
|
||||||
|
metadata,
|
||||||
|
shader_programs
|
||||||
|
)) {
|
||||||
|
|
||||||
|
if (auto shader_match = find_shader_program(req))
|
||||||
|
{
|
||||||
|
const auto& [ meta, handle ] = *shader_match;
|
||||||
|
program_meta.static_enabled = meta.static_enabled;
|
||||||
|
program_meta.dynamic_enable = meta.dynamic_enable;
|
||||||
|
program_handle = handle;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
program_meta = {};
|
||||||
|
program_handle = {};
|
||||||
|
m_shader_requirements_buffer.emplace_back(
|
||||||
|
req.geometry,
|
||||||
|
req.features
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
m_shader_metadata_buffer.clear();
|
||||||
|
m_shader_metadata_buffer.resize(m_shader_requirements_buffer.size());
|
||||||
|
shader_set_buffer.clear();
|
||||||
|
|
||||||
|
m_shader_manager.get_handles(
|
||||||
|
shader_sources,
|
||||||
|
m_shader_requirements_buffer,
|
||||||
|
m_shader_metadata_buffer,
|
||||||
|
shader_set_buffer
|
||||||
|
);
|
||||||
|
|
||||||
|
auto shader_set_req_it = m_shader_requirements_buffer.begin();
|
||||||
|
auto shader_set_meta_it = m_shader_metadata_buffer.begin();
|
||||||
|
auto shader_set_it = shader_set_buffer.begin();
|
||||||
|
|
||||||
|
const auto prev_shader_program_count = m_shader_program_lookup.size();
|
||||||
|
|
||||||
|
for (auto [ program_meta, program_handle ] : std::ranges::views::zip( metadata, shader_programs))
|
||||||
|
{
|
||||||
|
if (not program_handle.valid())
|
||||||
|
{
|
||||||
|
if (std::ranges::any_of(shader_set_it->stages, &shader_handle::valid))
|
||||||
|
{
|
||||||
|
shader_program_data program{};
|
||||||
|
|
||||||
|
if (link_shader_program(*shader_set_it))
|
||||||
|
{
|
||||||
|
program_handle = program.handle;
|
||||||
|
|
||||||
|
program_meta = shader_program_metadata{
|
||||||
|
.geometry = shader_set_req_it->geometry,
|
||||||
|
.static_enabled = shader_set_meta_it->static_enabled,
|
||||||
|
.dynamic_enable = shader_set_meta_it->dynamic_enable
|
||||||
|
};
|
||||||
|
|
||||||
|
m_shader_program_lookup.emplace_back(program_meta, std::move(program));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
++shader_set_req_it;
|
||||||
|
++shader_set_meta_it;
|
||||||
|
++shader_set_it;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto new_shader_programs = std::span(m_shader_program_lookup).subspan(prev_shader_program_count);
|
||||||
|
|
||||||
|
std::ranges::sort(
|
||||||
|
new_shader_programs,
|
||||||
|
prioritized_metadata_comparator{},
|
||||||
|
&shader_program_lookup_entry_type::first
|
||||||
|
);
|
||||||
|
|
||||||
|
std::ranges::inplace_merge(
|
||||||
|
m_shader_program_lookup,
|
||||||
|
m_shader_program_lookup.begin() + prev_shader_program_count,
|
||||||
|
prioritized_metadata_comparator{},
|
||||||
|
&shader_program_lookup_entry_type::first
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<std::pair<zgl::shader_program_metadata, zgl::shader_program_handle>> zgl::shader_program_manager::find_shader_program(
|
||||||
|
const shading::shader_program_requirements& requirements
|
||||||
|
) {
|
||||||
|
|
||||||
|
auto shader_program_it = std::ranges::lower_bound(
|
||||||
|
m_shader_program_lookup,
|
||||||
|
requirements.geometry,
|
||||||
|
std::greater{},
|
||||||
|
[](const shader_program_lookup_entry_type& entry)
|
||||||
|
{
|
||||||
|
const auto& meta = entry.first;
|
||||||
|
return meta.geometry;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
while (
|
||||||
|
shader_program_it != m_shader_program_lookup.end() and
|
||||||
|
shader_program_it->first.geometry == requirements.geometry
|
||||||
|
) {
|
||||||
|
const auto& [ meta, data ] = *shader_program_it;
|
||||||
|
|
||||||
|
const auto unwanted_static_features = meta.static_enabled & ~requirements.features;
|
||||||
|
const auto required_dynamic_features = requirements.features & ~meta.static_enabled;
|
||||||
|
const auto missing_dynamic_features = required_dynamic_features & ~meta.dynamic_enable;
|
||||||
|
|
||||||
|
if (unwanted_static_features == 0 and missing_dynamic_features == 0)
|
||||||
|
{
|
||||||
|
return std::pair{ meta, data.handle };
|
||||||
|
}
|
||||||
|
|
||||||
|
++shader_program_it;
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool zgl::shader_program_manager::link_shader_program(
|
||||||
|
const shader_handle_set& shaders
|
||||||
|
) {
|
||||||
|
const auto program = shader_program_data{ glCreateProgram() };
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while creating shader program: %.", e.message());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto [ index, entry ] : std::ranges::views::enumerate(std::ranges::views::zip(
|
||||||
|
shaders.stages,
|
||||||
|
shading::stage::names
|
||||||
|
))) {
|
||||||
|
const auto& [ shader, name ] = entry;
|
||||||
|
|
||||||
|
auto attached = false;
|
||||||
|
|
||||||
|
if (shader.id)
|
||||||
|
{
|
||||||
|
glAttachShader(program.handle.id, shader.id);
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
if (shading::stage::mandatory[index])
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while attaching the mandatory % shader: %.", name, e.message());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ztu::logger::warn("Error while attaching the optional % shader: %.", name, e.message());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
attached = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (not attached)
|
||||||
|
{
|
||||||
|
ztu::logger::warn("Using default % shader.", name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
glLinkProgram(program.handle.id);
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while linking shader program: %.", e.message());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto status = GLint{ GL_FALSE };
|
||||||
|
glGetProgramiv(program.handle.id, GL_LINK_STATUS, &status);
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while retrieving shader program link status: %.", e.message());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status == GL_FALSE) {
|
||||||
|
GLint log_length{};
|
||||||
|
glGetShaderiv(program.handle.id, GL_INFO_LOG_LENGTH, &log_length);
|
||||||
|
|
||||||
|
auto log = std::string(log_length, ' ');
|
||||||
|
glGetProgramInfoLog(program.handle.id, log_length, nullptr, log.data());
|
||||||
|
|
||||||
|
ztu::logger::error("Error while linking program:\n%", log);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
glUseProgram(0);
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::warn("Error while resetting active shader program: %.", e.message());
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto& shader : shaders.stages)
|
||||||
|
{
|
||||||
|
if (shader.id)
|
||||||
|
{
|
||||||
|
glDetachShader(program.handle.id, shader.id);
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::warn("Error while detaching shader: %.", e.message());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "opengl/data_uploaders/shader_preprocessor.hpp"
|
#include "opengl/data_managers/shader_source_manager.hpp"
|
||||||
|
|
||||||
#include "util/logger.hpp"
|
#include "util/logger.hpp"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@@ -7,6 +7,29 @@
|
|||||||
|
|
||||||
#include "opengl/shading/shader_metadata_language.hpp"
|
#include "opengl/shading/shader_metadata_language.hpp"
|
||||||
|
|
||||||
|
static auto mesh_feature_defines = std::array{
|
||||||
|
"#define FACE\n",
|
||||||
|
"#define LINE\n",
|
||||||
|
"#define POINT\n",
|
||||||
|
"#define V_L\n",
|
||||||
|
"#define V_RGB\n",
|
||||||
|
"#define V_A\n",
|
||||||
|
"#define LIGHTING\n",
|
||||||
|
"#define TEXTURE\n",
|
||||||
|
"#define U_RGBA\n",
|
||||||
|
};
|
||||||
|
|
||||||
|
static auto point_cloud_feature_defines = std::array{
|
||||||
|
"#define SQUARE\n",
|
||||||
|
"#define LIGHTING\n",
|
||||||
|
"#define V_L\n",
|
||||||
|
"#define V_RGB\n",
|
||||||
|
"#define V_A\n",
|
||||||
|
"#define U_RGBA\n",
|
||||||
|
"#define RAINBOW\n"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
struct prioritized_feature_set_comparator
|
struct prioritized_feature_set_comparator
|
||||||
{
|
{
|
||||||
using type = zgl::shader_features_set<zgl::shading::features::generic::type>;
|
using type = zgl::shader_features_set<zgl::shading::features::generic::type>;
|
||||||
@@ -53,7 +76,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void zgl::shader_preprocessor::preprocess(
|
void zgl::shader_source_manager::process(
|
||||||
const dynamic_shader_source_store& shader_sources
|
const dynamic_shader_source_store& shader_sources
|
||||||
) {
|
) {
|
||||||
namespace language = shading::shader_metadata_language;
|
namespace language = shading::shader_metadata_language;
|
||||||
@@ -95,7 +118,7 @@ void zgl::shader_preprocessor::preprocess(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void zgl::shader_preprocessor::fetch_shader_sources(
|
void zgl::shader_source_manager::get_shader_sources(
|
||||||
const dynamic_shader_source_store& shader_sources,
|
const dynamic_shader_source_store& shader_sources,
|
||||||
std::span<const shading::shader_source_requirements> requirements,
|
std::span<const shading::shader_source_requirements> requirements,
|
||||||
std::span<preprocessed_shader_source_metadata> metadata,
|
std::span<preprocessed_shader_source_metadata> metadata,
|
||||||
@@ -177,7 +200,7 @@ void zgl::shader_preprocessor::fetch_shader_sources(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void zgl::shader_preprocessor::get_define_strings(
|
void zgl::shader_source_manager::get_define_strings(
|
||||||
const shading::model_geometry::types geometry,
|
const shading::model_geometry::types geometry,
|
||||||
shading::features::generic::type features,
|
shading::features::generic::type features,
|
||||||
shading::features::generic::type& feature_count,
|
shading::features::generic::type& feature_count,
|
||||||
@@ -211,7 +234,7 @@ void zgl::shader_preprocessor::get_define_strings(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void zgl::shader_preprocessor::tokenize_declarations(
|
void zgl::shader_source_manager::tokenize_declarations(
|
||||||
std::string_view source_rest
|
std::string_view source_rest
|
||||||
) {
|
) {
|
||||||
namespace language = shading::shader_metadata_language;
|
namespace language = shading::shader_metadata_language;
|
||||||
@@ -274,7 +297,7 @@ void zgl::shader_preprocessor::tokenize_declarations(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool zgl::shader_preprocessor::parse_stage_declaration(
|
bool zgl::shader_source_manager::parse_stage_declaration(
|
||||||
std::span<const std::string_view> values,
|
std::span<const std::string_view> values,
|
||||||
shader_source_metadata& metadata
|
shader_source_metadata& metadata
|
||||||
) {
|
) {
|
||||||
@@ -301,7 +324,7 @@ bool zgl::shader_preprocessor::parse_stage_declaration(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool zgl::shader_preprocessor::parse_geometry_declaration(
|
bool zgl::shader_source_manager::parse_geometry_declaration(
|
||||||
std::span<const std::string_view> values,
|
std::span<const std::string_view> values,
|
||||||
shader_source_metadata& metadata
|
shader_source_metadata& metadata
|
||||||
) {
|
) {
|
||||||
@@ -329,7 +352,7 @@ bool zgl::shader_preprocessor::parse_geometry_declaration(
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void zgl::shader_preprocessor::parse_feature_tokens(
|
void zgl::shader_source_manager::parse_feature_tokens(
|
||||||
std::span<const std::string_view> values,
|
std::span<const std::string_view> values,
|
||||||
const ztu::string_lookup<T>& feature_lookup,
|
const ztu::string_lookup<T>& feature_lookup,
|
||||||
T& features
|
T& features
|
||||||
@@ -349,7 +372,7 @@ void zgl::shader_preprocessor::parse_feature_tokens(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool zgl::shader_preprocessor::parse_features_declaration(
|
bool zgl::shader_source_manager::parse_features_declaration(
|
||||||
std::span<const std::string_view> values,
|
std::span<const std::string_view> values,
|
||||||
shader_source_metadata& metadata
|
shader_source_metadata& metadata
|
||||||
) {
|
) {
|
||||||
@@ -370,7 +393,7 @@ bool zgl::shader_preprocessor::parse_features_declaration(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool zgl::shader_preprocessor::parse_static_enable_declaration(
|
bool zgl::shader_source_manager::parse_static_enable_declaration(
|
||||||
std::span<const std::string_view> values,
|
std::span<const std::string_view> values,
|
||||||
shader_source_metadata& metadata
|
shader_source_metadata& metadata
|
||||||
) {
|
) {
|
||||||
@@ -391,7 +414,7 @@ bool zgl::shader_preprocessor::parse_static_enable_declaration(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool zgl::shader_preprocessor::parse_dynamic_enable_declaration(
|
bool zgl::shader_source_manager::parse_dynamic_enable_declaration(
|
||||||
std::span<const std::string_view> values,
|
std::span<const std::string_view> values,
|
||||||
shader_source_metadata& metadata
|
shader_source_metadata& metadata
|
||||||
) {
|
) {
|
||||||
@@ -412,7 +435,7 @@ bool zgl::shader_preprocessor::parse_dynamic_enable_declaration(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<zgl::shader_source_metadata> zgl::shader_preprocessor::parse_metadata_from_tokens()
|
std::optional<zgl::shader_source_metadata> zgl::shader_source_manager::parse_metadata_from_tokens()
|
||||||
{
|
{
|
||||||
namespace language = shading::shader_metadata_language;
|
namespace language = shading::shader_metadata_language;
|
||||||
using namespace std::string_view_literals;
|
using namespace std::string_view_literals;
|
||||||
150
source/opengl/data_managers/texture_manager.cpp
Normal file
150
source/opengl/data_managers/texture_manager.cpp
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
#include "opengl/data_managers/texture_manager.hpp"
|
||||||
|
|
||||||
|
#include <ranges>
|
||||||
|
#include "util/logger.hpp"
|
||||||
|
#include "opengl/error.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
void zgl::texture_manager::process(
|
||||||
|
dynamic_texture_store& store
|
||||||
|
) {
|
||||||
|
m_texture_buffer.clear();
|
||||||
|
|
||||||
|
for (const auto& [ id, texture ] : store)
|
||||||
|
{
|
||||||
|
if (not m_resource_manager.has_resource(id))
|
||||||
|
{
|
||||||
|
m_texture_buffer.emplace_back(id, texture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_texture_id_buffer.resize(m_texture_buffer.size());
|
||||||
|
|
||||||
|
glGenTextures(m_texture_id_buffer.size(), m_texture_id_buffer.data());
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while creating % textures: %.", m_texture_id_buffer.size(), e.message());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto [ entry, texture_id ] : std::ranges::views::zip(m_texture_buffer, m_texture_id_buffer))
|
||||||
|
{
|
||||||
|
auto [ store_id, texture ] = entry;
|
||||||
|
|
||||||
|
GLenum format;
|
||||||
|
switch (texture.components()) {
|
||||||
|
using enum components::texture::flags;
|
||||||
|
case luminance:
|
||||||
|
format = GL_LUMINANCE;
|
||||||
|
break;
|
||||||
|
case luminance | alpha:
|
||||||
|
format = GL_LUMINANCE_ALPHA;
|
||||||
|
break;
|
||||||
|
case red | green | blue:
|
||||||
|
format = GL_RGB;
|
||||||
|
break;
|
||||||
|
case red | green | blue | alpha:
|
||||||
|
format = GL_RGBA;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// TODO create a print statement for these enum flaggy thingies
|
||||||
|
ztu::logger::error("Unsupported texture component configuration: %.", texture.components());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
glBindTexture(GL_TEXTURE_2D, texture_id);
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while binding texture %: %.", texture_id, e.message());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::warn("Error while setting texture parameters: %.", e.message());
|
||||||
|
}
|
||||||
|
|
||||||
|
glTexImage2D(
|
||||||
|
GL_TEXTURE_2D,
|
||||||
|
0,
|
||||||
|
GL_RGBA8,
|
||||||
|
texture.width(),
|
||||||
|
texture.height(),
|
||||||
|
0,
|
||||||
|
format,
|
||||||
|
GL_UNSIGNED_BYTE,
|
||||||
|
texture.data()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while setting texture data: %.", e.message());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
glGenerateMipmap(GL_TEXTURE_2D);
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::warn("Error while generating texture mipmaps: %.", e.message());
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto meta = metadata_type{
|
||||||
|
.components = texture.components()
|
||||||
|
};
|
||||||
|
|
||||||
|
m_resource_manager.add_resource(store_id, texture_id, meta);
|
||||||
|
|
||||||
|
texture_id = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
|
||||||
|
const auto valid_texture_ids = std::ranges::remove(
|
||||||
|
m_texture_id_buffer,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
const auto invalid_texture_count = m_texture_id_buffer.size() - valid_texture_ids.size();
|
||||||
|
|
||||||
|
glDeleteTextures(
|
||||||
|
invalid_texture_count,
|
||||||
|
m_texture_id_buffer.data()
|
||||||
|
);
|
||||||
|
if (const auto e = get_error())
|
||||||
|
{
|
||||||
|
ztu::logger::error("Error while deleting % textures: %.", invalid_texture_count, e.message());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<zgl::texture_manager::handle_type> zgl::texture_manager::get_handle(
|
||||||
|
const store_id_type id
|
||||||
|
) {
|
||||||
|
return m_resource_manager
|
||||||
|
.get_resource(id)
|
||||||
|
.transform(
|
||||||
|
[](auto& resource)
|
||||||
|
{
|
||||||
|
return *reinterpret_cast<handle_type*>(resource);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void zgl::texture_manager::collect_garbage(const bool force)
|
||||||
|
{
|
||||||
|
m_resource_manager.collect_garbage();
|
||||||
|
if (force or m_resource_manager.count_garbage() >= min_garbage_collection_count)
|
||||||
|
{
|
||||||
|
m_texture_id_buffer.clear();
|
||||||
|
m_resource_manager.extract_garbage(m_texture_id_buffer);
|
||||||
|
glDeleteTextures(
|
||||||
|
m_texture_id_buffer.size(),
|
||||||
|
m_texture_id_buffer.data()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
14
source/opengl/handles/index_buffer_handle.ipp
Normal file
14
source/opengl/handles/index_buffer_handle.ipp
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#ifndef INCLUDE_INDEX_BUFFER_HANDLE_IMPLEMENTATION
|
||||||
|
#error Never include this file directly include 'index_buffer_handle.hpp'
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
void zgl::index_buffer_handle::bind() const
|
||||||
|
{
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void zgl::index_buffer_handle::unbind()
|
||||||
|
{
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||||
|
}
|
||||||
@@ -25,7 +25,7 @@ shader_program_handle::attribute_support_type shader_program_handle::check_attri
|
|||||||
|
|
||||||
auto curr_attribute_flag = attribute_support_type{ 1 };
|
auto curr_attribute_flag = attribute_support_type{ 1 };
|
||||||
for (const auto& attribute : attributes) {
|
for (const auto& attribute : attributes) {
|
||||||
const auto location = glGetAttribLocation(program_id, attribute.name);
|
const auto location = glGetAttribLocation(id, attribute.name);
|
||||||
if (location == attribute.info.location)
|
if (location == attribute.info.location)
|
||||||
{
|
{
|
||||||
attribute_candidates |= curr_attribute_flag;
|
attribute_candidates |= curr_attribute_flag;
|
||||||
@@ -36,7 +36,7 @@ shader_program_handle::attribute_support_type shader_program_handle::check_attri
|
|||||||
auto supported_attributes = attribute_support_type{};
|
auto supported_attributes = attribute_support_type{};
|
||||||
|
|
||||||
GLint count;
|
GLint count;
|
||||||
glGetProgramiv(program_id, GL_ACTIVE_ATTRIBUTES, &count);
|
glGetProgramiv(id, GL_ACTIVE_ATTRIBUTES, &count);
|
||||||
if (check_error()) ztu::logger::error("GL_err: %", error.message());
|
if (check_error()) ztu::logger::error("GL_err: %", error.message());
|
||||||
|
|
||||||
for (GLint i{}; i != count and attribute_candidates; ++i)
|
for (GLint i{}; i != count and attribute_candidates; ++i)
|
||||||
@@ -46,7 +46,7 @@ shader_program_handle::attribute_support_type shader_program_handle::check_attri
|
|||||||
GLsizei name_length;
|
GLsizei name_length;
|
||||||
auto name = std::array<char, 256>{};
|
auto name = std::array<char, 256>{};
|
||||||
glGetActiveAttrib(
|
glGetActiveAttrib(
|
||||||
program_id, i,
|
id, i,
|
||||||
name.size(),
|
name.size(),
|
||||||
&name_length,
|
&name_length,
|
||||||
&size, &type,
|
&size, &type,
|
||||||
@@ -93,12 +93,12 @@ shader_program_handle::uniform_support_type shader_program_handle::check_uniform
|
|||||||
auto curr_uniform_flag = uniform_support_type{ 1 };
|
auto curr_uniform_flag = uniform_support_type{ 1 };
|
||||||
for (const auto& uniform : uniforms)
|
for (const auto& uniform : uniforms)
|
||||||
{
|
{
|
||||||
const auto location = glGetUniformLocation(program_id, uniform.name);
|
const auto location = glGetUniformLocation(id, uniform.name);
|
||||||
|
|
||||||
if (location == uniform.info.location)
|
if (location == uniform.info.location)
|
||||||
{
|
{
|
||||||
uniform_candidates |= curr_uniform_flag;
|
uniform_candidates |= curr_uniform_flag;
|
||||||
ztu::logger::debug("[%] '%': %.", program_id, uniform.name, location);
|
ztu::logger::debug("[%] '%': %.", id, uniform.name, location);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -110,7 +110,7 @@ shader_program_handle::uniform_support_type shader_program_handle::check_uniform
|
|||||||
auto supported_uniforms = uniform_support_type{};
|
auto supported_uniforms = uniform_support_type{};
|
||||||
|
|
||||||
GLint count;
|
GLint count;
|
||||||
glGetProgramiv(program_id, GL_ACTIVE_UNIFORMS, &count);
|
glGetProgramiv(id, GL_ACTIVE_UNIFORMS, &count);
|
||||||
if (check_error()) ztu::logger::error("GL_err: %", error.message());
|
if (check_error()) ztu::logger::error("GL_err: %", error.message());
|
||||||
|
|
||||||
for (GLint i{}; i != count and uniform_candidates; ++i)
|
for (GLint i{}; i != count and uniform_candidates; ++i)
|
||||||
@@ -120,7 +120,7 @@ shader_program_handle::uniform_support_type shader_program_handle::check_uniform
|
|||||||
GLsizei name_length;
|
GLsizei name_length;
|
||||||
auto name = std::array<char, 256>{};
|
auto name = std::array<char, 256>{};
|
||||||
glGetActiveUniform(
|
glGetActiveUniform(
|
||||||
program_id, i,
|
id, i,
|
||||||
name.size(),
|
name.size(),
|
||||||
&name_length,
|
&name_length,
|
||||||
&size, &type,
|
&size, &type,
|
||||||
@@ -149,4 +149,9 @@ shader_program_handle::uniform_support_type shader_program_handle::check_uniform
|
|||||||
|
|
||||||
return supported_uniforms;
|
return supported_uniforms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool shader_program_handle::valid() const
|
||||||
|
{
|
||||||
|
return id != 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace zgl
|
|||||||
{
|
{
|
||||||
inline void shader_program_handle::bind() const
|
inline void shader_program_handle::bind() const
|
||||||
{
|
{
|
||||||
glUseProgram(program_id);
|
glUseProgram(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void shader_program_handle::unbind()
|
inline void shader_program_handle::unbind()
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace zgl
|
|||||||
{
|
{
|
||||||
inline void texture_handle::bind() const
|
inline void texture_handle::bind() const
|
||||||
{
|
{
|
||||||
glBindTexture(GL_TEXTURE_2D, texture_id);
|
glBindTexture(GL_TEXTURE_2D, m_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void texture_handle::unbind()
|
inline void texture_handle::unbind()
|
||||||
|
|||||||
14
source/opengl/handles/vertex_buffer_handle.ipp
Normal file
14
source/opengl/handles/vertex_buffer_handle.ipp
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#ifndef INCLUDE_VERTEX_BUFFER_HANDLE_IMPLEMENTATION
|
||||||
|
#error Never include this file directly include 'vertex_buffer_handle.hpp'
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
void zgl::vertex_buffer_handle::bind() const
|
||||||
|
{
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, m_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void zgl::vertex_buffer_handle::unbind()
|
||||||
|
{
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
}
|
||||||
67
source/opengl/resource_management/resource_handle.ipp
Normal file
67
source/opengl/resource_management/resource_handle.ipp
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
#ifndef INCLUDE_RESOURCE_HANDLE_IMPLEMENTATION
|
||||||
|
# error Never include this file directly include 'resource_handle.hpp'
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
zgl::resource_handle::resource_handle(id_type id, reference_counter* manager)
|
||||||
|
: m_id{ id }, m_counter{ manager } {}
|
||||||
|
|
||||||
|
zgl::resource_handle::resource_handle(const resource_handle& other) noexcept
|
||||||
|
: m_id{ other.m_id }, m_counter{ other.m_counter }
|
||||||
|
{
|
||||||
|
if (m_id != 0 and m_counter != nullptr)
|
||||||
|
{
|
||||||
|
m_counter->add_reference(m_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
zgl::resource_handle& zgl::resource_handle::operator=(
|
||||||
|
const resource_handle& other
|
||||||
|
) noexcept {
|
||||||
|
if (&other != this)
|
||||||
|
{
|
||||||
|
this->~resource_handle();
|
||||||
|
|
||||||
|
m_id = other.m_id;
|
||||||
|
m_counter = other.m_counter;
|
||||||
|
|
||||||
|
if (m_id != 0 and m_counter != nullptr)
|
||||||
|
{
|
||||||
|
m_counter->add_reference(m_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
zgl::resource_handle::resource_handle(resource_handle&& other) noexcept
|
||||||
|
: m_id{ other.m_id }, m_counter{ other.m_counter }
|
||||||
|
{
|
||||||
|
other.m_id = 0;
|
||||||
|
other.m_counter = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
zgl::resource_handle& zgl::resource_handle::resource_handle::operator=(
|
||||||
|
resource_handle&& other
|
||||||
|
) noexcept {
|
||||||
|
if (&other != this)
|
||||||
|
{
|
||||||
|
this->~resource_handle();
|
||||||
|
|
||||||
|
m_id = other.m_id;
|
||||||
|
m_counter = other.m_counter;
|
||||||
|
|
||||||
|
other.m_id = 0;
|
||||||
|
other.m_counter = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
zgl::resource_handle::~resource_handle()
|
||||||
|
{
|
||||||
|
if (m_id != 0 and m_counter != nullptr)
|
||||||
|
{
|
||||||
|
m_counter->remove_reference(m_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
139
source/opengl/resource_management/resource_manager.ipp
Normal file
139
source/opengl/resource_management/resource_manager.ipp
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
#ifndef INCLUDE_RESOURCE_MANAGER_IMPLEMENTATION
|
||||||
|
# error Never include this file directly include 'resource_manager.hpp'
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <ranges>
|
||||||
|
|
||||||
|
|
||||||
|
template<typename StoreID, typename MetaData>
|
||||||
|
bool zgl::resource_manager<StoreID, MetaData>::has_resource(StoreID store_id)
|
||||||
|
{
|
||||||
|
std::shared_lock lock(m_lock);
|
||||||
|
return m_resource_lookup.contains(store_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename StoreID, typename MetaData>
|
||||||
|
void zgl::resource_manager<StoreID, MetaData>::add_resource(StoreID store_id, gl_id_type gl_id, MetaData meta)
|
||||||
|
{
|
||||||
|
std::unique_lock lock(m_lock);
|
||||||
|
m_resource_lookup.emplace(store_id, { gl_id, std::move(meta) });
|
||||||
|
m_reference_counters.emplace(gl_id, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename StoreID, typename MetaData>
|
||||||
|
std::optional<std::pair<zgl::resource_handle, MetaData>> zgl::resource_manager<StoreID, MetaData>::get_resource(
|
||||||
|
StoreID store_id
|
||||||
|
) {
|
||||||
|
std::unique_lock lock(m_lock);
|
||||||
|
|
||||||
|
const auto resource_it = m_resource_lookup.find(store_id);
|
||||||
|
if (resource_it == m_resource_lookup.end())
|
||||||
|
{
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto gl_id = resource_it.first;
|
||||||
|
|
||||||
|
auto [ counter_it, inserted ] = m_reference_counters.try_emplace(gl_id, 0);
|
||||||
|
|
||||||
|
++counter_it->second;
|
||||||
|
|
||||||
|
return std::pair{ resource_handle(gl_id, this), resource_it->second };
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename StoreID, typename MetaData>
|
||||||
|
void zgl::resource_manager<StoreID, MetaData>::collect_garbage()
|
||||||
|
{
|
||||||
|
std::unique_lock lock(m_lock);
|
||||||
|
|
||||||
|
for (auto& counter : m_reference_counters | std::ranges::views::values)
|
||||||
|
{
|
||||||
|
if (counter & unused_resource_flag)
|
||||||
|
{
|
||||||
|
const auto value = counter & ~unused_resource_flag;
|
||||||
|
counter = (value + 1) | unused_resource_flag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::erase_if(
|
||||||
|
m_reference_counters,
|
||||||
|
[&](const auto& entry)
|
||||||
|
{
|
||||||
|
auto& counter = entry.second;
|
||||||
|
|
||||||
|
const auto value = counter & ~unused_resource_flag;
|
||||||
|
|
||||||
|
if (value == counter) // Still in use
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value < max_unused_collection_cycle_count)
|
||||||
|
{
|
||||||
|
counter = (value + 1) | unused_resource_flag;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_unused_handles.emplace(entry.first);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
std::erase_if(
|
||||||
|
m_resource_lookup,
|
||||||
|
[&](const auto& entry)
|
||||||
|
{
|
||||||
|
return m_unused_handles.contains(entry.second);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename StoreID, typename MetaData>
|
||||||
|
void zgl::resource_manager<StoreID, MetaData>::add_reference(const gl_id_type id)
|
||||||
|
{
|
||||||
|
std::unique_lock lock(m_lock);
|
||||||
|
auto [it, inserted] = m_reference_counters.try_emplace(id, 0);
|
||||||
|
++it->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename StoreID, typename MetaData>
|
||||||
|
void zgl::resource_manager<StoreID, MetaData>::remove_reference(const gl_id_type id)
|
||||||
|
{
|
||||||
|
std::unique_lock lock(m_lock);
|
||||||
|
if (const auto it = m_reference_counters.find(id); it != m_reference_counters.end())
|
||||||
|
{
|
||||||
|
if (it->second == 1)
|
||||||
|
{
|
||||||
|
it->second = unused_resource_flag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename StoreID, typename MetaData>
|
||||||
|
typename zgl::resource_manager<StoreID, MetaData>::size_type zgl::resource_manager<StoreID, MetaData>::count_garbage()
|
||||||
|
{
|
||||||
|
std::shared_lock lock(m_lock);
|
||||||
|
return m_unused_handles.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename StoreID, typename MetaData>
|
||||||
|
void zgl::resource_manager<StoreID, MetaData>::extract_garbage(
|
||||||
|
std::vector<gl_id_type>& dst
|
||||||
|
) {
|
||||||
|
{
|
||||||
|
std::shared_lock lock(m_lock);
|
||||||
|
dst.reserve(m_unused_handles.size());
|
||||||
|
}
|
||||||
|
{
|
||||||
|
std::unique_lock lock(m_lock);
|
||||||
|
|
||||||
|
dst.resize(m_unused_handles.size());
|
||||||
|
|
||||||
|
std::ranges::copy(m_unused_handles, dst.begin());
|
||||||
|
|
||||||
|
m_unused_handles.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ void shader_program_lookup::add(
|
|||||||
const auto uniforms = shader_program_handle.check_uniform_support(all_uniforms);
|
const auto uniforms = shader_program_handle.check_uniform_support(all_uniforms);
|
||||||
|
|
||||||
ztu::logger::debug("add [%] uniforms: % attributes: %",
|
ztu::logger::debug("add [%] uniforms: % attributes: %",
|
||||||
shader_program_handle.program_id,
|
shader_program_handle.id,
|
||||||
std::bitset<32>(uniforms),
|
std::bitset<32>(uniforms),
|
||||||
std::bitset<32>(attributes)
|
std::bitset<32>(attributes)
|
||||||
);
|
);
|
||||||
@@ -185,7 +185,7 @@ void shader_program_lookup::print() {
|
|||||||
const auto uniforms = m_mesh_shader_program_uniforms[i];
|
const auto uniforms = m_mesh_shader_program_uniforms[i];
|
||||||
const auto [ attributes, locations ] = m_mesh_shader_program_attributes[i];
|
const auto [ attributes, locations ] = m_mesh_shader_program_attributes[i];
|
||||||
ztu::logger::debug("[%] uniforms: % attributes: % locations: %",
|
ztu::logger::debug("[%] uniforms: % attributes: % locations: %",
|
||||||
shader.program_id,
|
shader.id,
|
||||||
std::bitset<32>(uniforms),
|
std::bitset<32>(uniforms),
|
||||||
std::bitset<32>(attributes),
|
std::bitset<32>(attributes),
|
||||||
std::bitset<32>(locations)
|
std::bitset<32>(locations)
|
||||||
|
|||||||
@@ -120,9 +120,9 @@ std::optional<mesh_batch_renderer::id_type> mesh_batch_renderer::add(
|
|||||||
|
|
||||||
ztu::logger::debug(
|
ztu::logger::debug(
|
||||||
"shaders: % % %",
|
"shaders: % % %",
|
||||||
base_shader->program_id,
|
base_shader->id,
|
||||||
point_shader->program_id,
|
point_shader->id,
|
||||||
lit_shader->program_id
|
lit_shader->id
|
||||||
);
|
);
|
||||||
|
|
||||||
batch_index = m_batches.size();
|
batch_index = m_batches.size();
|
||||||
|
|||||||
@@ -556,7 +556,7 @@ bool asset_loader::unload(const zgl::shader_program_handle& shader_handle)
|
|||||||
const auto it = std::find_if(
|
const auto it = std::find_if(
|
||||||
m_gl_shader_program_data.begin(), m_gl_shader_program_data.end(),
|
m_gl_shader_program_data.begin(), m_gl_shader_program_data.end(),
|
||||||
[&shader_handle](const auto& gl_shader_data) {
|
[&shader_handle](const auto& gl_shader_data) {
|
||||||
return gl_shader_data.handle().program_id == shader_handle.program_id;
|
return gl_shader_data.handle().program_id == shader_handle.id;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ void viewer::dynamic_shader_program_loading::load_directory(
|
|||||||
ztu::logger::debug(
|
ztu::logger::debug(
|
||||||
"Linked (vertex: % geometry: % fragment: %) -> %",
|
"Linked (vertex: % geometry: % fragment: %) -> %",
|
||||||
vertex.id, geometry.id, fragment.id,
|
vertex.id, geometry.id, fragment.id,
|
||||||
program_handle.program_id
|
program_handle.id
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user