Commit Graph

55039 Commits

Author SHA1 Message Date
Marek Olšák b89b80a91d st/mesa: put RGBX8 and RGBA8 in the default format lists
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-06 14:51:32 +01:00
Marek Olšák c1856da75d st/mesa: add the rest of RGB8 format/type combos to exact_format_mapping tables
These formats were added a few months after these tables were committed.
No idea why we have the table though. AFAIK, texstore always takes the slow path
for GL_RGBn.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-06 14:51:32 +01:00
Marek Olšák ebe86b8082 mesa: fixup inconsistent naming of RG16 formats
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-06 14:51:31 +01:00
Marek Olšák cf37aef414 r600g: report correct control flow depth 2013-02-06 14:51:31 +01:00
Marek Olšák fc86394882 glsl: fix incorrect comment about do_common_optimization 2013-02-06 14:51:31 +01:00
Marek Olšák 4362bdadf3 st/mesa: emit saturates in the vertex shader if Shader Model 3.0 is supported
v2: change the requirement from GLSL 1.30 to SM 3.0 (R500 can do this)
2013-02-06 14:51:31 +01:00
Marek Olšák 48689ca14a st/mesa: advertise ARB_shading_language_packing for GLSL >= 1.30
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-06 14:51:31 +01:00
Marek Olšák afd4178fec st/mesa: do most of GLSL lowering outside of the optimization do-while loop
based on the intel driver

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-06 14:51:31 +01:00
Marek Olšák 7325f1faaa st/mesa: remove dead code depending on EmitCondCodes
EmitCondCodes is always false.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-06 14:51:31 +01:00
Marek Olšák 85efb2fff0 r300g: try to use color varyings for texcoords if max texcoord limit is exceeded
+35 piglits
2013-02-06 14:45:22 +01:00
Marek Olšák 1d3561d877 r300/compiler: copy-propagate saturate mode when possible
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-02-06 14:45:20 +01:00
Marek Olšák ae8696c7ee r300/compiler: add support for saturate output modifier in r500 vertex shaders
The GLSL compiler can simplify clamp(v,0,1) to saturate. The state tracker
doesn't use it yet, but it will.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-02-06 14:45:16 +01:00
Marek Olšák 499f7de12e r300g: fix blending with RGBX formats
Change DST_ALPHA to ONE.
2013-02-06 14:31:23 +01:00
Marek Olšák f40a7fc34a r300g: fix blending with blend color and RGBA formats
NOTE: This is a candidate for the stable branches.
2013-02-06 14:31:23 +01:00
José Fonseca 5048e69392 egl/dri: Don't invoke dri2_dpy->flush if it's NULL.
I'd like to test Mesa OpenGL ES along side with NVIDIA libGL drivers. But
without this change, I get a NULL pointer dereference.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-06 09:22:26 +00:00
Vinson Lee d08cee5d80 glsl: Initialize ast_parameter_declarator member variables.
Fixes uninitialized pointer field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-05 22:11:32 -08:00
Brian Paul ff60509157 svga: fix sRGB rendering
We weren't emitting the SVGA_RS_OUTPUTGAMMA state so sRGB rendering
didn't work properly.

Fixes piglit's framebuffer-srgb test.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-05 12:34:55 -07:00
Tom Stellard 8aaee4d64e r600g/compute: Fix segfault caused by new shader disassembler 2013-02-05 15:41:33 +00:00
Michel Dänzer 02a423b239 Require libdrm_radeon 2.4.42 for radeonsi.
It has new PCI IDs and an important tiled surface layout fix.
2013-02-05 15:12:14 +01:00
Eric Anholt 86536a321d i965: Disable write masking when setting up texturing m0.
v2/Kayden: Also disable write masking in the vec4 backend.

Fixes 78 oglconform glsl-bif-tex-* subcases.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net> [v2]
2013-02-04 17:29:41 -08:00
Tapani Pälli e062a4187d intel: Fix regression in intel_create_image_from_name stride handling
Strangely, the DRIimage interface we have passes the pitch in pixels
instead of bytes, which anholt missed in the change to using bytes for
region pitch.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-02-04 13:59:02 -08:00
Eric Anholt 5751d0cb2d i965: Fix segfaults from 45a28a927a
If you look up a level that isn't in the miptree, you crash.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-02-04 13:58:55 -08:00
Alex Deucher 4161d70bba radeonsi: add Oland pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the 9.1 branch.
2013-02-04 15:44:38 -05:00
Alex Deucher af0af75881 radeonsi: default PA_SC_RASTER_CONFIG to 0
That should work in all cases.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the 9.1 branch.
2013-02-04 15:44:07 -05:00
Alex Deucher 83e4407f44 radeonsi: add support for Oland chips
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the 9.1 branch
2013-02-04 15:43:21 -05:00
Paul Berry 99b78337e3 glsl: Support transform feedback of varying structs.
Since transform feedback needs to be able to access individual fields
of varying structs, we can no longer match up the arguments to
glTransformFeedbackVaryings() with variables in the vertex shader.

