mesa.git
11 years agoi965: Enable MESA_shader_integer_mix.
Matt Turner [Sat, 7 Sep 2013 00:53:39 +0000 (17:53 -0700)]
i965: Enable MESA_shader_integer_mix.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Implement MESA_shader_integer_mix extension.
Matt Turner [Thu, 29 Aug 2013 01:01:39 +0000 (18:01 -0700)]
glsl: Implement MESA_shader_integer_mix extension.

Because why doesn't GLSL allow you to do this already?

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Use conditional-select in mix().
Matt Turner [Fri, 6 Sep 2013 19:36:48 +0000 (12:36 -0700)]
glsl: Use conditional-select in mix().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoi965: Add support for ir_triop_csel.
Matt Turner [Mon, 19 Aug 2013 17:44:41 +0000 (10:44 -0700)]
i965: Add support for ir_triop_csel.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Add conditional-select IR.
Matt Turner [Mon, 19 Aug 2013 17:45:46 +0000 (10:45 -0700)]
glsl: Add conditional-select IR.

It's a ?: that operates per-component on vectors. Will be used in
upcoming lowering pass for ldexp and the implementation of frexp.

 csel(selector, a, b):
   per-component result = selector ? a : b

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Rename ir_function_signature::builtin_info to builtin_avail.
Kenneth Graunke [Mon, 9 Sep 2013 21:53:22 +0000 (14:53 -0700)]
glsl: Rename ir_function_signature::builtin_info to builtin_avail.

builtin_info was originally going to be a structure containing a bunch
of information, but after various rewrites, it turned into a boolean
availability predicate.

builtin_avail is a better name than builtin_info, since it doesn't
store any information other than availability.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agobuild: Delete cross-compiling macros.
Kenneth Graunke [Fri, 6 Sep 2013 00:10:54 +0000 (17:10 -0700)]
build: Delete cross-compiling macros.

Now that builtin_compiler is gone, nothing uses these.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Add missing type inference for ir_binop_bfm.
Kenneth Graunke [Thu, 5 Sep 2013 23:57:29 +0000 (16:57 -0700)]
glsl: Add missing type inference for ir_binop_bfm.

Matt noticed that this was missing.  Nothing uses this currently.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Delete old built-in function generation code.
Kenneth Graunke [Wed, 4 Sep 2013 04:23:18 +0000 (21:23 -0700)]
glsl: Delete old built-in function generation code.

None of this is used anymore.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Remove builtin_compiler from the build system.
Kenneth Graunke [Wed, 4 Sep 2013 04:22:17 +0000 (21:22 -0700)]
glsl: Remove builtin_compiler from the build system.

We don't actually use anything from builtin_function.cpp, so we don't
need to generate it anymore.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Switch to the new built-in function module.
Kenneth Graunke [Mon, 2 Sep 2013 03:48:45 +0000 (20:48 -0700)]
glsl: Switch to the new built-in function module.

All built-ins are now handled by the new code; the old system is dead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Write a new built-in function module.
Kenneth Graunke [Fri, 30 Aug 2013 06:06:39 +0000 (23:06 -0700)]
glsl: Write a new built-in function module.

This creates a new replacement for the existing built-in function code.
The new module lives in builtin_functions.cpp (not builtin_function.cpp)
and exists in parallel with the existing system.  It isn't used yet.

The new built-in function code takes a significantly different approach:

Instead of implementing built-ins via printed IR, build time scripts,
and run time parsing, we now implement them directly in C++, using
ir_builder.  This translates to faster load times, and a much less
complex build system.

It also takes a different approach to built-in availability: each
signature now stores a boolean predicate, which makes it easy to
construct arbitrary expressions based on _mesa_glsl_parse_state's
fields.  This is much more flexible than the old system, and also
easier to use.

Built-ins are also now stored in a single gl_shader object, rather
than being spread out across a number of shaders that need to be linked.
When searching for a matching prototype, we simply consult the
availability predicate.  This also simplifies the code.

v2: Incorporate Matt Turner's feedback: use the new fma() function rather
    than expr().  Don't expose textureQueryLOD() in GLSL 4.00 (since it
    was renamed to textureQueryLod()).  Also correct some #undefs.
v3: Incorporate Paul Berry's feedback: rename legacy to compatibility;
    add comments to explain a few things; fix uvec availability; include
    shaderobj.h instead of repeating the _mesa_new_shader prototype.
v4: Fix lack of TEX_PROJECT on textureProjGrad[Offset] (caught by oglc).
    Add an out_var convenience function (more feedback by Matt Turner).
v5: Rework availability predicates for Lod functions.  They were broken.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Enthusiastically-acked-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Add optional parameters to the ir_factory constructor.
Kenneth Graunke [Wed, 4 Sep 2013 00:07:18 +0000 (17:07 -0700)]
glsl: Add optional parameters to the ir_factory constructor.

Each ir_factory needs an instruction list and memory context in order to
be useful.  Rather than creating an object and manually assigning these,
we can just use optional parameters in the constructor.

