We were failing to deal with:
- vsnprintf returns negative value on error.
- vsnprintf returns the number of chars that *would* have been
written on truncation.
The alpha value wasn't set at all before so we got unpredictable results.
Note that we don't currently obey GL_DEPTH_TEXTURE_MODE in the state
tracker. For now, we return the result in the default mode (r,r,r,1).
Using uintptr_t as intermediate type for pointer -> integer conversions is
easier to understand and does not cause any size mismatch warnings.
uintptr_t is part of C99, and we already provide a suitable replacement
definition for all platforms we care about.
Avoids warnings on 64bit builds.
Use regular unsigned since that's what gallium expects, but use a
typedef to facilitate possible changes in the future.
Not only for cosmetic reasons, but also because we need to set the
SetWindowsHookEx hook for threads created before the DllMain is called
(threads for each we don't get the DLL_THREAD_ATTACH notification).
For some triangles we can generate quads which lie just outside the
surface bounds. Just check the quad's mask before trying to emit/process
the quad.
Fixes failed assertion in Lightsmark.
Render results are only visible when the render cache is flushed.
softpipe_is_texture_referenced must reflect that or transfers to/from the
textures bound in the framebuffer won't be proceeded of the necessary
flush, causing transfer data to be outdated/clobbered.
This fixes conform drawpix test with softpipe.
Because of flat shading, we can't use same code as PIPE_PRIM_TRIANGLE_FAN.
This is a follow-on to commit a59575d8fb.
(cherry picked from commit 086ecea179)
When approaching y = x * 0xffffffff / 0xffffff with bit arithmetic, the
8 least significant bits of y should come from the
8 most significant bits of x.
Fixes a crash when clearing the window with a quad after drawing large
points. We were asking the draw module how many vertex shader outputs
there were and got 3 instead of 2. This led to creating vertices with
too many attributes and trying to read invalid memory.
We reset extra_vp_outputs.slot to zero in the aaline/aapoint stage's
flush functions already.
This omission was just an oversight in the wide_point stage.
There is no current pixel format. Each HDC has its pixelformat which is
kept by gdi and set/get via the SetPixelFormat/GetPixelFormat functions.
Now the HDC's pixelformat is kept in the stw_framebuffer, which is
created during the SetPixelFormat.
This fixes the incorrect colors seen when rendering flat-shaded polygons.
Note that clipped polygons were correct, but unclipped polygons were wrong.
See the glean/clipFlat test for regression testing.