mesa.git
11 years agomesa: Enable GL_{ARB,APPLE}_vertex_array_object in all drivers
Ian Romanick [Wed, 22 Aug 2012 00:57:22 +0000 (17:57 -0700)]
mesa: Enable GL_{ARB,APPLE}_vertex_array_object in all drivers

This is a purely software extension.  The drivers don't need to do any
work to support it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agometa: Don't use deprecated keyword in 1.30 shader
Ian Romanick [Sat, 18 Aug 2012 00:57:17 +0000 (17:57 -0700)]
meta: Don't use deprecated keyword in 1.30 shader

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Disallow alpha, luminance, and LA textures in core context
Ian Romanick [Sat, 18 Aug 2012 00:15:06 +0000 (17:15 -0700)]
mesa: Disallow alpha, luminance, and LA textures in core context

Also disallow the 1, 2, 3, and 4 formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Disallow more deprecated functions in core context
Ian Romanick [Sat, 18 Aug 2012 00:14:47 +0000 (17:14 -0700)]
mesa: Disallow more deprecated functions in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Require names from Gen in core context
Ian Romanick [Sat, 18 Aug 2012 00:14:02 +0000 (17:14 -0700)]
mesa: Require names from Gen in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Allow NULL vertex pointer without a VBO
Ian Romanick [Sat, 18 Aug 2012 00:12:39 +0000 (17:12 -0700)]
mesa: Allow NULL vertex pointer without a VBO

There is text in the OpenGL 3.x specs to explicitly allow this case.
Weird.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Disallow VertexAttribPointer without a VAO in a core context
Ian Romanick [Sat, 18 Aug 2012 00:12:12 +0000 (17:12 -0700)]
mesa: Disallow VertexAttribPointer without a VAO in a core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Disallow wide lines in forward compatible context
Ian Romanick [Fri, 17 Aug 2012 23:08:40 +0000 (16:08 -0700)]
mesa: Disallow wide lines in forward compatible context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Only FRONT_AND_BACK is allowed for PolygonMode in core context
Ian Romanick [Fri, 17 Aug 2012 23:03:06 +0000 (16:03 -0700)]
mesa: Only FRONT_AND_BACK is allowed for PolygonMode in core context

Page 407 (page 423 of the PDF) of the OpenGL 3.0 spec says (in the list
of deprecated functionality):

    "Separate polygon draw mode - PolygonMode face values of FRONT and
    BACK; polygons are always drawn in the same mode, no matter which
    face is being rasterized."

Also modify meta to not use FRONT or BACK in a core context.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agometa: Don't stray outside the confines of the API specified in the context
Paul Berry [Wed, 8 Aug 2012 18:56:33 +0000 (11:56 -0700)]
meta: Don't stray outside the confines of the API specified in the context

Signed-off-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Don't allow display lists or evaluators in core context
Ian Romanick [Fri, 17 Aug 2012 21:32:43 +0000 (14:32 -0700)]
mesa: Don't allow display lists or evaluators in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Don't allow GL_EXTENSIONS query in core context
Ian Romanick [Fri, 17 Aug 2012 21:32:21 +0000 (14:32 -0700)]
mesa: Don't allow GL_EXTENSIONS query in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Non-sprite points are deprecated
Ian Romanick [Wed, 15 Aug 2012 15:45:03 +0000 (08:45 -0700)]
mesa: Non-sprite points are deprecated

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Fix VAO deletion on GL 3.1 core.
Eric Anholt [Thu, 9 Aug 2012 01:44:40 +0000 (18:44 -0700)]
mesa: Fix VAO deletion on GL 3.1 core.

We were calling through a dispatch table entry that was NULL, since the apple
variant is only on legacy desktop.  Just call the function we mean instead of
indirecting through the dispatch.

11 years agomesa: Enable a bunch of missing getters on 3.1 core.
Eric Anholt [Thu, 9 Aug 2012 01:29:14 +0000 (18:29 -0700)]
mesa: Enable a bunch of missing getters on 3.1 core.

NOTE: maybe I enabled too many?