This makes it possible to create a ready-to-use factory in one line:

   ir_factory body(&sig->body, mem_ctx);

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Add IR builder shortcuts for a bunch of random opcodes.
Kenneth Graunke [Wed, 4 Sep 2013 00:02:07 +0000 (17:02 -0700)]
glsl: Add IR builder shortcuts for a bunch of random opcodes.

Adding new convenience emitters makes it easier to generate IR involving
these opcodes.

bitfield_insert is particularly useful, since there is no expr() for
quadops.

v2: Add fma() and rename lrp() operands to x/y/a to match the GLSL
    specification (suggested by Matt Turner).  Fix whitespace issues.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Expose IR builder support for arbitrary swizzling.
Kenneth Graunke [Tue, 3 Sep 2013 23:55:37 +0000 (16:55 -0700)]
glsl: Expose IR builder support for arbitrary swizzling.

IR builder already offers a lot of swizzling functions, such as
swizzle_xxxx, swizzle_z, or swizzle_for_size.

The swizzle_xxxx style is convenient if you statically know which
components you want.  swizzle_for_size is great if you want to select
the first few components.  However, if you want to select components
based on, say, a loop counter, none of those are sufficient.

IR builder actually already had support for arbitrary swizzling, but
didn't expose it.  This patch exposes that API.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Add a new ir_builder::dotlike() function.
Kenneth Graunke [Tue, 3 Sep 2013 23:46:05 +0000 (16:46 -0700)]
glsl: Add a new ir_builder::dotlike() function.

dotlike() uses ir_binop_mul for scalars, and ir_binop_dot for vectors.

When generating built-in functions, we often want to use regular
multiply for scalar signatures, and dot() for vector signatures.
ir_binop_dot only works on vectors, so we have to switch opcodes,
even if the code is otherwise identical.  dotlike() makes this easy.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Add IR builder support for generating return statements.
Kenneth Graunke [Tue, 3 Sep 2013 23:44:25 +0000 (16:44 -0700)]
glsl: Add IR builder support for generating return statements.

We use "ret" as the function name since "return" is a C++ keyword, and
"ir_return" is already a class name.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Add IR builder support for conditional assignments.
Kenneth Graunke [Tue, 3 Sep 2013 23:41:42 +0000 (16:41 -0700)]
glsl: Add IR builder support for conditional assignments.

This adds two new signatures:

   assign(lhs, rhs, condition, writemask);
   assign(lhs, rhs, condition);

All the other existing APIs still exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Add IR builder support for triops.
Kenneth Graunke [Tue, 3 Sep 2013 23:37:39 +0000 (16:37 -0700)]
glsl: Add IR builder support for triops.

Now that we have the ir_expression constructor that does type inference,
this is trivial to do.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Add an ir_expression triop constructor with type inference.
Kenneth Graunke [Tue, 3 Sep 2013 18:52:40 +0000 (11:52 -0700)]
glsl: Add an ir_expression triop constructor with type inference.

We already have ir_expression constructors for unary and binary
operations, which automatically infer the type based on the opcode and
operand types.

These are convenient and also required for ir_builder support.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Add missing type inference support for ARB_gpu_shader5 unops.
Kenneth Graunke [Tue, 3 Sep 2013 20:58:04 +0000 (13:58 -0700)]
glsl: Add missing type inference support for ARB_gpu_shader5 unops.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Initialize lod_info in the ir_texture constructor.
Kenneth Graunke [Mon, 2 Sep 2013 06:18:37 +0000 (23:18 -0700)]
glsl: Initialize lod_info in the ir_texture constructor.

This isn't strictly necessary, since creators of ir_texture objects
should set LOD when relevant.  However, it's nice to have a NULL pointer
in case they forget.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Skip unavailable built-ins when printing out similar candidates.
Kenneth Graunke [Tue, 3 Sep 2013 06:14:43 +0000 (23:14 -0700)]
glsl: Skip unavailable built-ins when printing out similar candidates.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Skip unavailable built-ins when matching signatures.
Kenneth Graunke [Sat, 31 Aug 2013 06:15:59 +0000 (23:15 -0700)]
glsl: Skip unavailable built-ins when matching signatures.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Pass _mesa_glsl_parse_state into matching_signature and such.
Kenneth Graunke [Sat, 31 Aug 2013 06:11:55 +0000 (23:11 -0700)]
glsl: Pass _mesa_glsl_parse_state into matching_signature and such.

During compilation, we'll use this to determine built-in availability.
The plan is to have a single shader containing every built-in in every
version of the language, but filter out the ones that aren't actually
available to the shader being compiled.

At link time, we don't actually need this filtering capability: we've
already imported prototypes for every built-in that the shader actually
calls, and they're flagged as is_builtin().  The linker doesn't import
any additional prototypes, so it won't pull in any unavailable
built-ins.  When resolving prototypes to function definitions, the
linker ensures the values of is_builtin() match, which means that a
shader can't trick the linker into importing the body of an unavailable
built-in by defining a suspiciously similar prototype.

