Commit Graph

23017 Commits

Author SHA1 Message Date
Brian Paul
c20bb48d3a glsl: added slang_assemble_ctx::EmitContReturn field, init 2009-06-26 13:16:32 -06:00
Brian Paul
eb1eee03a6 demos: improve argv parsing in fslight.c 2009-06-26 13:16:32 -06:00
Brian Paul
4bc74a0756 glsl: don't unroll loops containing continue/break
Just search the AST in _slang_can_unroll_for_loop().
2009-06-26 13:16:32 -06:00
Brian Paul
625b0fe268 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 989856bde4.

Conflicts:

	src/mesa/shader/slang/slang_codegen.h
2009-06-26 13:16:32 -06:00
Brian Paul
4031ea1520 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...
2009-06-26 13:16:32 -06:00
Brian Paul
84c5e4805b docs: updated Mesa release instructions 2009-06-26 13:16:32 -06:00
José Fonseca
72aed16aee 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.
2009-06-26 19:57:47 +01:00
José Fonseca
25f6c936fe scons: Don't use C specific options with g++ 2009-06-26 19:57:46 +01:00
Keith Whitwell
3e94521912 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.
2009-06-26 13:45:34 +01:00
Keith Whitwell
c9f8c400ab aux/indices: don't use 'prim' value once it is known to be bad
Theoretical bugfix only - no known case where this might happen.
2009-06-26 13:44:20 +01:00
José Fonseca
c25534f30d wgl: Handle flush after a window is destroyed.
Fixes assertion failure with conform.
2009-06-24 15:23:44 +01:00
Brian Paul
b79e6a59d8 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.
2009-06-23 09:31:27 -06:00
Roland Scheidegger
2f184d0d9f 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 4ef1f8e3b5)
2009-06-22 15:15:20 -07:00
Owen W. Taylor
9d367d43b2 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 279143c6e8)
2009-06-22 15:15:20 -07:00
Michel Dänzer
0584b6e433 intel: intel_texture_drawpixels() can't handle GL_DEPTH_STENCIL.
Fixes glean depthStencil test.
(cherry picked from commit 3885b708fd)
2009-06-22 15:15:20 -07:00
Brian Paul
19218fe712 i965: added intelFlush() call in intel_get_tex_image()
Fixes the render-to-texture test in progs/tests/getteximage.c
(cherry picked from commit a03b349153)
2009-06-22 15:15:20 -07:00
Brian Paul
a5b7e0c7d7 mesa: s/MAX_VERTEX_PROGRAM_ATTRIBS/MAX_NV_VERTEX_PROGRAM_INPUTS/ in NV funcs
(cherry picked from commit 4dc426c016)
2009-06-22 15:15:20 -07:00
Brian Paul
54f425b5ce 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 4a95185c9f)
2009-06-22 15:15:19 -07:00
Brian Paul
810df8317d mesa: s/MAX_VERTEX_PROGRAM_ATTRIBS/MAX_NV_VERTEX_PROGRAM_INPUTS
(cherry picked from commit d2a74d76c9)
2009-06-22 15:15:19 -07:00
Brian Paul
19ca5ee1db 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 aac19609bf)
2009-06-22 15:15:19 -07:00
Brian Paul
ad0514b24d 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 dda82137d2)
2009-06-22 15:15:19 -07:00
Brian Paul
00e203fe17 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 3f25219c7b)
2009-06-22 15:15:19 -07:00
Eric Anholt
abfd56c24c intel: Fix other metaops versus GL_COMPILE_AND_EXECUTE dlists.
Fixes oglconform zbfunc.c and pxtrans-cidraw.c, at least.

(cherry picked from commit 405300bb19)
2009-06-19 16:57:06 -07:00
Eric Anholt
daacac1c24 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 64edde1004)
2009-06-19 16:54:59 -07:00
Roland Scheidegger
43bb78f2bb 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.
2009-06-19 20:00:55 +02:00
Michel Dänzer
9dfce365c7 Also release direct rendering resources in glXDestroyGLXPixmap.
Fixes leak running compiz with direct rendering.
2009-06-19 18:00:49 +02:00
Michel Dänzer
a120778c72 Always free image offsets memory when re-initializing texture image fields.
Fixes leak running compiz with direct rendering.
2009-06-19 18:00:33 +02:00
José Fonseca
3cf92e936a scons: Output the friendly "Linking ..." message when creating DLLs with MinGW. 2009-06-19 16:08:38 +01:00
Brian Paul
0487656245 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).
2009-06-19 08:53:15 -06:00
José Fonseca
8f382fd3f3 util: Add cast.
It is expected to loose precision here.
2009-06-18 14:54:09 +01:00
José Fonseca
21bfd0f4bd 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.
2009-06-18 14:54:09 +01:00
José Fonseca
d609df1dae trace: Use size_t consistently. 2009-06-18 14:54:09 +01:00
José Fonseca
2af0173e9e 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.
2009-06-18 14:54:08 +01:00
José Fonseca
42882897c6 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.
2009-06-18 14:54:07 +01:00
José Fonseca
4b4855c717 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).
2009-06-18 14:54:07 +01:00
Keith Whitwell
1b05b5b4fe 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.
2009-06-18 10:13:55 +01:00
Keith Whitwell
0491142152 mesa: protect Elements against multiple definitions
Mesa and gallium both have a definition of this macro
2009-06-18 09:53:45 +01:00
Brian Paul
39366ed995 intel: remove extra \n from warning string
(cherry picked from commit 42e9bde0fa)
2009-06-17 12:55:26 -07:00
Robert Ellison
d446d3acac 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 ab6c4fa582)
2009-06-17 12:55:26 -07:00
Robert Ellison
56235ae504 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 bc3270e99f)
2009-06-17 12:55:26 -07:00
Robert Ellison
e15aebe10e 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 44a4abfd4f)
2009-06-17 12:55:26 -07:00
Ian Romanick
a70c45bdab 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 7f8000db8b)
2009-06-17 12:55:26 -07:00
Eric Anholt
ff3da0966f 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 a945e203d4)
2009-06-17 11:08:36 -07:00
Eric Anholt
1b8e4dd2c8 i915: Fall back on NPOT textured metaops on 830-class.
(cherry picked from commit 8ec6e03679)
2009-06-17 11:08:28 -07:00
Eric Anholt
cee73ffdaf 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 0e83e8f51a)
2009-06-17 11:08:13 -07:00
Eric Anholt
7805c3b57b 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 3a521d84ec)
2009-06-17 11:07:03 -07:00
Eric Anholt
97974b7e51 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 22690482e6)
2009-06-17 11:06:52 -07:00
Eric Anholt
957f3c8c3d 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 0307e609aa)
2009-06-17 11:06:46 -07:00
Eric Anholt
66bfd025c8 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 4c6f829899)
2009-06-17 11:06:38 -07:00
Eric Anholt
fbd554d074 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 5c5a468848)
2009-06-17 11:06:25 -07:00