11 years agomesa: Expose texture buffer objects when the context is GL 3.1 core.
Eric Anholt [Thu, 26 Jul 2012 22:10:04 +0000 (15:10 -0700)]
mesa: Expose texture buffer objects when the context is GL 3.1 core.

v2: Use API_OPENGL_CORE.

v3: Only require desktop GL.  If a driver can't support TexBOs in a non-core
context, it should not enable them.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa: Allow PACK / UNPACK queries for ES2
Ian Romanick [Wed, 8 Aug 2012 18:47:15 +0000 (11:47 -0700)]
mesa: Allow PACK / UNPACK queries for ES2

These are part of the GL_EXT_unpack_subimage extension and ES 3.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Kill ES2 wrapper functions
Ian Romanick [Sat, 28 Jul 2012 22:20:48 +0000 (15:20 -0700)]
mesa: Kill ES2 wrapper functions

v2: Fix completely broken condition around ClearColorIiEXT and
ClearColorIuiEXT.

v3: Add special VertexAttrib handling for ES2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: glGetVertexAttribPointerv is part of core profile and ES2
Ian Romanick [Wed, 8 Aug 2012 20:37:45 +0000 (13:37 -0700)]
mesa: glGetVertexAttribPointerv is part of core profile and ES2

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glPointParameter pname in Mesa code rather than the ES wrapper
Ian Romanick [Sat, 28 Jul 2012 00:43:22 +0000 (17:43 -0700)]
mesa/es: Validate glPointParameter pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: Require OpenGL 2.0 for GL_POINT_SPRITE_COORD_ORIGIN
Ian Romanick [Sat, 28 Jul 2012 00:40:34 +0000 (17:40 -0700)]
mesa: Require OpenGL 2.0 for GL_POINT_SPRITE_COORD_ORIGIN

The comment in the code even says this is the right thing to do.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: Require that drivers supporting point sprites support point parameters
Ian Romanick [Sat, 28 Jul 2012 00:38:32 +0000 (17:38 -0700)]
mesa: Require that drivers supporting point sprites support point parameters

All drivers in Mesa do.  This allows a lot of extension checking code to be
gutted from the function.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa/es: Validate glGetTexEnv parameters in Mesa code rather than the ES wrapper
Ian Romanick [Sat, 28 Jul 2012 00:48:30 +0000 (17:48 -0700)]
mesa/es: Validate glGetTexEnv parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glTexEnv parameters in Mesa code rather than the ES wrapper
Ian Romanick [Sat, 28 Jul 2012 00:22:42 +0000 (17:22 -0700)]
mesa/es: Validate glTexEnv parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glGetTexGen parameters in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 23:47:27 +0000 (16:47 -0700)]
mesa/es: Validate glGetTexGen parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glTexGen parameters in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 23:27:23 +0000 (16:27 -0700)]
mesa/es: Validate glTexGen parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glLightModel pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 23:13:02 +0000 (16:13 -0700)]
mesa/es: Validate glLightModel pname in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glMaterial face and pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 23:07:19 +0000 (16:07 -0700)]
mesa/es: Validate glMaterial face and pname in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glGetMaterial pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 22:57:09 +0000 (15:57 -0700)]
mesa/es: Validate glGetMaterial pname in Mesa code rather than the ES wrapper

Fixes a bug that glGetMaterial[fx]v in ES1 contexts would (try to) allow
queries of GL_AMBIENT_AND_DIFFUSE.  This enum can only be used in glMaterial,
not in the get.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glGetPointerv pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 22:49:50 +0000 (15:49 -0700)]
mesa/es: Validate glGetPointerv pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile, GLES1, and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glMatrixMode mode in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 22:47:16 +0000 (15:47 -0700)]
mesa/es: Validate glMatrixMode mode in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glFog pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 19:37:05 +0000 (12:37 -0700)]
mesa/es: Validate glFog pname in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glReadPixels format and type in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 19:24:24 +0000 (12:24 -0700)]
mesa/es: Validate glReadPixels format and type in Mesa code rather than the ES wrapper

