2017-09-06 22:01:58 -04:00
|
|
|
VULKAN_DIR=modules/vulkan-docs/src
|
2018-04-01 21:45:52 -04:00
|
|
|
CTS_DIR=../VK-GL-CTS
|
2018-04-26 17:55:06 -04:00
|
|
|
CHERRY_DIR=../cherry
|
2017-09-06 21:34:41 -04:00
|
|
|
BINDING=target/vulkan.rs
|
|
|
|
NATIVE_DIR=target/native
|
|
|
|
TARGET=$(NATIVE_DIR)/test
|
2017-12-07 22:29:14 +01:00
|
|
|
OBJECTS=$(NATIVE_DIR)/test.o $(NATIVE_DIR)/window.o
|
2018-03-01 22:04:47 -05:00
|
|
|
LIB_EXTENSION=
|
2018-05-03 19:04:33 -06:00
|
|
|
TEST_LIST=$(CURDIR)/conformance/deqp.txt
|
2018-04-17 15:25:35 -04:00
|
|
|
TEST_LIST_SOURCE=$(CTS_DIR)/external/vulkancts/mustpass/1.0.2/vk-default.txt
|
2018-05-03 19:04:33 -06:00
|
|
|
DEQP_DIR=$(CTS_DIR)/build/external/vulkancts/modules/vulkan/
|
2018-05-28 23:10:16 -04:00
|
|
|
DEQP=cd $(DEQP_DIR) && RUST_LOG=debug LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) ./deqp-vk
|
2018-06-12 07:59:20 -07:00
|
|
|
DOTA_DIR=../dota2/bin/osx64
|
|
|
|
DOTA_EXE=$(DOTA_DIR)/dota2.app/Contents/MacOS/dota2
|
2018-06-24 22:27:10 -04:00
|
|
|
DOTA_PARAMS=-vulkan_disable_occlusion_queries -vulkan_scene_system_job_cost 2
|
2018-03-01 22:04:47 -05:00
|
|
|
|
|
|
|
RUST_BACKTRACE:=1
|
|
|
|
BACKEND:=gl
|
2018-04-18 15:30:31 -04:00
|
|
|
DEBUGGER=rust-gdb --args
|
2017-09-06 17:10:25 -04:00
|
|
|
|
2017-12-01 00:50:59 +01:00
|
|
|
CC=g++
|
2017-12-07 22:29:14 +01:00
|
|
|
CFLAGS=-std=c++11 -ggdb -O0 -I$(VULKAN_DIR)
|
2017-09-06 22:01:58 -04:00
|
|
|
DEPS=
|
2018-03-01 22:04:47 -05:00
|
|
|
LDFLAGS=
|
|
|
|
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
LDFLAGS=
|
|
|
|
BACKEND=dx12
|
|
|
|
LIB_EXTENSION=dll
|
|
|
|
else
|
|
|
|
UNAME_S:=$(shell uname -s)
|
|
|
|
ifeq ($(UNAME_S),Linux)
|
|
|
|
LDFLAGS=-lpthread -ldl -lm -lX11 -lxcb
|
|
|
|
BACKEND=vulkan
|
|
|
|
LIB_EXTENSION=so
|
|
|
|
endif
|
|
|
|
ifeq ($(UNAME_S),Darwin)
|
|
|
|
LDFLAGS=-lpthread -ldl -lm
|
|
|
|
BACKEND=metal
|
2018-04-18 15:30:31 -04:00
|
|
|
DEBUGGER=rust-lldb --
|
2018-03-01 22:04:47 -05:00
|
|
|
LIB_EXTENSION=dylib
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-04-01 21:45:52 -04:00
|
|
|
FULL_LIBRARY_PATH=$(CURDIR)/target/debug
|
2018-03-01 22:04:47 -05:00
|
|
|
LIBRARY=target/debug/libportability.$(LIB_EXTENSION)
|
2018-04-22 16:07:39 -04:00
|
|
|
LIBRARY_FAST=target/release/libportability.$(LIB_EXTENSION)
|
2017-09-06 22:01:58 -04:00
|
|
|
|
2018-06-24 22:27:10 -04:00
|
|
|
.PHONY: all rebuild debug release version-debug version-release binding run cts clean cherry dota-debug dota-release
|
2017-09-12 12:27:01 -04:00
|
|
|
|
2017-09-06 21:34:41 -04:00
|
|
|
all: $(TARGET)
|
2017-09-06 17:10:25 -04:00
|
|
|
|
2018-04-26 17:55:06 -04:00
|
|
|
rebuild:
|
|
|
|
cargo build --manifest-path libportability/Cargo.toml --features $(BACKEND)
|
|
|
|
|
2018-04-25 12:00:50 -04:00
|
|
|
debug:
|
2018-06-12 07:59:20 -07:00
|
|
|
cargo build --manifest-path libportability/Cargo.toml --features $(BACKEND),debug
|
|
|
|
|
|
|
|
release: $(LIBRARY_FAST)
|
2018-04-25 12:00:50 -04:00
|
|
|
|
2018-06-24 22:27:10 -04:00
|
|
|
version-debug:
|
2018-06-12 07:59:20 -07:00
|
|
|
cargo rustc --manifest-path libportability/Cargo.toml --features $(BACKEND),portability-gfx/env_logger -- -Clink-arg="-current_version 1.0.0" -Clink-arg="-compatibility_version 1.0.0"
|
2018-06-05 20:54:02 -06:00
|
|
|
|
2018-06-24 22:27:10 -04:00
|
|
|
version-release:
|
2018-06-12 07:59:20 -07:00
|
|
|
cargo rustc --release --manifest-path libportability/Cargo.toml --features $(BACKEND) -- -Clink-arg="-current_version 1.0.0" -Clink-arg="-compatibility_version 1.0.0"
|
|
|
|
|
2018-06-24 22:27:10 -04:00
|
|
|
dota-debug: version-debug $(DOTA_EXE)
|
|
|
|
DYLD_LIBRARY_PATH=`pwd`/target/debug:`pwd`/$(DOTA_DIR) $(DOTA_EXE) $(DOTA_PARAMS)
|
2018-06-12 07:59:20 -07:00
|
|
|
|
2018-06-24 22:27:10 -04:00
|
|
|
dota-release: version-release $(DOTA_EXE)
|
|
|
|
DYLD_LIBRARY_PATH=`pwd`/target/release:`pwd`/$(DOTA_DIR) $(DOTA_EXE) $(DOTA_PARAMS)
|
2018-04-22 16:07:39 -04:00
|
|
|
|
2017-09-12 12:27:01 -04:00
|
|
|
binding: $(BINDING)
|
|
|
|
|
2017-09-06 22:01:58 -04:00
|
|
|
$(BINDING): $(VULKAN_DIR)/vulkan/*.h
|
|
|
|
bindgen --no-layout-tests --rustfmt-bindings $(VULKAN_DIR)/vulkan/vulkan.h -o $(BINDING)
|
2017-09-06 17:10:25 -04:00
|
|
|
|
2018-04-12 09:24:47 -04:00
|
|
|
$(LIBRARY): libportability*/src/*.rs libportability*/Cargo.toml Cargo.lock
|
2018-03-01 22:04:47 -05:00
|
|
|
cargo build --manifest-path libportability/Cargo.toml --features $(BACKEND)
|
2018-04-12 09:24:47 -04:00
|
|
|
cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND)
|
2017-09-06 21:34:41 -04:00
|
|
|
mkdir -p target/native
|
|
|
|
|
2018-04-22 16:07:39 -04:00
|
|
|
$(LIBRARY_FAST): libportability*/src/*.rs libportability*/Cargo.toml Cargo.lock
|
|
|
|
cargo build --release --manifest-path libportability/Cargo.toml --features $(BACKEND)
|
|
|
|
cargo build --release --manifest-path libportability-icd/Cargo.toml --features $(BACKEND)
|
|
|
|
|
2017-12-01 00:50:59 +01:00
|
|
|
$(NATIVE_DIR)/%.o: native/%.cpp $(DEPS) Makefile
|
2017-09-06 21:34:41 -04:00
|
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
2017-09-06 17:10:25 -04:00
|
|
|
|
2017-11-06 21:57:32 -05:00
|
|
|
$(TARGET): $(LIBRARY) $(OBJECTS) Makefile
|
2017-12-01 00:50:59 +01:00
|
|
|
$(CC) -o $(TARGET) $(OBJECTS) $(LIBRARY) $(LDFLAGS)
|
2017-09-06 17:10:25 -04:00
|
|
|
|
2017-09-06 21:34:41 -04:00
|
|
|
run: $(TARGET)
|
|
|
|
$(TARGET)
|
2017-09-06 17:10:25 -04:00
|
|
|
|
2018-04-04 14:21:43 -04:00
|
|
|
$(TEST_LIST): $(TEST_LIST_SOURCE)
|
|
|
|
cat $(TEST_LIST_SOURCE) | grep -v -e ".event" -e "query" >$(TEST_LIST)
|
|
|
|
|
2018-05-30 21:27:34 -04:00
|
|
|
ifdef pick
|
|
|
|
cts:
|
|
|
|
cargo build --manifest-path libportability/Cargo.toml --features $(BACKEND),portability-gfx/env_logger
|
|
|
|
($(DEQP) -n $(pick))
|
|
|
|
else
|
|
|
|
ifdef debug
|
|
|
|
cts: $(LIBRARY)
|
|
|
|
#(cd $(DEQP_DIR) && LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) $(DEBUGGER) ./deqp-vk -n $(debug))
|
|
|
|
LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) $(DEBUGGER) $(DEQP_DIR)/deqp-vk -n $(debug)
|
|
|
|
else
|
|
|
|
cts: $(LIBRARY) $(TEST_LIST)
|
2018-05-03 19:04:33 -06:00
|
|
|
($(DEQP) --deqp-caselist-file=$(TEST_LIST))
|
2018-04-01 21:45:52 -04:00
|
|
|
python $(CTS_DIR)/scripts/log/log_to_xml.py TestResults.qpa conformance/last.xml
|
|
|
|
mv TestResults.qpa conformance/last.qpa
|
|
|
|
firefox conformance/last.xml
|
2018-05-30 21:27:34 -04:00
|
|
|
endif #debug
|
|
|
|
endif #pick
|
2018-04-06 10:42:38 -04:00
|
|
|
|
2017-09-06 17:10:25 -04:00
|
|
|
clean:
|
2017-09-06 21:34:41 -04:00
|
|
|
rm -f $(OBJECTS) $(TARGET) $(BINDING)
|
|
|
|
cargo clean
|
2018-04-26 17:55:06 -04:00
|
|
|
|
2018-05-12 21:17:49 -04:00
|
|
|
cherry: $(TARGET)
|
2018-06-05 12:57:17 -04:00
|
|
|
cd $(CHERRY_DIR) && rm -f Cherry.db && RUST_LOG=warn LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) go run server.go
|