profile/ivi/mesa.git
13 years agost/mesa: tell VBO module to always unmap buffers before drawing
Brian Paul [Tue, 25 Oct 2011 23:41:12 +0000 (17:41 -0600)]
st/mesa: tell VBO module to always unmap buffers before drawing

Without this it's possible to wind up in a draw call with the
glBegin/End VBO still in a mapped state.  This is a problem for
the SVGA3D driver and probably not good for other HW drivers.

13 years agoglsl: Rename remaining internal builtins from gl_MESA* to gl_*MESA.
Eric Anholt [Fri, 21 Oct 2011 17:45:48 +0000 (10:45 -0700)]
glsl: Rename remaining internal builtins from gl_MESA* to gl_*MESA.

This matches the usual convention for extension builtin variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agointel: Drop texture border support code.
Eric Anholt [Mon, 17 Oct 2011 21:53:13 +0000 (14:53 -0700)]
intel: Drop texture border support code.

Now that texture borders are gone, we never need to allocate our
textures through non-miptrees, which simplifies some irritating paths.

v2: Remove the !mt support case from intel_map_texture_image()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agointel: Enable stripping of texture borders.
Eric Anholt [Mon, 17 Oct 2011 21:34:52 +0000 (14:34 -0700)]
intel: Enable stripping of texture borders.

This replaces software rendering of textures with the deprecated
1-pixel border (which is always bad, since mipmapping is rather broken
in swrast, and GLSL 1.30 is unsupported) with hardware rendering that
just pretends there was never a border (so you have potential seams on
apps that actually intentionally used the 1-pixel borders, but correct
rendering otherwise).

This doesn't regress any piglit tests on gen6 (since the texwrap
border/bordercolor cases already failed due to broken border color
handling), but regresses texwrap border cases on original gen4 since
those end up sampling the border color instead of the border pixels.
It's a small price to pay for not thinking about texture borders any
more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Apply StripTextureBorder to CopyTexImage as well.
Eric Anholt [Tue, 25 Oct 2011 19:10:21 +0000 (12:10 -0700)]
mesa: Apply StripTextureBorder to CopyTexImage as well.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Fold gallium's texture border stripping into a core Mesa option.
Eric Anholt [Mon, 17 Oct 2011 21:30:26 +0000 (14:30 -0700)]
mesa: Fold gallium's texture border stripping into a core Mesa option.

We wanted to reuse this in the Intel driver.

v2: Move the flag to ctx->Const

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agomesa: Skip texstore for 0-sized texture data.
Eric Anholt [Tue, 25 Oct 2011 21:38:39 +0000 (14:38 -0700)]
mesa: Skip texstore for 0-sized texture data.

The intel driver (and gallium, it looks like, though it doesn't use
these texstore functions at this point) doesn't bother making storage
for textures with 0 width, height, or depth.  This avoids them having
to deal with returning a mapping for that nonexistent data.

Fixes assertion failures with an upcoming intel driver change.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agor600g: remove redundant assignment of pipe_draw_info in draw_vbo
Marek Olšák [Wed, 26 Oct 2011 13:52:32 +0000 (15:52 +0200)]
r600g: remove redundant assignment of pipe_draw_info in draw_vbo

13 years agollvmpipe: llvmpipe doesn't support pure integers yet.
Dave Airlie [Wed, 26 Oct 2011 13:50:47 +0000 (15:50 +0200)]
llvmpipe: llvmpipe doesn't support pure integers yet.

Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=42240

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: cleanup draw_vbo and add comments
Marek Olšák [Wed, 26 Oct 2011 00:17:52 +0000 (02:17 +0200)]
r600g: cleanup draw_vbo and add comments

13 years agoralloc: Move declaration before code.
Vinson Lee [Wed, 26 Oct 2011 03:30:27 +0000 (20:30 -0700)]
ralloc: Move declaration before code.

Fixes build error with MSVC.

13 years agoscons: Add link_uniforms.cpp to SConscript.
Vinson Lee [Wed, 26 Oct 2011 03:19:07 +0000 (20:19 -0700)]
scons: Add link_uniforms.cpp to SConscript.

