mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-10-23 13:18:16 +08:00
update vulkan samples with SPIR-V shaders
This commit is contained in:
@@ -19,8 +19,17 @@ For Linux:
|
||||
-- Install "libxcb1-dev" and "xorg-dev" as GLFW3 is depended on it
|
||||
-- Add Vulkan and GLFW3 libraries directories to LD_LIBRARY_PATH
|
||||
|
||||
|
||||
For Linux aarch64(L4T):
|
||||
-- Install GLFW3 library using "sudo apt-get install libglfw3-dev" this will provide glfw3
|
||||
-- install above will also provide libvulkan-dev as dependencies
|
||||
-- Add Vulkan and GLFW3 libraries directories to LD_LIBRARY_PATH
|
||||
-- Pass path to vulkan sdk while building 'make VULKAN_SDK_PATH=<PATH_TO_VULKAN_SDK>', VULKAN_SDK_PATH in this scenario is typically "/usr"
|
||||
-- Pass path to vulkan sdk while building 'make VULKAN_SDK_PATH=<PATH_TO_VULKAN_SDK>', VULKAN_SDK_PATH in this scenario is typically "/usr"
|
||||
|
||||
|
||||
For Shader changes:
|
||||
-- Update the sinewave.vert and/or sinewave.frag shader source file as required
|
||||
-- Use the glslc shader compiler from the installed Vulkan SDK's bin directory to compile shaders as:
|
||||
glslc sinewave.vert -o vert.spv
|
||||
glslc sinewave.frag -o frag.spv
|
||||
** Make sure to add glslc's path in your PATH environment variable **
|
||||
|
||||
BIN
Samples/simpleVulkan/frag.spv
Normal file
BIN
Samples/simpleVulkan/frag.spv
Normal file
Binary file not shown.
@@ -92,9 +92,9 @@ class VulkanCudaSineWave : public VulkanBaseApp {
|
||||
}
|
||||
// Add our compiled vulkan shader files
|
||||
char *vertex_shader_path =
|
||||
sdkFindFilePath("sinewave.vert", execution_path.c_str());
|
||||
sdkFindFilePath("vert.spv", execution_path.c_str());
|
||||
char *fragment_shader_path =
|
||||
sdkFindFilePath("sinewave.frag", execution_path.c_str());
|
||||
sdkFindFilePath("frag.spv", execution_path.c_str());
|
||||
m_shaderFiles.push_back(
|
||||
std::make_pair(VK_SHADER_STAGE_VERTEX_BIT, vertex_shader_path));
|
||||
m_shaderFiles.push_back(
|
||||
|
||||
BIN
Samples/simpleVulkan/vert.spv
Normal file
BIN
Samples/simpleVulkan/vert.spv
Normal file
Binary file not shown.
Reference in New Issue
Block a user