v2: Add proper GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glPixelStore pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 19:11:32 +0000 (12:11 -0700)]
mesa/es: Validate glPixelStore pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glEnable cap in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 18:56:42 +0000 (11:56 -0700)]
mesa/es: Validate glEnable cap in Mesa code rather than the ES wrapper

Also handle glDisable, glIsEnabled, glEnableClientState, and
glDisableClientState.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glHint target in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 18:03:06 +0000 (11:03 -0700)]
mesa/es: Validate glHint target in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glGetVertexAttribf pname in Mesa code rather than the ES wrapper
Ian Romanick [Wed, 25 Jul 2012 23:21:49 +0000 (16:21 -0700)]
mesa/es: Validate glGetVertexAttribf pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

v3: Allow glGetVertexAttribfv(0, GL_CURRENT_VERTEX_ATTRIB_ARB, param) in
OpenGL 3.1, just like OpenGL ES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glGetString pname in Mesa code rather than the ES wrapper
Ian Romanick [Wed, 25 Jul 2012 22:39:50 +0000 (15:39 -0700)]
mesa/es: Validate glGetString pname in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate primitive modes in Mesa code rather than the ES wrapper
Ian Romanick [Wed, 25 Jul 2012 14:15:29 +0000 (07:15 -0700)]
mesa/es: Validate primitive modes in Mesa code rather than the ES wrapper

v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Refactor _mesa_valid_prim_mode to use a switch-statement
Ian Romanick [Wed, 25 Jul 2012 14:12:33 +0000 (07:12 -0700)]
mesa: Refactor _mesa_valid_prim_mode to use a switch-statement

This makes the next change a bit easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate blend function enums in Mesa code rather than the ES wrapper
Ian Romanick [Wed, 25 Jul 2012 02:52:53 +0000 (19:52 -0700)]
mesa/es: Validate blend function enums in Mesa code rather than the ES wrapper

v2: Add proper core-profile filtering.

v3: Allow GL_SRC_ALPHA_SATURATE as a destination factor in GLES3.  Based
on review feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glClear mask in Mesa code rather than the ES wrapper
Ian Romanick [Tue, 20 Sep 2011 23:39:30 +0000 (16:39 -0700)]
mesa/es: Validate glClear mask in Mesa code rather than the ES wrapper

11 years agomesa/es: Validate glRenderbufferStorage internalFormat in Mesa code rather than the...
Ian Romanick [Fri, 27 Jul 2012 15:31:12 +0000 (08:31 -0700)]
mesa/es: Validate glRenderbufferStorage internalFormat in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

v3: Allow GL_RGB10_A2UI in GLES3 based on review feedback from Eric
Anholt.

v4: Arg.  Reject unsized RED and RG enums on GLES.  More feedback from
Eric.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glGetRenderbufferParameter pname in Mesa code rather than the ES...
Ian Romanick [Fri, 27 Jul 2012 14:49:49 +0000 (07:49 -0700)]
mesa/es: Validate glGetRenderbufferParameter pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa/es: Validate glGetFramebufferAttachmentParameter pname in Mesa code rather than...
Ian Romanick [Fri, 27 Jul 2012 14:47:28 +0000 (07:47 -0700)]
mesa/es: Validate glGetFramebufferAttachmentParameter pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile, GLES1, and GLES3 filtering.

v3: Fix the GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query when the
attachment type is GL_NONE on GLES3.  Other cleanups.  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glGenerateMipmap target in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 14:24:37 +0000 (07:24 -0700)]
mesa/es: Validate glGenerateMipmap target in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

v3: Fix a typo in GL_TEXTURE_2D_ARRAY checking.

v4: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test.  The test
around GL_TEXTURE_2D_ARRAY got some other changes because that enum is
also available with GLES3 (which uses API_OPENGLES2).  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glFramebufferTexture2D textarget in Mesa code rather than the ES...
Ian Romanick [Fri, 27 Jul 2012 14:22:41 +0000 (07:22 -0700)]
mesa/es: Validate glFramebufferTexture2D textarget in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

