Skip to content

Commit 0571f7e

Browse files
committed
Merge branch 'master' into new-sampler-concepts
# Conflicts: # examples_tests
2 parents c12a724 + d6c0f3e commit 0571f7e

39 files changed

Lines changed: 744 additions & 519 deletions

.github/workflows/build-nabla.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ jobs:
8484
Set-MpPreference -DisableArchiveScanning $true
8585
Set-MpPreference -DisableScanningMappedNetworkDrivesForFullScan $true
8686
87+
# workaround for Docker issue in windows runner
88+
# see <https://github.com/actions/runner-images/issues/13729#issuecomment-4183956802>
89+
$dockerState = Get-Service -Name "docker"
90+
if ($dockerState.Status -ne "Running") {
91+
Start-Service -Name "docker"
92+
}
93+
8794
$maxAttempts = 12
8895
$delaySeconds = 5
8996
$dockerReady = $false

examples_tests

Submodule examples_tests updated 40 files

include/nbl/asset/utils/IShaderCompiler.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
245245
@includeFinder Optional parameter; if not nullptr, it will resolve the includes in the code
246246
@maxSelfInclusionCount used only when includeFinder is not nullptr
247247
@extraDefines adds extra defines to the shader before compilation
248+
@optimizerIsExtraPasses Instead of entirely replacing the default optimization passes, run the provided passes after the default ones
249+
@preprocessedOutputPath If not empty, the preprocessed shader will be saved to this path
250+
@spvOutputPath If not empty, the compiled SPIR-V binary will be saved to this path
248251
*/
249252
struct SCompilerOptions
250253
{
@@ -261,6 +264,9 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
261264
SPreprocessorOptions preprocessorOptions = {};
262265
CCache* readCache = nullptr;
263266
CCache* writeCache = nullptr;
267+
bool optimizerIsExtraPasses = false; // Instead of disabling the default opt passes, run the provided optimization passes at the end
268+
std::string preprocessedOutputPath = "";
269+
std::string spvOutputPath = "";
264270
};
265271

266272
class CCache final : public IReferenceCounted
@@ -269,7 +275,7 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
269275

270276
public:
271277
// Used to check compatibility of Caches before reading
272-
constexpr static inline std::string_view VERSION = "1.1.0";
278+
constexpr static inline std::string_view VERSION = "1.1.1";
273279

274280
static auto const SHADER_BUFFER_SIZE_BYTES = sizeof(uint64_t) / sizeof(uint8_t); // It's obviously 8
275281

@@ -361,7 +367,7 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
361367
public:
362368
inline bool operator==(const SCompilerArgs& other) const {
363369
bool retVal = true;
364-
if (stage != other.stage || targetSpirvVersion != other.targetSpirvVersion || debugInfoFlags != other.debugInfoFlags || preprocessorArgs != other.preprocessorArgs) retVal = false;
370+
if (stage != other.stage || targetSpirvVersion != other.targetSpirvVersion || debugInfoFlags != other.debugInfoFlags || preprocessorArgs != other.preprocessorArgs || optimizerIsExtraPasses != other.optimizerIsExtraPasses) retVal = false;
365371
if (optimizerPasses.size() != other.optimizerPasses.size()) retVal = false;
366372
for (auto passesIt = optimizerPasses.begin(), otherPassesIt = other.optimizerPasses.begin(); passesIt != optimizerPasses.end(); passesIt++, otherPassesIt++) {
367373
if (*passesIt != *otherPassesIt) {
@@ -389,6 +395,7 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
389395
// Only SEntry should instantiate this struct
390396
SCompilerArgs(const SCompilerOptions& options)
391397
: stage(options.stage), targetSpirvVersion(options.preprocessorOptions.targetSpirvVersion), debugInfoFlags(options.debugInfoFlags), preprocessorArgs(options.preprocessorOptions)
398+
, optimizerIsExtraPasses(options.optimizerIsExtraPasses)
392399
{
393400
if (options.spirvOptimizer) {
394401
for (auto pass : options.spirvOptimizer->getPasses())
@@ -399,6 +406,7 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
399406
IShader::E_SHADER_STAGE stage;
400407
E_SPIRV_VERSION targetSpirvVersion;
401408
std::vector<ISPIRVOptimizer::E_OPTIMIZER_PASS> optimizerPasses;
409+
bool optimizerIsExtraPasses;
402410
core::bitflag<E_DEBUG_INFO_FLAGS> debugInfoFlags;
403411
SPreprocessorArgs preprocessorArgs;
404412
};
@@ -458,6 +466,9 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
458466

459467
bool setContent(const asset::ICPUBuffer* uncompressedSpirvBuffer);
460468

469+
IShader::E_SHADER_STAGE getShaderStage() const { return compilerArgs.stage; }
470+
SPreprocessorArgs getPreprocessorArgs() const { return compilerArgs.preprocessorArgs; }
471+
461472
core::smart_refctd_ptr<IShader> decompressShader() const;
462473

463474
// TODO: make some of these private

0 commit comments

Comments
 (0)