]> Chaos Git - corbenik/ctrulib.git/commitdiff
gpu: shader fix
authorsmea <smealum@gmail.com>
Tue, 26 Aug 2014 06:44:52 +0000 (23:44 -0700)
committersmea <smealum@gmail.com>
Tue, 26 Aug 2014 06:44:52 +0000 (23:44 -0700)
examples/gpu/Makefile
examples/gpu/data/test.vsh
examples/gpu/source/main.c

index af6ce87078c0d3cb9774c7823d7cbece57851997..6d7873e7697c94f1cd13c44a355a6b585931f2df 100644 (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)
index 3f9f5f8f322e59528e4ed4e44f92f7da055a2915..686b22b0947c1259b9e03126338c91b92c86c06e 100644 (file)
                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
index 7623db09c271299b4b33b24d1545b68cfb318c9a..159454fc18206cd89cf35c630ee39b5d7dbccf86 100644 (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);