gpu: shader fix

This commit is contained in:
smea 2014-08-25 23:44:52 -07:00
parent 8e86af967a
commit 45c7f027d8
3 changed files with 16 additions and 16 deletions

View File

@ -139,9 +139,9 @@ $(OUTPUT).elf : $(OFILES)
@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
@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

@ -19,23 +19,23 @@
mov d1A, d00 (0x4)
mov d1A, d25 (0x3)
; tempreg = mdlvMtx * in.pos
dp4 d10, d40, d1A (0x0)
dp4 d10, d41, d1A (0x1)
dp4 d10, d42, d1A (0x2)
dp4 d10, d44, d1A (0x0)
dp4 d10, d45, d1A (0x1)
dp4 d10, d46, d1A (0x2)
mov d10, d25 (0x3)
; result.pos = projMtx * tempreg
dp4 d00, d20, d10 (0x0)
dp4 d00, d21, d10 (0x1)
dp4 d00, d22, d10 (0x2)
dp4 d00, d23, d10 (0x3)
dp4 d00, d40, d10 (0x0)
dp4 d00, d41, d10 (0x1)
dp4 d00, d42, d10 (0x2)
dp4 d00, d43, d10 (0x3)
; result.texcoord = in.texcoord
mov d02, d01 (0x5)
mov d03, d25 (0x7)
mov d04, d25 (0x7)
; result.color = crappy lighting
dp3 d1A, d40, d02 (0x0)
dp3 d1A, d41, d02 (0x1)
dp3 d1A, d42, d02 (0x2)
dp3 d1A, d44, d02 (0x0)
dp3 d1A, d45, d02 (0x1)
dp3 d1A, d46, d02 (0x2)
dp4 d01, d00, d1A (0x6)
mov d01, d25 (0x3)
flush

View File

@ -101,8 +101,8 @@ void doFrame1()
initProjectionMatrix(projection, 1.3962634f, 240.0f/400.0f, 0.01f, 10.0f);
setUniformMatrix(0x20, modelView);
setUniformMatrix(0x80, projection);
setUniformMatrix(0x24, modelView);
setUniformMatrix(0x20, projection);
//draw first model
GPU_DrawArray(GPU_TRIANGLES, mdlFaces*3);
@ -116,7 +116,7 @@ void doFrame1()
rotateMatrixX(modelView, -angle);
rotateMatrixZ(modelView, -angleZ);
setUniformMatrix(0x20, modelView);
setUniformMatrix(0x24, modelView);
//draw second
GPU_DrawArray(GPU_TRIANGLES, mdlFaces*3);