Commit Graph

48764 Commits

Author SHA1 Message Date
Vinson Lee 3e18ad7fd7 i965: Fix Coverity wrong sizeof argument defect.
NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42542
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:19:34 -08:00
Paul Berry fcd5af4a91 i965: Set pitch of pull constant buffers to 16.
We always access pull constant buffers using the message types "OWord
Block Read" or "OWord Dual Block Read".  According to the Sandy Bridge
PRM, Vol 4 Part 1, pages 214 and 218, when using these messages:

    "the surface pitch is ignored, the surface is treated as a
    1-dimensional surface.  An element size (pitch) of 16 bytes is
    used to determine the size of the buffer for out-of-bounds
    checking if using the surface state model."

Previously we were setting the pitch for pull constant buffers to the
size of the whole constant buffer--this made no sense and would have
led to incorrect behavior if it were not for the fact that the pitch
is ignored.

For clarity, this patch sets the pitch for pull constant buffers to 16
bytes, consistent with the hardware's behavior.

v2: Clarify the meaning of the ignored values by writing them as (16 - 1).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:12:10 -08:00
Paul Berry f6f43bd5a2 i965 gen4-6: Fix off-by-one errors brw_create_constant_surface()
Commit 9bdc44a528 (i965: Replace struct
with bit shifting for WM pull constant surfaces) accidentally
introduced off-by-one errors into the calculation of the surface
width, height, and depth.  This patch restores the correct
computation.

The reason this wasn't noticed by Piglit tests is that the size of our
constant surfaces is always less than 2^20, therefore the off-by-one
error was causing the "depth" field of the surface to be set to all
1's.  The hardware interpreted this as an extremely large surface, so
overflow checking was effectively disabled.

No Piglit regressions on Sandy Bridge.

NOTE: This is a candidate for the 7.11 and 8.0 branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:12:10 -08:00
Christoph Bumiller af0ce1dba8 nv50/ir: make use of TGSI_INTERPOLATE_COLOR
Flat SHADE_MODEL still overrides any non-flat interpolation
qualifier, but pulling that state out of the rasterizer cso
isn't really worth the effort, is it ?

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 22:38:01 +01:00
Christoph Bumiller 7b6881932a nvc0: fix submission of VertexID and EdgeFlag in push mode
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 22:38:01 +01:00
Brian Paul cb254b75d7 osmesa: fix glReadPixels, etc
Needed to implement the Map/UnmapRenderbuffer() driver hooks.
This fixes glRead/Draw/CopyPixels, etc.

See https://bugs.freedesktop.org/show_bug.cgi?id=44723

Note: This is a candidate for the 8.0 branch.

Tested-by: Kevin Hobbs <hobbsk@ohiou.edu>
2012-01-12 13:49:15 -07:00
Brian Paul 062a4b601e intel: move declaration before code 2012-01-12 13:49:15 -07:00
Brian Paul 6dbdc03956 intel: fix mapping of malloc'd renderbuffers
This fixes accum buffer operations.  The accumulation buffer is the
only malloc-based renderbuffer for the intel drivers.

v2: apply x/y offset to returned pointer

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-12 13:49:15 -07:00
Eric Anholt 9be6654c1f mesa: Throw the required error for glCopyPixels from multisample FBO.
Fixes piglit EXT_framebuffer_multisample/negative-copypixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:20 -08:00
Eric Anholt 6950a4faf6 mesa: Throw the required error for glCopyTex{Sub,}Image from multisample FBO.
Fixes piglit EXT_framebuffer_multisample/negative-copyteximage.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:18 -08:00
Eric Anholt 86b7c6707f mesa: Throw the required error for glReadPixels() from a multisampled FBO.
Fixes piglit EXT_framebuffer_multisample-negative-readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:15 -08:00
Eric Anholt 0e8d156c3c mesa: Avoid short-circuiting realloc of renderbuffers to new sample count.
Fixes piglit EXT_framebuffer_multisample/renderbuffer-samples.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:13 -08:00
Eric Anholt f83756f80f meta: Add GL_RED/GL_RG support to meta CopyTexImage.
Fixes some _mesa_problem()s in oglconform.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:10 -08:00
Eric Anholt e6d6a10c5a i965/gen7: Fix depth buffer rendering to tile offsets.
Previously, we were saying that everything from the starting tile to
region width+height was part of the limits of our depthbuffer, even if
the tile was near the bottom of the depthbuffer.  This mean that our
range was not clipping to buffer buonds if the start tile was anything
but the start of the buffer.

