Commit graph

46621 commits

Author SHA1 Message Date
Paul Berry
2d686fe911 mesa: Decode GL_CLIP_DISTANCE[67] properly in _mesa_set_enable().
In order to support 8 clip distances, we need to properly decode when
the user sets the GL_CLIP_DISTANCE6 and GL_CLIP_DISTANCE7 enable
flags.

For clarity, this patch changes the names GL_CLIP_PLANE[0-5] in the
switch statement to the equivalent names GL_CLIP_DISTANCE[0-5], since
the GL_CLIP_PLANE names are deprecated.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-23 13:30:08 -07:00
Paul Berry
3d7c5a4f6f mesa: set up gl_vert_result and gl_frag_attrib values for gl_ClipDistance.
This patch assigns enumerated values for gl_ClipDistance in the
gl_vert_result and gl_frag_attrib enums, so that driver back-ends can
assign gl_ClipDistance to the appropriate hardware registers.  It also
adjusts the functions _mesa_vert_result_to_frag_attrib() and
_mesa_frag_attrib_to_vert_result() (which translate between the two
enums) to correctly translate the new enumerated values.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-23 13:30:03 -07:00
Paul Berry
1ad54ae0b1 mesa: Add a flag to indicate whether a program uses gl_ClipDistance.
GLSL 1.30 requires us to use gl_ClipDistance for clipping if the
vertex shader contains a static write to it, and otherwise use
user-defined clipping planes.  Since the driver needs to behave
differently in these two cases, we need a flag to record whether the
shader has written to gl_ClipDistance.

The new flag is called UsesClipDistance.  We initially store it in
gl_shader_program (since that is the data structure that is available
when we check to see whethe gl_ClipDistance was written to), and we
later copy it to a flag with the same name in gl_vertex_program, since
that is a more convenient place for the driver to access it (in i965,
at least).

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-23 13:28:51 -07:00
Paul Berry
c06e325967 glsl: Implement a lowering pass for gl_ClipDistance.
In i965 GEN6+ (and I suspect most other hardware), gl_ClipDistance
needs to be laid out as a pair of vec4's (the first containing clip
distances 0-3, and the second containing clip distances 4-7).
However, it is declared in GLSL as an array of 8 floats.

This lowering pass acts at the GLSL level, modifying the declaration
of gl_ClipDistance so that it is an array of vec4's rather than an
array of floats, and renaming it to gl_ClipDistanceMESA.  In addition,
it modifies all accesses to the array so that they access the
appropiate component of one of the vec4's.

