diff --git a/scripts/shader-embeded.mk b/scripts/shader-embeded.mk index d4aff4cfa..d6ccecf61 100644 --- a/scripts/shader-embeded.mk +++ b/scripts/shader-embeded.mk @@ -8,14 +8,17 @@ include $(THISDIR)/tools.mk VS_FLAGS+=-i $(THISDIR)../src/ --type vertex FS_FLAGS+=-i $(THISDIR)../src/ --type fragment +CS_FLAGS+=-i $(THISDIR)../src/ --type compute VS_SOURCES=$(wildcard vs_*.sc) FS_SOURCES=$(wildcard fs_*.sc) +CS_SOURCES=$(wildcard cs_*.sc) VS_BIN = $(addsuffix .bin.h, $(basename $(VS_SOURCES))) FS_BIN = $(addsuffix .bin.h, $(basename $(FS_SOURCES))) +CS_BIN = $(addsuffix .bin.h, $(basename $(CS_SOURCES))) -BIN = $(VS_BIN) $(FS_BIN) +BIN = $(VS_BIN) $(FS_BIN) $(CS_BIN) SHADER_TMP = $(TEMP)/tmp @@ -41,6 +44,13 @@ fs_%.bin.h : fs_%.sc -$(SILENT) $(SHADERC) $(FS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_mtl -@cat $(SHADER_TMP) >> $(@) +cs_%.bin.h : cs_%.sc + @echo [$(<)] + $(SILENT) $(SHADERC) $(CS_FLAGS) --platform linux -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_glsl + @cat $(SHADER_TMP) > $(@) + -$(SILENT) $(SHADERC) $(CS_FLAGS) --platform windows -p cs_5_0 -O 1 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_dx11 + -@cat $(SHADER_TMP) >> $(@) + .PHONY: all all: $(BIN) diff --git a/src/shader_spirv.cpp b/src/shader_spirv.cpp index 481a40c65..2fec1c0b0 100644 --- a/src/shader_spirv.cpp +++ b/src/shader_spirv.cpp @@ -781,7 +781,7 @@ namespace bgfx size += read(_reader, _instruction.result, _err); } - uint32_t currOp = 0; + uint16_t currOp = 0; switch (_instruction.opcode) { case SpvOpcode::EntryPoint: