Commit graph

47796 commits

Author SHA1 Message Date
Marek Olšák
496a3dab5f r300g: always set VF_MIN_VTX_INDX to 0
It's not really useful to have non-zero there.
2011-11-20 16:24:11 +01:00
Kenneth Graunke
bdffb941d3 i965: Remove unused file brw_fallback.h. 2011-11-19 14:40:26 -08:00
Marek Olšák
b781fc88b0 gallium/docs: remove obsolete documentation 2011-11-19 20:58:37 +01:00
Marek Olšák
ec174a4244 mesa: set the gl_FragDepth layout in the GLSL linker
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-19 17:35:49 +01:00
Marek Olšák
90be99427a glsl: when cloning a variable, copy the depth layout too
This fixes AMD_conservative_depth.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 16:46:59 +01:00
Brian Paul
038a7dfcaa mesa: handle MapRenderbuffer() failures in glReadPixels
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 07:28:08 -07:00
Brian Paul
72fb25cefb mesa: make slow_read_rgba_pixels() a void function
The boolean return value was ignored by the caller.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 07:28:07 -07:00
Brian Paul
2efa3d4f9f mesa: define, use _mesa_is_cube_face() in several places
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 07:28:07 -07:00
Brian Paul
a43908fe62 st/mesa: rewrite the primitive restart fallback code
Previously we were mapping/unmapping the index buffer each time we
found the restart index in the buffer.  This is bad when the restart
index is frequently used.  Now just map the index buffer once, scan
it to produce a list of sub-primitives, unmap the buffer, then draw
the sub-primitives.

Also, clean up the logic of testing for indexed primitives and calling
handle_fallback_primitive_restart().  Don't call it for non-indexed
primitives.

v2: per Jose, only map the relevant part of the index buffer with
pipe_buffer_map_range()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-18 07:39:14 -07:00
Ian Romanick
08b288be8e docs: Add 7.11.1 release md5sums
(cherry picked from commit 228da884c9)
2011-11-17 12:15:10 -08:00
Ian Romanick
6306245fc6 docs: Add news items for 7.11 and 7.11.1 releases 2011-11-17 12:00:40 -08:00
Ian Romanick
92e512230b docs: Import 7.11 release notes from branch 2011-11-17 12:00:40 -08:00
Ian Romanick
b3aaafc74c docs: Import 7.11.1 release notes from branch 2011-11-17 12:00:40 -08:00
Eric Anholt
7e84a64dd0 i965/gen4: Fix sampling from integer textures.
On original gen4, the surface format didn't determine the return data
type from sampling like it does on g45 and later.

Fixes GL_EXT_texture_integer/texture_integer_glsl130

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-17 08:31:55 -08:00
Vadim Girlin
0cddea37b2 r600g: don't change the order of writes in merge_inst_group
Merge may produce incorrect order of operations for r600-eg:

	x: inst1 R0.x, ... ;  //from current group
	...
	t: inst0 R0.x, ... ;  //from previous group, same destination

Result of inst1 will be lost.

So compare destinations and don't allow this.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-17 09:10:37 -05:00
Michel Dänzer
4b1205d53b Revert "read_rgba_pixels: Don't force clamping if the renderbuffer is normalized."
This reverts commit b11c16752a.