v3: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test.  The test
around GL_TEXTURE_2D_ARRAY got some other changes because that enum is
also available with GLES3 (which uses API_OPENGLES2).  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoradeon/llvm: Fix encoding of FP immediates on SI
Tom Stellard [Wed, 29 Aug 2012 15:39:38 +0000 (11:39 -0400)]
radeon/llvm: Fix encoding of FP immediates on SI

11 years agoradeon/llvm: Create a register class for the M0 register
Tom Stellard [Wed, 29 Aug 2012 14:33:58 +0000 (10:33 -0400)]
radeon/llvm: Create a register class for the M0 register

The Common Subexpression Elimination pass will not operate on
instructions with physical register defs, so we end up with
several redundant copies to M0 when using interpolation.

Adding a register class that only contains the M0 register allows
use to use a virtual register to represent M0, and makes it possible
for the Common Subexpression Elimination pass to remove the extra
copies.

11 years agoradeon/llvm: Set the neverHasSideEffects bit on more instructions
Tom Stellard [Wed, 29 Aug 2012 14:20:24 +0000 (10:20 -0400)]
radeon/llvm: Set the neverHasSideEffects bit on more instructions

This flag makes these instructions candidates for the dead code
elimination and common subexpression elimination.

11 years agoradeon/llvm: Declare the interpolation intrinsics as ReadOnly
Tom Stellard [Wed, 29 Aug 2012 13:58:28 +0000 (09:58 -0400)]
radeon/llvm: Declare the interpolation intrinsics as ReadOnly

This signals to the Dead Code Elimination pass that it is safe to
remove these instructions when they are dead.

11 years agoradeon/llvm: Mark M0 as a def when lowering interpolation instructions
Tom Stellard [Tue, 28 Aug 2012 19:38:30 +0000 (15:38 -0400)]
radeon/llvm: Mark M0 as a def when lowering interpolation instructions

11 years agometa: Add GLSL variant of _mesa_meta_GenerateMipmap() function
Anuj Phogat [Wed, 29 Aug 2012 18:13:55 +0000 (11:13 -0700)]
meta: Add GLSL variant of _mesa_meta_GenerateMipmap() function

This reduces the overhead of using the fixed function internally
in the driver.

V2: Use setup_glsl_generate_mipmap() and setup_ff_generate_mipmap()
    functions to avoid code duplication.
    Use glsl version when ARB_{vertex, fragmet}_shader are present.
    Remove redundant code.

V3: Remove redundant border related code leaving the assertion.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoglsl: s/class/struct/ for ast_type_qualifier
Brian Paul [Wed, 29 Aug 2012 15:04:00 +0000 (09:04 -0600)]
glsl: s/class/struct/ for ast_type_qualifier

To silence an MSVC compiler warning about class vs. struct.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa: convert a few more macros to inline functions
Brian Paul [Sat, 25 Aug 2012 12:50:40 +0000 (06:50 -0600)]
mesa: convert a few more macros to inline functions

11 years agomesa: remove COPY_4V_CAST() macro
Brian Paul [Sat, 25 Aug 2012 12:43:37 +0000 (06:43 -0600)]
mesa: remove COPY_4V_CAST() macro

Only used in one place, and not really needed.

11 years agomesa: convert a bunch of math macros to inline functions
Brian Paul [Sat, 25 Aug 2012 12:33:16 +0000 (06:33 -0600)]
mesa: convert a bunch of math macros to inline functions

11 years agotnl: use INTERP_4F() instead of four INTERP_F() calls
Brian Paul [Sat, 25 Aug 2012 13:09:14 +0000 (07:09 -0600)]
tnl: use INTERP_4F() instead of four INTERP_F() calls

11 years agoswrast: fix wrong assignments in _swrast_add_spec_terms_line()
Brian Paul [Sat, 25 Aug 2012 13:08:10 +0000 (07:08 -0600)]
swrast: fix wrong assignments in _swrast_add_spec_terms_line()

