Commit graph

46296 commits

Author SHA1 Message Date
Chia-I Wu
8adaed9347 d3d1x: fix a build error
Fix for the st/egl interface change since
08e1076fd2.
2011-09-09 15:48:10 +08:00
Eric Anholt
29361e14df i965/vs: Allow copy propagation on GRFs.
Further reduces instruction count by 4.0% in 40.7% of the vertex
shaders.
2011-09-08 21:40:39 -07:00
Eric Anholt
6d0c018776 i965/vs: Clear tracked copy propagation values whose source gets overwritten.
This only occurs for GRFs, and hasn't mattered until now because we
only copy propagated non-GRFs.
2011-09-08 21:40:39 -07:00
Eric Anholt
cc9eb936c2 i965/vs: Add support for copy propagation of the UNIFORM and ATTR files.
Removes 2.0% of the instructions from 35.7% of vertex shaders in shader-db.
2011-09-08 21:40:39 -07:00
Eric Anholt
42ce13195b i965/vs: Add constant propagation to a few opcodes.
This differs from the FS in that we track constants in each
destination channel, and we we have to look at all the swizzled source
channels.  Also, the instruction stream walk is done in an O(n) manner
instead of O(n^2).

Across shader-db, this reduces 8.0% of the instructions from 60.0% of
the vertex shaders, leaving us now behind the old backend by 11.1%
overall.
2011-09-08 21:40:39 -07:00
Eric Anholt
87b51fc4a8 i965/vs: Keep track of indices into a per-register array for virtual GRFs.
Tracking virtual GRFs has tension between using a packed array per
virtual GRF (which is good for register allocation), and sparse arrays
where there's an element per actual register (so the first and second
column of a mat2 can be distinguished inside of an optimization pass).

The FS mostly avoided the need for this second sparse array by doing
virtual GRF splitting, but that meant that instances where virtual GRF
splitting didn't work, instructions using those registers got much
less optimized.
2011-09-08 21:40:39 -07:00
Eric Anholt
d7c6c8428c i965/vs: Switch to the new VS backend by default.
Now instead of env INTEL_NEW_VS=1 to get it, you need INTEL_OLD_VS=1
to not get it.  While it's not quite to the same codegen efficiency as
the old backend, it is not regressing piglit on G965 and G45, and
actually fixing bugs on gen6, and the remaining codegen quality
regressions all appear tractable.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
df35d69180 i965/vs: Add support for overflowing the number of available push constants.
Fixes glsl-vs-uniform-array-4.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33742

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
f3ed973f53 i965/vs: Pack uniform registers before optimization
We don't expect uniform accesses to generally go away from being dead
code at this point, and we will want to have uniforms packed before
spilling them out to pull constants when we are forced to do that.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
1408169513 i965/vs: When failing due to lack of spilling, don't continue on.
Fixes assertion failure from double-free in oglc
glsl-arrayobject constructor.declaration.structure

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
27c03cb86a i965/vs: Fix variable indexed array access with more than one array.
The offset to the arrays after the first was mis-scaled, so we'd go
access off the end of the surface and read 0s.  Fixes
glsl-vs-uniform-array-3.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
6af968b673 i965/vs: Add annotation to more of the URB write.
While we had nice debug output for most of the instruction stream, it
was terminated by a series of anonymous MOVs and a send.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Chia-I Wu
48eb1fe6f9 egl_dri2: add support for RGBA_8888 android native buffer
HAL_PIXEL_FORMAT_RGBA_8888 maps to __DRI_IMAGE_FORMAT_ABGR8888.
2011-09-09 12:06:17 +08:00
Chia-I Wu
4f341ee65a st/dri: add support for __DRI_IMAGE_FORMAT_ABGR8888
It maps to PIPE_FORMAT_R8G8B8A8_UNORM.
2011-09-09 12:06:17 +08:00
Chia-I Wu
9fe197c626 intel: add support for __DRI_IMAGE_FORMAT_ABGR8888
It maps to MESA_FORMAT_RGBA8888_REV.  Surfaces of the format can only be
sampled from but not render to.

Only i915 is tested.

Reviewed-by: Eric Anholt <eric@anholt.net>

