Skip to content

Commit

Permalink
Replace shaderc dependency with precompiled shaders
Browse files Browse the repository at this point in the history
Fix python script to generate shaders
  • Loading branch information
0cc4m committed Oct 14, 2023
1 parent 73d01d1 commit de4b813
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 1,049 deletions.
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,12 @@ if (LLAMA_CLBLAST)
endif()

if (LLAMA_VULKAN)
find_package(Vulkan COMPONENTS shaderc_combined)
find_package(glslang)
find_package(SPIRV-Tools-opt)
find_package(Vulkan)
if (Vulkan_FOUND)
message(STATUS "Vulkan found")

add_library(ggml-vulkan STATIC ggml-vulkan.cpp ggml-vulkan.h)
target_link_libraries(ggml-vulkan PUBLIC Vulkan::Vulkan Vulkan::shaderc_combined)
target_link_libraries(ggml-vulkan PUBLIC Vulkan::Vulkan)

add_compile_definitions(GGML_USE_VULKAN)

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ endif # LLAMA_CLBLAST
ifdef LLAMA_VULKAN
CFLAGS += -DGGML_USE_VULKAN
CXXFLAGS += -DGGML_USE_VULKAN
LDFLAGS += -lvulkan -lopenblas -lglslang -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lshaderc_combined
LDFLAGS += -lvulkan
OBJS += ggml-vulkan.o
ggml-vulkan.o: ggml-vulkan.cpp ggml-vulkan.h
$(CXX) $(CXXFLAGS) -c $< -o $@
Expand Down
Loading

0 comments on commit de4b813

Please sign in to comment.