Commit Graph

24360 Commits

Author SHA1 Message Date
Chia-I Wu 18457cb263 egl: Add funtions to link contexts and surfaces to displays.
EGL contexts and surfaces are resources of displays.  They should be
managed by displays.  This commit adds a bunch of functions to
egldisplay.c to help establish the links between contexts/surfaces and
displays.  How links are established is considered opaque outside
display.  Functions like _eglGetSurfaceHandle or _eglLookupSurface are
therefore moved to egldisplay.c, with some small modifications.

The idea is also extended to display.  That is, displays need to link to
themselves to be looked up.

This commit only adds the functions.  A commit to use them should
follow.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-17 11:48:27 -06:00
Chia-I Wu 21b635ffa8 egl: Extend per-thread info for multiple current contexts.
EGL allows multiple current contexts, as long as they are bound to
different client APIs.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-17 11:42:04 -06:00
Chia-I Wu 75da80b295 egl: Support per-thread info.
This commit introduces a "current" system to manage per-thread info.  It
uses TLS, if GLX_USE_TLS is defined, or pthread, if PTHREADS is defined.
If none of them are defined, it uses a dummy implementation that is just
like before.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-17 11:41:02 -06:00
Chia-I Wu 8e92ec9fdd egl: Add eglcompiler.h for compiler features.
Only INLINE (from mesa/main/compiler.h) is defined now.  It may be used
to deal with symbol visibility and int/pointer conversion in the future.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2009-07-17 11:36:45 -06:00
Eric Anholt 9cea84b6b5 texenv: Calculate whether we need to do secondary color on our own.
The _TriangleCaps bit is deprecated, not updated when we require, and
is set based on state that hasn't been updated at that point in
_mesa_update_state_locked().

Fixes incorrect clear color in glsl/twoside.c with meta_clear_tris.
2009-07-16 19:02:04 -07:00
Eric Anholt 99174e7630 i965: Add missing state dependency of sf_unit on _NEW_BUFFERS. 2009-07-16 19:00:34 -07:00
Keith Whitwell 04dd8b71b4 draw: fix ppc build regression
Found by x.org tinderbox, reported by Chris Ball.
2009-07-16 19:01:29 +01:00
Brian Paul 3e8832d24b st/mesa: add some array index bounds assertions 2009-07-16 08:44:51 -06:00
Chia-I Wu 721f80b82a egl: Add xeglthreads
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-07-16 08:29:57 -06:00
Keith Whitwell caf5d52d48 tgsi: simplify and fix sse KIL implementation
Use sse_movmskps to extract the correct bits of the comparison result
for use in updating the killmask.  Simplify some logic around
identifying the set of necessary comparisons to make.
2009-07-16 12:49:27 +01:00
Keith Whitwell e1ad38ad8e rtasm: export sse_movmskps 2009-07-16 12:47:11 +01:00
Keith Whitwell 3858f47994 tgsi: initial texturing support on sse path
Most obvious problem is drawpixels comes out blocky, but this may be
an existing issue of KIL on the sse path.
2009-07-16 11:37:52 +01:00
Keith Whitwell a01383ff6a tgsi: make sse function callout mechanism more generic
Take a list of arguments rather than hardcoding TEMP_R0.
2009-07-16 10:11:46 +01:00
Keith Whitwell ebc4a9bf2e tgsi: reduce x86 reg usage in tgsi_sse generated programs
Pass the tgsi_exec_machine struct in directly and just hold a single
pointer to this struct, rather than keeping one for each of its
internal members.
2009-07-16 09:53:08 +01:00
Keith Whitwell 4e3002b50f tgsi: no need to separately malloc input and output arrays
Can now guarantee alignment in the initial allocation of the tgsi exec machine.
2009-07-16 09:53:08 +01:00
Keith Whitwell c202fe187c gallium: reduce recursive include of tgsi_exec.h
A lot of draw code no longer needs to see this header.
2009-07-16 09:53:07 +01:00
Keith Whitwell 7fb702705a tgsi: make function call code in tgsi_sse.c less opaque
Explictly pass src and dst arguments (previously dst argument was also
being used as a src).  Separate argument handling from the rest of
the function call emit.
2009-07-16 09:53:07 +01:00
Keith Whitwell 6175653d0b gallium: proper constructor and destructor for tgsi_exec_machine
Centralize the creation, initialization and destruction of this struct.
Use align_malloc instead of home-brew alternatives.
2009-07-16 09:53:07 +01:00
Dave Airlie 3a3b83e511 radeon: update span reading micro tile code
tested on r500 with zreaddraw with Z buffer in all 3 modes
2009-07-15 14:23:14 +10:00
Dave Airlie bd4ed25222 r300: emit z depth pitch reloc in preparation for tiling 2009-07-15 14:23:14 +10:00
Dave Airlie 94d2a809f9 radeon: r300 fix span reading for macro tiled buffers.
this uses the correct formula for macro tiled buffers for readback
2009-07-15 14:23:13 +10:00
Dave Airlie 9b17f041d1 radeon: for tiling you really need to use GET/PUT VALUE not PTR.
since the surfaces aren't linear you can't just use GET_PTR
2009-07-15 14:23:13 +10:00
Xiang, Haihao 868aa16074 i965: the offset of any branch/jump instruction is in unit of 64bits on IGDNG 2009-07-15 10:48:13 +08:00
Dave Airlie f6f0e117a4 intel/radeon: add common metaops code.
Move all the metaops to a dri_metaops file and port radeon/intel
to use the new common meta ops code.
2009-07-15 10:30:23 +10:00
Dave Airlie 681ede8836 radeon: fix unsigned vs signed comparison in stencil code.
This function takes a GLint not a GLuint, passing in -1
breaks internally.
2009-07-15 08:19:34 +10:00
Eric Anholt 99d07d0f91 intel: Fix ClearDepth to not be affected by DepthRange.
Fixes new piglit depthrange-clear.c test.
2009-07-14 15:14:52 -07:00
Eric Anholt b677c40abb intel: Set DepthRange in the metaops using RasterPos[2].
RasterPos[2] is already sent through the window transform, which includes
DepthRange handling.  So make DepthRange for the metaops a noop.

