platform/upstream/mesa.git
15 years agoglsl: rework loop nesting code
Brian Paul [Thu, 25 Jun 2009 15:50:37 +0000 (09:50 -0600)]
glsl: rework loop nesting code

15 years agoglsl: remove test for loop unrolling when we hit conditional cont/break
Brian Paul [Thu, 25 Jun 2009 15:30:53 +0000 (09:30 -0600)]
glsl: remove test for loop unrolling when we hit conditional cont/break

This is no longer needed since we added the new
_slang_loop_contains_continue_or_break() function/test.

15 years agoglsl: checkpoint: predicate __retVal = expr with __returnFlag
Brian Paul [Wed, 24 Jun 2009 23:02:34 +0000 (17:02 -0600)]
glsl: checkpoint: predicate __retVal = expr with __returnFlag

The glean "function with early return (1)" test passes now.

15 years agoglsl: use new helper functions in _slang_gen_logical_and/or()
Brian Paul [Wed, 24 Jun 2009 22:37:01 +0000 (16:37 -0600)]
glsl: use new helper functions in _slang_gen_logical_and/or()

15 years agoglsl: add comments
Brian Paul [Wed, 24 Jun 2009 22:36:24 +0000 (16:36 -0600)]
glsl: add comments

15 years agoglsl: checkpoint: replace 'return' with __returnFlag=true;
Brian Paul [Wed, 24 Jun 2009 22:28:32 +0000 (16:28 -0600)]
glsl: checkpoint: replace 'return' with __returnFlag=true;

Needed for "remove early returns" transformation.

15 years agoglsl: fix up scoping for parent/children in slang_operation_copy()
Brian Paul [Wed, 24 Jun 2009 22:25:00 +0000 (16:25 -0600)]
glsl: fix up scoping for parent/children in slang_operation_copy()

This will need more testing, but no regressions seen so far.

15 years agoglsl: fix uninitialized var in _slang_gen_for_without_continue()
Brian Paul [Wed, 24 Jun 2009 22:12:20 +0000 (16:12 -0600)]
glsl: fix uninitialized var in _slang_gen_for_without_continue()

15 years agoglsl: added slang_operation_free_children()
Brian Paul [Wed, 24 Jun 2009 22:04:33 +0000 (16:04 -0600)]
glsl: added slang_operation_free_children()

15 years agoglsl: added slang_oper_num_children() helper
Brian Paul [Wed, 24 Jun 2009 19:16:49 +0000 (13:16 -0600)]
glsl: added slang_oper_num_children() helper

15 years agoglsl: check-point: declare _returnFlag
Brian Paul [Wed, 24 Jun 2009 14:40:56 +0000 (08:40 -0600)]
glsl: check-point: declare _returnFlag

15 years agoglsl: added slang_operation_insert_child()
Brian Paul [Tue, 23 Jun 2009 23:07:12 +0000 (17:07 -0600)]
glsl: added slang_operation_insert_child()

15 years agoglsl: use slang_generate_declaration() to consolidate some code
Brian Paul [Tue, 23 Jun 2009 22:55:10 +0000 (16:55 -0600)]
glsl: use slang_generate_declaration() to consolidate some code

15 years agoglsl: remove obsolete comment
Brian Paul [Tue, 23 Jun 2009 22:17:06 +0000 (16:17 -0600)]
glsl: remove obsolete comment

15 years agost/mesa: query PIPE_CAP_TGSI_CONT_SUPPORTED
Brian Paul [Tue, 23 Jun 2009 20:28:43 +0000 (14:28 -0600)]
st/mesa: query PIPE_CAP_TGSI_CONT_SUPPORTED

15 years agoglsl: implement _slang_gen_while_without_continue()
Brian Paul [Tue, 23 Jun 2009 20:05:11 +0000 (14:05 -0600)]
glsl: implement _slang_gen_while_without_continue()

15 years agoglsl: fix a bug involving 'continue' in 'for' loops
Brian Paul [Tue, 23 Jun 2009 19:33:28 +0000 (13:33 -0600)]
glsl: fix a bug involving 'continue' in 'for' loops

Need to execute the for loop's increment code before we continue.
Add a slang_assemble_ctx::CurLoopOper field to keep track of the containing
loop and avoid the "cont if true" path in this situation.

Plus, assorted clean-ups.

15 years agoglsl: added slang_oper_child_const()
Brian Paul [Tue, 23 Jun 2009 18:46:11 +0000 (12:46 -0600)]
glsl: added slang_oper_child_const()

