mesa.git
12 years agogallium/u_blitter: add ability to disable and restore the render condition
Marek Olšák [Wed, 12 Sep 2012 21:33:50 +0000 (23:33 +0200)]
gallium/u_blitter: add ability to disable and restore the render condition

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agogallium/u_blitter: facilitate co-existence with the Draw module
Marek Olšák [Wed, 12 Sep 2012 21:14:57 +0000 (23:14 +0200)]
gallium/u_blitter: facilitate co-existence with the Draw module

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agogallium/u_blitter: check PIPE_CAP_TEXTURE_MULTISAMPLE
Marek Olšák [Wed, 12 Sep 2012 20:29:23 +0000 (22:29 +0200)]
gallium/u_blitter: check PIPE_CAP_TEXTURE_MULTISAMPLE

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agogallium: add blit into the interface
Marek Olšák [Tue, 11 Sep 2012 23:36:31 +0000 (01:36 +0200)]
gallium: add blit into the interface

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agogallium: add PIPE_CAP_TEXTURE_MULTISAMPLE
Marek Olšák [Tue, 11 Sep 2012 20:41:20 +0000 (22:41 +0200)]
gallium: add PIPE_CAP_TEXTURE_MULTISAMPLE

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agosoftpipe: fix set_framebuffer_state with uninitialized surfaces past nr_cbufs-1
Marek Olšák [Wed, 12 Sep 2012 22:46:54 +0000 (00:46 +0200)]
softpipe: fix set_framebuffer_state with uninitialized surfaces past nr_cbufs-1

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoscons: Use full path of texture_builtins.py.
Vinson Lee [Sat, 29 Sep 2012 06:41:29 +0000 (23:41 -0700)]
scons: Use full path of texture_builtins.py.

Fixes this build error on Cygwin.
Explicit dependency `src/glsl/builtins/tools/texture_builtins.py' not
found, needed by target
`build/cygwin-x86-debug/glsl/builtin_function.cpp'.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: add fall-through comment, just to be clear
Brian Paul [Fri, 28 Sep 2012 03:04:39 +0000 (21:04 -0600)]
mesa: add fall-through comment, just to be clear

12 years agomesa: remove useless GLenum casts
Brian Paul [Fri, 28 Sep 2012 03:00:43 +0000 (21:00 -0600)]
mesa: remove useless GLenum casts

12 years agomesa: add const qualifier in check_for_ending() to silence warning
Brian Paul [Sat, 29 Sep 2012 14:24:44 +0000 (08:24 -0600)]
mesa: add const qualifier in check_for_ending() to silence warning

12 years agoi965: Complain about variable index lowering when INTEL_DEBUG=perf.
Kenneth Graunke [Wed, 19 Sep 2012 20:27:59 +0000 (13:27 -0700)]
i965: Complain about variable index lowering when INTEL_DEBUG=perf.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Dump linked shaders on MESA_GLSL=dump.
Kenneth Graunke [Wed, 19 Sep 2012 20:27:58 +0000 (13:27 -0700)]
i965: Dump linked shaders on MESA_GLSL=dump.

Often, the original shader IR isn't terribly interesting because a lot
of crucial optimizations haven't been done (such as inlining built-ins).

ir_to_mesa used to print this out for us, but since we don't use it, we
have to do it ourselves.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoglsl: Rename variable_entry2 back to variable_entry in struct splitting.
Kenneth Graunke [Wed, 19 Sep 2012 20:27:57 +0000 (13:27 -0700)]
glsl: Rename variable_entry2 back to variable_entry in struct splitting.

The anonymous namespace should keep these private classes to file scope,
preventing clashes with other symbols of the same name elsewhere.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agointel/i965: Disable SampleAlphaToOne if dual source blending enabled
Anuj Phogat [Fri, 21 Sep 2012 22:16:38 +0000 (15:16 -0700)]
intel/i965: Disable SampleAlphaToOne if dual source blending enabled

From SandyBridge PRM, volume 2 Part 1, section 12.2.3, BLEND_STATE:
DWord 1, Bit 30 (AlphaToOne Enable):
"If Dual Source Blending is enabled, this bit must be disabled"

Note: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoscons: Disable build of assembly sources on Cygwin.
Vinson Lee [Fri, 28 Sep 2012 06:21:09 +0000 (23:21 -0700)]
scons: Disable build of assembly sources on Cygwin.

The assembly sources currently do not build on Cygwin.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: allow MESA_GL_VERSION_OVERRIDE to override the API type
Jordan Justen [Sat, 1 Sep 2012 08:38:08 +0000 (01:38 -0700)]
mesa: allow MESA_GL_VERSION_OVERRIDE to override the API type

Change the format to MAJOR.MINOR[FC]
For example: 2.1, 3.0FC, 3.1