In other words, during linking, we can just pass in NULL.  It will work
out fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Add a method to tell whether a built-in is available.
Kenneth Graunke [Fri, 30 Aug 2013 07:06:30 +0000 (00:06 -0700)]
glsl: Add a method to tell whether a built-in is available.

We can simply call the stored predicate function.  If state is NULL,
just report that the function is available.

v2: Add a comment (requested by Paul Berry).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Mark _mesa_glsl_parse_state::is_version() as const.
Kenneth Graunke [Fri, 30 Aug 2013 08:07:37 +0000 (01:07 -0700)]
glsl: Mark _mesa_glsl_parse_state::is_version() as const.

This promises the method won't modify the contents of the object.
This allows us to call it even with a const pointer to the state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Convert ir_function_signature::is_builtin to a method.
Kenneth Graunke [Fri, 30 Aug 2013 23:12:55 +0000 (16:12 -0700)]
glsl: Convert ir_function_signature::is_builtin to a method.

A signature is a built-in if and only if builtin_info != NULL, so we
don't actually need a separate flag bit.  Making a boolean-valued
method allows existing code to ask the same question while not worrying
about the internal representation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Store a predicate for whether a built-in signature is available.
Kenneth Graunke [Fri, 30 Aug 2013 23:00:43 +0000 (16:00 -0700)]
glsl: Store a predicate for whether a built-in signature is available.

For the upcoming built-in function rewrite, we'll need to be able to
answer "Is this built-in function signature available?".

This is actually a somewhat complex question, since it depends on the
language version, GLSL vs. GLSL ES, enabled extensions, and the current
shader stage.

Storing such a set of constraints in a structure would be painful, so
instead we store a function pointer.  When creating a signature, we
simply point to a predicate that inspects _mesa_glsl_parse_state and
answers whether the signature is available in the current shader.

Unfortunately, IR reader doesn't actually know when built-in functions
are available, so this patch makes it lie and say that they're always
present.  This allows us to hook up the new functionality; it just won't
be useful until real data is populated.  In the meantime, the existing
profile mechanism ensures built-ins are available in the right places.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoi965/vec4: Only zero out unused message components when there are any.
Kenneth Graunke [Mon, 9 Sep 2013 18:11:03 +0000 (11:11 -0700)]
i965/vec4: Only zero out unused message components when there are any.

Otherwise, coordinates with four components would result in a MOV
with a destination writemask that has no channels enabled:

mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q };