In bebc91f0f3, this was changed to
saying that we're just rendering to a region of the size of the
renderbuffer.  This is great -- we get a range that should actually
match what we want.  However, the hardware's range checking occurs
after the X/Y offset addition, so we were clipping out rendering to
small depth mip levels when an X/Y offset was present.  Just add
tile_x/y to the width in that case -- the WM won't produce negative
x/y values pre-offset, so we just need to get the left/bottom sides of
the region to cover our buffer.

Fixes the following Piglit regressions on gen7:
    spec/ARB_depth_buffer_float/fbo-clear-formats
    spec/ARB_depth_texture/fbo-clear-formats
    spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:33:55 -08:00
Brian Paul 003dd8adf3 mesa: remove incorrect (float) cast in mipmap do_row()
The array holds GLuint values so remove the float cast.
Note, however, that to compute the average of four GLuints we really
want to do (a+b+c+d)/4 but that could overflow.  This change doesn't
address that for now.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:55 -07:00
Brian Paul 706400f0a7 swrast: use BITFIELD64_BIT() macro to fix MSVC warnings
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:50 -07:00
Brian Paul decd018b99 mesa: fix ir_variable declaration
ir_variable is a class, not a struct.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:44 -07:00
Brian Paul a240c998ac mesa: fix incorrect float vs. int values in a few places
In the first case, the newImage[] array contains GLuint values.
In the second case, the parameter type is GLuint, but the maxDepth
value is never used in this case (GL_FLOAT_32_UNSIGNED_INT_24_8_REV).
Pass ~OU just to be safe.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:19 -07:00
Brian Paul 2f0fa456e3 meta: fix incorrect argument order in setup_texture_coords() call
And pass integer width, height values.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:01:59 -07:00
Brian Paul 36ede89687 mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functions
Rather than testing the fbo's name against zero.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 09:58:45 -07:00
Brian Paul 185ee042ac mesa: whitespace, 80-column wrapping in buffers.c 2012-01-12 09:23:55 -07:00
Brian Paul 45a3b54063 mesa: remove obsolete comment on _mesa_dest_buffer_exists() 2012-01-12 09:23:55 -07:00
Brian Paul 50ad155d48 st/mesa: whitespace fixes, 80-column wrapping 2012-01-12 09:23:55 -07:00
Brian Paul eab036a6ea mesa/gallium: add FFS_DEFINED to protect ffs() from multiple definitions
We include both imports.h and u_math.h in the state tracker.  This
leads to multiple, conflicting definitions of ffs() with MSVC.
Use FFS_DEFINED to skip the ffs() in u_math.h.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 09:18:34 -07:00
Brian Paul 8cfaab59e0 st/mesa: re-order #includes in st_manager.c
include mesa headers before gallium headers to avoid problem with
ffs() being defined in u_math.h and then again in imports.h

The next commit will add some #ifdefs to prevent multiple definitions
of ffs().
2012-01-12 08:39:17 -07:00
Brian Paul 0c57323de8 sofpipe: remove extraneous semicolon 2012-01-12 08:30:52 -07:00
Brian Paul 9f2963b631 st/mesa: fix struct vs. class compilation warning
glsl_to_tgsi_visitor is earlier defined as a class, not a struct.
Fixes MSVC warning.

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 08:29:16 -07:00
Dave Airlie 3e044bcc4b r600g: don't advertise integers yet on r600.
Still some work to be done before this is finished.

This is a candidate for 8.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-12 15:06:24 +00:00
Brian Paul c7188ece0e configs: fix, simplify RADEON_LIBS, RADEON_CFLAGS
Fixes build problems with the r200, radeon drivers.

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 07:54:19 -07:00
Brian Paul 9a548c27aa mesa: remove _mesa_ffs(), implement ffs() for non-GNU platforms
Call ffs() and ffsll() everywhere.  Define our own ffs(), ffsll()
functions when the platform doesn't have them.

v2: remove #ifdef _WIN32, __IBMC__, __IBMCPP_ tests inside ffs()
implementation.  The #else clause was recursive.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Alexander von Gluck <kallisti5@unixzen.com>
2012-01-12 07:30:58 -07:00
Thomas Hellstrom 87118d84ff configure: Add the svga gallium driver to the default gallium drivers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 13:31:34 +01:00
Thomas Hellstrom 8a4f7d1cdc st/xa: Bump version to 1.0.0 according to the README
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 13:31:34 +01:00
José Fonseca ce2929dde0 svga: Fix user clip planes.
Dirty flags also need to be updated in face of recent interface change.

