powly
|
|
« Reply #20 on: March 18, 2013, 11:15:41 AM » |
|
I've generated mipmaps by hand on a fragment shader by just rendering from the previous level to the next one. Never tried if it's faster than the reference implementation, since I also manipulated some extra data on each level and had to do it anyway.
Ham and brie would seem to be correct, there's no way the CPU can do 2048x2048 smooth and stall with 512x256. Though you shouldn't rely on one specific implementation as they can change - just do it by hand if you want to be sure it's GPU accelerated.
|
|
|
Logged
|
|
|
|
PompiPompi
|
|
« Reply #21 on: March 18, 2013, 11:46:27 AM » |
|
But there is a lot more going on than generating the mipmaps when drawing to the screen is involved. Drawing to the screen is bound to a refresh rate, even on a mobile phone. The code shows he hints for 60 frames per seconds. His results also show that at first the frame rate is 60 FPS. This means the CPU is stalled because it's waiting for the screen rendering to sync to 60 FPS, not because the GPU is busy generating the mipmaps.
Yea, generating the next level using the previous level simply with bi-linear filtering is what I already thought to do. I just kept on arguing on what seems to be pseudo logic.
In other words, the stall with the 512x256 might be due to synching with 60FPS, not related to generating the mipmaps.
|
|
|
Logged
|
Master of all trades.
|
|
|
ham and brie
|
|
« Reply #22 on: March 18, 2013, 11:52:19 AM » |
|
OK, you've convinced me: you really are too thick to understand this and I ought to give up.
|
|
|
Logged
|
|
|
|
PompiPompi
|
|
« Reply #23 on: March 18, 2013, 11:59:51 AM » |
|
Why is it so hard for you to do the same "experiment" without involving drawing to the screen? You would think that if you want to isolate generating mip maps you would not add drawing to a screen which is also being synched to 60FPS. Where the hell is the logic in that? Or does measuring this without drawing to the screen doesn't give you the desired results so you say that it's wrong?
|
|
|
Logged
|
Master of all trades.
|
|
|
ThemsAllTook
|
|
« Reply #24 on: March 18, 2013, 12:15:06 PM » |
|
Come on guys, no need to fight. If one of you is going to disagree with the other's conclusion, maybe you could bring data of your own that shows a different result?
|
|
|
Logged
|
|
|
|
PompiPompi
|
|
« Reply #25 on: March 18, 2013, 12:35:12 PM » |
|
That would require me to think of all the possible optimizations, threading issues, and edge cases that might be inside the OpenGL driver which is a black box for me. If you bring data and claim that it proves something, I would also be happy to know how you think it is done under the hood, and show ENOUGH data to prove that proves the structure and logic of the implementation of the OpenGL driver.
Maybe you are very smart and I am stupid, but I really can't tell from what you have show me the pipeline and what happens inside the OpenGL Driver.
Does generating the mip maps always happen on glGenerateMipMap? Is it done lazily only when required? Does the synching to 60 FPS of the screen happen only when on the function that draws present into the screen? Maybe the screen synching also inside glGenerateMipMap? Are they triple buffering? Does generating mipmaps make your drawing of the box wait in queue until they end like most other GPU operations? Do you have answers to these questions?
Edit: My answer is, they could be doing anything inside their drivers, ffff if I know what. Having slow small non square textures make generating mipmap on the GPU mostly pointless, since I need both square and non square.
|
|
|
Logged
|
Master of all trades.
|
|
|
|