13 years agoir_to_mesa: Use uniform_field_visitor to add all struct fields to parameter list
Ian Romanick [Mon, 24 Oct 2011 19:23:50 +0000 (12:23 -0700)]
ir_to_mesa: Use uniform_field_visitor to add all struct fields to parameter list

Previously the uniform was passed as single, whole structure to
_mesa_add_parameter.  This was completely bogus and resulted in a
DataType of 0 (instead of a valid GLSL type enum).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Cc: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agolinker: Add uniform_field_visitor class to process leaf fields of a uniform
Ian Romanick [Tue, 25 Oct 2011 02:37:11 +0000 (19:37 -0700)]
linker: Add uniform_field_visitor class to process leaf fields of a uniform

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agoralloc: Add new [v]asprintf_rewrite_tail functions.
Kenneth Graunke [Tue, 25 Oct 2011 02:33:16 +0000 (19:33 -0700)]
ralloc: Add new [v]asprintf_rewrite_tail functions.

This can be useful if you want to create a bunch of temporary strings
with a common prefix.  For example, when iterating over uniform
structure fields, one might want to create temporary strings like
"pallete.primary", "palette.outline", and "pallette.shadow".

This could be done by overwriting the '.' with a null-byte and calling
ralloc_asprintf_append, but that incurs the cost of strlen("pallete")
every time...when this is already known.

These new functions allow you rewrite the tail of the string, given a
starting index.  If the starting index is the length of the string, this
is equivalent to appending.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agolinker: Eliminate more dead code after demoting shader inputs and outputs
Ian Romanick [Fri, 21 Oct 2011 18:21:02 +0000 (11:21 -0700)]
linker: Eliminate more dead code after demoting shader inputs and outputs

Consider the following vertex shader and fragment shader:

// vertex shader
varying vec4 v;
uniform vec4 u;

void main() { gl_Position = vec4(0.0); v = u; }

// fragment shader
void main() { gl_FragColor = vec4(0.0); }

Since the fragment shader does not use 'v', it is demoted from a
varying to a simple global variable.  Once that happens, the
assignment to 'v' is useless, and it should be removed.  In addition,
'u' is no longer active, and it should also be removed.

Performing extra dead code elimination after demoting shader inputs
and outputs takes care of this.  This elimination must occur before
assigning uniform locations, or the declaration of 'u' cannot be
removed.

This change *breaks* the piglit test getuniform-01, but that test is
already incorrect.  The test uses a vertex shader that assigns to a
user-defined varying, but it has no fragment shader.  Since Mesa does
not support ARB_separate_shader_objects (we only support the EXT
version), the linker correctly eliminates the user-defined varying.
The cascading effect is that the uniform queried by the C code of the
test is also (correctly) eliminated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Cc: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
13 years agoglsl: Add uniform_locations_assigned parameter to do_dead_code opt pass
Ian Romanick [Fri, 21 Oct 2011 18:17:39 +0000 (11:17 -0700)]
glsl: Add uniform_locations_assigned parameter to do_dead_code opt pass

Setting this flag prevents declarations of uniforms from being removed
from the IR.  Since the IR is directly used by several API functions
that query uniforms in shaders, uniform declarations cannot be removed
after the locations have been set.  However, it should still be safe
to reorder the declarations (this is not tested).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
13 years agoi965: Add more #defines for Gen6+ 3DSTATE_GS fields.
Kenneth Graunke [Mon, 24 Oct 2011 06:02:05 +0000 (23:02 -0700)]
i965: Add more #defines for Gen6+ 3DSTATE_GS fields.

These should be useful for doing transform feedback on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: Add new brw_context::max_gs_threads constant.
Kenneth Graunke [Mon, 24 Oct 2011 05:27:14 +0000 (22:27 -0700)]
i965: Add new brw_context::max_gs_threads constant.

These are correct to the best of my knowledge, gleaned from a variety of
internal sources.  Sadly, the Sandybridge PRM has incorrect limits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: Rename (vs|wm)_max_threads to max_(vs|wm)_threads for consistency.
Kenneth Graunke [Mon, 24 Oct 2011 05:10:03 +0000 (22:10 -0700)]
i965: Rename (vs|wm)_max_threads to max_(vs|wm)_threads for consistency.

