Commit graph

40817 commits

Author SHA1 Message Date
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
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
Stéphane Marchesin
c1cac8feec st/mesa: Remove unused renderbuffer fields and functions.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-07 15:42:39 -07:00
Kenneth Graunke
4bc5bfb641 i965/fs: Implement ir_u2f opcode.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-07 10:43:09 -07:00
Kenneth Graunke
8de3314f63 i965: Fix disassembly for intdiv/intmod math functions.
The opcodes and strings were reversed.  Quotient means division, and
modulus means remainder.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-07 10:43:09 -07:00
Chia-I Wu
6b52e82768 st/egl: track changes to drop wl_visual in wayland
Follow a subset of changes in 7b1d94e5d1.
There are known issues, but it works to a certain degree.  Non-working
demos also fail gracefully.  More importantly, it fixes the build.
2011-09-08 01:26:24 +08:00
Chia-I Wu
b89bca6d8b st/egl: track server side wayland changes
Follow changes in c661ecce10.
2011-09-08 01:23:51 +08:00
Chia-I Wu
287278352e st/egl: use new wl_callback mechanism in wayland
Follow the changes in 6602bda23b.
2011-09-08 01:23:48 +08:00
Kenneth Graunke
477b74e85b i965: Use proper texture alignment units for cubemaps on Gen5+.
In particular, S3TC compressed textures need align_h == 4.

Fixes skybox errors in Quake 4 and FEAR.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34628
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-07 07:49:55 -07:00
Kenneth Graunke
8ceb235c9c glsl/ir_reader: Make sure constants have the right number of components.
The list of numbers in (constant type (<numbers>)) needs to contain
exactly type->components() numbers (16 for a mat4, 3 for a vec3, etc.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-07 07:49:32 -07:00
Kenneth Graunke
6afce988a9 glsl/builtins: Fix invalid float constant in noise4 built-in.
Throwing away the extra numbers ought to match the existing behavior.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-07 07:48:56 -07:00
Kenneth Graunke
f6481be298 glsl/builtins: Fix invalid vecN constants in hyperbolic functions.
Each of these vecN constants only provided one component, which is
illegal.  The printed IR is meant to contain exactly as many components
as are necessary; the IR reader does not splat single values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-07 07:46:57 -07:00
Dave Airlie
99c1a58b30 varray.c: fix logic around BGRA with ARB_vertex_type_2_10_10_10_rev.
I introduced a regression in here, I've just split the logic ot now, so
its easier to read/understand.

Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=40664

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-07 10:20:47 +01:00
Vinson Lee
6edef25a4b mesa/vbo: s/inline/INLINE/
MSVC does not support inline keyword.
2011-09-06 21:43:51 -07:00
Eric Anholt
9bd8d90646 i965/vs: Fix point size handling on gen4.
Fixes glsl-vs-point-size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:02:00 -07:00
Eric Anholt
9367960ea6 i965/vs: Use write commits on scratch writes in pre-gen6.
This is required to ensure ordering between reads and writes within a
thread.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:57 -07:00
Eric Anholt
838bfe0c46 i965/vs: Fix setup of scratch space pointer on pre-gen6.
We were failing to relocate, so on the first draw run our scratch
would tend to get written to 0x0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:54 -07:00
Eric Anholt
ddf8e602a7 i965/vs: Fix message setup for array read/writes on pre-gen6.
We were passing an MRF as the source argument, instead of using the
implied move and putting the MRF number in the proper place in the
instruction encoding.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:51 -07:00
Eric Anholt
88612e2c1b i965/vs: Fix constant-indexed array read/write addresses on pre-gen6.
The second vertex was getting a garbage index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:48 -07:00
Eric Anholt
bba910373f i965/vs: Add support for vector comparison ops resulting in bool cond codes.
Fixes a giant pile of VS tests on gen4.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:43 -07:00
Eric Anholt
9f84288607 i965/vs: Make pre-gen6 math operate in vector mode instead of scalar.
On the old backend, we used scalar mode because Mesa IR math is
result.xyzw = math(op0.xxxx), which matched up well.  However, in GLSL
IR we do things like result.xy = math(op0.xy), so we want vector mode.
For the common case of result.x = math(op0.x), performance will be the
same (no cost for un-executed channels), though result.xyzw =
math(op0.xxxx) would be worse.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:23 -07:00