The FC suffix indicates a forward compatible context, and
is only valid for versions >= 3.0.

Examples:
2.1:   GL Legacy/Compatibility context
3.0:   GL Legacy/Compatibility context
3.0FC: GL Core Profile context + Forward Compatible
3.1:   GL Core Profile context
3.1FC: GL Core Profile context + Forward Compatible

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: brwInitVtbl needs to know the chipset generation
Ian Romanick [Fri, 28 Sep 2012 22:38:26 +0000 (15:38 -0700)]
i965: brwInitVtbl needs to know the chipset generation

Fixes major regressions since de958de.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoi915: Don't free the intel_context structure when intelCreateContext fails.
Ian Romanick [Thu, 27 Sep 2012 00:57:01 +0000 (17:57 -0700)]
i915: Don't free the intel_context structure when intelCreateContext fails.

intelDestroyContext will eventually be called, and it will clean things up.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618

12 years agoi965: Don't free the intel_context structure when intelCreateContext fails.
Ian Romanick [Fri, 31 Aug 2012 21:55:21 +0000 (14:55 -0700)]
i965: Don't free the intel_context structure when intelCreateContext fails.

intelDestroyContext will eventually be called, and it will clean things
up.  The call to brwInitVtbl is moved earlier so that
intelDestroyContext can call the device-specific destructor.  This also
makes the code look more like the i915 code.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301

12 years agointel: Don't call intelDestroyContext if there is no context to destroy
Ian Romanick [Fri, 28 Sep 2012 15:29:12 +0000 (08:29 -0700)]
intel: Don't call intelDestroyContext if there is no context to destroy

Some error paths in the device-specific context creation functions can exit
before the deintel_context structure is allocated.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301

12 years agodri_util: Use calloc to allocate __DRIcontext
Ian Romanick [Wed, 26 Sep 2012 18:08:11 +0000 (11:08 -0700)]
dri_util: Use calloc to allocate __DRIcontext

The __DRIcontext contains some pointers, and some drivers check for them to be
NULL in some failure paths.  Instead of sprinkling NULL assignments across the
various drivers, just zero out the whole thing.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Lu Hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301

12 years agomain/version: add "(Core Profile) to version string for core profiles
Jordan Justen [Tue, 4 Sep 2012 22:49:01 +0000 (15:49 -0700)]
main/version: add "(Core Profile) to version string for core profiles

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglx: Fix compile warnings since 99fee476a102be898a1a093c037e06382f90a5b9
Eric Anholt [Tue, 25 Sep 2012 17:02:06 +0000 (10:02 -0700)]
glx: Fix compile warnings since 99fee476a102be898a1a093c037e06382f90a5b9

_glapi_table is a struct full of named function pointers, while the generated
code just wants to treat it as an array of function pointers.  Cast to avoid
the compiler warning.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agomesa/tests: Sanity check the ES2 dispatch table
Ian Romanick [Thu, 2 Aug 2012 05:19:01 +0000 (22:19 -0700)]
mesa/tests: Sanity check the ES2 dispatch table

This test is only built when shared-glapi is used.  Because of changes
elsewhere in the tree that were necessary to make shared-glapi work
correct with GLX, it's not feasible to make the test function both ways.

The list of expected functions originally came from the functions set by
api_exec_es2.c.  This file no longer exists in Mesa (but api_exec_es1.c
is still generated).  It was the generated file that configured the
dispatch table for ES2 contexts.  This test verifies that all of the
functions set by the old api_exec_es2.c (with the recent addition of VAO
functions) are set in the dispatch table and everything else is a NOP.

When adding ES2 (or ES3) extensions that add new functions, this test
will need to be modified to expect dispatch functions for the new
extension functions.

v2: Expect VAO functions be non-NOP.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agomesa/main: Make no-op dispatch function public
Ian Romanick [Thu, 2 Aug 2012 05:18:16 +0000 (22:18 -0700)]
mesa/main: Make no-op dispatch function public

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agomesa/tests: Move stub function to a separate file
Ian Romanick [Thu, 2 Aug 2012 05:15:12 +0000 (22:15 -0700)]
mesa/tests: Move stub function to a separate file

When building with shared-glapi, we can just use Mesa's _mesa_warning without
problems.  stubs.cpp is only used when shared-glapi is not used.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agomesa: Don't set uniform dispatch pointers for many things in ES2 or core
Ian Romanick [Wed, 5 Sep 2012 21:15:30 +0000 (14:15 -0700)]
mesa: Don't set uniform dispatch pointers for many things in ES2 or core

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Don't set shaderapi dispatch pointers for many things in ES2 or core
Ian Romanick [Wed, 5 Sep 2012 21:14:13 +0000 (14:14 -0700)]
mesa: Don't set shaderapi dispatch pointers for many things in ES2 or core