Instead, we build up a hashtable which records information about each
possible name that is a candidate for transform feedback, and then
match up the arguments to glTransformFeedbackVaryings() with the
contents of that hashtable.

Populating the hashtable uses the program_resource_visitor
infrastructure, so the logic is shared with how we handle uniforms.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-02-04 10:36:47 -08:00
Paul Berry 53febac02c glsl: Use parse_program_resource_name to parse transform feedback varyings.
Previously, transform feedback varyings were parsed in an ad-hoc
fashion that wasn't compatible with structs (or array of structs).
This patch makes it use parse_program_resource_name(), which correctly
handles both.

Note that parse_program_resource_name()'s technique for handling
mal-formed input strings is to simply let them through and rely on the
fact that a future name lookup will fail.  Because of this,
tfeedback_decl::init() no longer needs to return a boolean error
code--it always succeeds, and if the input was mal-formed the error
will be detected later.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-02-04 10:36:44 -08:00
Paul Berry b4db34cc4c glsl: Rename uniform_field_visitor to program_resource_visitor.
There's actually nothing uniform-specific in uniform_field_visitor.
It is potentially useful for all kinds of program resources (in
particular, future patches will use it for transform feedback
varyings).

This patch renames it to program_resource_visitor, and clarifies
several comments, to reflect the fact that it is useful for more than
just uniforms.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-02-04 10:36:40 -08:00
Paul Berry b92900d26a mesa/glsl: Separate parsing logic from _mesa_get_uniform_location.
The parsing logic is moved to a new function in the GLSL module,
parse_program_resource_name().  This name was chosen because it should
eventually be useful for handling everything that OpenGL 4.3 calls
"program resources" (e.g. uniforms, vertex inputs, fragment outputs,
and transform feedback varyings).

Future patches will make use of this function for linking transform
feedback varyings.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-02-04 10:36:35 -08:00
Quentin Glidic 11bd1b0f58 gallium/egl: Fix include dirs for VPATH build
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-02-04 10:36:50 -08:00
Abdiel Janulgue eaeb314372 intel: make sure to setup image dimension in image_from_planar setup
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=60212
Tested-by: Scott Moreau <oreaus@gmail.com>
Tested-by:  Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2013-02-04 10:18:22 -08:00
Matt Turner 2db1f73849 builtin_compiler/build: Don't use *_FOR_BUILD when not cross compiling
Previously we were relying on CFLAGS_FOR_BUILD to be the same as CFLAGS
when not cross compiling, but this assumption didn't take into
consideration 32-bit builds on 64-bit systems. More generally, not
honoring CFLAGS is bad.

Automake is evidently too stupid to accept

if CROSS_COMPILING
CC = @CC_FOR_BUILD@
...
else
CC = @CC@
endif

without warning that CC has been already defined. The warnings are
harmless, but I'd prefer to avoid future reports about them, so define
proxy variables, which are assigned inside the conditional and then
unconditionally assigned to CC et al.

NOTE: This is a candidate for the 9.1 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59737
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60038
2013-02-04 09:35:45 -08:00
Brian Paul 805cf07dc3 st/mesa: emit SQRT opcode when driver supports it 2013-02-04 09:33:44 -07:00
Brian Paul 13f3ae5b83 gallium/drivers: handle PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED query
Initially, only softpipe/llvmpipe support SQRT.
2013-02-04 09:33:44 -07:00
Brian Paul 2d367e40d9 gallivm: implement support for SQRT opcode 2013-02-04 09:33:44 -07:00
Brian Paul ad30e4545b tgsi: add support for new SQRT opcode 2013-02-04 09:33:44 -07:00
Brian Paul d276a40e15 gallium: add SQRT shader opcode
The glsl-to-tgsi translater will emit SQRT to implement GLSL's sqrt()
and distance() functions if the PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED
query says it's supported by the driver.

Otherwise, sqrt(x) is implemented with x*rsq(x).  The problem with
this is sqrt(0) must be handled specially because rsq(0) might be
Inf/NaN/undefined (and then 0*rsq(0) is Inf/Nan/undefined).  In the
glsl-to-tgsi code we use an extra CMP to check if x is zero and then
replace the result of x*rsq(x) with zero.

In the end, this makes sqrt() generate much more reasonable code for
drivers that can do square roots.

Note that many of piglit's generated shader tests use the GLSL
distance() function.
2013-02-04 09:33:44 -07:00
Michel Dänzer 6455d40b7e radeonsi: Remove spurious traces of R16G16B16 support.
The hardware can't do it, and these were causing warnings in some piglit tests.

NOTE: This is a candidate for the 9.1 branch.
2013-02-04 17:03:26 +01:00
Michel Dänzer 6bcb823844 radeonsi: Enable texture arrays.
28/30 piglit tests pass.

NOTE: This is a candidate for the 9.1 branch.
2013-02-04 17:03:25 +01:00
Michel Dänzer 120efeef8b radeonsi: Improve packing of texture address parameters.
In particular, the LOD bias and depth comparison values are packed before the
'normal' texture coordinates, and the array slice and LOD values are appended.

