Skip to content

Commit 8c3f3ba

Browse files
committed
Make descriptor_heap shaders self-contained
Drops the dependency on nvshaders/slang_types.h. The local shaderio.h files now define everything they need: the GLSL variant inlines the two HLSL-style type aliases (float4x4 -> mat4, float3 -> vec3) used by the shared struct definitions, and the Slang variant uses native types directly. Updates the // Compile: hint lines in the four GLSL and two Slang sources that include shaderio.h to drop the -I paths into nvpro-samples so anyone with glslang/slangc can rebuild the fixtures with no out-of-tree dependencies. Recompiled SPVs are byte-identical to the ones already committed, so no golden regeneration is needed. The two slang-only compute fixtures (multi_type_heap, as_heap) do not include shaderio.h and were already self-contained.
1 parent 3923cd7 commit 8c3f3ba

8 files changed

Lines changed: 12 additions & 19 deletions

File tree

tests/descriptor_heap/glsl/bindless.frag.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Compile: glslang -V --target-env vulkan1.3 -S frag -e main -IC:/code/source/nvpro-samples/nvpro_core2 -IC:/code/source/nvpro-samples/vk_mini_samples/common -o bindless.frag.spv bindless.frag.glsl
1+
// Compile: glslang -V --target-env vulkan1.3 -S frag -e main -o bindless.frag.spv bindless.frag.glsl
22
/*
33
* Copyright (c) 2024-2026, NVIDIA CORPORATION. All rights reserved.
44
*

tests/descriptor_heap/glsl/bindless.vert.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Compile: glslang -V --target-env vulkan1.3 -S vert -e main -IC:/code/source/nvpro-samples/nvpro_core2 -IC:/code/source/nvpro-samples/vk_mini_samples/common -o bindless.vert.spv bindless.vert.glsl
1+
// Compile: glslang -V --target-env vulkan1.3 -S vert -e main -o bindless.vert.spv bindless.vert.glsl
22
/*
33
* Copyright (c) 2024-2026, NVIDIA CORPORATION. All rights reserved.
44
*

tests/descriptor_heap/glsl/per_draw.frag.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Compile: glslang -V --target-env vulkan1.3 -S frag -e main -IC:/code/source/nvpro-samples/nvpro_core2 -IC:/code/source/nvpro-samples/vk_mini_samples/common -o per_draw.frag.spv per_draw.frag.glsl
1+
// Compile: glslang -V --target-env vulkan1.3 -S frag -e main -o per_draw.frag.spv per_draw.frag.glsl
22
/*
33
* Copyright (c) 2024-2026, NVIDIA CORPORATION. All rights reserved.
44
*

tests/descriptor_heap/glsl/per_draw.vert.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Compile: glslang -V --target-env vulkan1.3 -S vert -e main -IC:/code/source/nvpro-samples/nvpro_core2 -IC:/code/source/nvpro-samples/vk_mini_samples/common -o per_draw.vert.spv per_draw.vert.glsl
1+
// Compile: glslang -V --target-env vulkan1.3 -S vert -e main -o per_draw.vert.spv per_draw.vert.glsl
22
/*
33
* Copyright (c) 2024-2026, NVIDIA CORPORATION. All rights reserved.
44
*

tests/descriptor_heap/glsl/shaderio.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
#ifndef SHADERIO_H
2121
#define SHADERIO_H
2222

23-
#include "nvshaders/slang_types.h"
24-
25-
NAMESPACE_SHADERIO_BEGIN()
23+
// HLSL/Slang-style type aliases so the struct definitions below can be shared
24+
// verbatim with the matching slang/ fixture.
25+
#define float4x4 mat4
26+
#define float3 vec3
2627

2728
/*
2829
* Push data layout (used by vkCmdPushDataEXT):
@@ -68,6 +69,4 @@ struct BindlessPushData
6869
// gl_InstanceIndex
6970
};
7071

71-
NAMESPACE_SHADERIO_END()
72-
7372
#endif

tests/descriptor_heap/slang/bindless.slang

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Compile (vertex): slangc bindless.slang -target spirv -capability spvDescriptorHeapEXT -I C:/code/source/nvpro-samples/nvpro_core2 -I C:/code/source/nvpro-samples/vk_mini_samples/common -entry vertexMain -stage vertex -o bindless.vert.spv
2-
// Compile (fragment): slangc bindless.slang -target spirv -capability spvDescriptorHeapEXT -I C:/code/source/nvpro-samples/nvpro_core2 -I C:/code/source/nvpro-samples/vk_mini_samples/common -entry fragmentMain -stage fragment -o bindless.frag.spv
1+
// Compile (vertex): slangc bindless.slang -target spirv -capability spvDescriptorHeapEXT -entry vertexMain -stage vertex -o bindless.vert.spv
2+
// Compile (fragment): slangc bindless.slang -target spirv -capability spvDescriptorHeapEXT -entry fragmentMain -stage fragment -o bindless.frag.spv
33
/*
44
* Copyright (c) 2024-2026, NVIDIA CORPORATION. All rights reserved.
55
*

tests/descriptor_heap/slang/per_draw.slang

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Compile (vertex): slangc per_draw.slang -target spirv -I C:/code/source/nvpro-samples/nvpro_core2 -I C:/code/source/nvpro-samples/vk_mini_samples/common -entry vertexMain -stage vertex -o per_draw.vert.spv
2-
// Compile (fragment): slangc per_draw.slang -target spirv -I C:/code/source/nvpro-samples/nvpro_core2 -I C:/code/source/nvpro-samples/vk_mini_samples/common -entry fragmentMain -stage fragment -o per_draw.frag.spv
1+
// Compile (vertex): slangc per_draw.slang -target spirv -entry vertexMain -stage vertex -o per_draw.vert.spv
2+
// Compile (fragment): slangc per_draw.slang -target spirv -entry fragmentMain -stage fragment -o per_draw.frag.spv
33
/*
44
* Copyright (c) 2024-2026, NVIDIA CORPORATION. All rights reserved.
55
*

tests/descriptor_heap/slang/shaderio.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
#ifndef SHADERIO_H
2121
#define SHADERIO_H
2222

23-
#include "nvshaders/slang_types.h"
24-
25-
NAMESPACE_SHADERIO_BEGIN()
26-
2723
/*
2824
* Push data layout (used by vkCmdPushDataEXT):
2925
* Offset 0: FrameInfo (160 bytes) — pushed once per frame
@@ -68,6 +64,4 @@ struct BindlessPushData
6864
// gl_InstanceIndex
6965
};
7066

71-
NAMESPACE_SHADERIO_END()
72-
7367
#endif

0 commit comments

Comments
 (0)