Dave Airlie [Sat, 1 Oct 2011 12:44:49 +0000 (13:44 +0100)]
mesa/texstore: add texstore paths for all the integer types.
This just adds the entries to the table and fixes the asserts up.
The int32 one is definitely wrong, since it uses a float temp
which will lose precision, but its no worse than now.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 30 Sep 2011 07:41:20 +0000 (08:41 +0100)]
mesa/texformat: update choose_tex_format for integer types.
This adds the integer types to the tex format chooser.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Mon, 26 Sep 2011 20:14:10 +0000 (21:14 +0100)]
mesa/formats: add rest of integer formats.
This is taken from reading EXT_texture_integer + EXT_texture_rg in combination,
Comments on necessity of each format, naming of formats and bugs in the
formats tables please.
Is there any formats I've missed?
Eric looked over this to make sure its consistent at least.
As I've changed the ordering of things in the format table, the follow
patches are required to avoid regression.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 5 Oct 2011 12:18:17 +0000 (13:18 +0100)]
texstore: create texstore table on first access.
As per Brian's suggestion we can generate this table at first start
to make sure its correct. This is a sad workaround for compilers which
don't support named initialiser. (its 2011).
Signed-off-by: Dave Airlie <airlied@redhat.com>
Stéphane Marchesin [Wed, 5 Oct 2011 01:03:22 +0000 (18:03 -0700)]
glsl: Remove unneeded headers.
Brian Paul [Tue, 4 Oct 2011 22:53:46 +0000 (16:53 -0600)]
egl: restore missing \ in Makefile
Paul Berry [Wed, 28 Sep 2011 19:58:13 +0000 (12:58 -0700)]
r200/r300/r600: remove dangling radeon_tex_getimage.c symlinks.
Commit
d1fda903 (radeon: Drop mapping we were doing around
glGetTexImage()) removed the common Radeon source file
radeon_tex_getimage.c, and pulled it out of the r200, r300, r600, and
radeon makefiles. But it left behind the symlinks that were being
used to share that file among the four directories.
This patch removes the dangling symlinks.
Reviewed-by: Brian Paul <brianp@vmware.com>
Kenneth Graunke [Tue, 4 Oct 2011 09:53:45 +0000 (02:53 -0700)]
glapi: Enclose glapi.h in an extern "C" block when included by C++.
Fixes a build failure introduced in commit
b7fa0d0727a3a9e1f64d3cfc7a0f157b35dec09e.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Paul Berry <stereotype441@gmail.com>
Brian Paul [Tue, 4 Oct 2011 21:59:09 +0000 (15:59 -0600)]
scons: add new files to src/mesa/SConscript
Brian Paul [Tue, 4 Oct 2011 21:01:05 +0000 (15:01 -0600)]
softpipe: fix Z interpolation invariance bug
We want quad/pixel Z values to be interpolated exactly the same for
multi-pass algorithms. Because of how the optimized Z-test code is
written, we can't cull the first quad in a run even if it's totally
killed. See the comment for more info.
NOTE: This is a candidate for the 7.11 branch.
Brian Paul [Tue, 4 Oct 2011 20:45:13 +0000 (14:45 -0600)]
softpipe: add check for DO_PSTIPPLE_IN_HELPER_MODULE
We only want to generate the fragment shader variant that does
stippling if DO_PSTIPPLE_IN_HELPER_MODULE is being used.
Ian Romanick [Thu, 18 Aug 2011 22:43:50 +0000 (15:43 -0700)]
mesa: Remove unused gl_program::Attributes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Thu, 18 Aug 2011 22:27:18 +0000 (15:27 -0700)]
mesa: Determine GL_ACTIVE_ATTRIBUTE_MAX_LENGTH by walking the GLSL IR.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Thu, 18 Aug 2011 22:22:21 +0000 (15:22 -0700)]
mesa: Determine GL_ACTIVE_ATTRIBUTES by walking the GLSL IR.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Thu, 18 Aug 2011 22:08:51 +0000 (15:08 -0700)]
mesa: Remove unused gl_shader_program::Attributes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Thu, 18 Aug 2011 22:06:07 +0000 (15:06 -0700)]
mesa: Make _mesa_GetActiveAttribARB use the attributes in the shader IR
Instead of relying on the mirror in the Mesa IR assembly shader, just
use the variables actually stored in the GLSL IR. This will be a bit
slower, but nobody cares about the performance of glGetActiveAttrib.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Wed, 17 Aug 2011 22:44:48 +0000 (15:44 -0700)]
mesa: Move _mesa_GetActiveAttribARB to shader_query.cpp
This just folds get_active_attrib into _mesa_GetActiveAttribARB
and moves the resulting function function to the other source file.
More changes are coming soon.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Wed, 17 Aug 2011 22:40:03 +0000 (15:40 -0700)]
linker: Use gl_shader_program::AttributeBindings for attrib locations
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Wed, 17 Aug 2011 22:38:53 +0000 (15:38 -0700)]
mesa: Add gl_shader_program::AttributeBindings
This currently mirrors the state tracking
gl_shader_program::Attributes, but I'm working towards eliminating
that.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Wed, 17 Aug 2011 22:35:09 +0000 (15:35 -0700)]
mesa: Move _mesa_BindAttribLocationARB to shader_query.cpp
This just folds bind_attrib_location into _mesa_BindAttribLocationARB
and moves the resulting function function to the other source file.
More changes are coming soon.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Fri, 30 Sep 2011 21:58:29 +0000 (14:58 -0700)]
mesa: Add string_to_uint_map facade class
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Ian Romanick [Wed, 17 Aug 2011 18:51:15 +0000 (11:51 -0700)]
mesa: Add hash_table_replace
hash_table_replace doesn't use get_node to avoid having to hash the key twice.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Tue, 16 Aug 2011 19:51:25 +0000 (12:51 -0700)]
mesa: Move _mesa_GetAttribLocationARB to shader_query.cpp
This allows querying the linked shader itself rather than the Mesa IR.
This is the first step towards removing gl_program::Attributes.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Fri, 30 Sep 2011 21:21:10 +0000 (14:21 -0700)]
glsl: Delete symbol table in post-link shaders
The symbol table in the linked shaders may contain references to
variables that were removed (e.g., unused uniforms). Since it may
contain junk, there is no possible valid use. Delete it and set the
pointer to NULL.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Tue, 20 Sep 2011 16:58:26 +0000 (09:58 -0700)]
glapi: regen API files for new extension
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Ian Romanick [Sun, 2 Oct 2011 22:22:18 +0000 (15:22 -0700)]
mesa: Remove ARB_draw_buffers extension enable flag
All drivers in Mesa have supported this extension for eons. This
extension is an optional features in desktop OpenGL (via
GL_ARB_draw_buffers) and OpenGL ES 2.x (via GL_NV_draw_buffers).
The extension is not usable in OpenGL ES 1.x. There is no
glDrawBuffers* entry point in OpenGL ES 1.x contexts, and glGet*v
generate errors when MAX_DRAW_BUFFERS or DRAW_BUFFERi is queried.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Tue, 20 Sep 2011 21:48:56 +0000 (14:48 -0700)]
mesa: Advertise NV_fbo_color_attachments on OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Tue, 20 Sep 2011 16:47:52 +0000 (09:47 -0700)]
mesa: Advertise NV_draw_buffers in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Sun, 2 Oct 2011 22:27:22 +0000 (15:27 -0700)]
mesa/es: Allow querying GL_DRAW_BUFFERi in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Sun, 2 Oct 2011 22:12:11 +0000 (15:12 -0700)]
mesa/es: Allow querying GL_MAX_COLOR_ATTACHMENTS in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Sun, 2 Oct 2011 22:03:07 +0000 (15:03 -0700)]
mesa/es: Allow other color attachments in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Tue, 20 Sep 2011 22:14:34 +0000 (15:14 -0700)]
mesa/es: Make glDrawBuffersNV available in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Tue, 20 Sep 2011 16:31:55 +0000 (09:31 -0700)]
glapi: Add entry point for NV_draw_buffers
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Tue, 20 Sep 2011 16:25:31 +0000 (09:25 -0700)]
glapi: Move ARB_draw_buffers extension to a separate file
This also moves ATI_draw_buffers. This is to facilitate enabling
NV_draw_buffers in OpenGL ES 2.0.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Tue, 20 Sep 2011 22:13:27 +0000 (15:13 -0700)]
mesa/es: Remove redundant renderbuffer target validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Tue, 20 Sep 2011 22:10:50 +0000 (15:10 -0700)]
mesa/es: Validate FBO target enum in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Sun, 2 Oct 2011 21:50:21 +0000 (14:50 -0700)]
mesa/es: Validate FBO attachment enum in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Stéphane Marchesin [Sat, 1 Oct 2011 00:49:48 +0000 (17:49 -0700)]
configure: replace pkg-config calls with $(PKG_CONFIG) in the makefiles.
Us poor souls who cross compile mesa want to be able to specify which pkg-config to pick, or at least just change one place.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Stephen White [Mon, 3 Oct 2011 22:18:22 +0000 (15:18 -0700)]
st/glx: Set the drawable attribute on xmesa_buffer creation.
Otherwise we'll be unable to use our pbuffers.
Marek Olšák [Mon, 3 Oct 2011 19:45:15 +0000 (21:45 +0200)]
r300g: fix rendering with a non-zero index bias in draw_elements_immediate
NOTE: This is a candidate for the stable branches.
Guillem Jover [Tue, 4 Oct 2011 06:46:35 +0000 (08:46 +0200)]
docs: Update references to README files
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
Guillem Jover [Tue, 4 Oct 2011 06:46:34 +0000 (08:46 +0200)]
Remove remnants of legacy glide support
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
Guillem Jover [Tue, 4 Oct 2011 06:46:33 +0000 (08:46 +0200)]
Ignore all shared objects
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Sat, 1 Oct 2011 23:55:58 +0000 (01:55 +0200)]
r600g: fix parsing TGSI declarations
It was a lucky coincidence that it worked.
Brian Paul [Tue, 4 Oct 2011 00:20:59 +0000 (18:20 -0600)]
nouveau: remove unused code, unused var
Brian Paul [Tue, 4 Oct 2011 00:20:59 +0000 (18:20 -0600)]
i915: don't include texstore.h
Brian Paul [Tue, 4 Oct 2011 00:20:59 +0000 (18:20 -0600)]
i965: remove unneeded includes of texstore.h
Brian Paul [Mon, 3 Oct 2011 23:48:53 +0000 (17:48 -0600)]
swrast: fix delayed texel buffer allocation regression
Commit
617cdcd4c7b1cffb584c829c35bdf9c9bf04627b delayed the texel
buffer allocation until texture_combine() is called. But the
texel buffer is needed sooner in _swrast_texture_span() at line 649.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41433
Brian Paul [Mon, 3 Oct 2011 23:37:04 +0000 (17:37 -0600)]
mesa: fix warning (MSVC error) about void pointer arithmetic
Eric Anholt [Tue, 6 Sep 2011 17:21:54 +0000 (10:21 -0700)]
i965: Add support for GL_EXT_texture_array and GL_MESA_texture_array.
Eric Anholt [Thu, 29 Sep 2011 21:54:23 +0000 (14:54 -0700)]
intel: Add a safety check for mapping 1D texture arrays.
So easy to screw up with the crazy way GL manages them.
Eric Anholt [Thu, 29 Sep 2011 21:01:42 +0000 (14:01 -0700)]
intel: Add debug output to intel_map_texture_image.
Eric Anholt [Thu, 29 Sep 2011 18:30:18 +0000 (11:30 -0700)]
intel: Add a helper function for getting miptree size from a texture image.
With 1D array textures, we no longer agree between the GL information
about width/height/depth of a texture and how we lay out a miptree.
Eric Anholt [Thu, 29 Sep 2011 20:40:12 +0000 (13:40 -0700)]
i965: Refactor out the cube map setup for general texture array setup.
This is just moving the code out with s/6/slices/.
Eric Anholt [Thu, 29 Sep 2011 21:48:04 +0000 (14:48 -0700)]
mesa: Reuse existing make_2d_mipmap for 2D array generation.
Reviewed-by: Brian Paul <brianp@vmware.com>
Eric Anholt [Thu, 29 Sep 2011 21:09:07 +0000 (14:09 -0700)]
mesa: Make the uncompressed sw mipmap gen path do a Map per 1D array slice.
This also fixes what was probably a bug in 1D arrays with border.
Reviewed-by: Brian Paul <brianp@vmware.com>
Eric Anholt [Wed, 28 Sep 2011 18:17:11 +0000 (11:17 -0700)]
mesa: When storing texture data for a 1D array, map each slice separately.
Reviewed-by: Brian Paul <brianp@vmware.com>
Eric Anholt [Wed, 28 Sep 2011 18:15:01 +0000 (11:15 -0700)]
swrast: When asked to map a slice of a 1D array, give back that slice.
Until now, we've been treating 1D arrays as a single slice, and each
array slice is actually just a row of the 2D texture. While swrast
still stores them this way, hardware drivers think that 1D arrays have
actual separate slices not stored as contiguous rows.
Reviewed-by: Brian Paul <brianp@vmware.com>
Eric Anholt [Wed, 28 Sep 2011 23:07:56 +0000 (16:07 -0700)]
intel: Consolidate texture validation copy code, and reuse it correctly.
The path for ->Data was failing to be called for the FBO draw offset
fallback, and also had mismatched compressed texture support code.
This drops the intel_prepare_render() in the blit path. We aren't
copying to/from a GL_FRONT buffer, so it doesn't matter.
Eric Anholt [Wed, 28 Sep 2011 22:25:30 +0000 (15:25 -0700)]
intel: Clean up the function chain for mapping texture images for swrast.
Too many separate functions each called from one location (in
different files). This code should all die soon when swrast starts
using MapTextureImage.
Eric Anholt [Wed, 28 Sep 2011 19:27:56 +0000 (12:27 -0700)]
intel: Make PBO TexImage use AllocTextureImageBuffer like non-PBO does.
Now that whole block that also lives in AllocTextureImageBuffer can go
away.
Eric Anholt [Mon, 1 Aug 2011 22:24:14 +0000 (15:24 -0700)]
intel: Rely on Mesa core for glTexImage storage.
Reviewed-by: Brian Paul <brianp@vmware.com>
Eric Anholt [Wed, 28 Sep 2011 19:30:45 +0000 (12:30 -0700)]
intel: Allocate s8z24 separate renderbuffers from AllocTextureImageBuffer().
Before, we were only allocating these from our TexImage, so if the
texture image was set up in any other way (non-accelerated
glGenerateMipmaps()), they'd be missing or wrong.
Eric Anholt [Wed, 21 Sep 2011 21:43:20 +0000 (14:43 -0700)]
intel: Add an AllocTextureImageBuffer() implementation using miptrees.
Now we can rely on Mesa core for uploads of data without introducing
an extra copy at validate time.
Brian Paul [Tue, 2 Aug 2011 06:04:12 +0000 (23:04 -0700)]
mesa: Convert _mesa_generate_mipmap to MapTexImage()-based access.
Now that we can zero-copy generate the mipmaps into brand new
glTexImage()-generated storage using MapTextureImage(), we no longer
need to allocate image->Data in mipmap generate. This requires
deleting the drivers' old overrides of the miptree tracking after
calling _mesa_generate_mipmap at the same time, or the drivers
promptly lose our newly-generated data.
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Thu, 29 Sep 2011 00:37:57 +0000 (17:37 -0700)]
i965: Stop lowering integer division to multiply and reciprocal.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Thu, 29 Sep 2011 00:37:56 +0000 (17:37 -0700)]
i965: Reverse the operands for INT DIV prior to Gen6.
Apparently on Gen4 and 5, the denominator comes first.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Thu, 29 Sep 2011 00:37:55 +0000 (17:37 -0700)]
i965/vs: Implement integer quotient and remainder math operations.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Thu, 29 Sep 2011 00:37:54 +0000 (17:37 -0700)]
i965/fs: Implement integer quotient and remainder math operations.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Thu, 29 Sep 2011 00:37:53 +0000 (17:37 -0700)]
i965: Set the signed/unsigned type bit in Gen4/5 math messages.
It never mattered before since we only did floating point math.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Thu, 29 Sep 2011 00:37:52 +0000 (17:37 -0700)]
i965: Fix message and response length calculations for INT DIV.
Both POW and INT DIV need a message length of 2; previously, we only
checked for POW.
Also, BRW_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER has a response
length of 2; previously, we only checked for SINCOS. We don't use this
message, but in case we ever decide to, we may as well fix it now.
While we're at it, just move these computations into
brw_set_math_message, since they're entirely based on the function.
This fixes it for both brw_math and the old backend's brw_math_16.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Thu, 29 Sep 2011 00:37:51 +0000 (17:37 -0700)]
i965: Fix assertions about register types for INT DIV in brw_math.
BRW_MATH_FUNCTION_REMAINDER was missing. Also, it seems worthwhile to
assert that INT DIV's arguments are signed/unsigned integers.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Thu, 29 Sep 2011 00:37:50 +0000 (17:37 -0700)]
ir_to_mesa: Don't assertion fail on integer modulus.
Drivers implementing GLSL 1.30 want to do integer modulus, and until we
can stop generating code via ir_to_mesa, it's easier to make it silently
generate rubbish code. Multiply will do.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tom Stellard [Sat, 1 Oct 2011 22:22:24 +0000 (15:22 -0700)]
r300/compiler: Fix error in OMOD optimization
Classic compiler mistake. In the example below, the OMOD optimization
was combining instructions 4 and 10, but since there was an instruction
(#8) in between them that wrote to the same registers as instruction 10,
instruction 11 was reading the wrong value.
Example of the mistake:
Before OMOD:
4: MAD temp[0].y, temp[3]._y__, const[0]._x__, const[0]._y__;
...
8: ADD temp[2].x, temp[1].x___, -temp[4].x___;
...
10: MUL temp[2].x, const[1].y___, temp[0].y___;
11: FRC temp[5].x, temp[2].x___;
After OMOD:
4: MAD temp[2].x / 8, temp[3]._y__, const[0]._x__, const[0]._y__;
...
8: ADD temp[2].x, temp[1].x___, -temp[4].x___;
...
11: FRC temp[5].x, temp[2].x___;
https://bugs.freedesktop.org/show_bug.cgi?id=41367
Tom Stellard [Sat, 1 Oct 2011 22:21:05 +0000 (15:21 -0700)]
r300/compiler: Rewrite source swizzles when using OMOD
Tom Stellard [Sat, 1 Oct 2011 22:18:18 +0000 (15:18 -0700)]
r300/compiler: Fix rc_normal_rewrite_writemask()
This function had not been updated to use conversion swizzles.
Tom Stellard [Sun, 2 Oct 2011 04:06:12 +0000 (21:06 -0700)]
r300/compiler: Use consistent src swizzles for transcendent instructions
Source swizzles for transcendent instructions were being stored in the X
channel regardless of what channel the instruction was writing.
This was causing problems for some helper functions that were expecting
source swizzles to occupy channels corresponding to the instruction's
writemask. This commit makes transcendent instructions follow the same
convention as normal instructions for representing source swizzles.
Previous behavior:
LG2 temp[0].y, input[0].x___;
Current behavior:
LG2 temp[0].y, input[0]._x__;
Eric Anholt [Fri, 30 Sep 2011 06:13:44 +0000 (23:13 -0700)]
mesa: Respect GL_RASTERIZER_DISCARD for various meta-type operations.
From the EXT_transform_feedback spec:
Primitives can be optionally discarded before rasterization by calling
Enable and Disable with RASTERIZER_DISCARD_EXT. When enabled, primitives
are discared right before the rasterization stage, but after the optional
transform feedback stage. When disabled, primitives are passed through to
the rasterization stage to be processed normally. RASTERIZER_DISCARD_EXT
applies to the DrawPixels, CopyPixels, Bitmap, Clear and Accum commands as
well.
And the GL 3.2 spec says it applies to ClearBuffer* as well.
Reviewed-by: Brian Paul <brianp@vmware.com>
Eric Anholt [Thu, 29 Sep 2011 22:15:02 +0000 (15:15 -0700)]
mesa: Add missing glGetIntegerv() support for ARB_color_buffer_float tokens.
Fixes piglit ARB_color_buffer_float/api-get
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Mon, 26 Sep 2011 23:22:17 +0000 (16:22 -0700)]
Revert "vbo: Don't discount stride == 0 for testing all varyings in VBOs."
This reverts commit
d631c19db47181129811080bfa772b210d762d4d.
The commit was broken, and ended up returning false all the time
because nobody in the world binds every single possible vertex array.
On further reflection, we don't want to discount stride == 0: This
function is just used for deciding to calculate whether to compute the
bonuds on the index, and there's no sense in computing index bounds
when stride == 0.
For the separate question of "how much data do I upload for this
vertex element?", the i965 driver was fixed to upload the data.
Fixes a regression of about 2x in 3DMMES, and most importantly, makes
Hammerfight playable.
Eric Anholt [Mon, 26 Sep 2011 23:14:40 +0000 (16:14 -0700)]
i965: Make sure to upload the data for a collection of Stride == 0 arrays.
Commit
d631c19db47181129811080bfa772b210d762d4d avoided this problem
by forcing the driver to get the min/max index, but that commit was
broken, so just fix the driver problem (confusion between "do I need
to upload any data?" and "do I need the index bounds in order to
upload any data?").
Eric Anholt [Thu, 22 Sep 2011 19:52:43 +0000 (12:52 -0700)]
mesa: Delay s_texcombine.c memory allocation until it's used.
Generally we're using fragment programs in all our drivers, so wasting
4MB for code that's never called is pretty lame. Reduces i965 memory
allocation for a short shader program from 21,932,128B to 17,737,816B.
Eric Anholt [Thu, 22 Sep 2011 18:28:19 +0000 (11:28 -0700)]
tnl: Delay results allocation until we actually need them.
Decreases i965 peak memory allocation for a trivial shader program
from 23,483,048B to 21,932,128B, since we never actually use tnl for
rendering.
Ian Romanick [Fri, 30 Sep 2011 23:24:35 +0000 (16:24 -0700)]
i965/vs: Fix swizzle related assertion
As innocuous as it seemed,
ebca47a basically broke the world (e.g.,
>200 piglit regressions). In vec4_visitor::emit_block_move,
src->swizzle was expected to be BRW_SWIZZLE_NOOP before setting it to
a swizzle that would replicate the existing channels of the source
type to a vec4 (e.g., .xyyy for a vec2).
The original assertion seems to have been a little bogus. In addition
to being BRW_SWIZZLE_NOOP, src->swizzle might already be a swizzle
that would replicate the existing channels of the source type to a
vec4. In other words, it might already have the value that we're
about to assign to it.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Brian Paul [Sat, 1 Oct 2011 14:27:46 +0000 (08:27 -0600)]
mesa: number of combiner terms to pop depends on GL_NV_texture_env_combine4
If GL_NV_texture_env_combine4 is not supported, setting the fourth
combiner term would generate a GL error.
Of course, I noticed this right after committing the previous patch
to use a loop in the first place. <sigh>
Note that GL_EXT_texture_env_combine is always supported so the first
three combiner terms are always accepted.
Brian Paul [Sat, 1 Oct 2011 03:03:42 +0000 (21:03 -0600)]
mesa: s/INLINE/inline/
INLINE is still seen in some files (some generated files, etc) but this
is a good start.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Sat, 1 Oct 2011 03:12:04 +0000 (21:12 -0600)]
r600: include version.h for _mesa_override_glsl_version() prototype
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Sat, 1 Oct 2011 03:03:42 +0000 (21:03 -0600)]
mesa: use !! to simplify some _mesa_set_enable() calls in attrib.c
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Sat, 1 Oct 2011 03:03:42 +0000 (21:03 -0600)]
mesa: use loop in pop_texture_group() to restore 4 combiner terms
There's four combiner terms (not 3) with GL_NV_texture_env_combine4.
Use a loop to make the code a little more compact.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Wed, 17 Aug 2011 18:48:07 +0000 (11:48 -0700)]
mesa: Refactor hash_table_{find,remove} to share some code
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Wed, 17 Aug 2011 18:43:11 +0000 (11:43 -0700)]
mesa: Document an odd side-effect of hash_table_insert
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Tue, 16 Aug 2011 18:06:54 +0000 (11:06 -0700)]
mesa: Remove unused field gl_program::Varying
Lots of things set and copy this field around, but nothing uses it.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Thu, 22 Sep 2011 23:56:58 +0000 (16:56 -0700)]
mesa: Use Add linker_error instead of fail_link
See also
8aadd89.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Marek Olšák [Fri, 30 Sep 2011 21:06:51 +0000 (23:06 +0200)]
r600g: fix a compiler warning
Marek Olšák [Fri, 30 Sep 2011 21:02:06 +0000 (23:02 +0200)]
gallium/docs: update the documentation of capabilities
Still like 13 caps are undocumented.
Marek Olšák [Tue, 27 Sep 2011 14:42:01 +0000 (16:42 +0200)]
r600g: move all files from winsys/r600 into drivers/r600
Be sure to reconfigure after this commit.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Marek Olšák [Mon, 26 Sep 2011 23:10:20 +0000 (01:10 +0200)]
winsys/radeon: move GEM domains out of the drivers into winsys
The drivers don't need to care about the domains. All they need to set
are the bind and usage flags. This simplifies the winsys too.
This also fixes on r600g:
- fbo-depth-GL_DEPTH_COMPONENT32F-copypixels
- fbo-depth-GL_DEPTH_COMPONENT16-copypixels
- fbo-depth-GL_DEPTH_COMPONENT24-copypixels
- fbo-depth-GL_DEPTH_COMPONENT32-copypixels
- fbo-depth-GL_DEPTH24_STENCIL8-copypixels
I can't explain it.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Marek Olšák [Tue, 27 Sep 2011 00:08:15 +0000 (02:08 +0200)]
winsys/radeon: remove a redundant parameter 'size' from buffer_from_handle
It's part of pb_buffer already.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Marek Olšák [Sat, 17 Sep 2011 12:10:20 +0000 (14:10 +0200)]
r600g: remove struct radeon (or what's left of it)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Marek Olšák [Sat, 17 Sep 2011 11:56:09 +0000 (13:56 +0200)]
r600g: move family and chip_class from struct radeon to r600_screen
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>