v2: Allow GL_ARB_shader_objects functions in core profile because we
still expose the extension string there.  Don't allow
glBindFragDataLocation in GLES3 because it's not part of that API.
Based (mostly) on review comments from Eric Anholt.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Don't set vtxfmt dispatch pointers for many things in ES2 or core
Ian Romanick [Wed, 5 Sep 2012 21:11:33 +0000 (14:11 -0700)]
mesa: Don't set vtxfmt dispatch pointers for many things in ES2 or core

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Don't set loopback dispatch pointers for most things in ES2 or core
Ian Romanick [Wed, 5 Sep 2012 21:10:23 +0000 (14:10 -0700)]
mesa: Don't set loopback dispatch pointers for most things in ES2 or core

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Pass GL context to _mesa_create_save_table
Ian Romanick [Wed, 5 Sep 2012 15:12:18 +0000 (08:12 -0700)]
mesa: Pass GL context to _mesa_create_save_table

This isn't used by this patch, but it will be necessary for several
follow-on patches.  Separating this out will make it easier to reorder
patches later.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Don't set dispatch pointer for glTexStorage in ES2
Ian Romanick [Wed, 5 Sep 2012 21:07:50 +0000 (14:07 -0700)]
mesa: Don't set dispatch pointer for glTexStorage in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Don't set dispatch pointer for glGetProgramivARB in ES2
Ian Romanick [Wed, 5 Sep 2012 21:06:18 +0000 (14:06 -0700)]
mesa: Don't set dispatch pointer for glGetProgramivARB in ES2

This function is not the same as glGetProgramiv.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Don't set dispatch pointer for glResizeBuffersMESA in ES2
Ian Romanick [Wed, 5 Sep 2012 21:04:13 +0000 (14:04 -0700)]
mesa: Don't set dispatch pointer for glResizeBuffersMESA in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Don't set dispatch pointers for glPointParameter[if][v] in ES2
Ian Romanick [Wed, 5 Sep 2012 21:01:42 +0000 (14:01 -0700)]
mesa: Don't set dispatch pointers for glPointParameter[if][v] in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Don't set dispatch pointers for glClearDepth or glDepthRange in ES2
Ian Romanick [Wed, 5 Sep 2012 21:00:40 +0000 (14:00 -0700)]
mesa: Don't set dispatch pointers for glClearDepth or glDepthRange in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Don't set dispatch pointer for glGetBufferSubData in ES2
Ian Romanick [Wed, 5 Sep 2012 15:48:32 +0000 (08:48 -0700)]
mesa: Don't set dispatch pointer for glGetBufferSubData in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Don't set dispatch pointer for glGetDoublev in ES2
Ian Romanick [Wed, 5 Sep 2012 15:21:04 +0000 (08:21 -0700)]
mesa: Don't set dispatch pointer for glGetDoublev in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Don't set dispatch pointer for glPointSize in ES2
Ian Romanick [Wed, 5 Sep 2012 15:16:23 +0000 (08:16 -0700)]
mesa: Don't set dispatch pointer for glPointSize in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Set dispatch pointer for glShaderBinary
Ian Romanick [Wed, 5 Sep 2012 14:49:50 +0000 (07:49 -0700)]
mesa: Set dispatch pointer for glShaderBinary

NOTE: This is a candiate for stable branches

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agogles2: Alias glReadBufferNV with desktop glReadBuffer
Ian Romanick [Thu, 2 Aug 2012 05:09:08 +0000 (22:09 -0700)]
gles2: Alias glReadBufferNV with desktop glReadBuffer

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kristian Høgsberg <krh@bitplanet.net>
12 years agointel: Fix yet-another-bug in intel_texsubimage_tiled_memcpy
Chad Versace [Thu, 27 Sep 2012 18:05:34 +0000 (11:05 -0700)]
intel: Fix yet-another-bug in intel_texsubimage_tiled_memcpy

The most recent commit that touched this function,

    commit b1d0fe022dc4826dadce014ab8fe062a82f75a16
    Author: Chad Versace <chad.versace@linux.intel.com>
    Date:   Wed Sep 26 11:05:12 2012 -0700

        intel: Fix segfault in intel_texsubimage_tiled_memcpy

did fix the segfault, but introduced yet another bug. From Anholt: """You
need to still test format/type, because that's the incoming format (e.g.
GL_RGBA/GL_FLOAT) that you're trying to memcpy."""

This patch re-introduces the checks on the incoming format and type.