The inconsistency between vs_max_threads and max_vs_entries was rather
annoying.  I could never seem to remember which one was reversed, which
made it harder to find quickly.  "Max __ Threads" seems more natural.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agoi965: Remove "single threaded" INTEL_DEBUG mode.
Kenneth Graunke [Mon, 24 Oct 2011 04:42:27 +0000 (21:42 -0700)]
i965: Remove "single threaded" INTEL_DEBUG mode.

According to the docs for 3DSTATE_PS (Gen7+) and 3DSTATE_WM (Gen6),
there is a platform dependent value for the minimum number of pixel
shader threads.  It may also vary based on whether WIZ Hashing is on.

For example, Ivybridge requires at least 4 threads if WIZ hashing is
disabled, and 8 if it's enabled.  Programming it to use less threads is
illegal.  Sandybridge appears to have similar restrictions.

So on newer platforms, INTEL_DEBUG=sing will probably just hang the GPU.
Rather than try to patch it up for newer platforms and extend it to
support geometry shaders, just remove it as it isn't that useful anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agomesa: Remove unnecessary and incorrect TexEnv parameter validation.
Kenneth Graunke [Mon, 17 Oct 2011 23:41:57 +0000 (16:41 -0700)]
mesa: Remove unnecessary and incorrect TexEnv parameter validation.

For GL_RGB_SCALE and GL_ALPHA_SCALE targets, the API wrapper code
attempts to ensure the parameter is 1.0, 2.0, or 4.0.

This is unnecessary: set_combiner_scale in texenv.c (called by
_mesa_TexEnvfv) already checks this and raises an appropriate error.

It's also incorrect: For glTexEnvx, the API validation code directly
compares the GLfixed input parameter with a floating point constant,
prior to converting fixed-point to floating point.

Fixes an issue in the OpenGL ES 1.1 conformance suite.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agost/glx: Implement texture_from_pixmap without DRI.
Stéphane Marchesin [Mon, 24 Oct 2011 19:03:16 +0000 (12:03 -0700)]
st/glx: Implement texture_from_pixmap without DRI.

Makes texture_from_pixmap work with non-DRI llvmpipe.

13 years agoi915g: Cleanup the vertex sampler interface a bit.
Stéphane Marchesin [Tue, 18 Oct 2011 17:26:04 +0000 (10:26 -0700)]
i915g: Cleanup the vertex sampler interface a bit.

13 years agoi915g: Flesh out TODO idea.
Stéphane Marchesin [Tue, 18 Oct 2011 17:25:02 +0000 (10:25 -0700)]
i915g: Flesh out TODO idea.

13 years agointel: Kill dead code in intel_miptree_copy_teximage()
Chad Versace [Mon, 24 Oct 2011 20:55:43 +0000 (13:55 -0700)]
intel: Kill dead code in intel_miptree_copy_teximage()

Kill the code paths taken when src_mt is null. It is never null, otherwise
there would be a segfault on line 4 of this function:
    GLuint width = src_mt->level[level].width;

(Some interleaved lines in the diff make the real diff non-obvious. All
I did was delete some code and then left-shifted what remained to correct
the indentation.)

Reviewed-by: Eric Anholt <eric@aholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
13 years agotgsi: Fix memory leak in out-of-memory path.
Vinson Lee [Tue, 25 Oct 2011 15:23:02 +0000 (08:23 -0700)]
tgsi: Fix memory leak in out-of-memory path.

Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoswrast: Fix memory leak in out-of-memory path.
Vinson Lee [Tue, 25 Oct 2011 17:08:59 +0000 (10:08 -0700)]
swrast: Fix memory leak in out-of-memory path.

Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoswrast: use _mesa_ffs() instead of ffs()
Brian Paul [Tue, 25 Oct 2011 17:25:55 +0000 (11:25 -0600)]
swrast: use _mesa_ffs() instead of ffs()

Fixes MSVC build.

13 years agor600g: move some code out of draw_vbo into new r600_update_derived_state
Marek Olšák [Tue, 25 Oct 2011 17:20:14 +0000 (19:20 +0200)]
r600g: move some code out of draw_vbo into new r600_update_derived_state

13 years agor600g: cleanup some magic numbers
Marek Olšák [Tue, 25 Oct 2011 15:44:55 +0000 (17:44 +0200)]
r600g: cleanup some magic numbers