15 years agoglsl: use _slang_loop_contains_continue_or_break() to check for unrolling
Brian Paul [Tue, 23 Jun 2009 16:57:59 +0000 (10:57 -0600)]
glsl: use _slang_loop_contains_continue_or_break() to check for unrolling

The previous test failed for nested loops.

15 years agoglsl: use new _slang_loop_contains_continue() helper function
Brian Paul [Thu, 18 Jun 2009 23:25:47 +0000 (17:25 -0600)]
glsl: use new _slang_loop_contains_continue() helper function

15 years agoglsl: implement continue->break translation for do-while loops
Brian Paul [Thu, 18 Jun 2009 23:08:10 +0000 (17:08 -0600)]
glsl: implement continue->break translation for do-while loops

15 years agoglsl: added slang_operation_literal_int/bool() helper functions
Brian Paul [Thu, 18 Jun 2009 22:57:53 +0000 (16:57 -0600)]
glsl: added slang_operation_literal_int/bool() helper functions

15 years agoglsl: don't allocate 0-length children array in slang_operation_copy()
Brian Paul [Thu, 18 Jun 2009 22:57:23 +0000 (16:57 -0600)]
glsl: don't allocate 0-length children array in slang_operation_copy()

15 years agoglsl: remove debug code, misc clean-up
Brian Paul [Thu, 18 Jun 2009 20:24:30 +0000 (14:24 -0600)]
glsl: remove debug code, misc clean-up

15 years agoglsl: implement continue->break transformation for for-loops
Brian Paul [Thu, 18 Jun 2009 20:14:53 +0000 (14:14 -0600)]
glsl: implement continue->break transformation for for-loops

15 years agoglsl: added slang_operation_add_children() and slang_oper_child() helpers
Brian Paul [Thu, 18 Jun 2009 20:11:59 +0000 (14:11 -0600)]
glsl: added slang_operation_add_children() and slang_oper_child() helpers

15 years agoglsl: added slang_assemble_ctx::EmitContReturn field, init
Brian Paul [Thu, 18 Jun 2009 20:11:38 +0000 (14:11 -0600)]
glsl: added slang_assemble_ctx::EmitContReturn field, init

15 years agodemos: improve argv parsing in fslight.c
Brian Paul [Thu, 18 Jun 2009 18:43:43 +0000 (12:43 -0600)]
demos: improve argv parsing in fslight.c

15 years agoglsl: don't unroll loops containing continue/break
Brian Paul [Wed, 17 Jun 2009 19:51:35 +0000 (13:51 -0600)]
glsl: don't unroll loops containing continue/break

Just search the AST in _slang_can_unroll_for_loop().

15 years agoRevert "slang: if/else/break & if/else/continue work for unrolled loops"
Brian Paul [Wed, 17 Jun 2009 19:48:52 +0000 (13:48 -0600)]
Revert "slang: if/else/break & if/else/continue work for unrolled loops"

We should just check if the loop contains a continue/break in the
_slang_can_unroll_for_loop() test function...

This reverts commit 989856bde47d699d7e18798df4013fbf962e1d4b.

Conflicts:

src/mesa/shader/slang/slang_codegen.h

15 years agoglsl: Added gl_shader_state::EmitContReturn field
Brian Paul [Wed, 17 Jun 2009 17:57:39 +0000 (11:57 -0600)]
glsl: Added gl_shader_state::EmitContReturn field

This is the start of a glsl-continue-return feature branch to support
a GLSL code generator option for 'continue' and 'return' statements.
Some targets don't support CONT or RET statements so we'll need to
try to generate code that does not use them...

15 years agodocs: updated Mesa release instructions
Brian Paul [Wed, 24 Jun 2009 01:21:04 +0000 (19:21 -0600)]
docs: updated Mesa release instructions

15 years agoscons: Tool to build with DirectX SDK.
José Fonseca [Fri, 26 Jun 2009 18:51:57 +0000 (19:51 +0100)]
scons: Tool to build with DirectX SDK.

Also works with MinGW, as long as the path to the DirectX SDK top
directory is set in the DXSDK_DIR environment variable.

15 years agoscons: Don't use C specific options with g++
José Fonseca [Fri, 26 Jun 2009 18:50:12 +0000 (19:50 +0100)]
scons: Don't use C specific options with g++

