Since struct _IAVIStreamImpl has a pointer to a WAVEFORMATEX,
GCC 12.2 emits warning when dereferencing that pointer when
the block has been allocated with sizeof(PCMWAVEFORMAT).
The warning is fixed by always allocating with sizeof(WAVEFORMATEX).
This will overallocate in case of a PCM stream.
The alternative would have been to store in struct _IAVIStreamImpl
a pointer to PCMWAVEFORMAT instead, and add the casting to a
WAVEFORMATEX when needed. That would clutter the code IMO since most
of the ACM APIs expect a LPWAVEFORMATEX.
/home/eric/work/wine/dlls/avifil32/acmstream.c: In function 'AVIFILE_OpenCompressor':
/home/eric/work/wine/dlls/avifil32/acmstream.c:105:24: warning: array subscript 'struct tWAVEFORMATEX[0]' is partly outside array bounds of 'unsigned char[16]' [-Warray-bounds]
105 | This->lpOutFormat->wFormatTag = WAVE_FORMAT_PCM;
| ^~
/home/eric/work/wine/dlls/avifil32/acmstream.c:101:27: note: object of size 16 allocated by 'HeapAlloc'
101 | This->lpOutFormat = HeapAlloc(GetProcessHeap(), 0, This->cbOutFormat);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Legends game periodically (every 30 seconds) calls this function
with up to 22k virtual addresses. All but 1 of them is valid. Due to
amount of queries addresses, and cost of seek+read, this causes this
function to take up to about 50ms. So framerate drops from ~150 FPS to
20FPS for about a second.
As far as I can see, returning 0 entries from this function, still makes
Apex Legend work.
But keep code correct, and optimise it by only performing pagemap read
when the address is valid.
This change get_working_set_ex reduces peek wall clock runtime from 57ms
to 0.29ms.
Tested on Linux, but similar change done for the BSD part.
Signed-off-by: Witold Baryluk <witold.baryluk@gmail.com>
Some drivers (AMD Radeon RX 6700 XT, with radeonsi from Mesa 22.2.0-rc3) emit
less than one invocation per pixel, presumably because they detect that the
shader control flow is uniform for all pixels. Having the control flow depend on
SV_Position avoids this test failure.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Some drivers (AMD Radeon RX 6700 XT, with radeonsi from Mesa 22.2.0-rc3) emit
less than one invocation per pixel, presumably because they detect that the
shader control flow is uniform for all pixels. Having the control flow depend on
SV_Position avoids this test failure.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>