[olv: add a check in intel_image_target_renderbuffer_storage]
2011-09-09 12:06:17 +08:00
Chia-I Wu
e3cf7b69f2 dri2: add __DRI_IMAGE_FORMAT_ABGR8888 to __DRI_IMAGE
Add a new format token, __DRI_IMAGE_FORMAT_ABGR8888, to __DRI_IMAGE.  It
maps to MESA_FORMAT_RGBA8888_REV in core mesa or
PIPE_FORMAT_R8G8B8A8_UNORM in gallium.  The format is used by
translucent surfaces on Android.
2011-09-09 12:06:16 +08:00
Eric Anholt
60df737ad5 glsl: Don't do structure splitting until link time.
We were splitting on each side of an unlinked program, and the two
sides lost track of which variables they referenced, resulting in
assertion failure during validation.  Fixes piglit
link-struct-uniform-usage.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Eric Anholt
525cec98a5 glsl: Clarify error message about whole-array assignment in GLSL 1.10.
Previously, it would produce:

    Failed to compile FS: 0:6(7): error: non-lvalue in assignment

and now it produces:

    Failed to compile FS: 0:5(7): error: whole array assignment is not
    allowed in GLSL 1.10 or GLSL ES 1.00.

Also, add spec quotation to the two places we have code for array
lvalues in GLSL 1.10.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Eric Anholt
407a1001ae glsl: When assiging from a whole array, mark it as used.
Fixes piglit link-uniform-array-size.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Eric Anholt
d00deae3ef glsl: Fix setting of OutputsWritten for whole array dereference.
We just want to mark the whole thing used, not mark from each element
the whole size in use.  Fixes undefined URB entry writes on i965,
which blew up with debugging enabled.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Brian Paul
ce64b6d612 mesa: remove unneeded #include of texfetch.h 2011-09-08 20:54:58 -06:00
Brian Paul
c6ca3ca552 mesa: use _mesa_unpack_float_z_row in get_tex_depth()
Removes another use of the gl_texture_image::FetchTexelf() function.
2011-09-08 20:16:18 -06:00
Brian Paul
0386d9ac77 mesa: use ctx->Driver.GetTexImage() to decompress base texture image
This is a simple way to do the job and it removes one more use of
the soon-to-be-removed gl_texture_image::FetchTexelc() function.
2011-09-08 20:16:18 -06:00
Brian Paul
c1b3faefc0 mesa: handle compressed images in get_tex_rgba()
Uses the new _mesa_decompress_image() function.  Unlike the meta path
that uses textured quad rendering to do decompression, this works with
signed formats as well.
2011-09-08 20:16:18 -06:00
Brian Paul
3370ba802f mesa: new _mesa_decompress_image() function
Use the old texture fetch functions to decompress a whole image.
To be used by glGetTexImage().
2011-09-08 20:16:18 -06:00
Brian Paul
9a5b2899e0 mesa: added _mesa_get_uncompressed_format(), _mesa_format_num_components() 2011-09-08 20:16:18 -06:00
Brian Paul
730952aa12 mesa: add new pixel format unpacking code
This will be used instead of the texel fetch code to unpack images
in various formats.
2011-09-08 20:16:18 -06:00
Brian Paul
e3dc78e57a meta: added _mesa_meta_GetTexImage()
If the texture is compressed, call the meta decompress_texture_image()
function.  Otherwise, call the core _mesa_get_teximage() function.
2011-09-08 20:16:18 -06:00
Brian Paul
8e9485870b meta: move texcoord setup into setup_texture_coords() 2011-09-08 20:16:18 -06:00
Marcin Slusarz
96054375b1 nouveau: fix nouveau_fence leak
Note: This is a candidate for the 7.11 branch.
2011-09-08 23:00:31 +02:00
Marcin Slusarz
d8035fe173 nv50: fix screen->blitctx memory leak 2011-09-08 23:00:31 +02:00
Adam Jackson
faf5d6584b gles: Fix glGet(GL_{NUM_,}COMPRESSED_TEXTURE_FORMATS_ARB)
We'd still accept the GL_PALETTE[48]_* formats in glCompressedTexImage2D,
but they wouldn't be listed if you queried whether they were supported.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-09-08 13:40:06 -04:00
Paul Berry
b453ba2c9f glsl: Make sure gl_ClipDistance and gl_ClipVertex are not both written.
From section 7.1 (Vertex Shader Special Variables) of the GLSL 1.30
spec:

  "It is an error for a shader to statically write both
  gl_ClipVertex and gl_ClipDistance."

Fixes piglit test mixing-clip-distance-and-clip-vertex-disallowed.c.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:38:03 -07:00
Paul Berry
37bb1c4de2 glsl: Check that gl_ClipDistance[] is not sized too large.
Fixes piglit tests
clip-distance-explicit-too-large-with-access.{frag,vert} and
clip-distance-explicit-too-large.{frag,vert}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:37:45 -07:00
Paul Berry
93b9758d01 glsl: Rework oversize array check for gl_TexCoord.
The check now applies both when explicitly declaring the size of
gl_TexCoord and when implicitly setting the size of gl_TexCoord by
accessing it using integral constant expressions.

