Skip to content

Commit 393cd48

Browse files
committed
Merge remote-tracking branch 'origin/master' into nsct
2 parents b0131d7 + 885d309 commit 393cd48

File tree

12 files changed

+120
-5
lines changed

12 files changed

+120
-5
lines changed

3rdparty/dxc/dxc

Submodule dxc updated 311 files

include/nbl/builtin/hlsl/glsl_compat/core.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace glsl
1818
template<typename T>
1919
T atomicAdd(NBL_REF_ARG(T) ptr, T value)
2020
{
21-
return spirv::atomicAnd<T>(ptr, spv::ScopeDevice, spv::DecorationRelaxedPrecision, value);
21+
return spirv::atomicAdd<T>(ptr, spv::ScopeDevice, spv::DecorationRelaxedPrecision, value);
2222
}
2323
template<typename T>
2424
T atomicAnd(NBL_REF_ARG(T) ptr, T value)

include/nbl/builtin/hlsl/workgroup/arithmetic.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ template<bool Exclusive, uint16_t ItemCount, class BallotAccessor, class Arithme
9898
uint16_t ballotScanBitCount(NBL_REF_ARG(BallotAccessor) ballotAccessor, NBL_REF_ARG(ArithmeticAccessor) arithmeticAccessor)
9999
{
100100
const uint16_t subgroupIndex = SubgroupContiguousIndex();
101-
const uint16_t bitfieldIndex = impl::getDWORD(subgroupIndex);
101+
const uint16_t bitfieldIndex = getDWORD(subgroupIndex);
102102
const uint32_t localBitfield = ballotAccessor.get(bitfieldIndex);
103103

104104
static const uint16_t DWORDCount = impl::ballot_dword_count<ItemCount>::value;
@@ -111,7 +111,7 @@ uint16_t ballotScanBitCount(NBL_REF_ARG(BallotAccessor) ballotAccessor, NBL_REF_
111111
arithmeticAccessor.set(subgroupIndex,count);
112112
arithmeticAccessor.workgroupExecutionAndMemoryBarrier();
113113
count = arithmeticAccessor.get(bitfieldIndex);
114-
return uint16_t(countbits(localBitfield&(Exclusive ? glsl::gl_SubgroupLtMask():glsl::gl_SubgroupLeMask())[0])+count);
114+
return uint16_t(countbits(localBitfield&(Exclusive ? glsl::gl_SubgroupLtMask():glsl::gl_SubgroupLeMask())[getDWORD(glsl::gl_SubgroupInvocationID())])+count);
115115
}
116116
}
117117

src/nbl/asset/utils/CHLSLCompiler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ core::smart_refctd_ptr<ICPUShader> CHLSLCompiler::compileToSPIRV(const char* cod
440440
hlslOptions
441441
);
442442

443+
if (arg_storage)
444+
delete[] arg_storage;
445+
443446
if (!compileResult.objectBlob)
444447
{
445448
return nullptr;

src/nbl/asset/utils/waveContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ struct preprocessing_hooks final : public boost::wave::context_policies::default
7575
typename ContextT::token_type const& act_token
7676
)
7777
{
78+
hash_token_occurences++;
7879
auto optionStr = option.get_value().c_str();
7980
if (strcmp(optionStr,"shader_stage")==0)
8081
{

tools/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
add_subdirectory(nsc)
1+
add_subdirectory(nsc)

tools/ndt/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set(NBL_EXTRA_SOURCES
2+
# TODO: Cypi list extra sources if you need
3+
)
4+
5+
nbl_create_executable_project("${NBL_EXTRA_SOURCES}" "" "" "" "${NBL_EXECUTABLE_PROJECT_CREATION_PCH_TARGET}")

tools/ndt/__init__.py

Whitespace-only changes.

tools/ndt/config.json.template

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"enableParallelBuild": true,
3+
"threadsPerBuildProcess" : 2,
4+
"isExecuted": true,
5+
"scriptPath": "test/test.py",
6+
"cmake": {
7+
"configurations": [ "Release", "Debug", "RelWithDebInfo" ],
8+
"buildModes": [],
9+
"requiredOptions": []
10+
},
11+
"profiles": [
12+
{
13+
"backend": "vulkan",
14+
"platform": "windows",
15+
"buildModes": [],
16+
"runConfiguration": "Release",
17+
"gpuArchitectures": [],
18+
"inputs": [
19+
"test/config/release.json.template"
20+
]
21+
}
22+
],
23+
"inputs": []
24+
}

tools/ndt/main.cpp

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// TODO: Cypi
2+
3+
4+
// nsc input/simple_shader.hlsl -T ps_6_0 -E Main -Fo output/shader.ps
5+
6+
#include "nbl/system/IApplicationFramework.h"
7+
8+
#include <iostream>
9+
#include <cstdlib>
10+
11+
12+
13+
class ShaderCompiler final : public system::IApplicationFramework
14+
{
15+
using base_t = system::IApplicationFramework;
16+
17+
public:
18+
using base_t::base_t;
19+
20+
bool onAppInitialized(smart_refctd_ptr<ISystem>&& system) override
21+
{
22+
if (!base_t::onAppInitialized(std::move(system)))
23+
return false;
24+
25+
auto argc = argv.size();
26+
27+
core::vector<std::string> arguments(argv + 1, argv + argc);
28+
29+
for (auto i=0; i<argc; i++)
30+
{
31+
if (argv[i] == "-no-nbl-builtins")
32+
{
33+
no_nbl_builtins = true;
34+
break;
35+
}
36+
}
37+
38+
std::string command = "dxc.exe";
39+
for (std::string arg : arguments)
40+
{
41+
command.append(" ").append(arg);
42+
}
43+
44+
int execute = std::system(command.c_str());
45+
46+
std::cout << "-no-nbl-builtins - " << no_nbl_builtins;
47+
48+
49+
return true;
50+
}
51+
52+
53+
void workLoopBody() override {}
54+
55+
bool keepRunning() override { return false; }
56+
57+
58+
private:
59+
bool no_nbl_builtins{false};
60+
};

0 commit comments

Comments
 (0)