13 years agor600g: don't render if pipe_draw_info::count is 0
Marek Olšák [Tue, 25 Oct 2011 14:39:18 +0000 (16:39 +0200)]
r600g: don't render if pipe_draw_info::count is 0

Also call r600_conv_pipe_prim earlier.

13 years agomesa: fix comment language
Brian Paul [Tue, 25 Oct 2011 14:45:37 +0000 (08:45 -0600)]
mesa: fix comment language

13 years agopp: Fix memory leak on error path.
Vinson Lee [Mon, 24 Oct 2011 21:45:39 +0000 (14:45 -0700)]
pp: Fix memory leak on error path.

Fixes Coverity resource leak defect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
13 years agor600g: set correct tiling flags in depth info
Marek Olšák [Mon, 24 Oct 2011 23:28:39 +0000 (01:28 +0200)]
r600g: set correct tiling flags in depth info

The kernel currently overwrites the flags, but if we stopped doing that,
this would break badly.

13 years agoapple: Implement applegl_unbind_context
Jeremy Huddleston [Mon, 24 Oct 2011 23:21:28 +0000 (16:21 -0700)]
apple: Implement applegl_unbind_context

glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context
causing subsequent GLX requests to fail in peculiar ways

http://xquartz.macosforge.org/trac/ticket/514

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
13 years agoutil: handle failed mapping in u_upload_alloc()
Brian Paul [Mon, 24 Oct 2011 15:40:07 +0000 (09:40 -0600)]
util: handle failed mapping in u_upload_alloc()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
13 years agoutil: handle failed mapping in u_upload_alloc_buffer()
Brian Paul [Mon, 24 Oct 2011 15:37:26 +0000 (09:37 -0600)]
util: handle failed mapping in u_upload_alloc_buffer()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
13 years agomesa: Fix memory leak in out-of-memory path.
Vinson Lee [Mon, 24 Oct 2011 18:57:15 +0000 (11:57 -0700)]
mesa: Fix memory leak in out-of-memory path.

Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agoglsl: Fix gl_NormalMatrix swizzle setup to match i965's invariants.
Eric Anholt [Wed, 19 Oct 2011 00:17:28 +0000 (17:17 -0700)]
glsl: Fix gl_NormalMatrix swizzle setup to match i965's invariants.

A driver trying to set up builtin uniforms is faced with a problem:
How do I walk the ir_variable structure (representing an array of
structs, or array of matrices, or struct, or whatever), and set up
driver structures so that dereference of that uniform gets the
corresponding ParameterValues[] entry.  The rule in general is that
each corresponding vector-sized field of an array of structs is one
builtin uniform state slot.  i965 relied on another invariant: each
state slot has a number of unique channel swizzles corresponding to
the number of elements in the field's vector, to avoid needing to walk
the glsl_type in parallel to get at vector_elements.

All of the builtin uniforms followed this behavior, except for
gl_NormalMatrix.  That's a mat3 (so 3 vec3s), but it was swizzled as 3
vec4s.

Fixes piglit glsl-fs-normalmatrix.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
13 years agoglsl: Add gl_MaxVaryingComponents in GLSL 1.30.
Eric Anholt [Fri, 21 Oct 2011 22:17:16 +0000 (15:17 -0700)]
glsl: Add gl_MaxVaryingComponents in GLSL 1.30.

This is the new name for gl_MaxVaryingFloats now that non-float
varyings exist.  Fixes piglit
glsl-1.30/execution/maximums/gl_MaxVaryingFloats

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoi965: Apply post-sync non-zero workaround to homebrew workaround.
Kenneth Graunke [Fri, 21 Oct 2011 08:03:37 +0000 (01:03 -0700)]
i965: Apply post-sync non-zero workaround to homebrew workaround.

In commit 3e5d3626, Eric added a homebrew workaround to fix GPU hangs in
the Mesa "engine" demo and oglc's api-texcoord test.

Unfortunately, his PIPE_CONTROL contains a Depth Stall, which
necessitates the post-sync non-zero workaround,

Fixes GPU hangs in Civilization 4, PlaneShift, and 3DMMES.
Hopefully Heroes of Newerth as well, though I haven't tested that.

