Branimir Karadžić 9 سال پیش
والد
کامیت
e60d5532aa
5فایلهای تغییر یافته به همراه15 افزوده شده و 16 حذف شده
  1. 3 12
      examples/17-drawstress/makefile
  2. 5 1
      src/shader_dx9bc.cpp
  3. 1 1
      src/shader_dx9bc.h
  4. 5 1
      src/shader_spirv.cpp
  5. 1 1
      src/shader_spirv.h

+ 3 - 12
examples/17-drawstress/makefile

@@ -1,18 +1,9 @@
 #
-# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
 # License: http://www.opensource.org/licenses/BSD-2-Clause
 #
 
-BGFX_DIR=../..
-RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
-BUILD_DIR=../../.build
-
-include $(BGFX_DIR)/scripts/shader.mk
+include ../../../scripts/shader-embeded.mk
 
 rebuild:
-	@make -s --no-print-directory TARGET=0 clean all
-	@make -s --no-print-directory TARGET=1 clean all
-	@make -s --no-print-directory TARGET=2 clean all
-	@make -s --no-print-directory TARGET=3 clean all
-	@make -s --no-print-directory TARGET=4 clean all
-	@make -s --no-print-directory TARGET=5 clean all
+	@make -s --no-print-directory clean all

+ 5 - 1
src/shader_dx9bc.cpp

@@ -712,7 +712,11 @@ namespace bgfx
 			uint32_t size = read(&reader, instruction);
 			BX_CHECK(size/4 == instruction.length, "read %d, expected %d", size/4, instruction.length); BX_UNUSED(size);
 
-			_fn(token * sizeof(uint32_t), instruction, _userData);
+			bool cont = _fn(token * sizeof(uint32_t), instruction, _userData);
+			if (!cont)
+			{
+				return;
+			}
 
 			token += instruction.length;
 		}

+ 1 - 1
src/shader_dx9bc.h

@@ -247,7 +247,7 @@ namespace bgfx
 	int32_t read(bx::ReaderSeekerI* _reader, Dx9bc& _dx9bc);
 	int32_t write(bx::WriterSeekerI* _writer, const Dx9bc& _dx9bc);
 
-	typedef void (*Dx9bcParseFn)(uint32_t _offset, const Dx9bcInstruction& _instruction, void* _userData);
+	typedef bool (*Dx9bcParseFn)(uint32_t _offset, const Dx9bcInstruction& _instruction, void* _userData);
 	void parse(const Dx9bcShader& _src, Dx9bcParseFn _fn, void* _userData);
 
 	typedef void (*Dx9bcFilterFn)(Dx9bcInstruction& _instruction, void* _userData);

+ 5 - 1
src/shader_spirv.cpp

@@ -723,7 +723,11 @@ namespace bgfx
 					);
 			BX_UNUSED(size);
 
-			_fn(token * sizeof(uint32_t), instruction, _userData);
+			bool cont = _fn(token * sizeof(uint32_t), instruction, _userData);
+			if (!cont)
+			{
+				return;
+			}
 
 			token += instruction.length;
 		}

+ 1 - 1
src/shader_spirv.h

@@ -491,7 +491,7 @@ namespace bgfx
 	int32_t read(bx::ReaderSeekerI* _reader, SpirvShader& _shader);
 	int32_t write(bx::WriterI* _writer, const SpirvShader& _shader);
 
-	typedef void (*SpirvParseFn)(uint32_t _offset, const SpirvInstruction& _instruction, void* _userData);
+	typedef bool (*SpirvParseFn)(uint32_t _offset, const SpirvInstruction& _instruction, void* _userData);
 	void parse(const SpirvShader& _src, SpirvParseFn _fn, void* _userData);
 
 	typedef void (*SpirvFilterFn)(SpirvInstruction& _instruction, void* _userData);