Note: This is a candidate for the 9.0 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agomesa: Fix typo in error message.
Vinson Lee [Fri, 28 Sep 2012 05:32:10 +0000 (22:32 -0700)]
mesa: Fix typo in error message.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
12 years agor600g: add some members to radeon_llvm_context
Vincent Lejeune [Sun, 23 Sep 2012 13:53:57 +0000 (15:53 +0200)]
r600g: add some members to radeon_llvm_context

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
12 years agor600g: tgsi-to-llvm path is taken after declarations have been parsed
Vincent Lejeune [Sun, 23 Sep 2012 13:20:34 +0000 (15:20 +0200)]
r600g: tgsi-to-llvm path is taken after declarations have been parsed

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
12 years agometa: Use float for temporary images, not (un)signed normalized.
Kenneth Graunke [Sun, 16 Sep 2012 06:18:36 +0000 (23:18 -0700)]
meta: Use float for temporary images, not (un)signed normalized.

In commit 091eb15b694, Jordan changed get_temp_image_type() to use
_mesa_get_format_datatype() instead of returning GL_FLOAT.  That has
several possible return values: GL_FLOAT, GL_INT, GL_UNSIGNED_INT,
GL_SIGNED_NORMALIZED, and GL_UNSIGNED_NORMALIZED.

We do want to use GL_INT/GL_UNSIGNED_INT for integer formats.  However,
we want to continue using GL_FLOAT for the normalized fixed-point types.
There isn't any code in pack.c to handle GL_(UN)SIGNED_NORMALIZED.

Fixes oglconform's fboarb advanced.blit.copypix, which was regressed by
commit 091eb15b694a396f8453093575ccec2db7f14eb8.

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53573
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Don't advertise GLX_SWAP_COPY_OML
Chad Versace [Thu, 9 Aug 2012 16:06:42 +0000 (09:06 -0700)]
intel: Don't advertise GLX_SWAP_COPY_OML

This patch removes all gl_config's with swapMethod=GLX_SWAP_COPY_OML. When
page flipping, we are unable to comply with swap-copy semantics.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoi965: Remove stale comment about rebuilding tnl_program.
Eric Anholt [Fri, 21 Sep 2012 06:42:42 +0000 (08:42 +0200)]
i965: Remove stale comment about rebuilding tnl_program.

It gets built in Mesa core before we're called these days.

Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Add a comment explaining one of the brw_draw_upload.c loops.
Eric Anholt [Fri, 21 Sep 2012 05:26:33 +0000 (07:26 +0200)]
i965: Add a comment explaining one of the brw_draw_upload.c loops.

Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Remove broken non-interleaved-to-interleaved upload code.
Eric Anholt [Fri, 21 Sep 2012 05:50:05 +0000 (07:50 +0200)]
i965: Remove broken non-interleaved-to-interleaved upload code.

This failed when all the uploads to occur were uniform-type vertex data (like
glColor4f being active across a DrawArrays), because it would upload 1 element
instead of 1 element per vertex.  There was no citation for how this code
helped any particular application, and it breaks ETQW, so just remove it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47170
NOTE: This is a candidate for the 9.0 and 8.0 branches.
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Remove dead intel_format_to_rb_datatype.
Eric Anholt [Fri, 21 Sep 2012 08:38:03 +0000 (10:38 +0200)]
intel: Remove dead intel_format_to_rb_datatype.

This was for some of the old spans-related code that is now gone.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Mark some file-local code as static.
Eric Anholt [Fri, 21 Sep 2012 08:36:22 +0000 (10:36 +0200)]
intel: Mark some file-local code as static.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Mark brw_disasm.c tables as static const.
Eric Anholt [Fri, 21 Sep 2012 08:29:10 +0000 (10:29 +0200)]
i965: Mark brw_disasm.c tables as static const.

v2: Make the strings in the tables const, too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Use visibility cflags on the driver code.
Eric Anholt [Fri, 21 Sep 2012 08:10:54 +0000 (10:10 +0200)]
i965: Use visibility cflags on the driver code.

The only symbols that need to be public (those in intel_screen.c that the
loader looks for) are already marked public.  Saves 100k of compiled driver
size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
12 years agoi965/vp: Remove support for non-ARB_vp, non-NV_vp opcodes.
Eric Anholt [Thu, 20 Sep 2012 15:12:33 +0000 (17:12 +0200)]
i965/vp: Remove support for non-ARB_vp, non-NV_vp opcodes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/vp: Remove support for relative addressing of destination registers.
Eric Anholt [Thu, 20 Sep 2012 14:33:22 +0000 (16:33 +0200)]
i965/vp: Remove support for relative addressing of destination registers.

This was added for GLSL support back in the day.  It's prohibited by both
ARB_vp and NV_vp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/vp: Remove support for reading destination registers.
Eric Anholt [Thu, 20 Sep 2012 14:26:02 +0000 (16:26 +0200)]
i965/vp: Remove support for reading destination registers.

