Skip to content

Add DXC validation for generated HLSL in unit tests

0c2acba
Select commit
Loading
Failed to load commit list.
Draft

Add HLSL compilation support #89

Add DXC validation for generated HLSL in unit tests
0c2acba
Select commit
Loading
Failed to load commit list.
SonarQubeCloud / SonarCloud Code Analysis failed Apr 8, 2026 in 1m 11s

Quality Gate failed

Failed conditions
28.3% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Annotations

Check warning on line 1303 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Make the type of this parameter a reference-to-const. The current type of "expr" is "class std::unique_ptr<struct nzsl::Ast::Expression> &".

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_7Y&open=AZ1Ff0Mx9DoLcXMm8_7Y&pullRequest=89

Check warning on line 1955 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Remove this empty statement.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_7y&open=AZ1Ff0Mx9DoLcXMm8_7y&pullRequest=89

Check warning on line 589 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Define and throw a dedicated exception instead of using a generic one.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_60&open=AZ1Ff0Mx9DoLcXMm8_60&pullRequest=89

Check warning on line 689 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Define and throw a dedicated exception instead of using a generic one.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_6-&open=AZ1Ff0Mx9DoLcXMm8_6-&pullRequest=89

Check warning on line 610 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Remove this conditional structure or edit its code blocks so that they're not all the same.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_61&open=AZ1Ff0Mx9DoLcXMm8_61&pullRequest=89

Check warning on line 533 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

function 'Append' could be declared with attribute 'noreturn'

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_6p&open=AZ1Ff0Mx9DoLcXMm8_6p&pullRequest=89

Check warning on line 520 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Define and throw a dedicated exception instead of using a generic one.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_6o&open=AZ1Ff0Mx9DoLcXMm8_6o&pullRequest=89

Check warning on line 1272 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Replace this use of "emplace" with "try_emplace".

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_7U&open=AZ1Ff0Mx9DoLcXMm8_7U&pullRequest=89

Check warning on line 1085 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Define and throw a dedicated exception instead of using a generic one.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_7P&open=AZ1Ff0Mx9DoLcXMm8_7P&pullRequest=89

Check warning on line 656 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Use the init-statement to declare "isReadWrite" inside the if statement.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_65&open=AZ1Ff0Mx9DoLcXMm8_65&pullRequest=89

Check warning on line 503 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

function 'Append' could be declared with attribute 'noreturn'

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_6h&open=AZ1Ff0Mx9DoLcXMm8_6h&pullRequest=89

Check warning on line 1198 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Merge this "if" statement with the enclosing one.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_7S&open=AZ1Ff0Mx9DoLcXMm8_7S&pullRequest=89

Check warning on line 101 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Define and throw a dedicated exception instead of using a generic one.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_6Y&open=AZ1Ff0Mx9DoLcXMm8_6Y&pullRequest=89

Check warning on line 1384 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Reduce verbosity with "using enum" for "nzsl::Ast::AssignType".

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_6T&open=AZ1Ff0Mx9DoLcXMm8_6T&pullRequest=89

Check warning on line 785 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Replace "." with "::" for access to "std::string_view::npos".

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_7D&open=AZ1Ff0Mx9DoLcXMm8_7D&pullRequest=89

Check warning on line 607 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Define and throw a dedicated exception instead of using a generic one.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_62&open=AZ1Ff0Mx9DoLcXMm8_62&pullRequest=89

Check failure on line 1624 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

"std::forward" is never called on this forwarding reference argument.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_7h&open=AZ1Ff0Mx9DoLcXMm8_7h&pullRequest=89

Check warning on line 21 in tests/src/Tests/ShaderUtils.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

non-portable path to file '<Windows.h>'; specified path differs in case from file name on disk

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1uIaQN8C5q95abz3vr&open=AZ1uIaQN8C5q95abz3vr&pullRequest=89

Check warning on line 195 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Replace with the version of "std::ranges::find" that takes a range.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1es5HlV80h1Qdm2HgO&open=AZ1es5HlV80h1Qdm2HgO&pullRequest=89

Check failure on line 1069 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 29 to the 25 allowed.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_7O&open=AZ1Ff0Mx9DoLcXMm8_7O&pullRequest=89

Check warning on line 1001 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Remove these redundant parentheses.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_7K&open=AZ1Ff0Mx9DoLcXMm8_7K&pullRequest=89

Check warning on line 1901 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

This lambda has 62 lines, which is greater than the 20 lines authorized. Split it into several lambdas or functions, or make it a named function.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_7t&open=AZ1Ff0Mx9DoLcXMm8_7t&pullRequest=89

Check warning on line 702 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Define and throw a dedicated exception instead of using a generic one.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_6_&open=AZ1Ff0Mx9DoLcXMm8_6_&pullRequest=89

Check warning on line 159 in include/NZSL/HlslWriter.hpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Move this #include directive to the top of the file.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0N09DoLcXMm8_8H&open=AZ1Ff0N09DoLcXMm8_8H&pullRequest=89

Check warning on line 2103 in src/NZSL/HlslWriter.cpp

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Extract the assignment from this expression.

See more on https://sonarcloud.io/project/issues?id=NazaraEngine_ShaderLang&issues=AZ1Ff0Mx9DoLcXMm8_75&open=AZ1Ff0Mx9DoLcXMm8_75&pullRequest=89