Commit graph

47807 commits

Author SHA1 Message Date
Yuanhan Liu
2e6402feb7 swrast: fix unmatched span->array->ChanType
texture_combine converts the result rgba to CHAN_TYPE from FLOAT. At the
same time, make sure the span->array->ChanType is changed, too.

v2: pick a nicer comment from Brian

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-21 16:32:39 +08:00
Yuanhan Liu
6ba8f0688a swrast: simplify the prototype of function texture_combine
Parameter n and rgbaChan are both from structure span, thus using span
as paramter to simplify the prototype. Function texture_combine is only
used by _swrast_texture_span, so I guess it's safe to do so.

This patch is mainly for the next patch.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-21 16:32:29 +08:00
Marek Olšák
94cd9d6be8 r300g: set max_index to 0xffffff if there are no per-vertex attribs 2011-11-20 19:29:19 +01:00
Marek Olšák
03df791c6f u_vbuf_mgr: correctly compute max vertex count from hw buffers
And update r300g.

This is different from util_draw_max_index in how it obtains vertex elements
and that it doesn't have to call util_format_description due to additional
precomputed data in vertex elements.
2011-11-20 16:24:12 +01:00
Marek Olšák
72e1117e48 u_vbuf_mgr: correctly obtain min/max_index for uploads and translate
This forks vbo_get_minmax_index. We need to know the index range when
translating non-native vertices into native ones. There is no other way
around it.
2011-11-20 16:24:12 +01:00
Marek Olšák
c95bd12bec r600g: use u_vbuf_mgr to set/get the index buffer 2011-11-20 16:24:12 +01:00
Marek Olšák
a18dad8055 r300g: use u_vbuf_mgr to set/get the index buffer 2011-11-20 16:24:12 +01:00
Marek Olšák
4cfc8c775c u_vbuf_mgr: add set_index_buffer function
It will use the index buffer soon.
2011-11-20 16:24:11 +01:00
Marek Olšák
b5b7cc19d8 u_vbuf_mgr: add comments 2011-11-20 16:24:11 +01:00
Marek Olšák
df49b0ce90 u_vbuf_mgr: don't upload user buffers which have been uploaded by translate 2011-11-20 16:24:11 +01:00
Marek Olšák
dd2227e3fd r600g: set MIN/MAX_VTX_INDX to 0 and ~0, respectively
The CS checker doesn't check the regs and the state-tracker-provided values
are not to be trusted.

This also removes the hack for non-zero index bias.
2011-11-20 16:24:11 +01:00
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