NOTE: This is candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40324
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41096
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Eric Anholt <eric@anholt.net>
13 years agodocs: update relnotes-7.12
Marek Olšák [Mon, 24 Oct 2011 19:08:13 +0000 (21:08 +0200)]
docs: update relnotes-7.12

13 years agor300g: expose ARB_ES2_compatibility by claiming FIXED format support
Marek Olšák [Mon, 24 Oct 2011 19:05:38 +0000 (21:05 +0200)]
r300g: expose ARB_ES2_compatibility by claiming FIXED format support

13 years agonv50: fix max texture levels
Adel Gadllah [Mon, 24 Oct 2011 17:41:03 +0000 (19:41 +0200)]
nv50: fix max texture levels

MAX_TEXTURE_2D_LEVELS and MAX_TEXTURE_CUBE_LEVELS are supposed to be
14 not 13, while MAX_TEXTURE_3D_LEVELS should be 12 not 10.

13 years agowinsys/radeon: don't use the new GEM_WAIT ioctl for now
Marek Olšák [Mon, 24 Oct 2011 17:44:49 +0000 (19:44 +0200)]
winsys/radeon: don't use the new GEM_WAIT ioctl for now

13 years agoOnly use gcc visibility support with gcc4+.
Tom Fogal [Wed, 19 Oct 2011 20:41:35 +0000 (14:41 -0600)]
Only use gcc visibility support with gcc4+.

I had a colleague hitting issues compiling with an old gcc3.2
system.  These patches got them through.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agowinsys/radeon: restore the old r600g winsys memory characteristics.
Mathias Fröhlich [Sat, 8 Oct 2011 19:33:23 +0000 (21:33 +0200)]
winsys/radeon: restore the old r600g winsys memory characteristics.

Use VRAM for static and immutable buffers. This restores the
recently removed r600g winsys behaviour for memory locations.
This also improoves rendering times on the gpu for some
OpenSceneGraph based test cases by about 15%.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
13 years agoutil: remove gotos in u_upload_mgr.c
Brian Paul [Sun, 23 Oct 2011 16:14:27 +0000 (10:14 -0600)]
util: remove gotos in u_upload_mgr.c

We can trivially remove the gotos in two places in this code and make
it a bit more readable.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
13 years agomesa: Avoid ABA problem on buffer object bind.
Mathias Fröhlich [Sat, 22 Oct 2011 10:57:01 +0000 (12:57 +0200)]
mesa: Avoid ABA problem on buffer object bind.

Make sure we do not run into the classic ABA problem on buffer object bind,
reusing this name and may be never rebind since we get an new name
that was just deleted and never rebound in between.
The explicit rebinding to the debault object in the current context
prevents the above in the current context, but another context
sharing the same objects might suffer from this problem.

Minor var renaming and comments edited by Brian.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
13 years agoswrast: fix comment typo (s/texure/texture/)
Brian Paul [Mon, 24 Oct 2011 02:21:18 +0000 (20:21 -0600)]
swrast: fix comment typo (s/texure/texture/)

13 years agomesa: remove dead code from teximage.c
Brian Paul [Mon, 24 Oct 2011 02:17:53 +0000 (20:17 -0600)]
mesa: remove dead code from teximage.c

13 years agomesa: Fix multithreaded buffer object refcounting.
Mathias Fröhlich [Wed, 19 Oct 2011 05:54:20 +0000 (07:54 +0200)]
mesa: Fix multithreaded buffer object refcounting.

Buffer objects may be shared across contexts.
Rework the array attrib push/pop implementation
to be thread safe. Make use of more library functions
for this purpose.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
13 years agor300g: don't call u_trim_pipe_prim in r300_swtcl_draw_vbo
Marek Olšák [Sun, 23 Oct 2011 18:29:06 +0000 (20:29 +0200)]
r300g: don't call u_trim_pipe_prim in r300_swtcl_draw_vbo

This was dead code anyway.

13 years agou_blitter: accept overriden width0 and height0
Marek Olšák [Fri, 21 Oct 2011 01:32:29 +0000 (03:32 +0200)]
u_blitter: accept overriden width0 and height0

We'll use this soon.

13 years agou_blitter: add a copy_texture function which uses views and not resources
Marek Olšák [Fri, 21 Oct 2011 00:09:40 +0000 (02:09 +0200)]
u_blitter: add a copy_texture function which uses views and not resources

