On Tue May 2 12:13:08 2023 +0000, Giovanni Mascellani wrote:
First, a technicality: this is only valid for shader model 4+. So please move it at the end of the file and add a section like this just above it:
[require] shader model >= 4.0
Then, it would be nice to test this code in a configuration in which gradients are really used for the LOD calculation. Zeb just submitted !191 for supporting mipmapped textures. It would be great if you could rebase on that and then tweak the parameters and texture size until changing the gradients makes a difference in the number that is computed.
Will definitely rebase this once !191 is in - similar to those tests I will probably make a new sample-grad.shader_test as well.
In the meantime I'll see if I can find a sample somewhere that shows how this function really works... the IR/bytecode part works of course, but mathematically I'm a bit clueless on this one (like dsx/dsy before).