15 years agotgsi: correct handling of return value from util_vsnprintf
Keith Whitwell [Fri, 26 Jun 2009 12:43:10 +0000 (13:43 +0100)]
tgsi: correct handling of return value from util_vsnprintf

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.

15 years agoaux/indices: don't use 'prim' value once it is known to be bad
Keith Whitwell [Fri, 26 Jun 2009 12:44:20 +0000 (13:44 +0100)]
aux/indices: don't use 'prim' value once it is known to be bad

Theoretical bugfix only - no known case where this might happen.

15 years agowgl: Handle flush after a window is destroyed.
José Fonseca [Wed, 24 Jun 2009 13:46:07 +0000 (14:46 +0100)]
wgl: Handle flush after a window is destroyed.

Fixes assertion failure with conform.

15 years agodemos: fix issues in glxcontexts.c
Brian Paul [Tue, 23 Jun 2009 15:31:27 +0000 (09:31 -0600)]
demos: fix issues in glxcontexts.c

The reshape() function was called when there was no GLX context so
the viewport/modelview/projection setup wasn't doing anything.  Move
the call to reshape() into draw().

Also, remove -stereo, -fullscreen options and do some general clean-up.

15 years agoi965: handle OPCODE_SWZ in the glsl path
Roland Scheidegger [Tue, 16 Jun 2009 19:38:58 +0000 (21:38 +0200)]
i965: handle OPCODE_SWZ in the glsl path

glsl compiler will not generate OPCODE_SWZ, and as a first step it would
be translated away to a MOV anyway (why?), but later internally this opcode is
generated (for EXT_texture_swizzling).
(cherry picked from commit 4ef1f8e3b52a06fcf58f78c9c36738531b91dbac)

15 years agoDisable SGI_swap_control extension for DRI2
Owen W. Taylor [Sat, 6 Jun 2009 18:46:22 +0000 (14:46 -0400)]
Disable SGI_swap_control extension for DRI2

We currently don't have support for SGI_swap_control for direct
contexts with DRI2, so disable reporting the extension. Reporting
the extension, and then having glXSwapIntervalSGI() "succeed"
but do nothing can confuse applications.

https://bugs.freedesktop.org/show_bug.cgi?id=22123
(cherry picked from commit 279143c6e808b37c333321b696d80df77f709a04)

15 years agointel: intel_texture_drawpixels() can't handle GL_DEPTH_STENCIL.
Michel Dänzer [Thu, 11 Jun 2009 10:09:10 +0000 (12:09 +0200)]
intel: intel_texture_drawpixels() can't handle GL_DEPTH_STENCIL.

Fixes glean depthStencil test.
(cherry picked from commit 3885b708fdbb7bbd5dd3a247c41fb9a75ee7c057)

15 years agoi965: added intelFlush() call in intel_get_tex_image()
Brian Paul [Tue, 9 Jun 2009 21:07:39 +0000 (15:07 -0600)]
i965: added intelFlush() call in intel_get_tex_image()

Fixes the render-to-texture test in progs/tests/getteximage.c
(cherry picked from commit a03b349153660e449daf4f56d750f1caef23b1a5)

15 years agomesa: s/MAX_VERTEX_PROGRAM_ATTRIBS/MAX_NV_VERTEX_PROGRAM_INPUTS/ in NV funcs
Brian Paul [Fri, 22 May 2009 13:19:27 +0000 (07:19 -0600)]
mesa: s/MAX_VERTEX_PROGRAM_ATTRIBS/MAX_NV_VERTEX_PROGRAM_INPUTS/ in NV funcs
(cherry picked from commit 4dc426c01627a240bd5b148c1804c45b0d5ecd6c)

15 years agomesa: rename MAX_VERTEX_ATTRIBS to MAX_VERTEX_GENERIC_ATTRIBS
Brian Paul [Fri, 22 May 2009 13:26:08 +0000 (07:26 -0600)]
mesa: rename MAX_VERTEX_ATTRIBS to MAX_VERTEX_GENERIC_ATTRIBS

Be clearer that this is the number of generic vertex program/shader
attributes, not counting the legacy attributes (pos, normal, color, etc).
(cherry picked from commit 4a95185c9f30c2de7a03bb1a0653f51b53b1111d)

15 years agomesa: s/MAX_VERTEX_PROGRAM_ATTRIBS/MAX_NV_VERTEX_PROGRAM_INPUTS
Brian Paul [Thu, 21 May 2009 23:03:21 +0000 (17:03 -0600)]
mesa: s/MAX_VERTEX_PROGRAM_ATTRIBS/MAX_NV_VERTEX_PROGRAM_INPUTS
(cherry picked from commit d2a74d76c96957cf0294dcf40d29526621ada95e)