Since some hardware may not internally represent gl_ClipDistance as a
pair of vec4's, this lowering pass is optional.  To enable it, set the
LowerClipDistance flag in gl_shader_compiler_options to true.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-23 13:28:43 -07:00
Paul Berry
cc81eb09b9 glsl hierarchical visitor: Do not overwrite base_ir for parameter lists.
This patch fixes a bug in ir_hirearchical_visitor: when traversing an
exec_list representing the formal or actual parameters of a function,
it modified base_ir to point to each parameter in turn, rather than
leaving it as a pointer to the enclosing statement.  This was a
problem, since base_ir is used by visitor classes to locate the
statement containing the node being visited (usually so that
additional statements can be inserted before or after it).  Without
this fix, visitors might attempt to insert statements into parameter
lists.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-23 13:28:00 -07:00
Chad Versace
deff7fff49 mesa: Add missing includes to meta.h
Include mtypes.h.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-23 10:54:25 -07:00
Brian Paul
be928ecd8d docs: mention VMware svga driver updates in 7.12 release notes 2011-09-23 08:05:36 -06:00
Brian Paul
ea0cedce6a svga: indentation/formatting fixes 2011-09-23 07:59:21 -06:00
Brian Paul
2c308c66e2 svga: remove emit_consts() offset parameter
It was always zero.
2011-09-23 07:59:00 -06:00
Brian Paul
7c6a5134ba svga: s/int/unsigned/ in svga_state_constants.c
Be consistent with other functions in the file.  And add some comments.
2011-09-23 07:59:00 -06:00
Brian Paul
c27f24f6f0 svga: s/unit/shader/ and related clean-ups
'shader' is more intuitive.  Also s/int/unsigned/ and add assertions.
2011-09-23 07:59:00 -06:00
Brian Paul
5f053bf4ae svga: clean up return values and error codes
Previously we were using a hodge podge of int vs. pipe_enum and
0 vs. PIPE_OK.  Some functions that always returned PIPE_OK were
made void.
2011-09-23 07:59:00 -06:00
Brian Paul
681f92140c svga: add format translation for DXT/sRGB formats
Without this, apps/tests that tried to use a DXT/sRGB format would die on
a failed assertion (st_texture.c:80).
2011-09-23 07:58:48 -06:00
Brian Paul
2b2a69e088 svga: test register W component in emit_kil()
Only the XYZ components are checked to be negative by SVGA3DOP_TEXKILL.
GL_ARB_fp requires all four components be checked.  Emit a second texkill
for W if needed.
2011-09-23 07:58:48 -06:00
Brian Paul
7d09df0cbc svga: fix depth/shadow compare for non-projected texcoords
We only need to do the divide by Q step for TXP instructions.
This fixes the incorrectly rendered soft shadow test in Lightsmark.
Along with the previous texture swizzle commit, this also fixes all
the piglit glsl-fs-shadow2d-XX.shader_test failures.
2011-09-23 07:58:48 -06:00
Brian Paul
9bd15aef86 svga: implement texture swizzling
This exposes the GL_EXT_texture_swizzle extension and allows the various
depth texture modes to be implemented properly.  This, plus a follow-on
texture/shadow change fixes quite a few piglit GLSL shadow sampler test
failures.
2011-09-23 07:58:48 -06:00
Brian Paul
49a6f5e68e svga: check that we don't exceed input/ouput register limits 2011-09-23 07:58:47 -06:00
Brian Paul
2f40e4aac7 svga: implement point sprite suppport
Emit the SVGA3D_RS_POINTSPRITEENABLE render state.
When sprite_coord_mode=PIPE_SPRITE_COORD_LOWER_LEFT emit extra frag
shader code to invert the Y coordinate of the incoming texcoord.
2011-09-23 07:58:47 -06:00
Brian Paul
9a41ecaddd svga: add translation for float formats 2011-09-23 07:58:47 -06:00
Brian Paul
73e840ab7d svga: check to avoid writing beyond end of constant buffer
See bug 688394
2011-09-23 07:58:47 -06:00
José Fonseca
974b6413f4 svga: Cleanup format capability checking.
Accurately describe what operations are supported when a format caps
entry is not advertised by the host, and which formats are never
supported, instead of making ad-hoc and often incorrect assumptions.
2011-09-23 07:58:47 -06:00
José Fonseca
ffeed5da6e svga: Don't use the new depth formats for surfaces that will never be sampled from.
Mitigates issues with hosts where support for these new depth formats is
flaky.
2011-09-23 07:58:46 -06:00
Jakob Bornecrantz
8bf3fb4eca svga: Share one texcoord between depth and fog 2011-09-23 07:58:46 -06:00
Jakob Bornecrantz
4f17830b3d svga: Only emit Z depth work if it is actually read 2011-09-23 07:58:46 -06:00
Jakob Bornecrantz
3b32e51cb1 svga: Fix vPos usage 2011-09-23 07:58:45 -06:00
Jakob Bornecrantz
166e9421c8 svga: Wip for passing depth in a texcoord
TODO: Can we pass this as the same texcoord as fog?
2011-09-23 07:58:45 -06:00
José Fonseca
6759ad53e2 svga: Add a comment about depth format selection. 2011-09-23 07:58:45 -06:00
José Fonseca
846a21d352 svga: Consider the new depth formats in svga_texture_from_handle(). 2011-09-23 07:58:45 -06:00
José Fonseca
f74c04c22c svgadump: Dump the new depth format names. 2011-09-23 07:58:45 -06:00
Jakob Bornecrantz
4e0ae3e34f svga: Expose the new depth formats 2011-09-23 07:58:45 -06:00
José Fonseca
fd69fc8744 svga: Coalesce multiple shader constants in a single command.
HWv8 feature.

