Eric Anholt [Sat, 13 Nov 2010 06:18:09 +0000 (22:18 -0800)]
i965: Don't smash a group of coordinates doing gen6 16-wide sampler headers.
Eric Anholt [Fri, 3 Dec 2010 20:20:02 +0000 (12:20 -0800)]
i965: Fix up 16-wide gen6 FB writes after various refactoring.
Eric Anholt [Sat, 13 Nov 2010 00:38:38 +0000 (16:38 -0800)]
i965: Provide delta_xy reg to gen6 non-GLSL path PINTERP.
Fixes many assertion failures in that path.
Eric Anholt [Thu, 11 Nov 2010 17:30:16 +0000 (09:30 -0800)]
i965: Move payload reg setup to compile, not lookup time.
Payload reg setup on gen6 depends more on the dispatch width as well
as the uses_depth, computes_depth, and other flags. That's something
we want to decide at compile time, not at cache lookup. As a bonus,
the fragment shader program cache lookup should be cheaper now that
there's less to compute for the hash key.
Chia-I Wu [Mon, 6 Dec 2010 02:27:39 +0000 (10:27 +0800)]
mapi: Rewrite mapi_abi.py to get rid of preprocessor magic.
The preprocessor magic in mapi was nothing but obfuscation. Rewrite
mapi_abi.py to generate real C code.
This commit removes the hack added in
43121f20866bb89e8dac92bd92ec85a943704b7e.
Chia-I Wu [Mon, 6 Dec 2010 06:38:23 +0000 (14:38 +0800)]
egl: _eglFilterArray should not allocate.
Otherwise, when it is called from within a driver, the caller cannot
free the returned data (on Windows).
Zhenyu Wang [Mon, 6 Dec 2010 07:15:55 +0000 (15:15 +0800)]
i965: Fix GS state uploading on Sandybridge
Need to check the required primitive type for GS on Sandybridge,
and when GS is disabled, the new state has to be issued too, instead
of only updating URB state with no GS entry, that caused hang on Sandybridge.
This fixes hang issue during conformance suite testing.
Xiang, Haihao [Mon, 6 Dec 2010 01:33:18 +0000 (09:33 +0800)]
i965: fix for flat shading on Sandybridge
use constant interpolation instead of linear interpolation for
attributes COL0,COL1 if GL_FLAT is used. This fixes mesa demo bounce.
Henri Verbeet [Sun, 5 Dec 2010 17:42:43 +0000 (18:42 +0100)]
r600g: Cleanup fetch shader resources in r600_pipe_shader_destroy().
Henri Verbeet [Sun, 5 Dec 2010 17:42:43 +0000 (18:42 +0100)]
r600g: Cleanup block bo references in r600_context_fini().
Marek Olšák [Sun, 5 Dec 2010 05:43:18 +0000 (06:43 +0100)]
st/mesa: initialize key in st_vp_varient
This fixes endless vertex shader recompilations in find_translated_vp
if the shader contains an edge flag output.
NOTE: This is a candidate for the 7.9 branch.
Signed-off-by Brian Paul <brianp@vmware.com>
Xavier Chantry [Sun, 5 Dec 2010 11:12:20 +0000 (12:12 +0100)]
gallium/trace: check bind_vertex_sampler_states and set_vertex_sampler_views
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker at gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
Xavier Chantry [Sun, 5 Dec 2010 11:09:30 +0000 (12:09 +0100)]
init ps->context with util_surfaces_get and do_get
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker at gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
Xavier Chantry [Sun, 5 Dec 2010 11:04:47 +0000 (12:04 +0100)]
nvfx: fixes after array textures merge
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
Marek Olšák [Sat, 4 Dec 2010 09:06:48 +0000 (10:06 +0100)]
r300g: optimize looping over atoms
This also removes DBG_STATS (the stats can be obtained with valgrind instead).
Marek Olšák [Sat, 4 Dec 2010 03:36:02 +0000 (04:36 +0100)]
r300g: cleanup winsys
Dave Airlie [Fri, 3 Dec 2010 10:53:39 +0000 (20:53 +1000)]
r300g: try and use all of vertex constant space
Finished up by Marek Olšák.
We can set the constant space to use a different area per-call to the shader,
we can avoid flushing the PVS as often as we do by spreading out the constants
across the whole constant space.
Signed-off-by: Marek Olšák <maraeo@gmail.com>
Marek Olšák [Sun, 5 Dec 2010 00:30:09 +0000 (01:30 +0100)]
r300g: do not use the index parameter in set_constant_buffer
It appears to be a constant buffer index (in case there are more constant
buffers explicitly used by a shader), i.e. something that Gallium currently
does not use. We treated it incorrectly as the offset to a constant buffer.
Vinson Lee [Sun, 5 Dec 2010 01:30:08 +0000 (17:30 -0800)]
gallium/noop: Add prototype for noop_init_state_functions.
Silences this GCC warning.
noop_state.c:247: warning: no previous prototype for
'noop_init_state_functions'
Eric Anholt [Sun, 5 Dec 2010 00:27:57 +0000 (16:27 -0800)]
i965: Fix compile warning about missing opcodes.
Eric Anholt [Sat, 4 Dec 2010 02:20:42 +0000 (18:20 -0800)]
i965: Update gen6 SF state on fragment program change too.
SF state depends on what inputs there are to the fragment program, not
just the outputs of the VS.
Eric Anholt [Sat, 4 Dec 2010 02:25:52 +0000 (18:25 -0800)]
i965: Update gen6 WM state on compiled program change, not just FP change.
Eric Anholt [Fri, 3 Dec 2010 02:25:45 +0000 (18:25 -0800)]
intel: Add an env var override to execute for a different GPU revision.
Sometimes I'm on the train and want to just read what's generated
under INTEL_DEBUG=vs,wm for some code on another generation. Or, for
the next gen enablement we'll want to dump aub files before we have
the actual hardware. This will let us do that.
Chia-I Wu [Sat, 4 Dec 2010 13:42:51 +0000 (21:42 +0800)]
st/vega: Fix pipe blend state for various blend modes.
rgb_src_factor and rgb_dst_factor should be PIPE_BLENDFACTOR_ONE for
VG_BLEND_SRC_IN and VG_BLEND_DST_IN respectively. VG_BLEND_SRC_OVER can
be supported only when the fb has no alpha channel. VG_BLEND_DST_OVER
and VG_BLEND_ADDITIVE have to be supported with a shader.
Note that Porter-Duff blending rules assume premultiplied alpha.
Chia-I Wu [Sat, 4 Dec 2010 14:42:46 +0000 (22:42 +0800)]
st/vega: Add blend shaders for all blend modes.
Chia-I Wu [Sat, 4 Dec 2010 13:02:50 +0000 (21:02 +0800)]
st/vega: Fix VG_BLEND_MULTIPLY.
TEMP[1].w will be needed for OUT.w just below. Use TEMP[0] to store the
intermediate value.
Vinson Lee [Sat, 4 Dec 2010 09:29:50 +0000 (01:29 -0800)]
mesa: Clean up header file inclusion in texobj.h.
Vinson Lee [Sat, 4 Dec 2010 09:20:28 +0000 (01:20 -0800)]
mesa: Clean up header file inclusion in texgetimage.h.
Vinson Lee [Sat, 4 Dec 2010 09:11:33 +0000 (01:11 -0800)]
mesa: Clean up header file inclusion in texformat.h.
Vinson Lee [Sat, 4 Dec 2010 09:03:52 +0000 (01:03 -0800)]
mesa: Clean up header file inclusion in texenvprogram.h.
Vinson Lee [Sat, 4 Dec 2010 09:00:21 +0000 (01:00 -0800)]
mesa: Clean up header file inclusion in texcompress_s3tc.h.
Vinson Lee [Sat, 4 Dec 2010 08:53:44 +0000 (00:53 -0800)]
st/vega: Silence uninitialized variable warning.
Fixes this GCC warning.
api_filters.c: In function 'execute_filter':
api_filters.c:184: warning: 'tex_wrap' may be used uninitialized in this function
Vinson Lee [Sat, 4 Dec 2010 08:52:14 +0000 (00:52 -0800)]
mesa: Clean up header file inclusion in texcompress.h.
Chia-I Wu [Sat, 4 Dec 2010 06:51:27 +0000 (14:51 +0800)]
st/vega: Blending should use premultiplied alpha.
Convert color values to and back from premultiplied form for blending.
Finally the rendering result of the blend demo looks much closer to that
of the reference implementation.
Chia-I Wu [Sat, 4 Dec 2010 04:03:07 +0000 (12:03 +0800)]
st/vega: Add support for per-channel alpha.
Drawing an image in VG_DRAW_IMAGE_STENCIL mode produces per-channel
alpha for use in blending. Add a new shader stage to produce and save
it in TEMP[1].
For other modes that do not need per-channel alpha, the stage does
MOV TEMP[1], TEMP[0].wwww
Chia-I Wu [Sat, 4 Dec 2010 03:23:41 +0000 (11:23 +0800)]
st/vega: Move masking after blending.
Masking should happen after blending. The shader is not entirely
correct, but leave it as is for now.
Chia-I Wu [Fri, 3 Dec 2010 12:35:56 +0000 (20:35 +0800)]
st/vega: Refactor blend shaders.
Add a helper function, blend_generic, that supports all blend modes and
per-channel alpha. Make other blend generators a wrapper to it.
Both the old and new code expects premultiplied colors, yet the input is
non-premultiplied. Per-channel alpha is also not used for stencil
image. They still need to be fixed.
Chia-I Wu [Fri, 3 Dec 2010 12:16:37 +0000 (20:16 +0800)]
st/vega: Add some comments to pipeline shaders.
Brian Paul [Sat, 4 Dec 2010 00:07:16 +0000 (17:07 -0700)]
st/mesa: new comment about updating state vars
Brian Paul [Fri, 3 Dec 2010 23:45:44 +0000 (16:45 -0700)]
mesa: update comments, remove dead code
Brian Paul [Fri, 3 Dec 2010 23:40:36 +0000 (16:40 -0700)]
mesa: remove unneeded cast
Brian Paul [Fri, 3 Dec 2010 22:59:29 +0000 (15:59 -0700)]
mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM
In find_value() check if we've hit the 0th/invalid entry before checking
if the pname matches.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31987
NOTE: This is a candidate for the 7.9 branch.
Brian Paul [Fri, 3 Dec 2010 22:26:19 +0000 (15:26 -0700)]
swrast: restructure some glReadPixels() code
Brian Paul [Fri, 3 Dec 2010 22:21:36 +0000 (15:21 -0700)]
swrast: accept GL_RG in glReadPixels()
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32088
Kenneth Graunke [Thu, 2 Dec 2010 18:11:49 +0000 (10:11 -0800)]
ir_print_visitor: Print out constant structure values.
In the form (constant type ((field1 value) (field2 value) ...))
Brian Paul [Fri, 3 Dec 2010 21:49:19 +0000 (14:49 -0700)]
swrast: fix indentation
Brian Paul [Fri, 3 Dec 2010 21:48:01 +0000 (14:48 -0700)]
swrast: allow GL_RG format in glDrawPixels()
Restructure the switch statement to avoid having to add additional
color formats in the future.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32086
Brian Paul [Fri, 3 Dec 2010 17:59:52 +0000 (10:59 -0700)]
mesa: consolidate some compiler -D flags
-D__STDC_CONSTANT_MACROS and -D__STDC_LIMIT_MACROS are only needed for
LLVM build.
Marek Olšák [Fri, 3 Dec 2010 19:59:55 +0000 (20:59 +0100)]
r300g: one more r500_index_bias_supported leftover
Marek Olšák [Fri, 3 Dec 2010 07:01:19 +0000 (08:01 +0100)]
r300g: add capability bit index_bias_supported
.. instead of calling r500_index_bias_supported(..) every draw call.
Jerome Glisse [Fri, 3 Dec 2010 18:06:53 +0000 (13:06 -0500)]
r600g: more indentation fix + warning silencing + dead code removal
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Jerome Glisse [Fri, 3 Dec 2010 17:56:51 +0000 (12:56 -0500)]
r600g: indentation fix
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Jerome Glisse [Fri, 3 Dec 2010 17:20:40 +0000 (12:20 -0500)]
r600g: update polygon offset only when rasterizer or zbuffer change
Aim is to build as little state as possible in draw functions.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Brian Paul [Fri, 3 Dec 2010 16:42:37 +0000 (09:42 -0700)]
llvmpipe: fix broken stencil writemask
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32070
Fabian Bieler [Fri, 3 Dec 2010 02:39:48 +0000 (03:39 +0100)]
r600g: set address of pop instructions to next instruction
Jerome Glisse [Fri, 3 Dec 2010 16:34:47 +0000 (11:34 -0500)]
r600g: dump raw shader output for debugging
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Brian Paul [Fri, 3 Dec 2010 15:30:41 +0000 (08:30 -0700)]
mesa: return GL_FRAMEBUFFER_DEFAULT as FBO attachment type
If querying the default/window-system FBO's attachment type, return
GL_FRAMEBUFFER_DEFAULT (per the GL_ARB_framebuffer_object spec).
See http://bugs.freedesktop.org/show_bug.cgi?id=31947
NOTE: This is a candidate for the 7.9 branch.
Brian Paul [Fri, 3 Dec 2010 15:23:31 +0000 (08:23 -0700)]
mesa: fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query
Return 0 instead of generating an error.
See http://bugs.freedesktop.org/show_bug.cgi?id=30993
Note that piglit fbo-getframebufferattachmentparameter-01 still does
not pass. But Mesa behaves the same as the NVIDIA driver in this case.
Perhaps the test is incorrect.
NOTE: This is a candidate for the 7.9 branch.
Brian Paul [Fri, 3 Dec 2010 14:38:02 +0000 (07:38 -0700)]
gallivm: fix null builder pointers
Chia-I Wu [Fri, 3 Dec 2010 06:55:12 +0000 (14:55 +0800)]
st/vega: Add a missing break.
Chia-I Wu [Thu, 2 Dec 2010 16:44:43 +0000 (00:44 +0800)]
st/vega: Move vertex transformation to shader.
It was done in path-to-polygon conversion. That meant that the
results were invalidated when the transformation was modified, and CPU
had to recreate the vertex buffer with new vertices. It could be a
performance hit for apps that animate.
Chia-I Wu [Fri, 3 Dec 2010 03:59:25 +0000 (11:59 +0800)]
st/vega: Set pipe_resource::array_size to 1.
Chia-I Wu [Fri, 3 Dec 2010 03:57:37 +0000 (11:57 +0800)]
st/egl: Set pipe_resource::array_size to 1.
Marek Olšák [Fri, 3 Dec 2010 05:32:10 +0000 (06:32 +0100)]
r300g: do not remove unused constants if we are not near the limit
Marek Olšák [Fri, 3 Dec 2010 05:08:50 +0000 (06:08 +0100)]
r300g: fix pointer arithmetic with void* in transfer_inline_write
Marek Olšák [Thu, 2 Dec 2010 19:39:59 +0000 (20:39 +0100)]
mesa, st/mesa: fix gl_FragCoord with FBOs in Gallium
gl_FragCoord.y needs to be flipped upside down if a FBO is bound.
This fixes:
- piglit/fbo-fragcoord
- https://bugs.freedesktop.org/show_bug.cgi?id=29420
Here I add a new program state STATE_FB_WPOS_Y_TRANSFORM, which is set based
on whether a FBO is bound. The state contains a pair of transformations.
It can be either (XY=identity, ZW=transformY) if a FBO is bound,
or (XY=transformY, ZW=identity) otherwise, where identity = (1, 0),
transformY = (-1, height-1).
A classic driver (or st/mesa) may, based on some other state, choose whether
to use XY or ZW, thus negate the conditional "if (is a FBO bound) ...".
The reason for this is that a Gallium driver is allowed to only support WPOS
relative to either the lower left or the upper left corner, so we must flip
the Y axis accordingly again. (the "invert" parameter in emit_wpos_inversion)
NOTE: This is a candidate for the 7.9 branch.
Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Fri, 3 Dec 2010 04:44:47 +0000 (05:44 +0100)]
r300g: implement simple transfer_inline_write for buffers
r600g might need something like that as well. This speeds up constant buffer
upload a bit.
Marek Olšák [Fri, 3 Dec 2010 01:48:11 +0000 (02:48 +0100)]
r300g: use internal BO handle for add_buffer and write_reloc
Small perf improvement in ipers.
radeon_drm_get_cs_handle is exactly what this commit tries to avoid
in every write_reloc.
Brian Paul [Fri, 3 Dec 2010 01:11:13 +0000 (18:11 -0700)]
gallivm/llvmpipe: remove lp_build_context::builder
The field was redundant. Use the gallivm->builder value instead.
Brian Paul [Fri, 3 Dec 2010 01:06:40 +0000 (18:06 -0700)]
mesa: replace more MAX_WIDTH stack allocations with heap allocations
Marek Olšák [Thu, 2 Dec 2010 23:54:05 +0000 (00:54 +0100)]
r300g: fix build
nobled [Thu, 2 Dec 2010 21:48:40 +0000 (21:48 +0000)]
r300g: Drop unnecessary cast
nobled [Thu, 2 Dec 2010 22:49:05 +0000 (22:49 +0000)]
r300g: Abort if draw_create() fails
The other drivers need to be updated to do this, too.
nobled [Thu, 2 Dec 2010 21:46:04 +0000 (21:46 +0000)]
r300g: Abort if atom allocations fail
Ben Skeggs [Thu, 2 Dec 2010 22:23:44 +0000 (08:23 +1000)]
nv50: silence some unknown get_param warnings
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Brian Paul [Thu, 2 Dec 2010 21:23:43 +0000 (14:23 -0700)]
st/mesa: avoid large stack allocations in readpixels code
Brian Paul [Thu, 2 Dec 2010 21:18:31 +0000 (14:18 -0700)]
swrast: avoid large stack allocations in tex combine code
Brian Paul [Thu, 2 Dec 2010 21:18:18 +0000 (14:18 -0700)]
swrast: avoid large stack allocations in blend code
Brian Paul [Thu, 2 Dec 2010 21:00:30 +0000 (14:00 -0700)]
mesa: replace large/MAX_WIDTH stack allocations with heap allocations
Brian Paul [Thu, 2 Dec 2010 20:56:58 +0000 (13:56 -0700)]
mesa: replace large/MAX_WIDTH stack allocations with heap allocations
Alex Deucher [Thu, 2 Dec 2010 21:09:22 +0000 (16:09 -0500)]
r600g: bump texture/cb limits appropriately for evergreen
Alex Deucher [Thu, 2 Dec 2010 20:39:28 +0000 (15:39 -0500)]
r600c: bump texture limits to hw limits
Zack Rusin [Thu, 2 Dec 2010 20:49:36 +0000 (15:49 -0500)]
gallium/util: add states relevant to geometry shaders
José Fonseca [Thu, 2 Dec 2010 20:30:59 +0000 (20:30 +0000)]
mesa: Temporary hack to prevent stack overflow on windows
e.g. st_readpixels is trying to alloca() an huge ammount of memory from
the stack.
José Fonseca [Thu, 2 Dec 2010 20:21:39 +0000 (20:21 +0000)]
wgl: Fix visual's buffer_mask configuration.
José Fonseca [Thu, 2 Dec 2010 19:33:41 +0000 (19:33 +0000)]
mapi: Hack to avoid vgCreateFont being generated as vgCreateFontA.
Right fix is probably stop C-preprocessor abuse and stick 100% with
scripted code generation.
Eric Anholt [Thu, 2 Dec 2010 17:24:19 +0000 (09:24 -0800)]
mesa: Add getters for ARB_copy_buffer's attachment points.
Fixes more complaints by oglconform.
Eric Anholt [Thu, 2 Dec 2010 17:05:53 +0000 (09:05 -0800)]
mesa: Add getters for the rest of the supported draw buffers.
MAX_DRAW_BUFFERS is 8, so allow all 8 GL_DRAW_BUFFER# to be retrieved.
Fixes complaints by oglconform.
Eric Anholt [Thu, 2 Dec 2010 16:52:58 +0000 (08:52 -0800)]
glsl: Fix flipped return of has_value() for array constants.
Fixes glsl-array-uniform.
José Fonseca [Thu, 2 Dec 2010 17:27:05 +0000 (17:27 +0000)]
WIN32_THREADS -> WIN32
Fixes nasty bug where some parts of the code didn't define WIN32_THREADS
and were using the integer mutex implementation, causing even confusion
to the debuggers.
And there is little interest of other thread implemenation on Win32
besides Win32 threads.
Brian Paul [Thu, 2 Dec 2010 17:08:33 +0000 (10:08 -0700)]
softpipe: increase max texture size to 16K
Brian Paul [Thu, 2 Dec 2010 15:20:08 +0000 (08:20 -0700)]
mesa: raise max texture sizes to 16K
This allows 16K x 16K 2D textures, for example, but we don't want to
allow that for 3D textures. The new gl_constants::MaxTextureMBytes
field is used to prevent allocating too large of texture image.
This allows a 16K x 32 x 32 3D texture, for example, but prevents 16K^3.
Drivers can override this limit. The default is currently 1GB.
Apps should use the proxy texture mechanism to determine the actual
max texture size.
Marek Olšák [Thu, 2 Dec 2010 14:56:38 +0000 (15:56 +0100)]
r300/compiler: disable the swizzle lowering pass in vertex shaders
It was a no-op because all swizzles are native there.
José Fonseca [Thu, 2 Dec 2010 16:28:36 +0000 (16:28 +0000)]
wgl: Unreference the current framebuffer after the make_current call.
To prevent a dangling pointer dereference.
José Fonseca [Thu, 2 Dec 2010 15:14:20 +0000 (15:14 +0000)]
util: Don't try to use imagehlp on mingw.
José Fonseca [Thu, 2 Dec 2010 15:14:07 +0000 (15:14 +0000)]
util: __builtin_frame_address() doesn't work on mingw.
José Fonseca [Thu, 2 Dec 2010 15:13:46 +0000 (15:13 +0000)]
util: Plug leaks in util_destroy_gen_mipmap.
José Fonseca [Thu, 2 Dec 2010 14:57:40 +0000 (14:57 +0000)]
wgl: Fix double free. Remove dead code.
Marek Olšák [Thu, 2 Dec 2010 13:30:56 +0000 (14:30 +0100)]
r300g: fix up cubemap texture offset computation
Broken since
4c7001462607e6e99e474d6271dd481d3f8f201c.
José Fonseca [Thu, 2 Dec 2010 12:26:55 +0000 (12:26 +0000)]
util: C++ safe.