Hi Raphael,
Strange, your email shows up as an attachment.
- int i, cnt = min(count, MAX_VSHADER_CONSTANTS - (start
- 1));
should be: if (start > MAX_VSHADER_CONSTANTS - 1) return WINED3DERR_INVALIDCALL; UINT i, cnt = min(count, MAX_VSHADER_CONSTANTS - (start + 1));
as count and start are UINT (better to avoid ugliy unsigned/signed bugs).
The current code checks if cnt < 0 later on.
Anyway what windows do if (start + count > MAX_VSHADER_CONSTANTS) ? The code seems handle this case truncating the input
It's possible that this is buggy [ I always thought it was off by one ], or not handling this case properly. However, I've just copied the code that was already there - unrolled the existing SetConstant function into its callers, and made the change I was interested in. Fixing other bugs would go into a separate patch.