]> Chaos Git - corbenik/ctrulib.git/commitdiff
added Makefile rule to compile vsh shader code to gpu example (fincs, can you see...
authorsmea <smealum@gmail.com>
Tue, 26 Aug 2014 06:26:36 +0000 (23:26 -0700)
committersmea <smealum@gmail.com>
Tue, 26 Aug 2014 06:26:36 +0000 (23:26 -0700)
examples/gpu/Makefile
examples/gpu/data/test.vsh [moved from examples/gpu/source/test.vsh with 100% similarity]
examples/gpu/source/main.c
libctru/include/3ds/3ds.h

index c0eae79248a3a7aa6336e695155612e71b0a5a69..af6ce87078c0d3cb9774c7823d7cbece57851997 100644 (file)
@@ -130,7 +130,19 @@ $(OUTPUT).elf      :       $(OFILES)
 %.bin.o        :       %.bin
 #---------------------------------------------------------------------------------
        @echo $(notdir $<)
-       @$(bin2o)
+       $(bin2o)
+
+# not the right way to do this
+#---------------------------------------------------------------------------------
+%.vsh.o        :       %.vsh
+#---------------------------------------------------------------------------------
+       @echo $(notdir $<)
+       @python $(AEMSTRO)/aemstro_as.py $< ../$(notdir $<).shbin
+       @bin2s ../$(notdir $<).shbin | arm-none-eabi-as -o $@
+       echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(notdir $<).shbin | tr . _)`.h
+       echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(notdir $<).shbin | tr . _)`.h
+       echo "extern const u32" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(notdir $<).shbin | tr . _)`.h
+       @rm ../$(notdir $<).shbin
 
 -include $(DEPENDS)
  
index e52192365e316503b478e5b7faf1230e894d004b..7623db09c271299b4b33b24d1545b68cfb318c9a 100644 (file)
@@ -4,7 +4,7 @@
 #include <string.h>
 #include <3ds/3ds.h>
 #include "math.h"
-#include "test_shbin.h"
+#include "test_vsh_shbin.h"
 #include "test_png_bin.h"
 #include "mdl.h"
 
@@ -172,7 +172,7 @@ int main()
        memcpy(vertArray, mdlData, sizeof(mdlData));
 
        tx=ty=0.0f; tz=-0.1f;
-       shader=SHDR_ParseSHBIN((u32*)test_shbin,test_shbin_size);
+       shader=SHDR_ParseSHBIN((u32*)test_vsh_shbin,test_vsh_shbin_size);
 
        GX_SetMemoryFill(gxCmdBuf, (u32*)gpuOut, 0x404040FF, (u32*)&gpuOut[0x2EE00], 0x201, (u32*)gpuDOut, 0x00000000, (u32*)&gpuDOut[0x2EE00], 0x201);
        gfxSwapBuffersGpu();
index 8df0db6e276bd69dccccc0ed3a1361ed30d506a7..724712e08f21d8fb213dfb5982ff6d06868644ef 100644 (file)
@@ -13,4 +13,4 @@
 #include <3ds/os.h>
 #include <3ds/gfx.h>
 
-#endif __3DS_H
+#endif