11 years agomesa: test for GL_EXT_framebuffer_sRGB in glPopAttrib()
Brian Paul [Tue, 28 Aug 2012 03:52:07 +0000 (21:52 -0600)]
mesa: test for GL_EXT_framebuffer_sRGB in glPopAttrib()

To avoid spurious GL_INVALID_ENUM errors if the extension isn't supported.

11 years agomesa: Define CPU_TO_LE32 to work on OpenBSD
Martin Pieuchot [Wed, 29 Aug 2012 12:46:27 +0000 (14:46 +0200)]
mesa: Define CPU_TO_LE32 to work on OpenBSD

Signed-off-by: Brian Paul <brianp@vmware.com>
11 years agodocs: remove mention of old driver maintenance
Brian Paul [Tue, 28 Aug 2012 15:47:30 +0000 (09:47 -0600)]
docs: remove mention of old driver maintenance

People who need old drivers can use older versions of Mesa.

11 years agodocs/utilities: add/update some useful utilities
Andreas Boll [Tue, 28 Aug 2012 15:31:52 +0000 (17:31 +0200)]
docs/utilities: add/update some useful utilities

the progs/util directory is now in mesa demos
replace glean with piglit
add ApiTrace

markup: replace the unordered list <ul> with a definition list <dl>

Signed-off-by: Brian Paul <brianp@vmware.com>
11 years agoi965: Disable the swrast context setup on GL 3.1 core.
Eric Anholt [Sun, 26 Aug 2012 22:29:12 +0000 (15:29 -0700)]
i965: Disable the swrast context setup on GL 3.1 core.

I've reviewed the code, and the swrast callsites remaining are all in
drawpixels/copypixels/bitmap/accum, or _swrast_BlitFramebuffer that shouldn't
be hit.  A piglit run with the context setup disabled on legacy GL and GLES2
showed regressions only in the copypixels and drawpixels tests.

If the context type is forced, this reduces the shader_runner maximum heap
size for glsl-algebraic-add-add-1.shader_test from 15,137,496b to 4,165,376b.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agoi965: Replace general sw fallback support with a manual check for rendermode.
Eric Anholt [Sun, 26 Aug 2012 22:09:23 +0000 (15:09 -0700)]
i965: Replace general sw fallback support with a manual check for rendermode.

There were no other cases that set it any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agointel: Move RenderMode fallback func to i915 driver.
Eric Anholt [Sun, 26 Aug 2012 22:15:44 +0000 (15:15 -0700)]
intel: Move RenderMode fallback func to i915 driver.

The Fallback field of the context struct doesn't work that way on i965, and
it's the only caller of FALLBACK() in the driver.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoi965: Drop the old sw fallback for position array being disabled.
Eric Anholt [Sun, 26 Aug 2012 22:11:49 +0000 (15:11 -0700)]
i965: Drop the old sw fallback for position array being disabled.

This code has been in the driver since the first commit.  I think it was
trying to stop rendering from happening with a disabled position array.  Core
mesa has since had changes to deal with disabled position arrays correctly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoi965: Drop support for forcing drawing through sw fallbacks.
Eric Anholt [Sun, 26 Aug 2012 22:07:03 +0000 (15:07 -0700)]
i965: Drop support for forcing drawing through sw fallbacks.

It turns out it hasn't worked since at least 8.0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoi965: Move depth resolve for span fallbacks to a simpler place.
Eric Anholt [Sun, 26 Aug 2012 21:43:52 +0000 (14:43 -0700)]
i965: Move depth resolve for span fallbacks to a simpler place.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoi965: Drop manual hiz resolves in span rendering.
Eric Anholt [Sun, 26 Aug 2012 21:36:57 +0000 (14:36 -0700)]
i965: Drop manual hiz resolves in span rendering.

swrast uses MapRenderbuffer, which leads to intel_miptree_map, which does the
depth resolve.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoradeon/llvm: Handle TGSI KIL opcode for SI.
Michel Dänzer [Tue, 28 Aug 2012 13:59:30 +0000 (15:59 +0200)]
radeon/llvm: Handle TGSI KIL opcode for SI.

