Skip to content

Commit

Permalink
vulkan: add simple compute shader example
Browse files Browse the repository at this point in the history
  • Loading branch information
danbev committed Aug 7, 2024
1 parent c89c181 commit 9f0534e
Show file tree
Hide file tree
Showing 5 changed files with 440 additions and 50 deletions.
3 changes: 2 additions & 1 deletion gpu/vulkan/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
list-dev
helloworld
shader.spv
simple
simple-shader.spv
7 changes: 5 additions & 2 deletions gpu/vulkan/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#CFLAGS = -std=c++17 -O2
LDFLAGS = -lvulkan -ldl -lpthread -lX11 -lXrandr -lXi
CXXFLAGS += -I/usr/include/glm

VULKAN_SDK_PATH = /home/danbev/work/ai/vulkan/1.3.283.0/x86_64
DXC = $(VULKAN_SDK_PATH)/bin/dxc

helloworld: src/helloworld.cpp
g++ $(CFLAGS) -o $@ $< $(LDFLAGS)
simple: src/simple.cpp
g++ $(CXXFLAGS) -o $@ $< $(LDFLAGS)

simple-shader: src/simple.glsl
glslc -fshader-stage=compute $< -o $@.spv

shader: src/shader.frag
#glslc -fshader-stage=compute --target-env=vulkan1.3 -O $< -o [email protected]
Expand Down
47 changes: 0 additions & 47 deletions gpu/vulkan/src/helloworld.cpp

This file was deleted.

Loading

0 comments on commit 9f0534e

Please sign in to comment.