15 years agomesa: fix some potential state-restore issues in pop_texture_group()
Brian Paul [Thu, 21 May 2009 16:05:04 +0000 (10:05 -0600)]
mesa: fix some potential state-restore issues in pop_texture_group()

Call the _mesa_set_enable() functions instead of driver functions, etc.

Also, add missing code for 1D/2D texture arrays.
(cherry picked from commit aac19609bfd7c950b2577489b06886c8a8097bb2)

15 years agovbo: return VP_NONE from get_program_mode() if running fixed-func vertex program
Brian Paul [Thu, 21 May 2009 15:52:33 +0000 (09:52 -0600)]
vbo: return VP_NONE from get_program_mode() if running fixed-func vertex program

If we're running a vertex program to emulated fixed-function, we still need
to treat vertex arrays/attributes as if we're in fixed-function mode.

This should probably be back-ported to Mesa 7.5 after a bit more testing.
(cherry picked from commit dda82137d28aba846dda73da230871c115e30aaf)

15 years agomesa: create/use a fallback texture when bound texture is incomplete
Brian Paul [Fri, 1 May 2009 15:30:32 +0000 (09:30 -0600)]
mesa: create/use a fallback texture when bound texture is incomplete

When a GLSL sampler reads from an incomplete texture it should
return (0,0,0,1).  Instead of jumping through hoops in all the drivers
to make this happen, just create/install a fallback texture with those
texel values.

Fixes piglit/fp-incomplete-tex on i965 and more importantly, fixes some
GPU lockups when trying to sample from missing surfaces.  If a binding
table entry is NULL, it seems that sampling sometimes works, but not
always (lockup).

Todo: create a fallback texture for each type of texture target?
(cherry picked from commit 3f25219c7bf0f090502489928f0f018e62c4f6cf)

15 years agointel: Fix other metaops versus GL_COMPILE_AND_EXECUTE dlists.
Eric Anholt [Fri, 19 Jun 2009 22:57:03 +0000 (15:57 -0700)]
intel: Fix other metaops versus GL_COMPILE_AND_EXECUTE dlists.

Fixes oglconform zbfunc.c and pxtrans-cidraw.c, at least.

(cherry picked from commit 405300bb190f516e16b704050abe3389b366ed27)

15 years agointel: Fix glClear behavior versus display lists.
Eric Anholt [Fri, 19 Jun 2009 22:49:24 +0000 (15:49 -0700)]
intel: Fix glClear behavior versus display lists.

The CALL_DrawArrays was leaking the clear's primitives into the display
list with GL_COMPILE_AND_EXECUTE.  Use _mesa_DrawArrays instead, which
doesn't appear to leak.  Fixes piglit dlist-clear test.
(cherry picked from commit 64edde1004f7a69e77877bba24d315a92bcd47c8)

15 years agoradeons: use dp4 for position invariant vertex programs
Roland Scheidegger [Fri, 19 Jun 2009 18:00:55 +0000 (20:00 +0200)]
radeons: use dp4 for position invariant vertex programs

Fixes #22181. R200 requires this since DP4 is used in hw tnl mode.
R300 prefers it (should be faster due to no instruction dependencies), but
both methods should be correct (when sw tcl is used though, MUL/MAD might
be faster). Probably doesn't make much difference for R100 since vertex progs
are executed in software anyway, but let's just keep it the same there too.

15 years agoAlso release direct rendering resources in glXDestroyGLXPixmap.
Michel Dänzer [Fri, 19 Jun 2009 09:19:07 +0000 (11:19 +0200)]
Also release direct rendering resources in glXDestroyGLXPixmap.

Fixes leak running compiz with direct rendering.

15 years agoAlways free image offsets memory when re-initializing texture image fields.
Michel Dänzer [Fri, 19 Jun 2009 09:19:08 +0000 (11:19 +0200)]
Always free image offsets memory when re-initializing texture image fields.

Fixes leak running compiz with direct rendering.

15 years agoscons: Output the friendly "Linking ..." message when creating DLLs with MinGW.
José Fonseca [Fri, 19 Jun 2009 14:39:59 +0000 (15:39 +0100)]
scons: Output the friendly "Linking ..." message when creating DLLs with MinGW.

