added Makefile rule to compile vsh shader code to gpu example (fincs, can you see if you can improve it ?)

This commit is contained in:
smea 2014-08-25 23:26:36 -07:00
parent 0aff9c6902
commit 8e86af967a
4 changed files with 16 additions and 4 deletions

View 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)

View 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();

View File

@ -13,4 +13,4 @@
#include <3ds/os.h>
#include <3ds/gfx.h>
#endif __3DS_H
#endif