NOTE: This is a candidate for the 9.1 branch.
2013-02-04 17:03:25 +01:00
Michel Dänzer e5fb7347a7 radeonsi: Adapt to sample intrinsics changes.
Fix up intrinsic names, and bitcast texture address parameters to integers.

NOTE: This is a candidate for the 9.1 branch.
2013-02-04 17:03:25 +01:00
Brian Paul 624528834f st/mesa: simplify the update_single_texture() function
In particular, rework the sRGB/linear format selection code.
There's no reason to mess with the Mesa format.
Just do everything in terms of the gallium pipe_format.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-02-04 08:28:17 -07:00
Brian Paul 5f81549f6c st/mesa: merge st_ChooseTextureFormat_renderable() into st_ChooseTextureFormat()
That was the only place it was being called from.
2013-02-04 08:28:17 -07:00
Brian Paul f54a9f4ff2 st/mesa: improve the format choosing code for DrawPixels
The code before was getting a pipe format, then calling
st_pipe_format_to_mesa_format() and then converting back again with
st_mesa_format_to_pipe_format().  This removes one conversion step.
2013-02-04 08:28:17 -07:00
Andreas Boll 38d65a9769 gallium: handle unhandled PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60098

Signed-off-by: Brian Paul <brianp@vmware.com>
2013-02-04 08:28:17 -07:00
Brian Paul 4df42890c5 st/mesa: don't choose DXT formats if we can't do DXT compression
If we call gl[Copy]TexImage2D() with a generic compression format
(e.g. intFormat=GL_COMPRESSED_RGBA) we can't choose a DXT format if
we don't have the external DXT compression library.

We weren't actually enforcing this before since the
pipe_screen::is_format_supported(DXT) query has no dependency on
the DXT compression library.

Now if we're given a generic compressed format and we can't do DXT
compression we'll fall back to a non-compressed format.

v2: use util_format_is_s3tc() function and add more comments about
the allow_dxt parameter.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-04 07:58:21 -07:00
Brian Paul 478056b81a mesa: don't use format chooser code for glCompressedTexImage
When glCompressedTexImage is called the internalFormat is a specific
format for the incoming image and the the hardware format should be
the same (since we never do format transcoding).  So use the simpler
_mesa_glenum_to_compressed_format() function.  This change is also
needed for the next patch.

Note: This is a candidate for the stable branches.
2013-02-04 07:58:21 -07:00
Kenneth Graunke 44aa2e15f6 i965: Fix the SF Vertex URB Read Length calculation for Gen7 platforms.
Ivybridge doesn't appear to have the same errata as Sandybridge; no
corruption was observed by setting it to more than the minimal correct
value.  It's possible that we were simply lucky, since the URB entries
are 1024-bit on Ivybridge vs. 512-bit Sandybridge.  Or perhaps the
underlying hardware issue is fixed.

Either way, we may as well program the minimum value since it's now
readily available, likely to be more efficient, and possibly more
correct.

v2: Use GEN7_SBE_* defines rather than GEN6_SF_*.  (A copy and paste
    mistake.)  They're the same, but using the right names is better.

NOTE: This is a candidate for all stable branches.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-03 13:41:09 -08:00
Kenneth Graunke 09fbc29828 i965: Fix the SF Vertex URB Read Length calculation for Sandybridge.
(This commit message was primarily written by Paul Berry, who explained
 what's going on far better than I would have.)

Previous to this patch, we thought that the only restrictions on
3DSTATE_SF's URB read length were (a) it needs to be large enough to
read all the VUE data that the SF needs, and (b) it can't be so large
that it tries to read VUE data that doesn't exist.  Since the VUE map
already tells us how much VUE data exists, we didn't bother worrying
about restriction (a); we just did the easy thing and programmed the
read length to satisfy restriction (b).

However, we didn't notice this erratum in the hardware docs: "[errata]
Corruption/Hang possible if length programmed larger than recommended".
Judging by the context surrounding this erratum, it's pretty clear that
it means "URB read length must be exactly the size necessary to read all
the VUE data that the SF needs, and no larger".  Which means that we
can't program the read length based on restriction (b)--we have to
program it based on restriction (a).

The URB read size needs to precisely match the amount of data that the
SF consumes; it doesn't work to simply base it on the size of the VUE.

Thankfully, the PRM contains the precise formula the hardware expects.

Fixes random UI corruption in Steam's "Big Picture Mode", random terrain
corruption in PlaneShift, and Piglit's fbo-5-varyings test.

NOTE: This is a candidate for all stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56920
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60172
Tested-by: Jordan Justen <jordan.l.justen@intel.com> (v1/Piglit)
Tested-by: Martin Steigerwald <martin@lichtvoll.de> (PlaneShift)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-03 13:40:45 -08:00
Kenneth Graunke 5e9bc7bd12 i965: Compute the maximum SF source attribute.
The maximum SF source attribute is necessary to compute the Vertex URB
read length properly, which will be done in the next commit.

NOTE: This is a candidate for all stable branches.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Martin Steigerwald <martin@lichtvoll.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-03 13:40:43 -08:00