Commit graph

21631 commits

Author SHA1 Message Date
Corbin Simpson
731aa326ff r300-gallium: Use rs_state emit for r300_surface, move a few things around.
Also a possible fix for non-TCL chipsets and trivial/clear.
2009-02-28 11:22:40 -08:00
Corbin Simpson
2b7d39da1f r300-gallium: Move maths from r300_state to r300_state_inlines. 2009-02-28 11:22:40 -08:00
Brian Paul
23682dc629 mesa: just re-order some parts and update comments in sources.mak 2009-02-28 11:56:15 -07:00
Brian Paul
8d475822e6 mesa: rename, reorder FRAG_RESULT_x tokens
s/FRAG_RESULT_DEPR/FRAG_RESULT_DEPTH/
s/FRAG_RESULT_COLR/FRAG_RESULT/COLOR/
Remove FRAG_RESULT_COLH (NV half-precision) output since we never used it.
Next, we might merge the COLOR and DATA outputs (COLOR0, COLOR1, etc).
2009-02-28 11:49:46 -07:00
Brian Paul
7787fa10ba mesa: add gallium state tracker sources to ALL_SOURCES
This should fix some missing dependency checking.
2009-02-28 11:17:27 -07:00
Brian Paul
4c4268dd31 mesa: convert some #defines to enums
This makes debugging with gdb a bit easier.
Ex:
(gdb) p ctx->DrawBuffer.Attachment[BUFFER_STENCIL]

Note however that gdb only seems to recognize enum types that are actually
used to declare a variable somewhere.  For example, gl_buffer_index isn't
used to declare any vars so it's invisible to gdb.  Work around this by
adding a dummy function in context.c that declares some vars with these
new types.
2009-02-28 11:17:26 -07:00
Brian Paul
fe35378769 demos: add progs/glsl/shadow_sampler.c to test GLSL shadow2D(), etc.
Heh, I wrote this program a long time ago but just discovered today that
it wasn't in git.
2009-02-28 11:09:13 -07:00
Brian Paul
c50c2e4e98 mesa: move _GenFlags = 0x0 to texgen loop 2009-02-28 11:09:13 -07:00
Brian Paul
c88c8d7993 mesa: use fp pointer in _tnl_InvalidateState() 2009-02-28 11:09:13 -07:00
Joakim Sindholt
b2b2febe2c mesa: fix remaining FEEDBACK_TOKEN macros
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2009-02-28 10:07:15 -08:00
Corbin Simpson
5f1fdaabd1 r300-gallium: Cleanup color formats. 2009-02-28 09:56:35 -08:00
Corbin Simpson
d1559eac6d r300-gallium: Be more Gallium-ish in some of the math. 2009-02-28 09:56:35 -08:00
Corbin Simpson
3673fc35d6 r300-gallium: Move all state translators to r300_state_inlines.
Tryin' to do some cleanup.
2009-02-28 09:56:34 -08:00
Brian Paul
b7ebc270a4 mesa: move #include "bitset.h" out of mtypes.h - not needed in core Mesa 2009-02-28 10:08:22 -07:00
Brian Paul
079554a480 mesa: add a prototype to silence warnings 2009-02-28 10:06:55 -07:00
David Miller
ae5c06b9ce mesa: Sparc's IROUND() optimization is invalid.
We can't use the "fstoi" instruction like this.

Unlike other floating point instructions, "fstoi" always rounds
towards zero no matter what rounding mode the FPU has been set to.

This was validated using the following test program:

--------------------
static inline int iround(float f)
{
   int r;
   __asm__ ("fstoi %1, %0" : "=f" (r) : "f" (f));
   return r;
}
#define IROUND(x)  iround(x)

#define IROUND_REF(f)  ((int) (((f) >= 0.0F) ? ((f) + 0.5F) : ((f) - 0.5F)))