15 years agosoftpipe: return alpha=1 in shadow_compare() function
Brian Paul [Fri, 19 Jun 2009 14:40:43 +0000 (08:40 -0600)]
softpipe: return alpha=1 in shadow_compare() function

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).

15 years agoutil: Add cast.
José Fonseca [Thu, 18 Jun 2009 13:47:30 +0000 (14:47 +0100)]
util: Add cast.

It is expected to loose precision here.

15 years agodraw: Replace pointer arithmetic with cast.
José Fonseca [Thu, 18 Jun 2009 13:46:45 +0000 (14:46 +0100)]
draw: Replace pointer arithmetic with cast.

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.

15 years agotrace: Use size_t consistently.
José Fonseca [Thu, 18 Jun 2009 11:52:10 +0000 (12:52 +0100)]
trace: Use size_t consistently.

15 years agopipebuffer: Use a type consistently for sizes/offsets.
José Fonseca [Thu, 18 Jun 2009 11:51:00 +0000 (12:51 +0100)]
pipebuffer: Use a type consistently for sizes/offsets.

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.

15 years agowgl: Fix window resizing in multithread applications.
José Fonseca [Wed, 17 Jun 2009 20:28:18 +0000 (21:28 +0100)]
wgl: Fix window resizing in multithread applications.

In multithreading stw_call_window_proc can be called by a thread other
than the thread where the context is bound.

15 years agowgl: Move all thread related code together.
José Fonseca [Wed, 17 Jun 2009 18:24:51 +0000 (19:24 +0100)]
wgl: Move all thread related code together.

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).

15 years agoglew: correct misspelling of glFramebufferTextureLayer
Keith Whitwell [Thu, 18 Jun 2009 09:13:55 +0000 (10:13 +0100)]
glew: correct misspelling of glFramebufferTextureLayer

This was misspelt as glFramebufferTexturLayer (missing e), causing
conflicts with the correctly spelt version in glext.h and extfuncs.h.

15 years agomesa: protect Elements against multiple definitions
Keith Whitwell [Thu, 11 Jun 2009 09:52:37 +0000 (10:52 +0100)]
mesa: protect Elements against multiple definitions

Mesa and gallium both have a definition of this macro

15 years agointel: remove extra \n from warning string
Brian Paul [Mon, 8 Jun 2009 20:41:54 +0000 (14:41 -0600)]
intel: remove extra \n from warning string
(cherry picked from commit 42e9bde0fa2276b8f5bb434328eea7665794b127)

15 years agoi965: fix 1D texture borders with GL_CLAMP_TO_BORDER
Robert Ellison [Thu, 14 May 2009 02:40:23 +0000 (20:40 -0600)]
i965: fix 1D texture borders with GL_CLAMP_TO_BORDER

With 1D textures, GL_TEXTURE_WRAP_T should be ignored (only
GL_TEXTURE_WRAP_S should be respected).  But the i965 hardware
seems to follow the value of GL_TEXTURE_WRAP_T even when sampling
1D textures.

This fix forces GL_TEXTURE_WRAP_T to be GL_REPEAT whenever 1D
textures are used; this allows the texture to be sampled
correctly, avoiding "imaginary" border elements in the T direction.

This bug was demonstrated in the Piglit tex1d-2dborder test.
With this fix, that test passes.
(cherry picked from commit ab6c4fa582972e25f8800c77b5dd5b3a83afc996)

15 years agoi965: send all warnings through _mesa_warning()
Robert Ellison [Thu, 14 May 2009 02:38:33 +0000 (20:38 -0600)]
i965: send all warnings through _mesa_warning()

One warning message:
   drm_i915_getparam: -22

was still being sent to fprintf().  This causes all Piglit tests to fail,
even with MESA_DEBUG=0.

Using _mesa_warning() to emit the message allows the general Mesa controls
for messages like this to be applied.
(cherry picked from commit bc3270e99f5c39544aaf831742db14796ab83a6a)

15 years agoi965: fix segfault on low memory conditions
Robert Ellison [Fri, 8 May 2009 20:40:38 +0000 (14:40 -0600)]
i965: fix segfault on low memory conditions

When out of memory (in at least one case, triggered by a longrunning
memory leak), this code will segfault and crash.  By checking for the
out-of-memory condition, the system can continue, and will report
the out-of-memory error later, a much preferable outcome.
(cherry picked from commit 44a4abfd4f8695809eaec07df8eeb191d6e017d7)

