PeterLemon / RaspberryPi

Raspberry Pi Bare Metal Assembly Programming
447 stars 67 forks source link

Refresh example doesn't update #12

Closed quantumdude836 closed 7 years ago

quantumdude836 commented 7 years ago

The first frame renders just fine, but subsequent frames don't pick up changes to the vertices.

I've tried with both most recent firmware (commit 78c4983) and a year-old firmware (commit 046effa), and neither work. I've also tested with my own code based of yours, and it seems like any changes pre-rendering are picked up by the GPU, but not any changes in the middle of the loop.

Running on Raspberry Pi 2; display via HDMI.

PeterLemon commented 7 years ago

Hi quantumdude836,

Thanks for trying out my GPU demos, I am aware of this problem but have not fixed it yet. These demos were originally done for the Raspberry Pi 1 HW, & do work as expected on that device. When I converted my demos to R-Pi2, I found that there was a problem in my GPU demos with refreshing. I think it is because I have not setup the cache/MMU properly on these newer ARM CPU's, this problem is also on the R-Pi3.

I will try to get to the bottom of this, but if you get there 1st I'd love to know how to fix it.

Thanks for your message, I will keep this issue open, until it is fixed.

quantumdude836 commented 7 years ago

I figured it out.

Turns out, it is an issue with caching. The fix is to add 0xc0000000 to the address of the VERTEX_DATA to move it into the uncached address range. I imagine this address fixup needs to be applied to anything else that requires dynamic updates (like the CTnCA/CTnEA registers or anything in the control lists).

PeterLemon commented 7 years ago

Hi quantumdude836,

Thanks so much for working this out, I'll fix up all my demos then close this issue =D I hope you have fun doing your GPU stuff, take it easy.

PeterLemon commented 7 years ago

O.k I fixed up my R-Pi 2 & 3 GPU demos, I am now closing this issue.