The views (sampler views and surfaces) are great tools for changing resource
properties without having to change pipe_resource.

13 years agointel: remove duplicated #include of texstore.h
Brian Paul [Sun, 23 Oct 2011 17:19:46 +0000 (11:19 -0600)]
intel: remove duplicated #include of texstore.h

13 years agoradeon: remove unnecessary #includes of texstore.h
Brian Paul [Sun, 23 Oct 2011 17:18:22 +0000 (11:18 -0600)]
radeon: remove unnecessary #includes of texstore.h

13 years agoconfigs: add vmgfx-related dirs to configs/linux-dri
Brian Paul [Sun, 23 Oct 2011 16:39:38 +0000 (10:39 -0600)]
configs: add vmgfx-related dirs to configs/linux-dri

13 years agoswrast: update renderbuffer format assertion
Brian Paul [Sun, 23 Oct 2011 16:44:47 +0000 (10:44 -0600)]
swrast: update renderbuffer format assertion

Failed when exercising i965 swrast fallback rendering.

13 years agomesa: add swrast_texture_image::Buffer
Brian Paul [Sun, 23 Oct 2011 16:44:47 +0000 (10:44 -0600)]
mesa: add swrast_texture_image::Buffer

In the past, swrast_texture_image::Data has been overloaded.  It could
either point to malloc'd memory storing texture data, or it could point
to a current mapping of GPU memory.

Now, Buffer always points to malloc'd memory (if we're not using GPU
memory) and Data always points to mapped memory.  The next step would
be to rename Data -> Map.

This change also involves adding swrast functions for mapping textures
and renderbuffers prior to rendering to setup the Data pointer.  Plus,
corresponding functions to unmap texures and renderbuffers.  This is
very much like similar code in the dri drivers.

13 years agomesa: remove _mesa_alloc_texmemory(), _mesa_free_texmemory()
Brian Paul [Sun, 23 Oct 2011 16:44:47 +0000 (10:44 -0600)]
mesa: remove _mesa_alloc_texmemory(), _mesa_free_texmemory()

Core Mesa no longer does any texture memory allocation.

13 years agomesa: move gl_texture_image::Data, RowStride, ImageOffsets to swrast
Brian Paul [Sun, 23 Oct 2011 16:44:47 +0000 (10:44 -0600)]
mesa: move gl_texture_image::Data, RowStride, ImageOffsets to swrast

Only swrast and the drivers that fall back to swrast need these fields now.
This removes the last of the fields related to software rendering from
gl_texture_image.

13 years agollvmpipe: point out that there's two stencil writemasks
Brian Paul [Sun, 23 Oct 2011 16:08:06 +0000 (10:08 -0600)]
llvmpipe: point out that there's two stencil writemasks

In lp_build_stencil_op() the incoming 'stencil' var is a 2-element array.
There's a front-face writemask and a back-face writemask but we're ignoring
the later.  This patch doesn't fix anything but at least points out the
problem.

13 years agollvmpipe: compare front_facing to NULL to improve readability
Brian Paul [Sun, 23 Oct 2011 16:05:14 +0000 (10:05 -0600)]
llvmpipe: compare front_facing to NULL to improve readability

Compare 'front_facing' to NULL to make it more obvious that front_facing
is a pointer and not a simple boolean value.

13 years agogallivm: added lp_build_print_ivec4() function
Brian Paul [Sun, 23 Oct 2011 16:02:53 +0000 (10:02 -0600)]
gallivm: added lp_build_print_ivec4() function

13 years agomesa: improve the warning message in _mesa_choose_tex_format()
Brian Paul [Sun, 23 Oct 2011 16:00:00 +0000 (10:00 -0600)]
mesa: improve the warning message in _mesa_choose_tex_format()

Bug 42128 hits this _mesa_warning() call.

13 years agoglsl: Add support for constant expression evaluation on round(), roundEven().
Eric Anholt [Tue, 27 Sep 2011 21:54:10 +0000 (14:54 -0700)]
glsl: Add support for constant expression evaluation on round(), roundEven().

v2: Avoid the C99 rounding functions, because I don't trust
get/setting the C99 rounding mode from inside our library not having
other side effects.  Instead, open-code roundEven() behavior around
Mesa's IROUND, which we're already testing for C99 rounding mode
safety.