Breaks at least luminance destination formats.
2011-11-17 15:04:40 +01:00
Michel Dänzer
b11c16752a read_rgba_pixels: Don't force clamping if the renderbuffer is normalized.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-17 10:46:44 +01:00
Ben Skeggs
4517153278 nvc0: add support for GF119 (NVD9)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-11-17 10:17:06 +10:00
Brian Paul
f4c03da327 mesa: initialize stencilMap, Stride if stencilRb==depthRb 2011-11-16 14:16:29 -07:00
Ian Romanick
010dc29283 mesa: Only update sampler uniforms that are used by the shader stage
Previously a vertex shader that used no samplers would get updated (by
calling the driver's ProgramStringNotify) when a sampler in the
fragment shader was updated.  This was discovered while investigating
some spurious code generation for shaders in Cogs.  The behavior in
Cogs is especially pessimal because it ping-pongs sampler uniform
settings:

    glUniform1i(sampler1, 0);
    glUniform1i(sampler2, 1);
    draw();
    glUniform1i(sampler1, 1);
    glUniform1i(sampler2, 0);
    draw();
    glUniform1i(sampler1, 0);
    glUniform1i(sampler2, 1);
    draw();
    // etc.

ProgramStringNotify is still too big of a hammer.  Applications like
Cogs will still defeat the shader cache.  A lighter-weight mechanism
that can work with the shader cache is needed.  However, this patch at
least restores the previous behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-16 08:37:44 -08:00
Brian Paul
f6a50c0b1f mesa: don't map depth+stencil buffer twice in glReadPixels()
In slow_read_depth_stencil_pixels_separate() we might have separate
depth and stencil buffers or a combined buffer.  In the later case,
don't map the buffer twice.  This function is used when the depth
scale/bias pixel transfer values are not the defaults.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=42963

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-16 08:49:22 -07:00
Kenneth Graunke
728a830fae i965: Fix inconsistent indentation in brw_gs_emit.c. 2011-11-16 00:57:35 -08:00
Kenneth Graunke
5e3e9a8e9c glsl: Add missing textureSize(samplerCubeShadow, int) variant.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-16 00:57:33 -08:00
Yuanhan Liu
4f677ca5f9 mesa: do not skip att and spot calculation for infinite light
glspec doesn't say that we should skip the attenuation and spot
calculation for infinite light(Ppli.w == 0). Instead, it gives a same
formula to do the light calculation for both finite light and infinite
light(see page 62 of glspec 2.1.pdf)

Also from the formula (2.4) at page 62 of glspec 2.1.pdf, we can skip
attenuation calculation if Ppli.w == 0.

This would fix all the intel oglc l_sed fail subcases and introduces no
intel oglc regressions.

v2: fix an wrong intendation(comments from Brian).

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
2011-11-16 11:31:04 +08:00
Yuanhan Liu
099c4e372d mesa: make sure all lighting tables are updated before the computation
Make sure all lighting tables are updated before using the table to
calculate something, say using _SpotExpTable to calculate
_VP_inf_spot_attenuation.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-16 11:20:49 +08:00
Eric Anholt
d4df6318a1 mesa: Fix a couple of missed conversion to arrays in format_unpack.
Fixes regression in piglit:
ARB_color_buffer_float/GL_RGBA16F-getteximage
ARB_color_buffer_float/GL_RGBA16F-readpixels
ARB_color_buffer_float/GL_RGBA32F-getteximage
ARB_color_buffer_float/GL_RGBA32F-readpixels

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-15 17:38:41 -08:00
Eric Anholt
2bf9aeaa19 mesa: Include R/RG integer textures in _mesa_is_integer_format.
Fixes some spurious GL errors in the upcoming
gl-3.0-required-sized-formats piglit test.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-15 16:23:56 -08:00
Chad Versace
79653c12d6 intel: Fix separate stencil in builtin DRI2 backend
intelAllocateBuffer() was oblivious to separate stencil buffers.  This
patch fixes it to allocate a non-tiled stencil buffer with special pitch,
just as the DDX does.

Without this, any app that attempted to create an EGL surface with stencil
bits would crash. Of course, this affected only environments that used the
builtin DRI2 backend, such as Android and Wayland.

Fixes GLBenchmark2.1 on Android on gen7.

Note: This is a candidate for the 7.11 branch.
Tested-by: Louie Tsaie <louie.tsai@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 08:00:29 -08:00
Chad Versace
50b3356078 intel: Fix region dimensions for stencil buffers received from DDX
I changed the dimensions of the stencil buffer's region, as allocated by
the DDX, at xf86-video-intel commit
   commit 3e55f3e88b40471706d5cd45c4df4010f8675c75
   dri: Do not tile stencil buffer
But I forgot to make the analogous update to the Intel DRI2 glue in Mesa.
This patch makes that update.

Surprisingly, the mismatch did not cause any bugs. But the mismatch, if
left unfixed, *would* create bugs in the next commit.

Note: This is a candidate for the 7.11 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 08:00:29 -08:00
Chad Versace
dc4c3a31c6 intel: Simplify stencil detiling arithmetic
When calculating the y offset needed for detiling window system stencil
buffers, replace the term
   region->height * 2 + region->height % 2 - 1
with
   rb->Height - 1 .

The two terms are incidentally equivalent due to some out-of-date,
incorrect code in the Intel DRI2 glue for DDX. (See
intel_process_dri2_buffer_with_separate_stencil(), line ``buffer_height /=
2;``).

Note: This is a candidate for the 7.11 branch (only the intel_span.c hunk).
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 08:00:29 -08:00
Brian Paul
1161facaf9 radeon: use _mesa_readpixels() instead of _swrast_ReadPixels() 2011-11-15 08:10:24 -07:00
Brian Paul
b31bc6b543 i965: use _mesa_readpixels() instead of _swrast_ReadPixels() 2011-11-15 08:07:22 -07:00
Brian Paul
caaefe1969 mesa: convert unpack functions to operate on an array of values
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
546f76d58f mesa: new BYTE/SHORT_TO_FLOATZ() macros
Rather than redefining the BYTE/SHORT_TO_FLOAT macros, just define new
ones with different names.  These macros preserve zero when converting.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
b098e1af1c mesa: move CEILING() macro into macros.h
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
bef4b42938 mesa: remove unused macros in macros.h
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
83863d468e mesa: consolidate cases in _mesa_components_in_format()
and _mesa_sizeof_packed_type()

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
6dbf2bac50 swrast: fix glReadPixels from texture attachment
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=42635
2011-11-15 07:49:26 -07:00
Brian Paul
d0836eda5e st/mesa: check for missing VBO in setup_interleaved_attribs()
This fixes a crash with the piglit vbo-too-small test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-15 07:49:26 -07:00
Brian Paul
438d7ac146 util/draw: replace assertions with conditionals in util_draw_max_index()
Don't assert/die if a VBO is too small.  Return zero instead.  For
debug builds, emit a warning message since this is an unusual situation
that might indicate that there's a bug in the app.

Note that util_draw_max_index() now returns max_index+1 instead of
max_index.  This lets us return zero to indicate that one of the VBOs
is too small to draw anything.

Fixes a failure with the new piglit vbo-too-small test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-15 07:49:26 -07:00
Brian Paul
94780b5ee6 st/mesa: remove most of the ReadPixels code
We can use the core Mesa code for glReadPixels now.  We just have to
validate state and flush the bitmap cache before reading.
2011-11-15 07:49:26 -07:00
Brian Paul
3754ebb33d st/mesa: remove dependencies on code in st_cb_readpixels.c
st_cb_readpixels.c is going away next.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
77c85f014a mesa: remove _swrast_ReadPixels()
We use the code in main/readpix.c now.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
bd5ba36bf7 mesa: use _mesa_readpixels() as default driver hook
Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
d2a23d4ded mesa: move swrast ReadPixels code into core Mesa
The swrast ReadPixels code has no dependencies on swrast since moving
to Map/UnmapRenderbuffer().  We'll be able to remove s_readpix.c and
remove the state tracker's glReadPixels code next.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
e0e454943c st/mesa: check renderbuffer orientation in st_MapRenderbuffer()
We'll soon be able to use these for a core Mesa implementation of
glReadPixels.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
371b1648ab mesa: remove support for software alpha buffers
This was only used by the xlib driver to add an alpha channel to the
front/window color buffer.  This was no longer going to work well with
the move to direct mapping of renderbuffers.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
6c6803f28d xlib: remove xm_image.[ch] files
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
bc63b226bc xlib: remove a ton of old xlib driver cruft
The days of 1-bpp, 8-bpp and dithering are long behind us.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
c9bfad2921 xlib: use MESA_FORMAT_XRGB8888 for pixmap surfaces
We no longer have software-allocated alpha buffers so we can forget
about the alpha channel.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00