-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Actually I am afraid the patch isn't quite correct. If e.g. ps constant 220 is dirty, and no others are, then highest_dirty_ps_const is 220, and pshader_const_dirty[ARB_FFP_CONST_TFACTOR] is 0. After setting the texfactor you still have to reload constant nr. ARB_FFP_CONST_TFACTOR, so you have to set it to 1 in the array.
If managing the dirty constant array is expensive you could try to replace it by a bitmap where you just store 1 bit per dirty constant. That reduces the memory size(helps with the CPU cache) and you can skip 8, 16 or 32 clean constants at once in shader_arb_load_constantsF but it adds some overhead because extra operations are needed to test for single bits.
- /* TODO: this call is actually very expensive, figure out a better way... */ GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_TFACTOR, col));
There's no real alternative, except hardcoding the texfactor into the shader, and I doubt that is cheaper. Maybe local constants are cheaper, but I doubt this as well. That also means you have to reload the texfactor every time you switch between fixed function pipeline replacement shaders.
Am 04.02.2011 um 10:27 schrieb Stefan Dösinger:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 03.02.2011 um 23:01 schrieb Adam Martinson:
Oddly enough this gives us an average 1.8% boost in the 3DMark06 batch size tests.
Impressive.
One more thing you could investigate(but that doesn't affect this patch): Try to figure out why this code is called in the first place. The only situation when this should happen is if the app is using fixed function fragment processing. I wouldn't expect that 3Dmark06 does that.
-----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
iQIcBAEBAgAGBQJNS8aYAAoJEN0/YqbEcdMwI1AQAJder+8LZILzdT+8tA2YiwZ+ ZEVOi4S2voFASHUVJbYuWIXkzzVu6fQlZXw/KCyvdQaslpTWQFFc/cOMXcCVjVs5 puJJDydjCyI8FZF7ec8dCIjCHqBH4S91kxDjRmWGifdp1Qd6h/f7o1xyhOHG62xG XZbY1xx3DhQ7lRxRtsdqqq22MM5cOqR4mCen2YPGsd04rlwsxW6zuxZ32oBof0rO ggzBW1F2WdDHeT6rcDK5Iv7R4zdSCtl6IXfsMaT1frTcd8Mo/9jLj7GaLMnQ/UtG JkyQbCP59AOtEKU8nwrISn71YMRkCBHOttaIAVhr6Nq02eNmcxWomSbIsb293LzP fQHFDPJ2aO161AimO/7Nk6DbGniUtlgRGhPhrK+YJvrAhftrtZ2gFUaN3QLJgcKA HHhkU00NsBXOJvz8YuGFDRVmpPpCLcGM7gvMIyjYy3x3W1FWO4giNxnj6CxqHmLs ohkAbsLEnJohhpTyVEaQKTG0Zq49s5WcvkjQbmncqKdP2D9NHmi50FI8MbJJxXAu mMW6sA6oExn31Fnm1/pQOWCZk8hidK1hRN7f25nSRa58q7bSvNT/Gw3kk6S8T5CU yL3r5UIb64ss4QmtXY8SPIR9IDNvmnYUX4/Av/iKpZrSRHCHzpYX7Eecp2jdV/ta jgKpR4VaDyemyij093oW =LXas -----END PGP SIGNATURE-----