15 years agoFast path when rebinding the same texture in single context environment
Ian Romanick [Wed, 3 Jun 2009 16:49:05 +0000 (17:49 +0100)]
Fast path when rebinding the same texture in single context environment

If there is no shared context, there is no purpose in rebinding the same
texture.  In some artificial tests this improves performance 10% - 30%.
(cherry picked from commit 7f8000db8bd45bb95bda4a4f8535c49b8ef74254)

15 years agoi915: Don't put VBOs in graphics memory unless required for an operation.
Eric Anholt [Tue, 2 Jun 2009 13:53:40 +0000 (06:53 -0700)]
i915: Don't put VBOs in graphics memory unless required for an operation.

This saves doing swtnl from uncached memory, which is painful.  Improves
clutter test-text performance by 10% since it started using VBOs.
(cherry picked from commit a945e203d4fe254593bc0c5c5d6caca45e65f9f7)

15 years agoi915: Fall back on NPOT textured metaops on 830-class.
Eric Anholt [Wed, 27 May 2009 03:45:29 +0000 (20:45 -0700)]
i915: Fall back on NPOT textured metaops on 830-class.
(cherry picked from commit 8ec6e036792decf5149a209e51cb5e93ccc5c754)

15 years agoi915: Restore the Viewport and DepthRange functions on 8xx.
Eric Anholt [Wed, 27 May 2009 02:48:08 +0000 (19:48 -0700)]
i915: Restore the Viewport and DepthRange functions on 8xx.

Fixes failed viewport updates on glxgears (and other apps) resize since
e41780fedc2c1f22b43118da30a0103fa68b769f.

Bug #20473.
(cherry picked from commit 0e83e8f51af07a3066519f169f07d9afbf23252e)

15 years agoi956: Make state dependency of SF on drawbuffer bounds match Mesa's.
Eric Anholt [Wed, 20 May 2009 22:59:07 +0000 (15:59 -0700)]
i956: Make state dependency of SF on drawbuffer bounds match Mesa's.

Noticed while debugging a weird 1D FBO testcase that left its existing
viewport and projection matrix in place when switching drawbuffers.  Didn't
fix the testcase, though.
(cherry picked from commit 3a521d84ecc646fcc65fa3fe7c5f1fdbdebe8bc2)

15 years agointel: Don't complain on falling back from PBO fastpaths.
Eric Anholt [Sat, 16 May 2009 00:32:21 +0000 (17:32 -0700)]
intel: Don't complain on falling back from PBO fastpaths.

Instead, stash the debug info under the handy debug flag.

Bug #20053
(cherry picked from commit 22690482e692cb5ed2f84d3e69545c09292e3484)

15 years agomesa: Mark FBOs with compressed color attachments as FBO-incomplete.
Eric Anholt [Fri, 15 May 2009 23:24:59 +0000 (16:24 -0700)]
mesa: Mark FBOs with compressed color attachments as FBO-incomplete.

Both EXT_fbo and ARB_fbo agree on this.  Fixes a segfault in the metaops
mipmap generation in Intel for SGIS_generate_mipmap of S3TC textures in
Regnum Online.

Bug #21654.
(cherry picked from commit 0307e609aa3e707eeb40051bd664d36f2340ba9b)

15 years agoi915: Use Stencil.Enabled instead of Stencil._Enabled in DrawBuffers.
Eric Anholt [Fri, 15 May 2009 19:32:51 +0000 (12:32 -0700)]
i915: Use Stencil.Enabled instead of Stencil._Enabled in DrawBuffers.

The _Enabled field isn't updated at the point that DrawBuffers is called,
and the Driver.Enable() function does the testing for stencil buffer
presence anyway.

bug #21608 for Radeon
(cherry picked from commit 4c6f82989983eecc0b3b724716cb3bcb675664c5)

15 years agoi915: Only use the new 945 cube layout for compressed textures.
Eric Anholt [Fri, 15 May 2009 18:41:42 +0000 (11:41 -0700)]
i915: Only use the new 945 cube layout for compressed textures.

The docs actually explain this, but not in a terribly clear manner.
This nearly fixes the piglit cubemap testcase, except that something's
going wrong with the nearest filtering at 2x2 sizes in the testcase.
Looks good by visual inspection, though.

Bug #21692
(cherry picked from commit 5c5a46884899ea25cdf25545d6ab3d9a74eafa3a)