Fixes a failure in oglconform depthrange.c
2009-07-14 15:14:52 -07:00
Eric Anholt e5f63c403b Fix state flag dependencies for fixed function fragment program updates.
I started looking into why _NEW_ARRAY punishes us, and while annotating
dependencies noticed that a bunch of dependencies were missing.
2009-07-14 15:14:52 -07:00
Eric Anholt 374110bc98 intel: Flag _NEW_ARRAY state when doing array object binding in clears.
This is just following bind_vertex_array()'s behavior.
2009-07-14 15:14:51 -07:00
Brian Paul e786ecbfb5 mesa: regenerated enums.c file 2009-07-14 07:47:19 -06:00
Corbin Simpson b727150b14 dri-st: Unbreak GL_EXT_blend_equation_separate.
Since it has a dispatch table entry (for BlendEquationSeparateEXT,)
can't omit it from this list. It'll still get disabled if the cap
(PIPE_CAP_BLEND_EQUATION_SEPARATE) isn't set.

Somebody that doesn't suck at GL (read: not me) should probably add
this into progs/samples/blendeq or similar so we can test it.
2009-07-14 01:16:25 -07:00
Patrice Mandin 54cf63278f gallium: Define PIPE_CAP_BLEND_EQUATION_SEPARATE, remove extension from default extension list 2009-07-14 09:44:49 +02:00
Michel Dänzer 33f56b4612 radeon: Differentiate 16 bpp destination formats.
Fixes those formats in fbo_firecube.

Only tested with r300, radeon and r200 compile tested only.
2009-07-14 08:25:27 +02:00
Michel Dänzer 60e60bb302 radeon: Invert front face winding when rendering to FBO.
Fixes fgl_glxgears and progs/demos/fbotexture after pressing 'c'.

Tested with r300, radeon and r200 compile tested only.
2009-07-14 08:00:49 +02:00
Nicolai Hähnle 59155f70e7 r300g: Small compile warning fixes.
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-07-13 16:26:29 -07:00
Nicolai Hähnle b3f1d370a2 r300g, radeon: Whitespace fixes.
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-07-13 16:26:29 -07:00
Corbin Simpson ca28e591f2 r300g: Use align() instead of inline maths. 2009-07-13 16:26:29 -07:00
Maciej Cencora 9226e3d6a6 Merge branch 'shaders_cleanup' 2009-07-13 20:29:11 +02:00
Eric Anholt 0dc700850a intel: Partially fix fallback detection for glCopyTexSubImage.
Really, we should be checking that the MesaTexFormat for the read buffer
and the texture match, but the previous code wasn't even doing that, so
matching the cpp should be an improvement (and potentially fix some hangs!).
The previous code also rejected GL_RGB even though blitting the alpha
channel to the ignored channel of an x8r8g8b8 texture should be fine, which
tripped up compiz's blur plugin.
2009-07-13 10:57:12 -07:00
Maciej Cencora 582bd34665 r300: always assume all components are read by fragment program
Components of input attributes that are used by fragment program aren't part of vertex program key, and that may lead to situations when vertex program writes only TEX1.xy and fragment program reads TEX1.xyz, resulting in rendering errors.

Reported-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-07-13 19:28:15 +02:00
Nicolai Hähnle f06910f6c3 r300: Fix fogcoord rewriting
We only care about the actual fogcoord itself now, reducing the rewriting
done for the vertex program.

The rewriting of source operand swizzles in the fragment program takes
care that fogcoord.yzw = 001.

This should fix fogcoord rewriting entirely, which had been horribly
broken in the face of dot-product instructions, and just broken (though
not horribly so) in the face of almost every other instruction (the W
component would be incorrect for most arithmetic instructions).

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-07-13 19:28:15 +02:00
Maciej Cencora 3f5382819e r300: fix swizzle masking in getUsedComponents 2009-07-13 19:28:15 +02:00
Maciej Cencora acd3360041 r300: minor fix
Split initializations becase the vars are of different type.

Reported-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-07-13 19:28:15 +02:00
Maciej Cencora 1a5520fcd3 r300: move variables declarations 2009-07-13 19:28:14 +02:00
Maciej Cencora b3716eeb61 r300: document r300_vertex_program_cont structure
Reported-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-07-13 19:28:14 +02:00
Maciej Cencora a0204ce456 r300: document r300_fragment_program_cont struct 2009-07-13 19:28:14 +02:00
Maciej Cencora ec854729d1 r300: fix indentation
Reported-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-07-13 19:28:13 +02:00
Maciej Cencora 48cc352a71 r300: fix StrideB == 0 case when converting data format
Reported-by: Nicolai Hähnle <nhaehnle@gmail.com>
2009-07-13 19:28:13 +02:00
Maciej Cencora 4eff323731 r300: hw can handle per component negations in vertex shaders
Reported-by: Nicolai Haehnle <nhaehnle@gmail.com>
2009-07-13 19:28:13 +02:00
Maciej Cencora 4efb9f053c r300: fix WPOS for SWTCL 2009-07-13 19:28:13 +02:00