Fixes glsl-1.30/compiler/built-in-functions/round*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
13 years agodri-r600: Hook up a drm_descriptor configuration function
Mathias Fröhlich [Fri, 14 Oct 2011 14:25:21 +0000 (16:25 +0200)]
dri-r600: Hook up a drm_descriptor configuration function

Returns a configuration that makes the dri state-tracker-manager
throttle.

13 years agor600g: make r[67]00 not bail out on PRED_SETNE_INT.
Mathias Fröhlich [Sun, 23 Oct 2011 06:57:43 +0000 (08:57 +0200)]
r600g: make r[67]00 not bail out on PRED_SETNE_INT.

13 years agor600g: make if's use PRED_SETNE_INT no matter what.
Dave Airlie [Sat, 22 Oct 2011 19:13:20 +0000 (20:13 +0100)]
r600g: make if's use PRED_SETNE_INT no matter what.

This is more correct for TGSI if, and with native ints enabled
it fixes 25 piglit fails.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: print inst in hex in dumps
Dave Airlie [Sat, 22 Oct 2011 19:11:26 +0000 (20:11 +0100)]
r600g: print inst in hex in dumps

since we have them as hex in the headers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agor600g: drop specific i2f it should be a trans only op2.
Dave Airlie [Sat, 22 Oct 2011 19:08:44 +0000 (20:08 +0100)]
r600g: drop specific i2f it should be a trans only op2.

Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agovbo: Clean up unused variables in the vbo module.
Mathias Froehlich [Wed, 3 Aug 2011 06:10:52 +0000 (08:10 +0200)]
vbo: Clean up unused variables in the vbo module.

Remove some unused or unused but set variables
from the vbo module.

13 years agoConvert additional GNUC_MINOR checks to multiplied version
Alan Coopersmith [Fri, 21 Oct 2011 22:43:28 +0000 (15:43 -0700)]
Convert additional GNUC_MINOR checks to multiplied version

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agoFix gcc version checks for _mesa_bitcount
Alan Coopersmith [Fri, 21 Oct 2011 00:14:05 +0000 (17:14 -0700)]
Fix gcc version checks for  _mesa_bitcount

- Fix _GNUC__ typo in both checks
- Fix logic error in check for gcc < 3.4 that breaks for gcc 2.x & older

Without this fix, builds with gcc 3.4.x end up depending on undefined
_mesa_bitcount instead of gcc's __builtin_popcount.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
13 years agogallium/targets: Add vdpau target for nouveau
Maarten Lankhorst [Tue, 18 Oct 2011 12:24:30 +0000 (14:24 +0200)]
gallium/targets: Add vdpau target for nouveau

Should fall back to shader based decoding (g3dvl) for now.

This is probably broken on systems that support xvmc, because
nouveau_video_buffer_create has no way to know for what api
the buffer is created, so I think this call might need a
separate argument as workaround.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
13 years agod3d1x: set primitive restart in the correct draw calls
Christoph Bumiller [Thu, 20 Oct 2011 21:36:15 +0000 (23:36 +0200)]
d3d1x: set primitive restart in the correct draw calls

13 years agonv50/ir: import SM4 converter
Christoph Bumiller [Tue, 18 Oct 2011 16:36:57 +0000 (18:36 +0200)]
nv50/ir: import SM4 converter

13 years agonouveau,nvc0: fix/improve handling of multiple constant buffers
Christoph Bumiller [Thu, 20 Oct 2011 20:42:59 +0000 (22:42 +0200)]
nouveau,nvc0: fix/improve handling of multiple constant buffers

13 years agonvc0: add support for linear and buffer textures and RTs
Christoph Bumiller [Tue, 18 Oct 2011 10:08:19 +0000 (12:08 +0200)]
nvc0: add support for linear and buffer textures and RTs

13 years agonvc0: add support for clip distance shader outputs
Christoph Bumiller [Tue, 18 Oct 2011 10:07:01 +0000 (12:07 +0200)]
nvc0: add support for clip distance shader outputs

13 years agonvc0: handle more query types
Christoph Bumiller [Fri, 21 Oct 2011 20:58:18 +0000 (22:58 +0200)]
nvc0: handle more query types