Tested with GoogleEarth, Mesa demos.
2011-09-23 07:58:44 -06:00
José Fonseca
157309348e svgadump: Update for svga3d_reg.h header changes. 2011-09-23 07:58:44 -06:00
Brian Paul
2b74fb139c svga: updated svga3d_reg.h to latest public version 2011-09-23 07:58:44 -06:00
Alex Corscadden
2883e3c0b5 Allow RBUG to start blocked
It is sometimes useful to examine the first frame or and early frame of a
quickly executing and non-repeating application, this chain introduces a new
environment variable that is checked when creating contexts.  If
GALLIUM_RBUG_START_BLOCKED is set, then each context that is created is started
in a blocked state.  This allows time to connect rbug before anything is
rendered in the context.
2011-09-23 07:58:44 -06:00
Brian Paul
ddfdea88d8 draw/llvm: add additional null pointer checkin draw_pt_fetch_pipeline_or_emit_llvm() 2011-09-23 07:58:44 -06:00
Yuanhan Liu
1a662e7c18 intel: fix the wrong code to detect null texture.
There is already comments show how to detect a null texture. Fix the
code to match the comments.

This would fix the oglc divzero(basic.texQOrWEqualsZero) and
divzero(basic.texTrivialPrim) test case fail.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 13:34:26 +08:00
Yuanhan Liu
cd6b8421ca i965: fix the constant interp bitmask for flat mode
Fix the constant interpolation enable bit mask for flat light mode.
FRAG_BIT_COL0 attribute bit might be 0, in which case we need to
shift one more bit right.

This would fix the oglc specularColor test fail on both Sandybridge and
Ivybridge.

v2: move the constant interp bitmask setup code into for(; attr <
FRAG_ATTRIB_MAX; attr++) loop suggested by Eric.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-09-23 10:49:42 +08:00
Stéphane Marchesin
e3c94fac4e i915g: Don't generate useless swizzles before texture accesses.
That helps reduce the number of texture indirections, which are very limited on i915.
2011-09-22 19:26:33 -07:00
Stéphane Marchesin
79a0499369 i915g: Fix whitespace. 2011-09-22 19:26:32 -07:00
Marek Olšák
661b853f11 docs: update relnotes-7.12 with r600g changes 2011-09-23 03:03:45 +02:00
Brian Paul
7276ab2c36 st/mesa: remove unnecessary st_texture_match_image() parameters
We didn't use the face parameter and the level parameter can be found
in the gl_texture_image.
2011-09-22 16:43:45 -06:00
Stéphane Marchesin
687e62a5d7 i915g: Fix peephole optimization for MOVs. 2011-09-22 12:43:24 -07:00
Stéphane Marchesin
7cba40306e i915g: Add unsupported PIPE_CAP_MIN_TEXEL_OFFSET/PIPE_CAP_MAX_TEXEL_OFFSET. 2011-09-22 12:01:19 -07:00
Eric Anholt
86939e05d2 intel: Unindent the blit call in PBO blit uploads.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-22 11:03:26 -07:00
Eric Anholt
275ce9631b intel: Drop gratuitous flush in PBO blit upload.
Since the blit gets sequenced after other batchbuffer rendering like
normal, there's no need to push things out early.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:24 -07:00
Eric Anholt
3bb536e4c7 intel: Clean up check_pbo_format to ignore internalFormat.
All that matters here is the format of the texture, not the
internalformat (which might mean various different pixel formats).  In
one case, the pbo upload for MESA_FORMAT_YCBCR would have swapped the
channels for MESA_FORMAT_YCBCR_REV.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:22 -07:00
Eric Anholt
0ba2390947 intel: Move more of the PBO blit upload logic into that function.
This also improves the debugging output in the failure paths so you
get more than just "failed", and don't get spammed with "failed" when
you didn't even have a PBO to try.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:20 -07:00
Eric Anholt
d58a3182b1 intel: Remove stale comment about non-intel gl_buffer_objects.
This hasn't been true since dd26899ca3
in 2009.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:17 -07:00
Eric Anholt
bc0335fc0e intel: Remove the pbo zero-copy code.
There were notes about the possibility of slowdowns due to zcopy from
a PBO due to thrashing around of the region.  Slowdowns are even more
likely now that textures are generally tiled, which a zcopy wouldn't
get.  Additionally, there were no checks on the buffer size to ensure
that the hardware-required rounding was present, which could result in
GPU hangs on large zcopy PBOs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:13 -07:00
Eric Anholt
57024e084a intel: Remove extra FreeTextureImageBuffer() from glTexImage*.
The core code does this before calling in to us.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:10 -07:00