This is prep work for adding similar size checks to gl_ClipDistance.

Fixes piglit tests texcoord/implicit-access-max.{frag,vert}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:37:24 -07:00
Paul Berry
36c4b1a3da glsl: Add constant gl_MaxClipDistances.
Fixes piglit tests {vs,fs}-clip-distance-sizeable-to-max.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:37:12 -07:00
Paul Berry
af243b55ac glsl: Make gl_ClipDistance[] implicitly sized.
From the GLSL 1.30 spec, section 7.1 (Vertex Shader Special Variables):

  The gl_ClipDistance array is predeclared as unsized and must be
  sized by the shader either redeclaring it with a size or indexing it
  only with integral constant expressions.

Fixes piglit tests clip-distance-implicit-length.vert,
clip-distance-implicit-nonconst-access.vert, and
{vs,fs}-clip-distance-explicitly-sized.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:36:13 -07:00
José Fonseca
2864f723d1 scons: Use -g instead of -g3.
-g3 causes binaries to be 3x - 10x bigger, not only on MinGW w/ dwarf
debugging info, but linux as well.

Stick with -g, (which defaults to -g2), like autoconf does.
2011-09-08 09:59:01 +01:00
José Fonseca
221a04fa8e st/egl: Fix GDI build. 2011-09-08 09:32:10 +01:00
José Fonseca
1cf808c86e Define INLINE macro in terms of inline. 2011-09-08 09:17:42 +01:00
Benjamin Franzke
7645c49e07 st/egl: add premultiplied alpha support to wayland
Return true for NATIVE_PARAM_PREMULTIPLIED_ALPHA when all formats with
alpha support premultiplied alpha.

(Based on Chia-I Wu's patch)

[olv: remove the use of param_premultiplied_alpha from the original
      patch]
2011-09-08 16:05:41 +08:00
Benjamin Franzke
1191d20363 st/egl: correctly return configs under wayland
Handle "format" events and return configs for the supported formats.

(Based on Chia-I Wu's patch)

[olv: update and explain why PIPE_FORMAT_B8G8R8A8_UNORM should not be
      enabled without HAS_ARGB32]
2011-09-08 16:05:40 +08:00
Chia-I Wu
ee0e6ae2bb Revert "st/egl: correctly return configs under wayland"
This reverts commit 95b445699d.
2011-09-08 16:05:32 +08:00
Chia-I Wu
93a96abe16 Revert "st/egl: add premultiplied alpha support to wayland"
This reverts commit 23aa978a9d.
2011-09-08 16:05:22 +08:00
Chia-I Wu
23aa978a9d st/egl: add premultiplied alpha support to wayland
Return true for NATIVE_PARAM_PREMULTIPLIED_ALPHA when all formats with
alpha support premultiplied alpha.  Currently, it means when argb32 and
argb32_pre are both supported.
2011-09-08 11:16:12 +08:00
Chia-I Wu
95b445699d st/egl: correctly return configs under wayland
When wl_drm is avaiable and enabled, handle "format" events and return
configs for the supported formats.  Otherwise, assume all formats of
wl_shm are supported.
2011-09-08 11:16:12 +08:00
Chia-I Wu
41f5d2e8ac st/egl: overload NATIVE_PARAM_PREMULTIPLIED_ALPHA
EGL does not export this capability of a display server.  But wayland
makes use of EGL_VG_ALPHA_FORMAT to achieve it.

So, when the native display returns true for the parameter, st/egl will
set EGL_VG_ALPHA_FORMAT_PRE_BIT for all EGLConfig's with non-zero
EGL_ALPHA_SIZE.  EGL_VG_ALPHA_FORMAT attribute of a surface will affect
how the surface is presented.

Because st/vega does not support EGL_VG_ALPHA_FORMAT_PRE_BIT,
EGL_OPENVG_BIT will be cleared.
2011-09-08 11:16:12 +08:00
Chia-I Wu
f4c37d6ab2 st/egl: add NATIVE_PARAM_PREMULTIPLIED_ALPHA
Return TRUE if the display supports premultiplied alpha.
2011-09-08 11:16:12 +08:00
Chia-I Wu
08e1076fd2 st/egl: add native_present_control
Replace the parameters of native_surface::present by a struct,
native_present_control.  Using a struct allows us to add more control
options without having to update each backend every time.
2011-09-08 11:16:11 +08:00
Brian Paul
c0470bf77a glsl: s/int/unsigned/ to silence warning 2011-09-07 16:47:14 -06:00