15 years agoi965: Fix varying payload reg assignment for the non-GLSL-instructions path.
Eric Anholt [Thu, 14 May 2009 17:56:32 +0000 (10:56 -0700)]
i965: Fix varying payload reg assignment for the non-GLSL-instructions path.

I don't have a testcase for this, but it seems clearly wrong.
(cherry picked from commit dc657f3929fbe03275b3fae4ef84f02e74b51114)

15 years agoi965: Fix register allocation of GLSL fp inputs.
Eric Anholt [Thu, 14 May 2009 16:49:45 +0000 (09:49 -0700)]
i965: Fix register allocation of GLSL fp inputs.

Before, if the VP output something that is in the attributes coming into
the WM but which isn't used by the WM, then WM would end up reading subsequent
varyings from the wrong places.  This was visible with a GLSL demo
using gl_PointSize in the VS and a varying in the WM, as point size is in
the VUE but not used by the WM.  There is now a regression test in piglit,
glsl-unused-varying.

(cherry picked from commit 0f5113deed91611ecdda6596542530b1849bb161)

15 years agointel: Use FRONT_AND_BACK for StencilOp as well.
Eric Anholt [Thu, 14 May 2009 02:08:17 +0000 (19:08 -0700)]
intel: Use FRONT_AND_BACK for StencilOp as well.
(cherry picked from commit 64980125c76b05501a6fe7fe20fe52438f459129)

15 years agointel: Use GL_FRONT_AND_BACK for stencil clearing.
Eric Anholt [Thu, 14 May 2009 01:18:29 +0000 (18:18 -0700)]
intel: Use GL_FRONT_AND_BACK for stencil clearing.

This comes from a radeon-rewrite fallback fix, but may also fix stencil
clear failure when the polygon winding mode is flipped.
(cherry picked from commit d866abeffc7e4a29736fa35fb8ac09c3a28a44d6)

15 years agointel: Skip the DRI2 renderbuffer update when doing Viewport on an FBO.
Eric Anholt [Sun, 10 May 2009 17:08:32 +0000 (10:08 -0700)]
intel: Skip the DRI2 renderbuffer update when doing Viewport on an FBO.
(cherry picked from commit d4a42b0ce6455d03be70aa56aacd779be193aca4)

15 years agointel: Map write-only buffer objects through the GTT when possible.
Eric Anholt [Sun, 10 May 2009 16:45:43 +0000 (09:45 -0700)]
intel: Map write-only buffer objects through the GTT when possible.

This looks to be a win of a few percent in cairogears with new vbo code,
thanks to not polluting caches.
(cherry picked from commit aa422b262509bc0763a50f63a51a1730139ea52f)

15 years agomesa: rework viewport/scissor initialization code
Brian Paul [Wed, 17 Jun 2009 14:35:55 +0000 (08:35 -0600)]
mesa: rework viewport/scissor initialization code

The first time a context is bound to a drawable, the viewport and scissor
bounds are initialized to the buffer's size.  This is actually a bit tricky.

A new _mesa_check_init_viewport() function is called in several places
to check if the viewport has been initialized.  We also use a new
ctx->ViewportInitialized flag instead of the overloaded
ctx->FirstTimeCurrent flag.

15 years agomesa: added null ptr check in Fake_glXCreatePixmap()
Brian Paul [Wed, 17 Jun 2009 14:34:24 +0000 (08:34 -0600)]
mesa: added null ptr check in Fake_glXCreatePixmap()

Fixes segfault in progs/xdemos/glxgears_pixmap.c

15 years agost/glx: added null ptr check in Fake_glXCreatePixmap()
Brian Paul [Wed, 17 Jun 2009 14:33:39 +0000 (08:33 -0600)]
st/glx: added null ptr check in Fake_glXCreatePixmap()

Fixes segfault in progs/xdemos/glxgears_pixmap.c

15 years agoRevert "scons: Debug build by default."
José Fonseca [Wed, 17 Jun 2009 14:24:06 +0000 (15:24 +0100)]
Revert "scons: Debug build by default."

Per Brian's request.

This reverts commit 25f0c33bb3509958a532bdd72b3945c1d5d1cad5.

15 years agoprogs/wgl: Fix shreadtex_mt too.
José Fonseca [Wed, 17 Jun 2009 14:22:47 +0000 (15:22 +0100)]
progs/wgl: Fix shreadtex_mt too.

