mesa.git
12 years agomesa: Fix memory leak in out-of-memory path.
Vinson Lee [Thu, 27 Oct 2011 21:51:08 +0000 (14:51 -0700)]
mesa: Fix memory leak in out-of-memory path.

Fixes Coverity resource leak defect.

12 years agodrisw: Enable SGI_make_current_read for direct contexts
Adam Jackson [Tue, 1 Nov 2011 17:52:48 +0000 (13:52 -0400)]
drisw: Enable SGI_make_current_read for direct contexts

Equivalent to glXMakeContextCurrent, which had better already work since
we advertise GLX 1.3.

Signed-off-by: Adam Jackson <ajax@redhat.com>
12 years agost/xa: Add a scanout flag for surfaces
Thomas Hellstrom [Tue, 1 Nov 2011 16:42:21 +0000 (17:42 +0100)]
st/xa: Add a scanout flag for surfaces

Bump minor to signal availability.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agoBuild link_uniforms for android
Eugeni Dodonov [Tue, 1 Nov 2011 17:04:01 +0000 (15:04 -0200)]
Build link_uniforms for android

Otherwise android-x86 build fails.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agollvmpipe: Re-advertise support for stencil formats...
José Fonseca [Tue, 1 Nov 2011 12:28:47 +0000 (12:28 +0000)]
llvmpipe: Re-advertise support for stencil formats...

"no fetch_rgba_float for uint formats" => "llvmpipe does not support uint formats"

"stencil == uint" => "llvmpipe does not support stencil"

12 years agollvmpipe: Use -1 instead of ~0 for "no slot".
José Fonseca [Mon, 31 Oct 2011 19:35:55 +0000 (19:35 +0000)]
llvmpipe: Use -1 instead of ~0 for "no slot".

As the value of unsigned ~0 depends on the bit-width.

Fixes fdo 42411.

12 years agodocs: update relnotes-7.12
Marek Olšák [Sat, 29 Oct 2011 12:33:08 +0000 (14:33 +0200)]
docs: update relnotes-7.12

12 years agodri/nouveau: Enable NV_fog_distance on NV10 and NV20 hardware
Nicholas Miell [Tue, 20 Sep 2011 13:20:39 +0000 (15:20 +0200)]
dri/nouveau: Enable NV_fog_distance on NV10 and NV20 hardware

Add support for NV_fog_distance to the NV10 and NV20 drivers.

[ Francisco Jerez: Fix fog coord. signedness for
  GL_EYE_RADIAL_NV/GL_EYE_PLANE on nv20 ]

12 years agost/mesa: Enable NV_fog_distance for Gallium drivers
Nicholas Miell [Tue, 20 Sep 2011 06:17:01 +0000 (23:17 -0700)]
st/mesa: Enable NV_fog_distance for Gallium drivers

The fixed-function generated vertex program is all that's needed for
Gallium drivers.

12 years agomesa: Add NV_fog_distance to the fixed-function vertex program generator
Nicholas Miell [Tue, 20 Sep 2011 06:17:00 +0000 (23:17 -0700)]
mesa: Add NV_fog_distance to the fixed-function vertex program generator

This is all that is needed to implement NV_fog_distance on programmable
hardware.

12 years agomesa: Add the basics for the NV_fog_distance extension
Nicholas Miell [Tue, 20 Sep 2011 06:16:59 +0000 (23:16 -0700)]
mesa: Add the basics for the NV_fog_distance extension

No driver implements it yet.

12 years agoralloc: Use _vscprintf on MinGW.
José Fonseca [Tue, 1 Nov 2011 06:58:29 +0000 (06:58 +0000)]
ralloc: Use _vscprintf on MinGW.

MinGW uses MSVC's runtime DLLs for most of C runtime's functions, and
there has same semantics for vsnprintf.

Not sure how this worked until now -- maybe one of the internal
vsnprintf implementations was taking precedence.

12 years agosvga: Fix potential buffer overflow in rs draw state.
José Fonseca [Mon, 31 Oct 2011 19:26:53 +0000 (19:26 +0000)]
svga: Fix potential buffer overflow in rs draw state.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agollvmpipe: Remove unsed variables.
José Fonseca [Mon, 31 Oct 2011 19:36:07 +0000 (19:36 +0000)]
llvmpipe: Remove unsed variables.