int main(void)
{
	float f = -2.0;

	while (f < 3.0f) {
		int sparc_val = IROUND(f);
		int ref_val = IROUND_REF(f);

		if (sparc_val != ref_val)
			printf("DIFFERENT[%f]: REF==%d SPARC==%d\n",
			       f, ref_val, sparc_val);
		f += 0.1f;
	}

	return 0;
}
--------------------

which prints out things like:

--------------------
DIFFERENT[-1.900000]: REF==-2 SPARC==-1
DIFFERENT[-1.800000]: REF==-2 SPARC==-1
DIFFERENT[-1.700000]: REF==-2 SPARC==-1
DIFFERENT[-1.600000]: REF==-2 SPARC==-1
DIFFERENT[-1.000000]: REF==-1 SPARC==0
DIFFERENT[-0.900000]: REF==-1 SPARC==0
DIFFERENT[-0.800000]: REF==-1 SPARC==0
DIFFERENT[-0.700000]: REF==-1 SPARC==0
DIFFERENT[-0.600000]: REF==-1 SPARC==0
DIFFERENT[0.500000]: REF==1 SPARC==0
DIFFERENT[0.600000]: REF==1 SPARC==0
...
--------------------

So we have to remove Sparc's IROUND() definition, it's wrong.

Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-28 09:36:56 -07:00
Brian Paul
389d50baff mesa: move GLfixed type and related macros to swrast module
Fixed point is only used in swrast and sw-based drivers.
2009-02-28 09:35:16 -07:00
Brian Paul
8bf25a17d2 mesa: convert macro to inline function 2009-02-28 09:35:16 -07:00
Brian Paul
bf8a187f71 mesa: replace FEEDBACK_TOKEN macro with _mesa_feedback_token() inline function 2009-02-28 09:35:15 -07:00
Brian Paul
559aec4701 mesa: comments, whitespace, reformatting 2009-02-28 09:35:15 -07:00
Brian Paul
f6021ab3c6 mesa: remove dead code 2009-02-28 09:35:15 -07:00
Brian Paul
7f25d9ebb4 mesa: move gl_attrib_node struct to attrib.c too 2009-02-28 09:35:15 -07:00
Brian Paul
55399c2951 mesa: move gl_enable_attrib struct to attrib.c, the only place it's used 2009-02-28 09:35:15 -07:00
Brian Paul
bedd20743b mesa: lots of updated comments, formatting clean-ups 2009-02-28 09:35:15 -07:00
Corbin Simpson
3e131d7d74 r300-gallium: A handful of fixups. 2009-02-28 08:14:35 -08:00
Corbin Simpson
2b5770e652 r300-gallium: Fix C99 error. 2009-02-28 08:14:35 -08:00
Corbin Simpson
b210c3fb3f r300-gallium: Fix RS.
I should just stop using "git stash" altogether.
2009-02-28 08:14:35 -08:00
Michal Krol
ba91e79dad tgsi: More descriptive sanity diagnostic messages. 2009-02-28 16:53:37 +01:00
Brian Paul
07f96a6d8e demos: fix renderbuffer leak in progs/tests/fbotexture.c
And re-org some code for testing purposes.
2009-02-27 15:57:46 -07:00
Brian Paul
c6bde8873f intel: remove some unneeded buffer unmap calls
Core mesa now unmaps the buffers if needed in these cases.
2009-02-27 15:57:46 -07:00
Brian Paul
a070937c00 mesa: update fragResults array in arb_output_attrib_string()
Plus add some comments.
2009-02-27 13:45:49 -07:00
Corbin Simpson
49de8ec2ea r300-gallium: Properly split up RS into r300 and r500 variants. 2009-02-27 12:25:09 -08:00
Corbin Simpson
991c945e72 radeon: Add DRM stubs.
Nothing really of note, unfortunately.
2009-02-27 12:25:09 -08:00
Corbin Simpson
7a10fcb7b6 Include p_compiler.h in drm_api.h for boolean typedef. 2009-02-27 12:25:09 -08:00
Corbin Simpson
fd5411fe36 r300-gallium: Turn true and false into TRUE and FALSE.
Match the rest of Gallium.
2009-02-27 12:25:09 -08:00
Brian Paul
67025f7893 mesa: set bufObj->Pointer = NULL after unmapping
Also, ctx->Driver.UnmapBuffer can never be null, so remove conditional.
2009-02-27 13:10:45 -07:00
Brian Paul
a7f434b486 mesa: if a buffer object is mapped when glDeleteBuffers() is called, unmap it 2009-02-27 13:04:38 -07:00
Brian Paul
395bcad8c0 mesa: updated comments 2009-02-27 12:56:07 -07:00
Brian Paul
75e3ccf6a5 mesa: fix incorrect error handling in glBufferDataARB()
If glBufferDataARB() is called while a buffer object is currently mapped
we're supposed to unmap the current buffer, then replace it.  Don't generate
an error.
2009-02-27 12:56:07 -07:00
Shaohua Li
40290745ea i915: Add support for a new G33-like chipset.
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2009-02-27 11:49:10 -08:00
Keith Whitwell
43714e92e3 tgsi: don't dump interpolation info except for fragment shader inputs
Don't print the meaningless and confusing CONSTANT interpolation
attribute after everything else.
2009-02-27 19:34:27 +00:00
Brian Paul
b6e2dd6e06 tests: new mapvbo.c test
Test that glDrawArrays() isn't effected by a glMapBuffer()/modify/glUnmapBuffer()
immediately afterward.
2009-02-27 11:46:38 -07:00
Corbin Simpson
c28298855b r300-gallium: Add RS block setup.
This is still icky, and only compile-tested.
2009-02-27 10:19:22 -08:00
Corbin Simpson
4ef8c047ea r300-gallium: Add RS600 chipsets. 2009-02-27 10:19:22 -08:00
Corbin Simpson
65021162a4 r300-gallium: A handful of tiny vfmt fixups.
Using a tab of inputs should work, but I keep getting bad results.
If only Rawhide's GDB wasn't broken...
2009-02-27 10:19:22 -08:00
Robert Ellison
17c7852bf9 i965: texture fixes: bordered textures, fallback rendering
i965 doesn't natively support GL_CLAMP; it treats it like
GL_CLAMP_TO_EDGE, which fails conformance tests.