15 years agoprogs/wgl: Tweak the initialization wait in wglthreads.
José Fonseca [Wed, 17 Jun 2009 14:22:32 +0000 (15:22 +0100)]
progs/wgl: Tweak the initialization wait in wglthreads.

There was still a non-zero probability for wglShareLists of failing.

15 years agoprogs/wgl: Get wglShareLists working in wglthreads.
José Fonseca [Wed, 17 Jun 2009 13:48:25 +0000 (14:48 +0100)]
progs/wgl: Get wglShareLists working in wglthreads.

wglShareLists is a little picky -- it seems to check if it has exclusive
access to a lock, and fails if it doesn't.

This allows the texture to be shared with all windows.

15 years agoscons: Debug build by default.
José Fonseca [Wed, 17 Jun 2009 09:14:32 +0000 (10:14 +0100)]
scons: Debug build by default.

Match what autotools and other build systems do by default.

15 years agoGLX: attempt to fix glean makeCurrent test cases.
Brian Paul [Wed, 17 Jun 2009 13:58:35 +0000 (07:58 -0600)]
GLX: attempt to fix glean makeCurrent test cases.

Two parts to this:

One we don't keep pointers to possibly freed memory anymore once we unbind the
drawables from the context. Brian I need to figure out what the comment
you made there, can we get a glean/piglit test so we can fix it properly?

If the new gc is the same as the oldGC, we call the unbind even though
we just bound it in that function. doh.

(cherry picked from master, commit 77506dac8e81e9548a7e9680ce367175fe5747af)

15 years agodocs: Document building with SCons.
José Fonseca [Wed, 17 Jun 2009 09:12:11 +0000 (10:12 +0100)]
docs: Document building with SCons.

15 years agowgl: Factor out some repetitive code into inline functions.
José Fonseca [Tue, 16 Jun 2009 20:30:59 +0000 (21:30 +0100)]
wgl: Factor out some repetitive code into inline functions.

15 years agoprogs/wgl: Allow resizing wglthreads' windows.
José Fonseca [Tue, 16 Jun 2009 18:49:38 +0000 (19:49 +0100)]
progs/wgl: Allow resizing wglthreads' windows.

15 years agoi965: fix bugs in projective texture coordinates
Brian Paul [Wed, 17 Jun 2009 00:19:45 +0000 (18:19 -0600)]
i965: fix bugs in projective texture coordinates

For the TXP instruction we check if the texcoord is really a 4-component
atttibute which requires the divide by W step.  This check involved the
projtex_mask field.  However, the projtex_mask field was being miscalculated
because of some confusion between vertex program outputs and fragment
program inputs.

1. Rework the size_masks calculation so we correctly set bits corresponding
to fragment program input attributes.

2. Rename projtex_mask to proj_attrib_mask since we're interested in more
than just texcoords (generic varying vars too).

3. Simply the indexing of the size_masks and proj_attrib_mask fields.

4. The tracker::active[] array was mis-dimensioned.  Use MAX_PROGRAM_TEMPS
instead of a magic number.

5. Update comments, add new assertions.

With these changes the Lightsmark demo/benchmark renders correctly, until
we eventually hit a GPU lockup...

15 years agosoftpipe: fix out of bounds quad rasterization bug
Brian Paul [Tue, 16 Jun 2009 21:41:49 +0000 (15:41 -0600)]
softpipe: fix out of bounds quad rasterization bug

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.

15 years agomesa: fix incorrect viewport clamping in _mesa_set_viewport()
Brian Paul [Tue, 16 Jun 2009 15:34:35 +0000 (09:34 -0600)]
mesa: fix incorrect viewport clamping in _mesa_set_viewport()

A 0 by 0 viewport size is legal.  Don't clamp against lower bound of one.
The error checking earlier in the function prevents negative values.

15 years agomesa: fix REMAINDER() macro
Brian Paul [Tue, 16 Jun 2009 14:45:06 +0000 (08:45 -0600)]
mesa: fix REMAINDER() macro

The results were incorrect for some negative values of A.
See bug 21872.

15 years agogallium: Avoid atomic ops / locking when src is dst.
José Fonseca [Tue, 16 Jun 2009 12:05:25 +0000 (13:05 +0100)]
gallium: Avoid atomic ops / locking when src is dst.

15 years agoprogs/wgl: Quit after displaying usage for -h option.
José Fonseca [Tue, 16 Jun 2009 11:34:29 +0000 (12:34 +0100)]
progs/wgl: Quit after displaying usage for -h option.