Fixes regression in compiz.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-12 12:05:31 +00:00
Dave Airlie 16b5fda032 softpipe: bump max texture array layers to 256.
This as per GL3 specification.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-12 11:17:07 +00:00
Thomas Hellstrom 4dac89d92c gallium/svga: Pass the SVGA3D_SURFACE_HINT_RENDERTARGET flag to the device
Some hardware versions rely on it to render correctly.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 11:20:16 +01:00
Brian Paul 90d654b09d vbo: fix breakage from previous commit
Don't know how that slipped by.
2012-01-11 20:23:12 -07:00
Brian Paul bbc74ffad6 vbo: fix void * arithmetic compilation error on MSVC
Also, call vbo_sizeof_ib_type() once and fix argument cast in
MapBufferRange() call.
2012-01-11 20:05:02 -07:00
Marek Olšák 4c0d88c145 docs/GL3: consolidate FBO extensions into one ARB 2012-01-12 03:59:21 +01:00
Marek Olšák 571e1947d0 docs/GL3: document r300 extension support 2012-01-12 03:59:21 +01:00
Marek Olšák 272896b885 docs/GL3: document what's missing for GL3 2012-01-12 03:59:21 +01:00
Yuanhan Liu 42d4972bf0 vbo: introduce vbo_get_minmax_indices function
Introduce vbo_get_minmax_indices() function to handle the min/max index
computation for nr_prims(>= 1). The old code just compute the first
prim's min/max index; this would results an error rendering if user
called functions like glMultiDrawElements(). This patch servers as
fixing this issue.

As when nr_prims = 1, we can pass 1 to paramter nr_prims, thus I made
vbo_get_minmax_index() static.

v2: per Roland's suggestion, put the indices address compuation into
    vbo_get_minmax_index() instead.

    Also do comination if possible to reduce map/unmap count

v3: per Brian's suggestion, use a pointer for start_prim to avoid
    structure copy per loop.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-12 10:47:41 +08:00
Brian Paul 459a44460e mesa: remove const qualifier from fProg to silence warning
The args to _mesa_reference_shader_program() can't be const.
2012-01-11 18:22:17 -07:00
Brian Paul fe1b38960b mesa: include uniforms.h to silence warning, remove unused var 2012-01-11 18:22:17 -07:00
Jakob Bornecrantz 6fe42b603d mesa: Include glx tests Makefile.in in tarball
Fix suggested by Kenneth Graunke.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Kenneth Graunke <kenneth@whitescape.org>
2012-01-12 00:44:12 +01:00
Anuj Phogat c979fe3e20 Enable is_front_buffer_rendering variable in case of GL_FRONT_AND_BACK
glDrawBuffer(GL_FRONT_AND_BACK) results in to segmentation fault if
intel->is_front_buffer_rendering is not enabled with GL_FRONT_AND_BACK.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44153

Reported-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 14:25:11 -08:00
Jakob Bornecrantz 04e262ebe9 mesa: Remove unused opengl version macro
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-11 23:17:40 +01:00
Jakob Bornecrantz c076882fbd rbug: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-11 21:53:23 +01:00
Ian Romanick 1c17745200 i965: Don't use _mesa_ir_link_shader to do our dirty work
Instead, do the uniform setting and input / output mapping directly in
brw_link_shader.  Hurray for not generating Mesa IR!  However, once
the i965 driver stops calling _mesa_ir_link_shader, UsesClipDistance
and UsesKill are no longer set.

Ideally gen6_upload_vs_push_constants should use the
gl_shader_program, but I don't see a way to propagate the information
there.  The other alternative, since this is the only usage, is to
move gl_vertex_program::UsesClipDistance to brw_vertex_program.

The compile (and precompile) stages use UsesKill to determine the
cache key for the shader.  This is then used to determine whether or
not to compile the shader.  Calculating this data during compilation
is too late.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2012-01-11 12:51:24 -08:00
Ian Romanick efdc8bf189 i965: Don't calculate masks of used FS inputs
This previously enabled some optimizations in the fragment shader
(interpolation, etc.) if some input components were always 0.0 or
1.0.  However, this data was generated by analyzing Mesa IR.  The
next patch in this series removes generation of Mesa IR for GLSL
paths.  When we detect that case, just set the used mask to ~0 and
circumvent the optimizations.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick 6c0df75803 linker: Calculate used samplers and shadow samplers in the linker
It used to be done in ir_to_mesa, and that was kind of a bad place.

I didn't change st_glsl_to_tgsi because there is some strange stuff
happening in the code that generates glDrawPixels shaders.  It looked
like this would break horribly if I touched anything.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00