This fix adds a clause to the check_fallbacks() test to check
whether GL_CLAMP is in use on any enabled 2D texture.  If so,
and if strict conformance is required (via INTEL_STRICT_CONFORMANCE),
a software fallback is mandated.

In addition, validate textures *before* checking for fallbacks,
rather than after; otherwise, the texture state is never validated
and can't be trusted.  (In particular, if texturing is enabled and
the sampler would access any level beyond level 0 of a texture, the
sampler will segfault, because texture validation sets the firstLevel
and lastLevel fields of a texture object so that the valid levels
will be mapped and accessed correctly.  If texture validation doesn't
occur, only level 0 is accessed correctly, and that only because
firstLevel and lastLevel happen to be set to 0.)
2009-02-27 10:11:37 -07:00
Brian Paul
026465b9b1 gallium: fix state tracker's stencil buffer test
Need to check ctx->DrawBuffer->Visual.stencilBits not ctx->Visual.stencilBits
because the later only applies to the window system buffers, not user-created
FBOs.

This, plus the previous commit, fixes progs/tests/fbotexture.c
2009-02-27 10:08:46 -07:00
Brian Paul
5fc74734d9 gallium: add st_validate_framebuffer() driver function
Gallium only supports combined depth/stencil buffers, not separate ones.
If the user tries to create create a FBO with separate depth/stencil
renderbuffers mark the FBO as unsupported.
2009-02-27 10:08:46 -07:00
Keith Whitwell
b747e1dec4 util: set vbuf.max_index in draw_vertex_buffer()
(cherry picked from commit 1350f2efba5eeceebe0e711db6152c29e9889ce7)
2009-02-27 15:30:34 +00:00
Keith Whitwell
a321b8ed6e softpipe: add dumping of post-tranfsormed vertices (disabled) 2009-02-27 15:23:21 +00:00