It's prohibited by ARB_vp and NV_vp, and not used by fixed function t&l.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965/vp: Remove support for GLSL flow control from the old VS backend.
Eric Anholt [Thu, 20 Sep 2012 14:17:22 +0000 (16:17 +0200)]
i965/vp: Remove support for GLSL flow control from the old VS backend.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agobuild: Link libglapi with pthreads
Matt Turner [Wed, 19 Sep 2012 03:22:37 +0000 (20:22 -0700)]
build: Link libglapi with pthreads

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=839060
          https://bugs.gentoo.org/show_bug.cgi?id=435152
Reviewed-by: Adam Jackson <ajax@redhat.com>
12 years agobuild: Use AX_PTHREAD to detect pthreads
Matt Turner [Wed, 19 Sep 2012 03:21:47 +0000 (20:21 -0700)]
build: Use AX_PTHREAD to detect pthreads

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
12 years agor600g: fix EXP on Cayman
Marek Olšák [Tue, 25 Sep 2012 15:28:13 +0000 (17:28 +0200)]
r600g: fix EXP on Cayman

NOTE: This is a candidate for the stable branches.

12 years agor600g: fix RSQ of negative value on Cayman
Marek Olšák [Tue, 25 Sep 2012 15:20:38 +0000 (17:20 +0200)]
r600g: fix RSQ of negative value on Cayman

NOTE: This is a candidate for the stable branches.

12 years agor600g: fix instance divisor on Cayman
Marek Olšák [Tue, 25 Sep 2012 14:09:24 +0000 (16:09 +0200)]
r600g: fix instance divisor on Cayman

Not sure if this is the best way to fix it.

NOTE: This is a candidate for the stable branches.

12 years agor600g: flush FMASK and CMASK when changing colorbuffers on Evergreen
Marek Olšák [Tue, 25 Sep 2012 01:11:22 +0000 (03:11 +0200)]
r600g: flush FMASK and CMASK when changing colorbuffers on Evergreen

This fixes rare graphical corruption.

NOTE: This is a candidate for the stable branches.

12 years agor600g: use invalid DB hardware formats to disable depth/stencil
Marek Olšák [Tue, 14 Aug 2012 18:42:35 +0000 (20:42 +0200)]
r600g: use invalid DB hardware formats to disable depth/stencil

12 years agointel: Fix segfault in intel_texsubimage_tiled_memcpy
Chad Versace [Wed, 26 Sep 2012 18:05:12 +0000 (11:05 -0700)]
intel: Fix segfault in intel_texsubimage_tiled_memcpy

The function segfaulted when a game called glTexSubImage2D on a texture
with internalformat/format/type = GL_SLUMINANCE8/GL_BGRA/GL_UNSIGNED_BYTE.

The function only supports MESA_FORMAT_ARGB8888 and returns early if it
detects an unsupported format. Clearly, its detection condition was
insufficient. This patch fixes it to explicity check for
MESA_FORMAT_ARGB8888.

Note: This is a candidate for the 9.0 branch (fixes 413c491).
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoi965: Do texture swizzling in hardware on Haswell.
Kenneth Graunke [Fri, 21 Sep 2012 10:13:36 +0000 (03:13 -0700)]
i965: Do texture swizzling in hardware on Haswell.

Haswell supports EXT_texture_swizzle and legacy DEPTH_TEXTURE_MODE
swizzling by setting SURFACE_STATE entries.  This means we don't have to
bake the swizzle settings into the shader code by emitting MOV
instructions, and thus don't have to recompile shaders whenever the
swizzles change.

Unfortunately, we can't handle GL_ALPHA this way: unlike all the others,
which store the comparison result in the .r channel (and possibly others
as well), GL_ALPHA puts it in the .a channel.  The GLSL 1.30+ style
functions which return a float always simply return the .r channel,
which would be zero if we handled this as a surface override.  In this
case, fall back to doing it the old way.  DEPTH_TEXTURE_MODE = GL_ALPHA
isn't an interesting performance path anyway.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Refactor texture swizzle generation into a helper.
Kenneth Graunke [Fri, 7 Sep 2012 20:24:16 +0000 (13:24 -0700)]
i965: Refactor texture swizzle generation into a helper.

It's going to be reused in a second place soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoradeon/llvm: improve select_cc lowering to generate CND* more often
Vincent Lejeune [Mon, 24 Sep 2012 14:04:26 +0000 (16:04 +0200)]
radeon/llvm: improve select_cc lowering to generate CND* more often

v2: - Simplify isZero()
    - Remove a unused function prototype
    - Clean whitespace trails

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
12 years agointel: Fix size of temporary etc1 buffer
Chad Versace [Thu, 20 Sep 2012 16:54:29 +0000 (18:54 +0200)]
intel: Fix size of temporary etc1 buffer

