Skip to content

Commit 7f3b919

Browse files
1 parent 5441c9f commit 7f3b919

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

include/nbl/builtin/hlsl/ext/FullScreenTriangle/SVertexAttributes.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace FullScreenTriangle
1515

1616
struct VertexAttributes
1717
{
18-
[[vk::location(0)]] float32_t2 uv;
18+
[[vk::location(0)]] float32_t2 uv : TEXCOORD0;
1919
};
2020

2121
}
Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
// Copyright (C) 2018-2024 - DevSH Graphics Programming Sp. z O.O.
22
// This file is part of the "Nabla Engine".
33
// For conditions of distribution and use, see copyright notice in nabla.h
4+
#include <nbl/builtin/hlsl/glsl_compat/core.hlsl>
45
#include <nbl/builtin/hlsl/ext/FullScreenTriangle/SVertexAttributes.hlsl>
56
//#include <nbl/builtin/glsl/utils/surface_transform.glsl>
67

7-
namespace nbl
8-
{
9-
namespace hlsl
10-
{
11-
namespace ext
12-
{
13-
namespace FullScreenTriangle
14-
{
8+
using namespace ::nbl::hlsl;
9+
using namespace ::nbl::hlsl::ext::FullScreenTriangle;
1510

1611
const static float32_t2 pos[3] = {
1712
float32_t2(-1.0,-1.0),
@@ -33,16 +28,11 @@ layout (push_constant) uniform pushConstants
3328

3429
VertexAttributes main()
3530
{
36-
using namespace nbl::hlsl::glsl;
31+
using namespace ::nbl::hlsl::glsl;
3732

3833
VertexAttributes retval;
39-
// vec2 pos = nbl_glsl_surface_transform_applyToNDC(u_pushConstants.swapchainTransform, pos[gl_VertexIndex]);
40-
spirv::Position = vec4(pos[gl_VertexIndex()], 0.f, 1.f);
34+
// vec2 pos = nbl_glsl_surface_transform_applyToNDC(u_pushConstants.swapchainTransform, pos[gl_VertexIndex]);
35+
spirv::Position = float32_t4(pos[gl_VertexIndex()], 0.f, 1.f);
4136
retval.uv = tc[gl_VertexIndex()];
4237
return retval;
43-
}
44-
45-
}
46-
}
47-
}
4838
}

src/nbl/asset/utils/CHLSLCompiler.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,11 @@ core::smart_refctd_ptr<ICPUShader> CHLSLCompiler::compileToSPIRV(const char* cod
396396
arguments = {};
397397
for (size_t i = 0; i < RequiredArgumentCount; i++)
398398
arguments.push_back(RequiredArguments[i]);
399+
arguments.push_back(L"-HV");
400+
arguments.push_back(L"202x");
401+
// TODO: add this to `CHLSLCompiler::SOptions` and handle it properly in `dxc_compile_flags.empty()`
402+
arguments.push_back(L"-E");
403+
arguments.push_back(L"main");
399404
// If a custom SPIR-V optimizer is specified, use that instead of DXC's spirv-opt.
400405
// This is how we can get more optimizer options.
401406
//

0 commit comments

Comments
 (0)