2008/9/3 Jeff Zaroyko jeffzaroyko@gmail.com:
Please ignore the previous patch sent two days ago, this one fixes a performance regression as well as removing the memory leak.
-Jeff
Do you have some kind of benchmark data for this change? I don't think allocating relatively large buffers like that on the stack is a good idea. If it does make a lot of difference in terms of performance, it probably makes sense to allocate the buffer in arbfp_alloc() instead and just reuse it. In that case it probably also makes sense to do that for the ARB and GLSL shader backends as well.
On Wed, Sep 3, 2008 at 10:25 PM, Henri Verbeet hverbeet@gmail.com wrote:
2008/9/3 Jeff Zaroyko jeffzaroyko@gmail.com:
Please ignore the previous patch sent two days ago, this one fixes a performance regression as well as removing the memory leak.
-Jeff
Do you have some kind of benchmark data for this change? I don't think allocating relatively large buffers like that on the stack is a good idea. If it does make a lot of difference in terms of performance, it probably makes sense to allocate the buffer in arbfp_alloc() instead and just reuse it. In that case it probably also makes sense to do that for the ARB and GLSL shader backends as well.
None as such since difference in performance is so large. I can say that without a doubt using HeapAlloc and HeapFree in this function causes noticeable delays such that in Battlefield 1942 the framerate is falls so much that it is unplayable, changing the allocation leaves no trace of this.
"Jeff Zaroyko" jeffzaroyko@gmail.com writes:
None as such since difference in performance is so large. I can say that without a doubt using HeapAlloc and HeapFree in this function causes noticeable delays such that in Battlefield 1942 the framerate is falls so much that it is unplayable, changing the allocation leaves no trace of this.
The first thing to try would be to get rid of the useless HEAP_ZERO_MEMORY. If that's not enough you should profile it to find where the bottleneck is.
The real problems are that the ffp description structure still contains 3 uninitialized padding bytes, and that a HeapFree is missing. I'm going to send patches for those