Fixes valgrind errors in piglit test
oes_compressed_etc1_rgb8_texture-miptree: an invalid write in
_mesa_store_compressed_store_texsubimage() at line 4406 and invalid reads
in texcompress_etc_tmp.h:etc1_parse_block().

The calculation of the size of the temporary etc1 buffer allocated by
intel_miptree_map_etc1() was incorrect. Sometimes the allocated buffer was
too small, sometimes too large.  This patch corrects the size to that
expected by _mesa_store_compressed_store_texsubimage().

Note: This is candidate for the 9.0 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoradeonsi: fix truncated register define.
Alex Deucher [Wed, 26 Sep 2012 13:34:59 +0000 (09:34 -0400)]
radeonsi: fix truncated register define.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agomesa: move _mesa_es_error_check_format_and_type() to glformats.c
Brian Paul [Sat, 22 Sep 2012 15:30:24 +0000 (09:30 -0600)]
mesa: move _mesa_es_error_check_format_and_type() to glformats.c

Where the non-ES _mesa_error_check_format_and_type() function lives.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: move GL_HALF_FLOAT_OES definition to glheader.h
Brian Paul [Sat, 22 Sep 2012 15:30:24 +0000 (09:30 -0600)]
mesa: move GL_HALF_FLOAT_OES definition to glheader.h

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: minor fix to glTexSubImage error message
Brian Paul [Sat, 22 Sep 2012 15:30:24 +0000 (09:30 -0600)]
mesa: minor fix to glTexSubImage error message

12 years agomesa: consolidate sub-texture error checking code
Brian Paul [Sat, 22 Sep 2012 15:30:24 +0000 (09:30 -0600)]
mesa: consolidate sub-texture error checking code

Do all error checking of glTexSubImage, glCopyTexSubImage and
glCompressedTexSubImage's xoffset, yoffset, zoffset, width, height, and
depth params in one place.

12 years agomesa: consolidate glTexSubImage() error checking
Brian Paul [Sat, 22 Sep 2012 15:30:24 +0000 (09:30 -0600)]
mesa: consolidate glTexSubImage() error checking

12 years agomesa: consolidate glCompressedTexSubImage() error checking
Brian Paul [Sat, 22 Sep 2012 15:30:24 +0000 (09:30 -0600)]
mesa: consolidate glCompressedTexSubImage() error checking

Do all the checking in one function instead of two and fix up some of
the error checking.alignment check

12 years agomesa: consolidate subtexture xoffset/yoffset/width/height error checking code
Brian Paul [Sat, 22 Sep 2012 15:30:23 +0000 (09:30 -0600)]
mesa: consolidate subtexture xoffset/yoffset/width/height error checking code

This is the code that checks if a subtexture region is aligned to the
compressed format's block size.

12 years agomesa: consolidate glCopyTexSubImage error checking
Brian Paul [Sat, 22 Sep 2012 15:30:23 +0000 (09:30 -0600)]
mesa: consolidate glCopyTexSubImage error checking

Do all the checking in one function instead of two.

12 years agomesa: fix incorrect error for glCompressedSubTexImage
Brian Paul [Sat, 22 Sep 2012 15:30:23 +0000 (09:30 -0600)]
mesa: fix incorrect error for glCompressedSubTexImage

If a subtexture region isn't aligned to the compressed block size,
return GL_INVALID_OPERATION, not gl_INVALID_VALUE.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoradeonsi: move draw cmds to si_commands.c
Christian Koenig [Thu, 20 Sep 2012 15:20:51 +0000 (17:20 +0200)]
radeonsi: move draw cmds to si_commands.c

Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
12 years agoradeonsi: start seperating commands into si_commands.c
Christian Koenig [Thu, 20 Sep 2012 10:15:11 +0000 (12:15 +0200)]
radeonsi: start seperating commands into si_commands.c

Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
12 years agoradeonsi: get rid of evergreen_hw_context.c
Christian Koenig [Thu, 20 Sep 2012 10:00:30 +0000 (12:00 +0200)]
radeonsi: get rid of evergreen_hw_context.c

Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
12 years agoradeonsi: remove unused code
Christian Koenig [Wed, 19 Sep 2012 12:44:17 +0000 (14:44 +0200)]
radeonsi: remove unused code

Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
12 years agoradeonsi: start reworking inferred state handling
Christian König [Fri, 14 Sep 2012 15:05:34 +0000 (17:05 +0200)]
radeonsi: start reworking inferred state handling

Instead of tracking the inferred state changes separately
just check if queued and emitted states are the same.

