From 45c7f027d89455b199372649b768b4c080270955 Mon Sep 17 00:00:00 2001 From: smea Date: Mon, 25 Aug 2014 23:44:52 -0700 Subject: [PATCH] gpu: shader fix --- examples/gpu/Makefile | 6 +++--- examples/gpu/data/test.vsh | 20 ++++++++++---------- examples/gpu/source/main.c | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/gpu/Makefile b/examples/gpu/Makefile index af6ce87..6d7873e 100644 --- a/examples/gpu/Makefile +++ b/examples/gpu/Makefile @@ -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) diff --git a/examples/gpu/data/test.vsh b/examples/gpu/data/test.vsh index 3f9f5f8..686b22b 100644 --- a/examples/gpu/data/test.vsh +++ b/examples/gpu/data/test.vsh @@ -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 diff --git a/examples/gpu/source/main.c b/examples/gpu/source/main.c index 7623db0..159454f 100644 --- a/examples/gpu/source/main.c +++ b/examples/gpu/source/main.c @@ -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);