12 years agoutil: Add missing initializer.
José Fonseca [Mon, 31 Oct 2011 19:04:08 +0000 (19:04 +0000)]
util: Add missing initializer.

12 years agoi965: Fix flat integral varyings.
Paul Berry [Tue, 25 Oct 2011 00:46:26 +0000 (17:46 -0700)]
i965: Fix flat integral varyings.

Previously, the vertex and fragment shader back-ends assumed that all
varyings were floats.  In GLSL 1.30 this is no longer true--they can
also be of integral types provided that they have an interpolation
qualifier of "flat".

This required two changes in each back-end: assigning the correct type
to the register that holds the varying value during shader execution,
and assigning the correct type to the register that ties the varying
value to the rest of the graphics pipeline (the message register in
the case of VS, and the payload register in the case of FS).

Fixes piglit tests fs-int-interpolation and fs-uint-interpolation.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Add glsl_type::get_scalar_type() function.
Paul Berry [Tue, 25 Oct 2011 23:24:03 +0000 (16:24 -0700)]
mesa: Add glsl_type::get_scalar_type() function.

This function is similar to get_base_type(), but when called on
arrays, it returns the scalar type composing the array.  For example,
glsl_type(vec4[]) => float_type.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/gen6+: Switch GLSL from ALT to IEEE floating point mode
Paul Berry [Sat, 8 Oct 2011 00:37:32 +0000 (17:37 -0700)]
i965/gen6+: Switch GLSL from ALT to IEEE floating point mode

i965 graphics hardware has two floating point modes: ALT and IEEE.  In
ALT mode, floating-point operations never generate infinities or NaNs,
and MOV instructions translate infinities and NaNs to finite values.
In IEEE mode, infinities and NaNs behave as specified in the IEEE 754
spec.

Previously, we used ALT mode for all vertex and fragment programs,
whether they were GLSL programs or ARB programs.  The GLSL spec is
sufficiently vague about how infs and nans are to be handled that it
was unclear whether this mode was compliant with the GLSL 1.30 spec or
not, and it made it very difficult to test the isinf() and isnan()
functions.

This patch changes i965 GLSL programs to use IEEE floating-point mode,
which is clearly compliant with GLSL 1.30's inf/nan requirements.  In
addition to making the Piglit isinf and isnan tests pass, this paves
the way for future support of the ARB_shader_precision extension.

Unfortunately we still have to use ALT floating-point mode when
executing ARB programs, because those programs require 0^0 == 1, and
i965 hardware generates 0^0 == NaN in IEEE mode.

Fixes piglit tests "isinf-and-isnan fs_fbo", "isinf-and-isnan vs_fbo",
and {fs,vs}-{isinf,isnan}-{vec2,vec3,vec4}.

12 years agoglsl: Add isinf() and isnan() builtins.
Paul Berry [Thu, 6 Oct 2011 17:20:10 +0000 (10:20 -0700)]
glsl: Add isinf() and isnan() builtins.

The implementations are as follows:

isinf(x) = (abs(x) == +infinity)
isnan(x) = (x != x)

Note: the latter formula is not necessarily obvious.  It works because
NaN is the only floating point number that does not equal itself.

Fixes piglit tests "isinf-and-isnan fs_basic" and "isinf-and-isnan
vs_basic".

12 years agoglsl: Add '.ir' extension to builtin IR files
Paul Berry [Thu, 6 Oct 2011 17:31:34 +0000 (10:31 -0700)]
glsl: Add '.ir' extension to builtin IR files