13 years agonvc0: fix location of the PrimitiveID output
Christoph Bumiller [Sat, 15 Oct 2011 09:49:55 +0000 (11:49 +0200)]
nvc0: fix location of the PrimitiveID output

13 years agonvc0: prevent VERTEXID/INSTANCEID from consuming input slots
Christoph Bumiller [Mon, 17 Oct 2011 21:26:57 +0000 (23:26 +0200)]
nvc0: prevent VERTEXID/INSTANCEID from consuming input slots

13 years agonvc0: fixes for program tessellation parameters
Christoph Bumiller [Mon, 17 Oct 2011 21:30:02 +0000 (23:30 +0200)]
nvc0: fixes for program tessellation parameters

13 years agonv50,nvc0: reset per-instance state for inactive vertex elements
Christoph Bumiller [Sat, 15 Oct 2011 10:03:03 +0000 (12:03 +0200)]
nv50,nvc0: reset per-instance state for inactive vertex elements

13 years agonv50,nvc0: reset base element in draw_arrays
Christoph Bumiller [Fri, 14 Oct 2011 20:22:04 +0000 (22:22 +0200)]
nv50,nvc0: reset base element in draw_arrays

It affects VERTEX_BUFFER_FIRST,COUNT submission, too.

13 years agonvc0: apply first_layer offset to all resources with array_size
Christoph Bumiller [Tue, 11 Oct 2011 09:41:47 +0000 (11:41 +0200)]
nvc0: apply first_layer offset to all resources with array_size

Makes CUBE arrays work with d3d1x.

13 years agonvc0: emit state to allow GP to select the RT layer
Christoph Bumiller [Fri, 14 Oct 2011 20:19:01 +0000 (22:19 +0200)]
nvc0: emit state to allow GP to select the RT layer

13 years agonvc0: validate GP samplers, textures
Christoph Bumiller [Fri, 14 Oct 2011 20:16:48 +0000 (22:16 +0200)]
nvc0: validate GP samplers, textures

13 years agonvc0: fix clear_render_target/depth_stencil region
Christoph Bumiller [Fri, 14 Oct 2011 20:12:42 +0000 (22:12 +0200)]
nvc0: fix clear_render_target/depth_stencil region

In all 3 dimensions (now clearing all layers too).

13 years agonvc0: fix assertion that immediate array buffer fits
Christoph Bumiller [Sun, 25 Sep 2011 16:00:07 +0000 (18:00 +0200)]
nvc0: fix assertion that immediate array buffer fits

13 years agonv50/ir: use RDSV to fetch FrontFacing before lowering
Christoph Bumiller [Mon, 17 Oct 2011 21:04:11 +0000 (23:04 +0200)]
nv50/ir: use RDSV to fetch FrontFacing before lowering

13 years agonv50/ir: fix textureGrad with offsets and in non-FPs
Christoph Bumiller [Tue, 11 Oct 2011 15:58:14 +0000 (17:58 +0200)]
nv50/ir: fix textureGrad with offsets and in non-FPs

13 years agonv50/ir: add wrap mode for shift operations
Christoph Bumiller [Mon, 17 Oct 2011 21:02:16 +0000 (23:02 +0200)]
nv50/ir: add wrap mode for shift operations

D3D1x specifies that only the low 5 bit of the shift are used.

13 years agonv50/ir: initialize RelocInfo to 0
Christoph Bumiller [Thu, 6 Oct 2011 18:45:08 +0000 (20:45 +0200)]
nv50/ir: initialize RelocInfo to 0

13 years agonvc0/ir: fix emission of cvt when register and type size differ
Christoph Bumiller [Thu, 6 Oct 2011 12:32:58 +0000 (14:32 +0200)]
nvc0/ir: fix emission of cvt when register and type size differ

13 years agonv50/ir: fix argument count for CUBE_ARRAY texture target
Christoph Bumiller [Fri, 14 Oct 2011 17:58:04 +0000 (19:58 +0200)]
nv50/ir: fix argument count for CUBE_ARRAY texture target

13 years agonvc0/ir: GP emit address must end up in $r0
Christoph Bumiller [Mon, 17 Oct 2011 21:00:59 +0000 (23:00 +0200)]
nvc0/ir: GP emit address must end up in $r0