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:
parent
0aff9c6902
commit
8e86af967a
@ -130,7 +130,19 @@ $(OUTPUT).elf : $(OFILES)
|
|||||||
%.bin.o : %.bin
|
%.bin.o : %.bin
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
@echo $(notdir $<)
|
@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)
|
-include $(DEPENDS)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/3ds.h>
|
#include <3ds/3ds.h>
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "test_shbin.h"
|
#include "test_vsh_shbin.h"
|
||||||
#include "test_png_bin.h"
|
#include "test_png_bin.h"
|
||||||
#include "mdl.h"
|
#include "mdl.h"
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ int main()
|
|||||||
memcpy(vertArray, mdlData, sizeof(mdlData));
|
memcpy(vertArray, mdlData, sizeof(mdlData));
|
||||||
|
|
||||||
tx=ty=0.0f; tz=-0.1f;
|
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);
|
GX_SetMemoryFill(gxCmdBuf, (u32*)gpuOut, 0x404040FF, (u32*)&gpuOut[0x2EE00], 0x201, (u32*)gpuDOut, 0x00000000, (u32*)&gpuDOut[0x2EE00], 0x201);
|
||||||
gfxSwapBuffersGpu();
|
gfxSwapBuffersGpu();
|
||||||
|
@ -13,4 +13,4 @@
|
|||||||
#include <3ds/os.h>
|
#include <3ds/os.h>
|
||||||
#include <3ds/gfx.h>
|
#include <3ds/gfx.h>
|
||||||
|
|
||||||
#endif __3DS_H
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user