Fixes piglit fp-kil and glBitmap() with radeonsi.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeon/llvm: Basic support for SI EXEC register.
Michel Dänzer [Tue, 28 Aug 2012 18:06:20 +0000 (20:06 +0200)]
radeon/llvm: Basic support for SI EXEC register.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeonsi: Don't write to the PA_SC_RASTER_CONFIG register.
Michel Dänzer [Fri, 24 Aug 2012 15:31:48 +0000 (17:31 +0200)]
radeonsi: Don't write to the PA_SC_RASTER_CONFIG register.

It should be initialized by the kernel as necessary.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
11 years agor600g: fix relative addressing on RS780 and RS880
Marek Olšák [Mon, 27 Aug 2012 00:08:37 +0000 (02:08 +0200)]
r600g: fix relative addressing on RS780 and RS880

They should be treated like RV670.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
11 years agodocs/helpwanted: add radeonsi todo list
Andreas Boll [Tue, 28 Aug 2012 15:28:20 +0000 (17:28 +0200)]
docs/helpwanted: add radeonsi todo list

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
11 years agoconfigure.ac: add radeonsi to --with-gallium-drivers help string
Andreas Boll [Tue, 28 Aug 2012 15:28:19 +0000 (17:28 +0200)]
configure.ac: add radeonsi to --with-gallium-drivers help string

the help string is used by ./configure --help

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
11 years agollvmpipe: Bump the maximum texture size (in pixels).
José Fonseca [Fri, 6 Jul 2012 18:14:37 +0000 (19:14 +0100)]
llvmpipe: Bump the maximum texture size (in pixels).

But cap the size in bytes, to avoid depleting the whole system memory,
with humongus textures.

Tested with max-texture-size piglit test.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agou_vbuf: avoid unnecessary update of the vertex elements
Vadim Girlin [Tue, 28 Aug 2012 14:01:13 +0000 (18:01 +0400)]
u_vbuf: avoid unnecessary update of the vertex elements

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
11 years agoegl: fix invalid flag detection for EGL_KHR_create_context
Matt Turner [Fri, 24 Aug 2012 23:26:54 +0000 (16:26 -0700)]
egl: fix invalid flag detection for EGL_KHR_create_context

We want to check whether there are bits set outside of the valid flags.

Fixes piglit test egl-create-context-invalid-flag-gl

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoi965: Make VS programs obey the shader_precompile driconf option.
Kenneth Graunke [Sun, 26 Aug 2012 19:17:29 +0000 (12:17 -0700)]
i965: Make VS programs obey the shader_precompile driconf option.

Now that it's on by default, we may as well make it obey the flag,
for consistency's sake if nothing else.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Reenable the fragment shader precompile.
Kenneth Graunke [Sun, 26 Aug 2012 19:11:50 +0000 (12:11 -0700)]
i965: Reenable the fragment shader precompile.

Precompiling the shader at link time often allows us to avoid compiling
it at the first use.  This moves the expensive compilation and
optimization process to game or level load time, rather than at draw
time, where we really can't avoid any cycles and don't want to risk
stalling the GPU.

The downside is that we have to guess the non-orthagonal state the
program will have set when it draws with the shader.  Previously, we
guessed wrong for nearly every shader, so it wasn't useful.  With the
recent SamplerUnits rework and this series, we've either eliminated
state or made smarter guesses, and usually get it right now.

In the L4D2 time demo, I now have 39 fragment shader recompiles and no
vertex shader recompiles.  Before this series and the SamplerUnits
rework, I had 206 fragment shader recompiles and 192 vertex shader
recompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Set swizzle fields in the VS precompile program key.
Kenneth Graunke [Sun, 26 Aug 2012 18:45:49 +0000 (11:45 -0700)]
i965: Set swizzle fields in the VS precompile program key.

This fixes a regression since 76d1301e8e8e50dc962601a9977bc52148798349:
I began setting SWIZZLE_XYZW for unused sampler units in the actual
program keys, since this matched the FS precompile behavior.  However,
the VS precompile was expecting zero, so that commit made essentially
every vertex shader (even those not using texturing) mismatch and need
to be recompiled.