This patch just reworks the update of the SPI map between
vs and ps, but there are probably more cases like this.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
12 years agogles3: Prohibit set/get of GL_FRAMEBUFFER_SRGB.
Paul Berry [Mon, 24 Sep 2012 21:47:12 +0000 (14:47 -0700)]
gles3: Prohibit set/get of GL_FRAMEBUFFER_SRGB.

GLES 3 supports sRGB functionality, but it does not expose the
GL_FRAMEBUFFER_SRGB enable/disable bit.  Instead the implementation
is expected to behave as though that bit is always enabled.

This patch ensures that ctx->Color.sRGBEnabled (the internal variable
tracking GL_FRAMEBUFFER_SRGB) is initially true in GLES 2/3 contexts,
and that it cannot be modified through the GLES 3 API.

This is safe for GLES 2, since ctx->Color.sRGBEnabled has no effect on
non-sRGB formats, and GLES 2 doesn't support any sRGB formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
12 years agometa: Properly save/restore GL_FRAMEBUFFER_SRGB in Meta.
Paul Berry [Mon, 24 Sep 2012 21:38:19 +0000 (14:38 -0700)]
meta: Properly save/restore GL_FRAMEBUFFER_SRGB in Meta.

Previously, meta logic was saving and restoring the value of
GL_FRAMEBUFFER_SRGB in an ad-hoc fashion.  As a result, it was not
properly disabled and/or restored for some meta operations.

This patch causes GL_FRAMEBUFFER_SRGB to be saved/restored in the
conventional way of meta-ops (using _mesa_meta_begin() and
_mesa_meta_end()).  It is now reliably saved/restored for
_mesa_meta_BlitFramebuffer, _mesa_meta_GenerateMipmap, and
decompress_texture_image, and preserved for all other meta ops.

Fixes piglit tests "ARB_framebuffer_sRGB/blit renderbuffer
{linear_to_srgb,srgb} scaled {disabled,enabled}".

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
12 years agoenable: Create _mesa_set_framebuffer_srgb() function for use by meta ops.
Paul Berry [Mon, 24 Sep 2012 21:24:28 +0000 (14:24 -0700)]
enable: Create _mesa_set_framebuffer_srgb() function for use by meta ops.

GLES3 supports sRGB formats, but it does not support the
GL_FRAMEBUFFER_SRGB enable/disable flag (instead it behaves as if this
flag is always enabled).  Therefore, meta ops that need to disable
GL_FRAMEBUFFER_SRGB will need a backdoor mechanism to do so when the
API is GLES3.

We were already doing a similar thing for GL_MULTISAMPLE, which has
the same constraints.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
12 years agotargets/xorg-i915: Rename driver to i915_drv.so.
Matt Turner [Mon, 24 Sep 2012 16:56:38 +0000 (09:56 -0700)]
targets/xorg-i915: Rename driver to i915_drv.so.

modesetting_drv.so is undescriptive and collides with
xf86-video-modesetting.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agointel: Improve teximage perf for Google Chrome paint rects (v3)
Chad Versace [Tue, 4 Sep 2012 19:15:29 +0000 (12:15 -0700)]
intel: Improve teximage perf for Google Chrome paint rects (v3)

This patch reduces the time spent in glTexImage and glTexSubImage by
over 5x on Sandybridge for the workload described below.

It adds a new fast path for glTexImage2D and glTexSubImage2D,
intel_texsubimage_tiled_memcpy, which is optimized for Google Chrome's
paint rectangles. The fast path is implemented only for 2D GL_BGRA
textures for chipsets with a LLC.

=== Performance Analysis ===

Workload description:

    Personalize your google.com page with a wallpaper.  Start chromium
with flags "--ignore-gpu-blacklist --enable-accelerated-painting
--force-compositing-mode".  Start recording with chrome://tracing. Visit
google.com and wait for page to finish rendering.  Measure the time spent
by process CrGpuMain in GLES2DecoderImpl::HandleTexImage2D and
HandleTexSubImage2D.

System config:

    cpu: Sandybridge Mobile GT2+ (0x0126)
    kernel 3.4.9 x86_64
    chromium 21.0.1180.89 (154005)

Statistics:

                  | N   Median  Avg   Stddev
    --------------|-------------------------
    before (msec) | 8   472.5  463.75 72.6
    after  (msec) | 8    78.0   79.6   5.7

    Arithmetic difference at 95.0% confidence:
       -384.1  +/- 55.2 msec
        -82.8% +/- 11.9%

    Ratio at 95.0% confidence:
          5.81 +/- 0.119

v2:
    - Replace check for `intel->gen >= 6` with `intel->has_llc`, per
      danvet.
    - Fix typo in comment, s/throuh/through/.
    - Swap 'before' and 'after' rows in stat table.