At best, this is stupid: we emit code that shouldn't do anything.
Worse, it apparently causes GPU hangs (observable with Chris's
textureGather test on CubeArrays.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
11 years agovbo: Implement new gs prim types in vbo_count_tessellated_primitives.
Paul Berry [Wed, 28 Aug 2013 03:51:31 +0000 (20:51 -0700)]
vbo: Implement new gs prim types in vbo_count_tessellated_primitives.

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoi965: Enable AMD_seamless_cubemap_per_texture
Ian Romanick [Wed, 4 Sep 2013 18:15:15 +0000 (11:15 -0700)]
i965: Enable AMD_seamless_cubemap_per_texture

The change is very small.  Do seamless filtering if either the context
enable is set or the sampler enable is set.

The AMD_seamless_cubemap_per_texture says:

    "If TEXTURE_CUBE_MAP_SEAMLESS_ARB is emabled (sic) globally or the
    value of the texture's TEXTURE_CUBE_MAP_SEAMLESS_ARB parameter is
    TRUE, seamless cube map sampling is enabled..."

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa: Always use seamless cubemap filtering in GLES3
Ian Romanick [Wed, 4 Sep 2013 18:09:05 +0000 (11:09 -0700)]
mesa: Always use seamless cubemap filtering in GLES3

Appendix F.2 of the OpenGL ES 3.0.0 spec says:

    "OpenGL ES 3.0 requires that all cube map filtering be
    seamless. OpenGL ES 2.0 specified that a single cube map face be
    selected and used for filtering."

Setting the field only in the context will work fine with sampler
objects (and drivers that support AMD_seamless_cubemap_per_texture)
because seamless filtering is used if *either* the context or the
sampler enable it:

    "If TEXTURE_CUBE_MAP_SEAMLESS_ARB is emabled (sic) globally or the
    value of the texture's TEXTURE_CUBE_MAP_SEAMLESS_ARB parameter is
    TRUE, seamless cube map sampling is enabled..."

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reported-by: Maxence Le Dore <maxence.ledore@gmail.com>
Thanked-by: Maxence Le Dore <maxence.ledore@gmail.com>
11 years agomesa: Don't allow glSamplerParameteriv(GL_TEXTURE_CUBE_MAP_SEAMLESS) in ES
Ian Romanick [Wed, 4 Sep 2013 17:44:55 +0000 (10:44 -0700)]
mesa: Don't allow glSamplerParameteriv(GL_TEXTURE_CUBE_MAP_SEAMLESS) in ES

There is no GL_TEXTURE_CUBE_MAP_SEAMLESS in any version of OpenGL ES or
in any extension that applies to OpenGL ES.  The same error check
already occurs for glTexParameteri.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: Maxence Le Dore <maxence.ledore@gmail.com>
11 years agodocs: initial 9.3 release notes file
Ian Romanick [Wed, 4 Sep 2013 18:27:09 +0000 (11:27 -0700)]
docs: initial 9.3 release notes file

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
11 years agoilo: preliminary GEN 7.5 support
Chia-I Wu [Sun, 6 Oct 2013 17:21:08 +0000 (01:21 +0800)]
ilo: preliminary GEN 7.5 support

This is based on grepping for brw->is_haswell in i965 to see how GEN 7.5
differs from GEN 7.  Slightly tested with Xonotic and some Mesa demos.

11 years agoradeonsi: add berlin pci ids
Alex Deucher [Fri, 25 Jan 2013 00:46:50 +0000 (19:46 -0500)]
radeonsi: add berlin pci ids

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: remove DMA padding
Alex Deucher [Fri, 6 Sep 2013 23:10:27 +0000 (19:10 -0400)]
r600g: remove DMA padding

This is now handled in the winsys.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agoradeon/winsys: pad IBs to a multiple of 8 DWs
Alex Deucher [Fri, 6 Sep 2013 20:43:34 +0000 (16:43 -0400)]
radeon/winsys: pad IBs to a multiple of 8 DWs

This aligns the gfx, compute, and dma IBs to 8 DW boundries.
This aligns the the IB to the fetch size of the CP for optimal
performance. Additionally, r6xx hardware requires at least 4
DW alignment to avoid a hw bug.  This also aligns the DMA
IBs to 8 DW which is required for the DMA engine.  This
alignment is already handled in the gallium driver, but that
patch can be removed now that it's done in the winsys.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: "9.1" <mesa-stable@lists.freedesktop.org>
11 years agogallium, intel: Implements new __DRI_IMAGE_USE_LINEAR and PIPE_BIND_LINEAR flags...
Axel Davy [Thu, 15 Aug 2013 10:47:58 +0000 (12:47 +0200)]
gallium, intel: Implements new __DRI_IMAGE_USE_LINEAR and PIPE_BIND_LINEAR flags to enforce no tiling.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
11 years agomesa: Ensure gl_query_object is fully initialized.
Vinson Lee [Fri, 6 Sep 2013 19:27:11 +0000 (12:27 -0700)]
mesa: Ensure gl_query_object is fully initialized.

278372b47e4db8a022d57f60302eec74819e9341 added the uninitialized pointer
field gl_query_object:Label. A free of this pointer resulted in a crash.

This patch fixes piglit regressions with swrast introduced by
6d8dd59cf53d2f47b817d79204a52bb3a46e8c77.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69047
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agogallivm: support indirect registers on both dimensions
Zack Rusin [Tue, 3 Sep 2013 17:41:30 +0000 (13:41 -0400)]
gallivm: support indirect registers on both dimensions

We support indirect addressing only on the vertex index, but some
shaders also use indirect addressing on attributes. This patch
adds support for indirect addressing on both dimensions inside
gs arrays.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agoi915g: Document fall-through switch
Stéphane Marchesin [Fri, 6 Sep 2013 18:02:25 +0000 (11:02 -0700)]
i915g: Document fall-through switch

Fixes warning reported by Coverity.

11 years agoi915g: Handle i915->batch == NULL correctly in flush
Stéphane Marchesin [Fri, 6 Sep 2013 17:55:16 +0000 (10:55 -0700)]
i915g: Handle i915->batch == NULL correctly in flush

Fixes warning reported by Coverity.

11 years agoi915g: Remove useless comparison
Stéphane Marchesin [Fri, 6 Sep 2013 17:52:44 +0000 (10:52 -0700)]
i915g: Remove useless comparison

Fixes "Macro compares unsigned to 0" defect reported by Coverity.

11 years agoi915g: Fix initial array index
Stéphane Marchesin [Fri, 6 Sep 2013 17:45:27 +0000 (10:45 -0700)]
i915g: Fix initial array index

Fixes "Out-of-bounds read" defect reported by Coverity.

11 years agomesa: add GL_KHR_debug functions to dispatch_sanity.cpp
Brian Paul [Wed, 4 Sep 2013 19:29:36 +0000 (13:29 -0600)]
mesa: add GL_KHR_debug functions to dispatch_sanity.cpp

Fixes 'make check' failures.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agodocs: Add some notes on submitting patches
Timothy Arceri [Thu, 5 Sep 2013 08:54:00 +0000 (02:54 -0600)]
docs: Add some notes on submitting patches

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agor600g/compute: Fix bug in compute memory pool
Tom Stellard [Mon, 26 Aug 2013 20:06:53 +0000 (13:06 -0700)]
r600g/compute: Fix bug in compute memory pool

When adding a new buffer to the beginning of the memory pool, we were
accidentally deleting the buffer that was first in the buffer list.
This was caused by a bug in the memory pool's linked list
implementation.

11 years agor600g/compute: Don't flush the cs in pipe_context::launch_grid()
Tom Stellard [Tue, 27 Aug 2013 00:55:49 +0000 (17:55 -0700)]
r600g/compute: Don't flush the cs in pipe_context::launch_grid()

This is the state tracker's responsibility.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
11 years agoi965: Remove never used DPA2 opcode.
Matt Turner [Thu, 29 Aug 2013 00:14:20 +0000 (17:14 -0700)]
i965: Remove never used DPA2 opcode.

DPA2 is listed in the "Defeatured Instructions" section of the
965 PRM, Volume 4:

"The following instructions are removed from Gen4 implementation mainly
 due to implementation cost/schedule reasons.  They are candidates for
 future generations."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Remove never used RSR and RSL opcodes.
Matt Turner [Thu, 29 Aug 2013 00:03:22 +0000 (17:03 -0700)]
i965: Remove never used RSR and RSL opcodes.

RSR and RSL are listed in the "Defeatured Instructions" section of the
965 PRM, Volume 4:

"The following instructions are removed from Gen4 implementation mainly
 due to implementation cost/schedule reasons.  They are candidates for
 future generations."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl: propagate max_array_access through function calls
Dominik Behr [Wed, 4 Sep 2013 21:40:48 +0000 (14:40 -0700)]
glsl: propagate max_array_access through function calls

Fixes a bug where if an uniform array is passed to a function the accesses
to the array are not propagated so later all but the first vector of the
uniform array are removed in parcel_out_uniform_storage resulting in
broken shaders and out of bounds access to arrays in
brw::vec4_visitor::pack_uniform_registers.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-and-Tested-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dominik Behr <dbehr@chromium.org>
11 years agonv30: fix inconsistent setting of push->user_priv
Ilia Mirkin [Wed, 4 Sep 2013 06:06:05 +0000 (02:06 -0400)]
nv30: fix inconsistent setting of push->user_priv

It's set to &nv30->bufctx everywhere else.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
11 years agoi965/gen7.5: Fix lower bound on number of VS URB entries.
Paul Berry [Sun, 1 Sep 2013 03:23:49 +0000 (20:23 -0700)]
i965/gen7.5: Fix lower bound on number of VS URB entries.

Haswell GT2 and GT3 require the number of vertex shader URB entries to
be at least 64, not 32.

At the moment, we always meet this requirement automatically, because
in the absence of a geometry shader, we assign all available URB space
to the vertex shader.  But when we turn on support for geometry
shaders, this lower limit will become important.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agoi965/vs: Move vs-specific code out of brw_vec4_visitor.cpp.
Paul Berry [Sun, 1 Sep 2013 03:56:06 +0000 (20:56 -0700)]
i965/vs: Move vs-specific code out of brw_vec4_visitor.cpp.

This patch creates a new file brw_vec4_vs_visitor.cpp, to contain code
that is specific to the vertex shader.  Now the organization of vertex
shader and geometry shader visitor code is symmetric: vs-specific code
is in brw_vec4_vs_visitor.cpp, gs-specific code is in
brw_vec4_gs_visitor.cpp, and code shared between vs and gs is in
brw_vec4_visitor.cpp.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/vec4: Make with_writemask() non-static.
Paul Berry [Sun, 1 Sep 2013 03:51:48 +0000 (20:51 -0700)]
i965/vec4: Make with_writemask() non-static.

This will allow it to be shared between brw_vec4_visitor.cpp and
brw_vec4_vs_visitor.cpp (which will be created in the next patch).

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/vs: Move vs-specific code out of brw_vec4.h.
Paul Berry [Sun, 1 Sep 2013 03:40:47 +0000 (20:40 -0700)]
i965/vs: Move vs-specific code out of brw_vec4.h.

Now brw_vec4.h contains only code that is shared between the vertex
and geometry shaders.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/gs: Don't assign gl_Layer its own slot in the VUE map.
Paul Berry [Tue, 3 Sep 2013 20:57:35 +0000 (13:57 -0700)]
i965/gs: Don't assign gl_Layer its own slot in the VUE map.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agoi915g: Implement writemask fixup
Stéphane Marchesin [Thu, 5 Sep 2013 00:55:21 +0000 (17:55 -0700)]
i915g: Implement writemask fixup

The fixup code emulates non-BGRA render targets by adding an
extra instruction at the end of fragment shaders to swizzle the
output. To do this, we also swizzle the blend function. However
an oversight until now was that the writemask wasn't getting
swizzled. This patch fixes that which fixes a bunch of piglit
tests.

11 years agoi915g: Stop calling draw_prepare_shader_outputs
Stéphane Marchesin [Wed, 4 Sep 2013 21:44:49 +0000 (14:44 -0700)]
i915g: Stop calling draw_prepare_shader_outputs

It's not useful on i915g since we don't support primid. Fixes
piglit point tests on i915g.

11 years agoglx: Initialize OpenGL version to 1.0
Rico Schüller [Sun, 1 Sep 2013 19:30:19 +0000 (21:30 +0200)]
glx: Initialize OpenGL version to 1.0

The old code in dri2_glx suffered from a typographical error that caused
the default version to be 2.1 instead of 1.2 (minimum required by the
Linux OpenGL ABI).  drisw_glx had a similar error resulting in a default
version of 0.1.

Some driver/card combinations (r200/RV280, i915/915G) don't support
OpenGL 2.1.  These create in some corner cases an indirect context
instead of a direct context when calling glXCreateContextAttribsARB().
This happens because of a bad default value.  To avoid this, just used
the default value specified by the GLX_ARB_create_context specification:

    "The default values for GLX_CONTEXT_MAJOR_VERSION_ARB and
    GLX_CONTEXT_MINOR_VERSION_ARB are 1 and 0 respectively. In this
    case, implementations will typically return the most recent version
    of OpenGL they support which is backwards compatible with OpenGL 1.0
    (e.g. 3.0, 3.1 + GL_ARB_compatibility, or 3.2 compatibility
    profile)"

Refactor all the default value setting to dri2_convert_glx_attribs, and
make sure the correct defaults are set in that one place.

Signed-off-by: Rico Schüller <kgbricola@web.de>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla http://bugs.winehq.org/show_bug.cgi?id=34238
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
11 years agoi915g: Add more optimizations
Stéphane Marchesin [Wed, 4 Sep 2013 19:03:10 +0000 (12:03 -0700)]
i915g: Add more optimizations

This patch adds liveness analysis to i915g and a couple
optimizations which benefit from it. One interesting
optimization turns (fake) indirect texture accesses into direct
texture accesses (the i915 supports a maximum of 4 indirect
texture accesses). Among other things this fixes a bunch of
piglit tests.

11 years agoglsl: Remove unused prog parameter from tfeedback_decl::init
Ian Romanick [Fri, 30 Aug 2013 22:48:26 +0000 (15:48 -0700)]
glsl: Remove unused prog parameter from tfeedback_decl::init

It looks like commit 53febac removed the last user of that parameter.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Validate qualifiers on VS color outputs with FS color inputs
Ian Romanick [Fri, 30 Aug 2013 22:42:01 +0000 (15:42 -0700)]
glsl: Validate qualifiers on VS color outputs with FS color inputs

The vertex shader color outputs (gl_FrontColor, gl_BackColor,
gl_FrontSecondaryColor, and gl_BackSecondaryColor) don't have the same
names as the matching fragment shader color inputs (gl_Color and
gl_SecondaryColor).  As a result, the qualifiers on them were not being
properly cross validated.

Full spec compliance required ir_variable::used and
ir_variable::assigned be set properly.  Without the preceeding patch,
which fixes the ::clone method to copy them, this will not be the case.

Fixes all of the previously failing piglit
spec/glsl-1.30/linker/interpolation-qualifiers tests.

v2: Update callers of cross_validate_types_and_qualifiers and
cross_validate_front_and_back_color.  The function signature changed in
v2 of a previous patch.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47755

11 years agoglsl: Copy ir_variable::assigned and ir_variable::used fields in ::clone method
Ian Romanick [Fri, 30 Aug 2013 22:27:49 +0000 (15:27 -0700)]
glsl: Copy ir_variable::assigned and ir_variable::used fields in ::clone method

Nothing currently relies on this, but one of the next patches will.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Refactor a bunch of the code out of cross_validate_outputs_to_inputs
Ian Romanick [Fri, 30 Aug 2013 22:41:53 +0000 (15:41 -0700)]
glsl: Refactor a bunch of the code out of cross_validate_outputs_to_inputs

The new function, cross_validate_types_and_qualifiers, will have
multiple callers from this file in future commits.

v2: Don't pass the names of the producer / consumer stages to
cross_validate_types_and_qualifiers.  Instead, pass the types and get
the names only in the error paths.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoglsl: Reallow precision qualifiers on structure members
Ian Romanick [Fri, 30 Aug 2013 21:04:18 +0000 (14:04 -0700)]
glsl: Reallow precision qualifiers on structure members

Changes to the grammar for GL_ARB_shading_language_420pack (commit
6eec502) moved precision qualifiers out of the type_specifier production
chain.  This caused declarations such as:

    struct S {
        lowp float f;
    };

to generate parse errors.  Section 4.1.8 (Structures) of both the GLSL
ES 1.00 spec and GLSL 1.30 specs says:

        "Member declarators may contain precision qualifiers, but may not
        contain any other qualifiers."

So, it sure seems like we shouldn't generate a parse error. :)

Instead of type_specifier, use fully_specified_type in struct members.
However, fully_specified_type allows a lot of other qualifiers that are
not allowed on structure members, so expeclitly disallow them.

Note, this makes struct_declaration look an awful lot like
member_declaration (used for interface blocks).  We may want to
(somehow) unify these rules to reduce code duplication at some point.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68753
Reported-by: Aras Pranckevicius <aras@unity3d.com>
Cc: Aras Pranckevicius <aras@unity3d.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
11 years agomesa: Setup remaining infrastucture and enable KHR_debug
Timothy Arceri [Mon, 26 Aug 2013 09:40:46 +0000 (19:40 +1000)]
mesa: Setup remaining infrastucture and enable KHR_debug

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoglapi: Setup autogeneration infrastructure for KHR_debug
Timothy Arceri [Mon, 26 Aug 2013 09:36:07 +0000 (19:36 +1000)]
glapi: Setup autogeneration infrastructure for KHR_debug

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Remap debug type and severity
Timothy Arceri [Mon, 26 Aug 2013 09:32:16 +0000 (19:32 +1000)]
mesa: Remap debug type and severity

Remap any type or severity exclusive to KHR_debug to
something suitable for ARB_debug_output

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Implement GL_DEBUG_OUTPUT
Timothy Arceri [Mon, 26 Aug 2013 09:02:11 +0000 (19:02 +1000)]
mesa: Implement GL_DEBUG_OUTPUT

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Update builds scripts to build object labels
Timothy Arceri [Mon, 26 Aug 2013 08:08:51 +0000 (18:08 +1000)]
mesa: Update builds scripts to build object labels

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Implement KHR_debug ObjectLabel functions
Timothy Arceri [Wed, 28 Aug 2013 05:11:15 +0000 (15:11 +1000)]
mesa: Implement KHR_debug ObjectLabel functions

V3: make sure to add null terminator when setting label,
generate error when the client specifies an explicit
length that exceeds MAX_LABEL_LENGTH, set label pointer
to NULL when freed, and output correct length in
MAX_LABEL_LENGTH error message.

V2: fixed indentation of comment

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: make _mesa_validate_sync() non-static
Timothy Arceri [Mon, 26 Aug 2013 07:45:06 +0000 (17:45 +1000)]
mesa: make _mesa_validate_sync() non-static

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: free object labels when deleting
Timothy Arceri [Mon, 26 Aug 2013 07:16:08 +0000 (17:16 +1000)]
mesa: free object labels when deleting

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: add debug Label field to several data structures
Timothy Arceri [Mon, 26 Aug 2013 07:08:46 +0000 (17:08 +1000)]
mesa: add debug Label field to several data structures

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: make _mesa_lookup_list() non-static
Timothy Arceri [Mon, 26 Aug 2013 07:07:04 +0000 (17:07 +1000)]
mesa: make _mesa_lookup_list() non-static

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: make _mesa_lookup_arrayobj() non-static
Timothy Arceri [Mon, 26 Aug 2013 07:05:42 +0000 (17:05 +1000)]
mesa: make _mesa_lookup_arrayobj() non-static

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Implement glPushDebugGroup and glPopDebugGroup
Timothy Arceri [Mon, 26 Aug 2013 07:01:16 +0000 (17:01 +1000)]
mesa: Implement glPushDebugGroup and glPopDebugGroup

V4: fixes _mesa_error() compiler warnings (BrianP).

V3: removed C++ style comment

V2: fixed spelling typo in comment

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Add a clone function to mesa hash
Timothy Arceri [Wed, 28 Aug 2013 02:32:18 +0000 (12:32 +1000)]
mesa: Add a clone function to mesa hash

V2: const qualify table parameter

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Share common code between ARB_debug_output and KHR_debug functions
Timothy Arceri [Mon, 26 Aug 2013 06:49:37 +0000 (16:49 +1000)]
mesa: Share common code between ARB_debug_output and KHR_debug functions

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Add some constants and state variables for KHR_debug functions
Timothy Arceri [Mon, 26 Aug 2013 06:39:46 +0000 (16:39 +1000)]
mesa: Add some constants and state variables for KHR_debug functions

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Rename gl_context::swtnl_im to vbo_context; use proper type.
Kenneth Graunke [Thu, 21 Mar 2013 06:58:03 +0000 (23:58 -0700)]
mesa: Rename gl_context::swtnl_im to vbo_context; use proper type.

The main GL context's swtnl_im field is the VBO module's vbo_context
structure.  Using the name "swtnl" in the name is confusing since
some drivers use hardware texturing and lighting, but still rely on the
VBO module for drawing.

v2: Forward declare the type and use that instead of void *
    (suggested by Eric Anholt).
v3: Remove unnecessary cast (pointed out by by Topi Pohjolainen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoi965: Rename "prim" parameter to "prims" where it's an array.
Kenneth Graunke [Wed, 28 Aug 2013 21:59:03 +0000 (14:59 -0700)]
i965: Rename "prim" parameter to "prims" where it's an array.

Some drawing functions take a single _mesa_prim object, while others
take an array of primitives.  Both kinds of functions used a parameter
called "prim" (the singular form), which was confusing.

Using the plural form, "prims," clearly communicates that the parameter
is an array of primitives.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoi965: Actually check every primitive for cut index support.
Kenneth Graunke [Wed, 28 Aug 2013 21:50:38 +0000 (14:50 -0700)]
i965: Actually check every primitive for cut index support.

can_cut_index_handle_prims() was passed an array of _mesa_prim objects
and a count, and ran a loop for that many iterations.  However, it
treated the array like a pointer, repeatedly checking the first element.

This patch makes it actually check every primitive.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoradeonsi: Don't save/restore FMASK sampler view states for u_blitter
Michel Dänzer [Fri, 30 Aug 2013 15:45:31 +0000 (17:45 +0200)]
radeonsi: Don't save/restore FMASK sampler view states for u_blitter

Fixes assertion failues in 24 piglit tests with
MESA_GL_VERSION_OVERRIDE=3.0, 12 of which are now passing.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
11 years agoradeonsi: Expose pure integer vertex formats
Michel Dänzer [Thu, 29 Aug 2013 14:39:16 +0000 (16:39 +0200)]
radeonsi: Expose pure integer vertex formats

Fixes 20 piglit tests with MESA_GL_VERSION_OVERRIDE=3.0.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
11 years agonvc0: restore viewport after blit
Maarten Lankhorst [Mon, 2 Sep 2013 15:08:48 +0000 (17:08 +0200)]
nvc0: restore viewport after blit

Based on calim's original fix in the nine branch.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
11 years agoradeon/uvd: save the aligned width & height
Christian König [Mon, 2 Sep 2013 13:42:13 +0000 (15:42 +0200)]
radeon/uvd: save the aligned width & height

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=68845
Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agoglx: make the interval of LIBGL_SHOW_FPS adjustable
Chia-I Wu [Wed, 28 Aug 2013 03:40:05 +0000 (11:40 +0800)]
glx: make the interval of LIBGL_SHOW_FPS adjustable

LIBGL_SHOW_FPS=1 makes GLX print FPS every second while other values do
nothing.  Extend it so that LIBGL_SHOW_FPS=N will print the FPS every N
seconds.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
11 years agoi965: Use the proper element of the prim array in brw_try_draw_prims.
Kenneth Graunke [Thu, 21 Mar 2013 22:01:34 +0000 (15:01 -0700)]
i965: Use the proper element of the prim array in brw_try_draw_prims.

The VBO module actually calls us with an array of _mesa_prim objects.
For example, it may break up a DrawArrays() call into multiple
primitives when primitive restart is enabled.

Previously, we treated prim like a pointer, always accessing element 0.
This worked because all of the primitive objects in a single draw call
have the same value for num_instances and basevertex.

However, accessing an array as a pointer and using the wrong object's
fields is misleading.  For stylistic reasons alone, we should use the
right object.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoi965: Combine brw_emit_prim and gen7_emit_prim.
Kenneth Graunke [Sat, 6 Apr 2013 06:10:39 +0000 (23:10 -0700)]
i965: Combine brw_emit_prim and gen7_emit_prim.

These functions have almost identical code; the only difference is that
a few of the bits moved around.  Adding a few trivial conditionals
allows the same function to work on all generations, and the resulting
code is still quite readable.

v2: Comment that the workaround flush is only necessary on SNB
    (requested by Paul Berry).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoi965: Remove unused ATTRIB_BIT_DWORDS define.
Kenneth Graunke [Wed, 28 Aug 2013 21:23:39 +0000 (14:23 -0700)]
i965: Remove unused ATTRIB_BIT_DWORDS define.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agonvc0: delete compute object on screen destruction
Christoph Bumiller [Sun, 12 May 2013 14:42:45 +0000 (16:42 +0200)]
nvc0: delete compute object on screen destruction

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
11 years agonvc0: fix blitctx memory leak
Joakim Sindholt [Sun, 12 May 2013 14:17:00 +0000 (16:17 +0200)]
nvc0: fix blitctx memory leak

Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
11 years agonvc0: don't use bufctx in nvc0_cb_push
Christoph Bumiller [Mon, 17 Jun 2013 16:47:21 +0000 (18:47 +0200)]
nvc0: don't use bufctx in nvc0_cb_push

Too many calls into libdrm when a single one is enough.

11 years agonvc0: clear the flushed flag
Christoph Bumiller [Tue, 18 Jun 2013 08:59:45 +0000 (10:59 +0200)]
nvc0: clear the flushed flag

11 years agonvc0/ir: add f32 long immediate cannot saturate
Christoph Bumiller [Sun, 30 Jun 2013 13:23:15 +0000 (15:23 +0200)]
nvc0/ir: add f32 long immediate cannot saturate

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
11 years agonvc0/ir: fix use after free in texture barrier insertion pass
Tiziano Bacocco [Tue, 30 Jul 2013 20:04:49 +0000 (22:04 +0200)]
nvc0/ir: fix use after free in texture barrier insertion pass

Fixes crash with Amnesia: The Dark Descent.

Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>