Setting them in the VS precompile key solves the issue.  It also is an
improvement over our old behavior: previously we guessed that vertex
shaders didn't use any textures at all.  Now we actually look to see if
the VS had any sampler uniforms and guess based on that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965/vs: Add VS program key dumping to INTEL_DEBUG=perf.
Kenneth Graunke [Sun, 26 Aug 2012 14:41:50 +0000 (07:41 -0700)]
i965/vs: Add VS program key dumping to INTEL_DEBUG=perf.

Eric added support for WM key debugging.  This adds it for the VS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965/fs: Assume shadow sampler swizzling is <X, X, X, 1>.
Kenneth Graunke [Sun, 26 Aug 2012 07:34:03 +0000 (00:34 -0700)]
i965/fs: Assume shadow sampler swizzling is <X, X, X, 1>.

Our previous assumption, SWIZZLE_XYZW, was completely bogus for depth
textures.  There are no Y, Z, or W components.

DEPTH_TEXTURE_MODE has three options:
- GL_LUMINANCE: <X, X, X, 1>
- GL_INTENSITY: <X, X, X, X>
- GL_ALPHA:     <0, 0, 0, X>

The default value is GL_LUMINANCE, and most applications don't seem to
alter DEPTH_TEXTURE_MODE.  Make that our precompile guess.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Index sampler program key data by linker-assigned index.
Kenneth Graunke [Sun, 26 Aug 2012 07:28:38 +0000 (00:28 -0700)]
i965: Index sampler program key data by linker-assigned index.

Now that most things are based on the linker-assigned index, it makes
sense to convert the arrays in the VS/WM program key as well.  It seems
silly to leave them indexed by texture unit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Only set proj_attrib_mask for fixed function.
Kenneth Graunke [Tue, 14 Aug 2012 06:42:23 +0000 (23:42 -0700)]
i965: Only set proj_attrib_mask for fixed function.

brw_wm_prog_key's proj_attrib_mask field is designed to enable an
optimization for fixed-function programs, letting us avoid projecting
attributes where the divisor is 1.0.

However, for shaders, this is not useful, and is pretty much impossible
to guess when building the FS precompile key.  Turning it off for
shaders should allow the precompile to work and not lose much.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Suggested-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Don't set stats_wm in the WM program key on Gen6+.
Kenneth Graunke [Sun, 26 Aug 2012 07:47:44 +0000 (00:47 -0700)]
i965: Don't set stats_wm in the WM program key on Gen6+.

It's only needed for Gen4/5 IZ lookup workarounds.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Don't set vp_outputs_written in the WM program key on Gen6+.
Kenneth Graunke [Tue, 14 Aug 2012 06:59:09 +0000 (23:59 -0700)]
i965: Don't set vp_outputs_written in the WM program key on Gen6+.

It's only used by on pre-Sandybridge hardware.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Double the size of the state cache.
Kenneth Graunke [Sun, 26 Aug 2012 07:07:56 +0000 (00:07 -0700)]
i965: Double the size of the state cache.

We probably want to do something more sophisticated here, but this at
least makes it through L4D2 without dumping the program cache.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoglapi/glx: call __glEmptyImage if USE_XCB, not memcpy directly
Julien Cristau [Fri, 20 Jul 2012 09:09:19 +0000 (11:09 +0200)]
glapi/glx: call __glEmptyImage if USE_XCB, not memcpy directly

We were stomping on the caller's buffer by ignoring their alignment
requests and other pixel store modes.  This patch makes the USE_XCB path match
the older one more closely.

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

Signed-off-by: Julien Cristau <julien.cristau@logilab.fr>
Signed-off-by: Brian Paul <brianp@vmware.com>
11 years agogallium/util: implement tile code for PIPE_FORMAT_Z32_FLOAT
Brian Paul [Mon, 27 Aug 2012 15:31:18 +0000 (09:31 -0600)]
gallium/util: implement tile code for PIPE_FORMAT_Z32_FLOAT

Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agost/mesa: use fallback path for glCopyTexSubImage(GL_TEXTURE_1D_ARRAY)
Brian Paul [Mon, 27 Aug 2012 15:31:18 +0000 (09:31 -0600)]
st/mesa: use fallback path for glCopyTexSubImage(GL_TEXTURE_1D_ARRAY)

