2009/4/15 Stefan Dösinger stefan@codeweavers.com:
+void record_const_read(DWORD reg, unsigned int *array, int *num) {
- int r;
- BOOL inc = TRUE;
- for(r = 0; r < *num; r++) {
if(array[r] == reg) {
inc = FALSE;
break;
}
- }
- if(inc) {
array[(*num)++] = reg;
- }
+}
This should be static. Using a bitmap and counting the bits would be nicer, imo.
Am Mittwoch, 15. April 2009 09:36:46 schrieb Henri Verbeet:
2009/4/15 Stefan Dösinger stefan@codeweavers.com:
+void record_const_read(DWORD reg, unsigned int *array, int *num) {
- int r;
- BOOL inc = TRUE;
- for(r = 0; r < *num; r++) {
if(array[r] == reg) {
inc = FALSE;
break;
}
- }
- if(inc) {
array[(*num)++] = reg;
- }
+}
This should be static. Using a bitmap and counting the bits would be nicer, imo.
On the static thing I agree. Wrt a bitmap, how'll things work in d3d10? My guess is that due to the constant buffer we do not have the issue this patch addresses in the first place, but if we do, the array makes it easier to grow the amount of int constants.
2009/4/15 Stefan Dösinger stefan@codeweavers.com:
Am Mittwoch, 15. April 2009 09:36:46 schrieb Henri Verbeet:
2009/4/15 Stefan Dösinger stefan@codeweavers.com:
+void record_const_read(DWORD reg, unsigned int *array, int *num) {
- int r;
- BOOL inc = TRUE;
- for(r = 0; r < *num; r++) {
- if(array[r] == reg) {
- inc = FALSE;
- break;
- }
- }
- if(inc) {
- array[(*num)++] = reg;
- }
+}
This should be static. Using a bitmap and counting the bits would be nicer, imo.
On the static thing I agree. Wrt a bitmap, how'll things work in d3d10? My guess is that due to the constant buffer we do not have the issue this patch addresses in the first place, but if we do, the array makes it easier to grow the amount of int constants.
Constant buffers mostly make the problem go away, although we still need to integrate d3d9 style constants with that as well. Bitmaps can have arbitrary sizes though, and in the 16 unsigned ints you currently use you could register 512 integers/bools.