v3:
    - If the current batch references the bo, then flush batch before mapping
      the bo. Found by Chris.
    - Restrict supported texture images to level 0 of target
      GL_TEXTURE_2D. This avoids an arithmetic bug in calculating image
      offsets within the miptree, found by Paul. This restriction does not
      diminish this patch's benefit to Chrome OS performance.
    - Use less instructions for bit6 swizzling, suggested by Paul.
    - Remove erroneous comment about Y-tiling, for Paul.
    - Print perf_debug messages when flushing and stalling.
    - Update stats in commit message; run workload under a release build
      rather than a debug build.

Note: This is a candidate for the 9.0 branch.
Acked-by: Eric Anholt <eric@anholt.net>
CC: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoclover: Fix build with libclang v3.2
Tom Stellard [Mon, 24 Sep 2012 21:07:55 +0000 (21:07 +0000)]
clover: Fix build with libclang v3.2

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
12 years agoclover: Query device for CL_DEVICE_MAX_MEM_ALLOC_SIZE v2
Tom Stellard [Mon, 17 Sep 2012 14:29:49 +0000 (14:29 +0000)]
clover: Query device for CL_DEVICE_MAX_MEM_ALLOC_SIZE v2

v2:
  - Use driver reported values and don't correct them to the OpenCL
    required minimum.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
12 years agogallium: Add PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE v2
Tom Stellard [Fri, 21 Sep 2012 20:19:14 +0000 (20:19 +0000)]
gallium: Add PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE v2

v2:
  - Add comment in screen.rst
  - Report OpenCL required minimum for r600g

12 years agor600g: Handle multiple kernels in the same program v2
Tom Stellard [Thu, 13 Sep 2012 14:59:50 +0000 (14:59 +0000)]
r600g: Handle multiple kernels in the same program v2

v2:
  - Use pc parameter of launch_grid

12 years agoclover: Handle multiple kernels in the same program v2
Blaž Tomažič [Thu, 13 Sep 2012 14:51:46 +0000 (14:51 +0000)]
clover: Handle multiple kernels in the same program v2

v2: Tom Stellard
  - Use pc parameter of launch_grid()

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
12 years agomesa: remove 'struct' from texenv_fragment_program
Brian Paul [Mon, 24 Sep 2012 21:23:20 +0000 (15:23 -0600)]
mesa: remove 'struct' from texenv_fragment_program

texenv_fragment_program is declared as a class.  Fixes warnings with MSVC.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Allow fast depth clears if scissoring doesn't do anything.
Kenneth Graunke [Wed, 19 Sep 2012 20:27:55 +0000 (13:27 -0700)]
i965: Allow fast depth clears if scissoring doesn't do anything.

A game we're working with leaves scissoring enabled, but frequently sets
the scissor rectangle to the size of the whole screen.  In that case,
scissoring has no effect, so it's safe to go ahead with a fast clear.

Chad believe this should help with Oliver McFadden's "Dante" as well.

v2/Chad: Use the drawbuffer dimensions rather than the miptree slice
dimensions.  The miptree slice may be slightly larger due to alignment
restrictions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-and-tested-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
12 years agoi965: Don't spill "smeared" registers.
Paul Berry [Wed, 19 Sep 2012 20:28:00 +0000 (13:28 -0700)]
i965: Don't spill "smeared" registers.

Fixes an assertion failure when compiling certain shaders that need both
pull constants and register spilling:

brw_eu_emit.c:204: validate_reg: Assertion `execsize >= width' failed.

NOTE: This is a candidate for release branches.

Signed-off-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agonv50/ir/ra: Fix register interference tracking.
Jay Cornwall [Sat, 22 Sep 2012 16:15:11 +0000 (11:15 -0500)]
nv50/ir/ra: Fix register interference tracking.

See fdo bug 55224.

12 years agoi965/blorp: Fix sRGB MSAA resolves.
Paul Berry [Mon, 24 Sep 2012 12:38:32 +0000 (05:38 -0700)]
i965/blorp: Fix sRGB MSAA resolves.

Commit e2249e8c4d06a85d6389ba1689e15d7e29aa4dff (i965/blorp: Add
support for blits between SRGB and linear formats) changed blorp to
always configure surface states for in linear format (even if the
underlying surface is sRGB).  This allowed sRGB-to-linear and
linear-to-sRGB blits to occur without causing the image to be
inappropriately brightened or darkened.

However, it broke sRGB MSAA resolves, since they rely on the
destination buffer format being sRGB in order to ensure that samples
are averaged together in sRGB-correct fashion.

This patch fixes the problem by instead configuring the source buffer
to use the *same* format as the destination buffer.  This ensures that
the image won't be brightened or darkened, but preserves proper sRGB
averaging.

Fixes piglit tests "EXT_framebuffer_multisample/accuracy srgb".

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55265

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>