Fixes many failing cases in piglit copyteximage test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agoi965: Move hiz resolve to after renderbuffer resizing (v2)
Chad Versace [Tue, 14 Aug 2012 18:23:21 +0000 (11:23 -0700)]
i965: Move hiz resolve to after renderbuffer resizing (v2)

Do all pre-draw hiz resolves *after* the renderbuffers are resized by
intel_prepare_render. Otherwise, we may resolve buffers that are
immediately discarded afterwards.

Fixes the assertion failure below when resizing windows in KDE and under
some unknown circumstance in Chrome OS:
    intel_resolve_map.c:46: intel_resolve_map_set: Assertion
    `(*tail)->need == need' failed.

Also, remove the comment that "resolves must occur [...] before setting up
any hardware state". That was true when resolves were implemented with
meta-ops, but no longer with blorp.

v2:
  - Keep brw_predraw_resolve_buffers in its current position, which is
    before any brw_context bits are modified. Instead, move the call to
    intel_prepare_render.

Note: This is a candiate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52252
Reported-by: Lu Hua <huax.lu@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
11 years agoi965: Remove redundant null check
Chad Versace [Tue, 14 Aug 2012 18:28:27 +0000 (11:28 -0700)]
i965: Remove redundant null check

intel_renderbuffer_resolve_hiz checks if rb->mt is null, so there is no
need for the caller to do so.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
11 years agor300g: implement TRUNC correctly
Marek Olšák [Mon, 27 Aug 2012 05:38:15 +0000 (07:38 +0200)]
r300g: implement TRUNC correctly

This fixes some integer division tests.

11 years agoradeonsi: Use FP16 shader export format when necessary / possible.
Michel Dänzer [Wed, 22 Aug 2012 16:15:36 +0000 (18:15 +0200)]
radeonsi: Use FP16 shader export format when necessary / possible.

Fixes piglit fbo-blending-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agoradeonsi: Refactor initialization of shader export intrinsic arguments.
Michel Dänzer [Fri, 24 Aug 2012 10:03:11 +0000 (12:03 +0200)]
radeonsi: Refactor initialization of shader export intrinsic arguments.

In preparation for extending this code, which would make it rather unwieldy in
its current place.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agoradeonsi: Maintain cache of pixel shader variants according to contxt state.
Michel Dänzer [Thu, 23 Aug 2012 15:10:37 +0000 (17:10 +0200)]
radeonsi: Maintain cache of pixel shader variants according to contxt state.

Mostly inspired by r600g commit 4acf71f01ea1edb253cd38cc059d4af1a2a40bf4
('r600g: cache shader variants instead of rebuilding v3').

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agoradeonsi: Drop extraneous semicolons from pm4 state macro definitions.
Michel Dänzer [Thu, 23 Aug 2012 15:55:51 +0000 (17:55 +0200)]
radeonsi: Drop extraneous semicolons from pm4 state macro definitions.

Could cause build failures if trying to use the macros in certain constructs.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: implement compression for MSAA colorbuffers for evergreen
Marek Olšák [Sun, 12 Aug 2012 18:06:33 +0000 (20:06 +0200)]
r600g: implement compression for MSAA colorbuffers for evergreen

This adds the FMASK and CMASK buffers. They share the same resource
with color data.

COMPRESSION and FAST_CLEAR are always enabled if both FMASK and CMASK are
allocated. We initialize the CMASK to a "compressed" state (not "fast cleared"),
so that we can keep FAST_CLEAR enabled all the time.

Both FMASK and CMASK must be present at the moment. If either one is missing,
the other one is not used.

v2: add cayman regs in the list

Reviewed-by: Jerome Glisse <jglisse@redhat.com>