This patch adds the extension '.ir' to all the files in
src/glsl/builtins/ir/, and changes generate_builtins.py so that it no
longer globs on '*' to find the files to build.  This prevents
spurious files (such as EMACS' infamous *~ backup files) from breaking
the build.

12 years agoglsl: Fix copy-paste error in constant_expression_value(ir_binop_nequal)
Paul Berry [Thu, 6 Oct 2011 18:28:42 +0000 (11:28 -0700)]
glsl: Fix copy-paste error in constant_expression_value(ir_binop_nequal)

The implementation of ir_binop_nequal in constant_expression_value()
appears to have been copy-and-pasted from the implementation of
ir_binop_equal, but with all instances of '==' changed to '!='.  This
is correct except for one minor flaw: one of those '==' operators was
in an assertion checking that the types of the two arguments were
equal.  That one needs to stay an '=='.

Fixes piglit tests {fs,vs}-inline-notequal.

12 years agodocs: list GL_ARB_texture_storage in 7.12 release notes
Brian Paul [Mon, 31 Oct 2011 16:52:57 +0000 (10:52 -0600)]
docs: list GL_ARB_texture_storage in 7.12 release notes

12 years agomesa: add note about immutable textures for _mesa_test_texobj_completeness()
Brian Paul [Mon, 31 Oct 2011 16:52:57 +0000 (10:52 -0600)]
mesa: add note about immutable textures for _mesa_test_texobj_completeness()

12 years agoswrast: implement GL_ARB_texture_storage
Brian Paul [Mon, 31 Oct 2011 16:52:57 +0000 (10:52 -0600)]
swrast: implement GL_ARB_texture_storage

12 years agost/mesa: implement GL_ARB_texture_storage
Brian Paul [Mon, 31 Oct 2011 16:52:57 +0000 (10:52 -0600)]
st/mesa: implement GL_ARB_texture_storage

12 years agomesa: plug in dispatch functions for GL_ARB_texture_storage
Brian Paul [Mon, 31 Oct 2011 16:52:57 +0000 (10:52 -0600)]
mesa: plug in dispatch functions for GL_ARB_texture_storage

12 years agomesa: compile new texstore.c file
Brian Paul [Mon, 31 Oct 2011 16:52:56 +0000 (10:52 -0600)]
mesa: compile new texstore.c file

12 years agomesa: init extension entry for GL_ARB_texture_storage
Brian Paul [Mon, 31 Oct 2011 16:52:56 +0000 (10:52 -0600)]
mesa: init extension entry for GL_ARB_texture_storage

12 years agomesa: display list dispatch for GL_ARB_texture_storage
Brian Paul [Mon, 31 Oct 2011 16:52:56 +0000 (10:52 -0600)]
mesa: display list dispatch for GL_ARB_texture_storage

12 years agomesa: new glTexImage error checks for GL_ARB_texture_storage
Brian Paul [Mon, 31 Oct 2011 16:52:56 +0000 (10:52 -0600)]
mesa: new glTexImage error checks for GL_ARB_texture_storage

If the texture memory was allocated with glTexStorage1/2/3D() we can
only change the image data with glTexSubImage calls.

12 years agomesa: glGetTexParameter support for GL_ARB_texture_storage
Brian Paul [Mon, 31 Oct 2011 16:52:56 +0000 (10:52 -0600)]
mesa: glGetTexParameter support for GL_ARB_texture_storage

12 years agomesa: implement new functions for GL_ARB_texture_storage
Brian Paul [Mon, 31 Oct 2011 16:52:56 +0000 (10:52 -0600)]
mesa: implement new functions for GL_ARB_texture_storage

This is the glTexStorage1D/2D/3D() functions.  Basically do error
checking then call the driver hook to actually allocate memory.

12 years agoglapi: regenerated API files for GL_ARB_texture_storage
Brian Paul [Mon, 31 Oct 2011 16:52:56 +0000 (10:52 -0600)]
glapi: regenerated API files for GL_ARB_texture_storage

12 years agoglapi: new API specs for GL_ARB_texture_storage
Brian Paul [Mon, 31 Oct 2011 16:52:56 +0000 (10:52 -0600)]
glapi: new API specs for GL_ARB_texture_storage

12 years agomesa: add new driver hook for AllocTextureStorage()
Brian Paul [Mon, 31 Oct 2011 16:52:56 +0000 (10:52 -0600)]
mesa: add new driver hook for AllocTextureStorage()

12 years agomesa: add new fields for GL_ARB_texture_storage
Brian Paul [Mon, 31 Oct 2011 16:52:56 +0000 (10:52 -0600)]
mesa: add new fields for GL_ARB_texture_storage

12 years agosvga: Flush the hwtnl primitives before writing to buffers.
José Fonseca [Thu, 27 Oct 2011 18:09:25 +0000 (19:09 +0100)]
svga: Flush the hwtnl primitives before writing to buffers.

svga keeps a small queue of similar primitive draws in order to coalesce
them into a single draw primitive command.

But the buffers referred in primitives not yet emitted were being ignored
in the considerations to flush or not the context.

This fixes piglit vbo-map-remap, vbo-subdata-sync, vbo-subdata-zero, and
Seeker.

Based on investigation and patch from Brian Paul.

Reviewed-By: Brian Paul <brianp@vmware.com>
12 years agost/xa: Plug a pipe context leak.
Thomas Hellstrom [Mon, 31 Oct 2011 13:01:39 +0000 (14:01 +0100)]
st/xa: Plug a pipe context leak.

Forgot to destroy the pipe context on xa context destroy.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agopipebuffer/debug: Fix a recursive mutex lock
Thomas Hellstrom [Mon, 31 Oct 2011 11:14:05 +0000 (12:14 +0100)]
pipebuffer/debug: Fix a recursive mutex lock

pb_debug_manager_dump was trying to take a lock already
held by all callers.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agoradeon/r200: drop remains of r300/r600 support along with old drm 1.x kernel
Dave Airlie [Sat, 29 Oct 2011 07:39:54 +0000 (08:39 +0100)]
radeon/r200: drop remains of r300/r600 support along with old drm 1.x kernel

This drops all the old drmSupports* checks since KMS does them all, and it
also drop R300_CLASS and R600_CLASS.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agollvmpipe: fix a crash in non-SSE path
Chia-I Wu [Fri, 23 Sep 2011 03:40:49 +0000 (11:40 +0800)]
llvmpipe: fix a crash in non-SSE path

It is a typo went unnoticed.

12 years agointel: enable GL_OES_draw_texture
Chia-I Wu [Sun, 21 Aug 2011 13:47:39 +0000 (21:47 +0800)]
intel: enable GL_OES_draw_texture

12 years agometa: add _mesa_meta_DrawTex()
Chia-I Wu [Sun, 21 Aug 2011 13:08:25 +0000 (21:08 +0800)]
meta: add _mesa_meta_DrawTex()

It is set to dd->DrawTex.

Reviewed-by: Brian Paul <brianp@vmware.com>
[olv: set dd->DrawTex in _mesa_init_driver_functions]

12 years agor600g: reset the render condition to NULL when rendering unconditionally
Marek Olšák [Sat, 29 Oct 2011 14:19:45 +0000 (16:19 +0200)]
r600g: reset the render condition to NULL when rendering unconditionally

12 years agor600g: shortcut ctx->screen->ws to ctx->ws
Marek Olšák [Sat, 29 Oct 2011 15:56:12 +0000 (17:56 +0200)]
r600g: shortcut ctx->screen->ws to ctx->ws

12 years agoi965: Remove the prepare() hook from state atoms.
Eric Anholt [Sat, 22 Oct 2011 19:16:44 +0000 (12:16 -0700)]
i965: Remove the prepare() hook from state atoms.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Remove the memcpy()ed atoms array now that everything is emit()-based.
Eric Anholt [Sat, 22 Oct 2011 19:16:05 +0000 (12:16 -0700)]
i965: Remove the memcpy()ed atoms array now that everything is emit()-based.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Merge brw_validate_state() and brw_upload_state() together.
Eric Anholt [Sat, 22 Oct 2011 19:11:27 +0000 (12:11 -0700)]
i965: Merge brw_validate_state() and brw_upload_state() together.

They were called back-to-back at this point.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Remove state upload code for calling prepare() now that there are none.
Eric Anholt [Sat, 22 Oct 2011 19:02:37 +0000 (12:02 -0700)]
i965: Remove state upload code for calling prepare() now that there are none.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Remove some old texturing debug code.
Eric Anholt [Sat, 22 Oct 2011 19:03:36 +0000 (12:03 -0700)]
i965: Remove some old texturing debug code.

It caught one possible bug I recall in my time working on the driver,
and we haven't been setting it for non-fixed-function since the new FS
backend came along.  The bug it caught was likely a confusion about
sampler mappings, which we have tests for these days.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Finally, move the global fallbacks check to emit() time.
Eric Anholt [Sat, 22 Oct 2011 18:57:44 +0000 (11:57 -0700)]
i965: Finally, move the global fallbacks check to emit() time.

This was the last prepare() function, and it's the first state atom,
so it must be ready to move.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Move index buffer upload to emit() time.
Eric Anholt [Sat, 22 Oct 2011 18:54:32 +0000 (11:54 -0700)]
i965: Move index buffer upload to emit() time.

It's consumed by the brw_emit_index_buffer() code at emit() time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Do a hack job of merging VB prepare()/emit() together.
Eric Anholt [Sat, 22 Oct 2011 18:35:56 +0000 (11:35 -0700)]
i965: Do a hack job of merging VB prepare()/emit() together.

I don't really want to touch this impenetrable code in this series, so
just call the one function from the other, since no other atom cares
about them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Move the WM input sizes calculation to emit() time.
Eric Anholt [Sat, 22 Oct 2011 18:34:49 +0000 (11:34 -0700)]
i965: Move the WM input sizes calculation to emit() time.

It's used for program compile.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Move program compile to emit() time.
Eric Anholt [Sat, 22 Oct 2011 18:33:54 +0000 (11:33 -0700)]
i965: Move program compile to emit() time.

Only 4 other prepare() functions are left, which don't rely on this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965/gen4: Move CURBE offset calculation to emit() time.
Eric Anholt [Sat, 22 Oct 2011 18:32:05 +0000 (11:32 -0700)]
i965/gen4: Move CURBE offset calculation to emit() time.

This is consumed by the unit state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965/gen4: Fold push constant prepare()/emit() together.
Eric Anholt [Sat, 22 Oct 2011 18:21:51 +0000 (11:21 -0700)]
i965/gen4: Fold push constant prepare()/emit() together.

While other units need to know about our constant buffer offsets,
nothing else cared about which particular BO other than the emit() half.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965/gen6: Move viewport state setup to emit() time.
Eric Anholt [Sat, 22 Oct 2011 18:18:56 +0000 (11:18 -0700)]
i965/gen6: Move viewport state setup to emit() time.

Only the emit() for the pointers into the batch later in this file
cares.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965/gen4: Move URB fence recalculate to emit() time.
Eric Anholt [Sat, 22 Oct 2011 18:25:15 +0000 (11:25 -0700)]
i965/gen4: Move URB fence recalculate to emit() time.

This is used by the unit state, which is at emit() time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Fold the gen6/7 URB state prepare()/emit() together.
Eric Anholt [Sat, 22 Oct 2011 18:17:27 +0000 (11:17 -0700)]
i965: Fold the gen6/7 URB state prepare()/emit() together.

No other unit cares about the prepare state, unlike gen4-5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Move VS pull constant upload to emit() time.
Eric Anholt [Sat, 22 Oct 2011 18:14:02 +0000 (11:14 -0700)]
i965: Move VS pull constant upload to emit() time.

Only needed by the emit() for VS surfaces.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Fold prepare() and emit() of VS surface state setup together.
Eric Anholt [Sat, 22 Oct 2011 18:12:43 +0000 (11:12 -0700)]
i965: Fold prepare() and emit() of VS surface state setup together.

This rearranges the code a bit, and makes the upload of the binding
table take only as many surfaces as there are in use.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Move WM pull constant setup to emit() time.
Eric Anholt [Sat, 22 Oct 2011 18:07:40 +0000 (11:07 -0700)]
i965: Move WM pull constant setup to emit() time.

It's needed by the WM surface state setup, which is now emit().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965/gen7: Fold WM surface state prepare()/emit() together.
Eric Anholt [Sat, 22 Oct 2011 18:07:00 +0000 (11:07 -0700)]
i965/gen7: Fold WM surface state prepare()/emit() together.

These produce BRW_NEW_SURFACES (used by binding table emit()) and
BRW_NEW_NR_WM_SURFACES (used by WM unit emit()).  Fixes a bug where
with no texturing and no color buffer, we wouldn't consider the null
renderbuffer in nr_surfaces.  This was harmless because nr_surfaces is
only used for the prefetch info in the unit state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965/gen4: Fold WM surface state prepare()/emit() together.
Eric Anholt [Sat, 22 Oct 2011 18:01:40 +0000 (11:01 -0700)]
i965/gen4: Fold WM surface state prepare()/emit() together.

These produce BRW_NEW_SURFACES (used by binding table emit()) and
BRW_NEW_NR_WM_SURFACES (used by WM unit emit()).  Fixes a bug where
with no texturing and no color buffer, we wouldn't consider the null
renderbuffer in nr_surfaces.  This was harmless because nr_surfaces is
only used for the prefetch info in the unit state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Move sampler state to emit() time.
Eric Anholt [Sat, 22 Oct 2011 18:23:59 +0000 (11:23 -0700)]
i965: Move sampler state to emit() time.

This is consumed by the WM unit, which is already at emit().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965/gen4: Move unit state setup to emit() time.
Eric Anholt [Sat, 22 Oct 2011 17:51:34 +0000 (10:51 -0700)]
i965/gen4: Move unit state setup to emit() time.

It is only needed in time for brw_psp_urb_cbs(), which is also an emit().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965/gen7: Fold prepare() and emit() of SF CLIP/VP state together.
Eric Anholt [Sat, 22 Oct 2011 17:53:18 +0000 (10:53 -0700)]
i965/gen7: Fold prepare() and emit() of SF CLIP/VP state together.

The prepare() only made state for its emit(), not anybody else.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965/gen4: Move CC VP to emit() time, since it's only needed by CC's emit().
Eric Anholt [Sat, 22 Oct 2011 17:48:26 +0000 (10:48 -0700)]
i965/gen4: Move CC VP to emit() time, since it's only needed by CC's emit().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Move push constants setup to emit() time.
Eric Anholt [Sat, 22 Oct 2011 17:43:05 +0000 (10:43 -0700)]
i965: Move push constants setup to emit() time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965/gen6: Move setup of CC state batches to emit time.
Eric Anholt [Sat, 22 Oct 2011 17:37:14 +0000 (10:37 -0700)]
i965/gen6: Move setup of CC state batches to emit time.

This is part of a series trying to eliminate the separate prepare()
hook in state upload.  The prepare() hook existed to support the
check_aperture in between calculating state updates and setting up the
batch, but there should be no reason for that any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Check Fallback again after upload.
Eric Anholt [Sat, 22 Oct 2011 18:56:01 +0000 (11:56 -0700)]
i965: Check Fallback again after upload.

As we move state to emit() time from prepare() time, a couple of the
places that flag fallbacks will move here.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Remove the validated BO list, now that it's unused.
Eric Anholt [Sat, 22 Oct 2011 16:40:38 +0000 (09:40 -0700)]
i965: Remove the validated BO list, now that it's unused.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Use the batch save/reset code to avoid needing the BO validate step.
Eric Anholt [Sat, 22 Oct 2011 16:37:57 +0000 (09:37 -0700)]
i965: Use the batch save/reset code to avoid needing the BO validate step.

We were doing the BO validate step in prepare() (brw_validate_state())
hooks of atoms so that we could check_aperture before emitting the
relocation trees during brw_upload_state() that would actually make
the batchbuffer reference too much memory to be executed.  Now that
all relocations occur in the batchbuffer, we can instead
check_aperture after emitting our state into the batchbuffer, and
easily roll back, flush, and retry if we happened to go over the
limits.

This will let us remove the whole prepare() vs emit() split in our
state atoms, which is a source of tricky dependencies and duplicated
code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agointel: Return error value from intel_batchbuffer_flush().
Eric Anholt [Sat, 22 Oct 2011 17:33:24 +0000 (10:33 -0700)]
intel: Return error value from intel_batchbuffer_flush().

This will let the caller do something sensible on error, if it cares.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi965: Add a note about an unsafe-looking state check.
Eric Anholt [Sat, 22 Oct 2011 02:08:55 +0000 (19:08 -0700)]
i965: Add a note about an unsafe-looking state check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agointel: Add an interface for saving/restoring the batchbuffer state.
Eric Anholt [Sat, 22 Oct 2011 02:01:17 +0000 (19:01 -0700)]
intel: Add an interface for saving/restoring the batchbuffer state.

This will be used to avoid the prepare() step in the i965 driver's
state setup.  Instead, we can just speculatively emit the primitive
into the batchbuffer, then check if the batch is too big, rollback and
flush, and replay the primitive.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoi915: Move the always_flush_cache code to triangle emit.
Eric Anholt [Fri, 21 Oct 2011 23:32:03 +0000 (16:32 -0700)]
i915: Move the always_flush_cache code to triangle emit.

This could have broken always_flush_cache on i965, since
reserved_space doesn't reflect the size of the workaround flushes, and
we might run out of space.  This should make always_flush_cache more
useful on pre-i965, anyway (since the point is to flush around each
draw call, even within a batchbuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
12 years agoglsl: Fix compilation of glsl_lexer.ll with MSVC.
Morgan Armand [Sat, 29 Oct 2011 17:37:58 +0000 (10:37 -0700)]
glsl: Fix compilation of glsl_lexer.ll with MSVC.

strtoull is not supported on msvc (as there is no C99 support).

12 years agor600g: Replace needless flush in texture upload.
Mathias Fröhlich [Tue, 26 Jul 2011 05:05:10 +0000 (07:05 +0200)]
r600g: Replace needless flush in texture upload.

Replace pipe->flush() with pipe->texture_barrier() in
the texture upload path for the staging texture.
This should be enough to get data out of the gpu
caches ready to be read for texture fetch.

12 years agor600g: remove one pointless flush
Marek Olšák [Fri, 28 Oct 2011 17:24:16 +0000 (19:24 +0200)]
r600g: remove one pointless flush

It's not useful for anything.
The rest of the patch is just a cleanup resulting
from some of the variables being no longer used.

There are no piglit regressions.

12 years agoradeon/r200: forgot one somehow
Dave Airlie [Sat, 29 Oct 2011 07:15:00 +0000 (08:15 +0100)]
radeon/r200: forgot one somehow

drops last usage.

12 years agoradeon/r200: drop remains of non-libdrm_radeon build
Dave Airlie [Sat, 29 Oct 2011 07:11:37 +0000 (08:11 +0100)]
radeon/r200: drop remains of non-libdrm_radeon build

These wrappers and associated symlinks were from the non-libdrm_radeon build.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa/st: get interpolation mode from the fragment shader.
Dave Airlie [Fri, 28 Oct 2011 16:18:15 +0000 (17:18 +0100)]
mesa/st: get interpolation mode from the fragment shader.

With the recent changes to interpolation stuff, we can now get the value
direct from the program instead of just being fail.

fixes some of the glsl-1.30 interpolation tests with softpipe

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoglx: Don't enable INTEL_swap_event unconditionally
Adam Jackson [Sat, 29 Oct 2011 00:38:32 +0000 (20:38 -0400)]
glx: Don't enable INTEL_swap_event unconditionally

DRI2 supports this now - and already enables it explicitly - but drisw
does not and should not.  Otherwise toolkits like clutter will only ever
SwapBuffers once and wait forever for an event that's not coming.

Signed-off-by: Adam Jackson <ajax@redhat.com>
12 years agoimplement WGL_ARB_create_context
Morgan Armand [Fri, 28 Oct 2011 13:42:29 +0000 (06:42 -0700)]
implement WGL_ARB_create_context

Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agor600g: get backend mask after the context is fully set up
Marek Olšák [Fri, 28 Oct 2011 20:31:34 +0000 (22:31 +0200)]
r600g: get backend mask after the context is fully set up

12 years agoir_to_mesa: Let check_resources halt compilation
Ian Romanick [Tue, 11 Oct 2011 23:27:41 +0000 (16:27 -0700)]
ir_to_mesa: Let check_resources halt compilation

Previously check_resources could fail, but we'd still try to optimize
the shader, do device-specific code generation, etc.  In some cases,
this could explode (especially in the device-specific code
generation).  I haven't found that I could trigger this with the
current code.  When too many samplers were used with the new uniform
handling code, I observed several crashes deep down in the driver.

NOTE: This is candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41609
Cc: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Use glsl_type::column_type instead of open-coding it
Ian Romanick [Sat, 22 Oct 2011 01:22:42 +0000 (18:22 -0700)]
i965: Use glsl_type::column_type instead of open-coding it

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Clean-up spurious error message on bad structure definitions
Ian Romanick [Wed, 26 Oct 2011 00:49:07 +0000 (17:49 -0700)]
glsl: Clean-up spurious error message on bad structure definitions

Previously a shader like

int X;
struct X { int i; };

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

would generate two error message:

0:2(19): error: struct `X' previously defined
0:2(20): error: incomplete declaration

The first one is the real error, and the second is spurious.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Generate an error for array-of-array declarations
Ian Romanick [Mon, 24 Oct 2011 18:45:50 +0000 (11:45 -0700)]
glsl: Generate an error for array-of-array declarations

Other parts of the code already caught things like 'float x[4][2]'.
However, nothing caught 'float [4] x[2]'.

Fixes piglit test array-multidimensional-new-syntax.vert.

NOTE: This is candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agor300c/compiler: remove the compiler too
Marek Olšák [Fri, 28 Oct 2011 19:27:22 +0000 (21:27 +0200)]
r300c/compiler: remove the compiler too

Gallium has a fork of this.

12 years agoi965/fs: Use the actual hardware g0 register for texel offset setup.
Kenneth Graunke [Thu, 27 Oct 2011 05:41:07 +0000 (22:41 -0700)]
i965/fs: Use the actual hardware g0 register for texel offset setup.

The idea here is to set up the message header with the Sampler State
pointer which the hardware provides as part of the PS Thread Payload in
register g0.

Unfortunately, the existing code

   fs_reg(GRF, 0, BRW_REGISTER_TYPE_UD))

actually references "virtual GRF 0" rather than the hardware g0.  This
is just some arbitrary GRF temporary which will get register allocated.

So, we ended up setting up the header with garbage.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agou_format: Fix -NaN handling for packing of 10F_11F_11F_REV to match GL specs.
Eric Anholt [Wed, 26 Oct 2011 23:23:50 +0000 (16:23 -0700)]
u_format: Fix -NaN handling for packing of 10F_11F_11F_REV to match GL specs.

Fixes the remainder of piglit GL_EXT_packed_float/pack.c

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agou_format: Fix clamping of overflow in 10F_11F_11F_REV to match GL specs.
Eric Anholt [Wed, 26 Oct 2011 23:11:27 +0000 (16:11 -0700)]
u_format: Fix clamping of overflow in 10F_11F_11F_REV to match GL specs.

Fixes the 1000000.0 overflow cases of piglit
GL_EXT_packed_float/pack.c

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agomesa: Don't do [0, 1] clamping on glGetTexImage() of packed float formats.
Eric Anholt [Wed, 26 Oct 2011 23:09:16 +0000 (16:09 -0700)]
mesa: Don't do [0, 1] clamping on glGetTexImage() of packed float formats.

From the GL_EXT_packed_float spec:

    For an RGBA color, if <type> is not one of FLOAT,
    UNSIGNED_INT_5_9_9_9_REV_EXT, or UNSIGNED_INT_10F_11F_11F_REV_EXT,
    or if the CLAMP_READ_COLOR_ARB is TRUE, or CLAMP_READ_COLOR_ARB
    is FIXED_ONLY_ARB and the selected color (or texture) buffer is
    a fixed-point buffer, each component is first clamped to [0,1].
    Then the appropriate conversion formula from table 4.7 is applied
    the component."

(but we previously resolved that the CLAMP_READ_COLOR bit is not
relevant to glGetTexImage())

This fixes most of the cases in piglit GL_EXT_packed_float/pack.

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agou_format: Fix bitshifting for unpacking from 10F.
Eric Anholt [Tue, 25 Oct 2011 23:53:00 +0000 (16:53 -0700)]
u_format: Fix bitshifting for unpacking from 10F.

This code was copy and pasted from the 11F unpacking, but not updated
for actually being 10 bits instead of 11.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41206
Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agou_format: Fix bit definition of UF10_MANTISSA_BITS.
Eric Anholt [Tue, 25 Oct 2011 23:50:44 +0000 (16:50 -0700)]
u_format: Fix bit definition of UF10_MANTISSA_BITS.

This is only used in the code for packing to INF, and resulted in an
extra bit set that was set anyway, so it was harmless except for the
confusion caused.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl: Implement GLSL 1.30's literal integer range restrictions.
Eric Anholt [Mon, 3 Oct 2011 23:59:01 +0000 (16:59 -0700)]
glsl: Implement GLSL 1.30's literal integer range restrictions.

From page 22 (28 of PDF) of GLSL 1.30 spec:
    It is an error to provide a literal integer whose magnitude is too
    large to store in a variable of matching signed or unsigned type.

    Unsigned integers have exactly 32 bits of precision.  Signed integers
    use 32 bits, including a sign bit, in two's complement form.

Fixes piglit int-literal-too-large-0[123].frag.

v2: Take care with INT_MIN, use stroull, and make it a function.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoradeon: Remove the non-libdrm kernel memory manager support.
Eric Anholt [Fri, 14 Oct 2011 21:50:50 +0000 (14:50 -0700)]
radeon: Remove the non-libdrm kernel memory manager support.

We should have never been building this at this point.