Commit graph

40817 commits

Author SHA1 Message Date
Brian Paul
1c8d079e20 mesa: fix out of bounds array access in rtgc debug code
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39841
This would only be hit if someone set RGTC_DEBUG=1.
2011-08-04 15:33:39 -06:00
Brian Paul
d6a0692f9d mesa: don't use K&R style function pointer calls 2011-08-04 15:33:39 -06:00
Bryan Cain
4683529048 Merge branch 'glsl-to-tgsi'
Conflicts:
	src/mesa/state_tracker/st_atom_pixeltransfer.c
	src/mesa/state_tracker/st_program.c
2011-08-04 15:43:34 -05:00
Bryan Cain
9adcab9cd4 st/mesa: replace duplicated create_color_map_texture() function with shared function 2011-08-04 13:52:09 -05:00
Bryan Cain
b7e8911531 glsl_to_tgsi: remove debugging printf 2011-08-04 13:52:06 -05:00
Brian Paul
50073563b2 st/mesa: silence int/float and double/float conversion warnings 2011-08-04 08:22:31 -06:00
Brian Paul
09ba2527e8 st/mesa: move declaration before code 2011-08-04 08:22:31 -06:00
Brian Paul
192baaac0f mesa: minor comment updates in enable.c 2011-08-04 08:22:31 -06:00
Brian Paul
1e89a526c6 mesa: whitespace, formatting fixes in GetTexParameter() code 2011-08-04 08:22:31 -06:00
Brian Paul
02d81dfcaf mesa: add null ptr checks in GetTexParameterI[u]iv() functions 2011-08-04 08:22:31 -06:00
Brian Paul
1254a2b2e4 mesa: condense GL_TEXTURE_RESIDENT query code 2011-08-04 08:22:31 -06:00
Brian Paul
88a4f2fe54 mesa: make error handling in glGetTexParameter() a bit more concise 2011-08-04 08:22:30 -06:00
Christoph Bumiller
e9d84dab88 nv50: implement resource_resolve with custom blit 2011-08-04 15:38:49 +02:00
Christoph Bumiller
f253d83bc7 st/mesa: implement multisample resolve via BlitFramebuffer 2011-08-04 15:38:49 +02:00
Christoph Bumiller
94822c6d83 gallium: extend resource_resolve to accommodate BlitFramebuffer
Resolve via glBlitFramebuffer allows resolving a sub-region of a
renderbuffer to a different location in any mipmap level of some
other texture, and, with a new extension, even scaling. Therefore,
location and size parameters are needed.

The mask parameter was added because resolving only depth or only
stencil of a combined buffer is possible as well.

Full information about the blit operation allows the drivers to
take the most efficient path they possibly can.
2011-08-04 15:38:49 +02:00
Christoph Bumiller
57590e173b st/mesa: determine Const.MaxSamples in init_extensions
v2: Check for non-pow2 sample counts as well.
2011-08-04 15:38:49 +02:00
Benjamin Franzke
32f4cf3808 egl/gbm: Fix EGL_DEFAULT_DISPLAY 2011-08-04 14:09:34 +02:00
Benjamin Franzke
ca6bbfd769 gbm: link gbm_gallium_drm.so against math library
This avoids the following runtime error with EGL on platforms that
require linking with libm for nontrivial math functions:

failed to load module: /xorg/lib64/gbm/gbm_gallium_drm.so: undefined
symbol: powf

(Based on Kristóf RALOVICHs patch and Ian's suggestions in
http://lists.freedesktop.org/archives/mesa-dev/2011-August/010036.html)
2011-08-04 14:09:34 +02:00
RALOVICH, Kristóf
eeed782ecb gbm/dri: avoid crash in dri_screen_create 2011-08-04 14:09:34 +02:00
Marek Olšák
babb26776f r600g: remove more of unused code
This is a follow-up to f6df430a85.
2011-08-04 03:25:18 +02:00
Stephane Marchesin
974c49ed17 i915g: Fix whitespace. 2011-08-04 02:46:18 +02:00
Stephane Marchesin
d476d7ce5a i915g: fix whitespace. 2011-08-03 23:18:30 +02:00
Vadim Girlin
2bde0cc95d r600g: take into account force_add_cf in pops
When we have two ENDIFs in a row, we shouldn't modify the pop_count
for the same alu clause twice.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38163

Note: this is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-03 10:17:50 -04:00
Vadim Girlin
6eb94fc344 r600g: use backend mask for occlusion queries
Use backend_map kernel query if supported, otherwise analyze ZPASS_DONE
results to get the mask.

Fixes lockups with predicated rendering due to incorrect query buffer
initialization on some cards.

Note: this is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-03 10:17:44 -04:00
Marek Olšák
2664980760 winsys/radeon: remove dummy function pb_buffer 2011-08-03 01:18:10 +02:00
Marek Olšák
b5e3940583 util: fix a typo in util_format_swizzle_4f
Reported by Gustaw Smolarczyk.
2011-08-03 01:15:41 +02:00
Eric Anholt
e0e4c2e305 radeon: Remove some remaining set-but-unused variables.
These looked more like copy-and-paste to me than the others (which
looked more like possibly someone forgot to write some code in a
refactor), so I didn't verify where they came from.
2011-08-02 13:58:42 -07:00
Eric Anholt
8de1d42f24 radeon: Remove set-but-unused variables in radeon_lock.c
These have been unused since this function's introduction in the FBO
support development around 2009.
2011-08-02 13:58:42 -07:00
Eric Anholt
f5e612ab59 radeon: Remove set-but-unused variables in radeonSetTexBuffer2() variants.
These have been unused since 2009.
2011-08-02 13:58:42 -07:00
Eric Anholt
25fffa9364 radeon: Remove set-but-unused log2depth variable.
r100 doesn't support 3D GL_EXT_texture3D.
2011-08-02 13:51:14 -07:00
Eric Anholt
7cf799d472 radeon: Remove set-but-unused color_mask variable.
This has been around since the initial import in 2003 and never used.
2011-08-02 13:51:14 -07:00
Eric Anholt
0f1aae3ae7 intel: Fix unused variable warning. 2011-08-02 13:33:49 -07:00
Stephane Marchesin
e49c36b8d9 Fix trailing whitespace. 2011-08-02 19:40:26 +02:00
Marek Olšák
e69dde5233 r600g: remove dummy function r600_bo_offset
Always returned 0.
2011-08-02 18:52:17 +02:00
Marek Olšák
f6df430a85 r600g: remove unused code 2011-08-02 18:52:17 +02:00
Marek Olšák
be7407b75b gallium/util: add functions for manipulating swizzles
Some of those have been in drivers already.
2011-08-02 18:49:30 +02:00
Ian Romanick
0290a018a5 i915: Only emit program errors when INTEL_DEBUG=wm or INTEL_DEBUG=fallbacks
This makes piglit a lot more happy.  The errors are logged when
INTEL_DEBUG=fallbacks because the application is about to hit a big
software fallback.  We frequently ask people to run applications that
are hitting software fallbacks with INTEL_DEBUG=fallbacks so the we
can help them debug the reason for the software fallback.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
3bb2f0dde1 i915: Fail without crashing if a Mesa IR program uses too many registers
This can only happen in GLSL shaders because assembly shaders that use
too many temps are rejected by core Mesa.  It is easiest to make this
happen with shaders that contain flow-control that could not be lowered.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
322c3bf9dc ir_to_mesa: Emit warnings instead of errors for IR that can't be lowered
Rely on the driver to do the right thing.  This probably means falling
back to software.  Page 88 of the OpenGL 2.1 spec specifically says:

    "A shader should not fail to compile, and a program object should
    not fail to link due to lack of instruction space or lack of
    temporary variables. Implementations should ensure that all valid
    shaders and program objects may be successfully compiled, linked
    and executed."

There is no provision for saying "No" to a valid shader that is
difficult for the hardware to handle, so stop doing that.

On i915 this causes a large number of piglit tests to change from FAIL
to WARN.  The warning is because the driver still emits messages to
stderr like "i915_program_error: Unsupported opcode: BGNLOOP".

It also fixes ES2 conformance CorrectFull_frag and CorrectParse1_frag
on i915 (and probably other hardware that can't handle loops).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
8aadd89d07 ir_to_mesa: Use Add linker_error instead of fail_link
The functions were almost identical.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
89193933cb mesa: Ensure that gl_shader_program::InfoLog is never NULL
This prevents assertion failures in ralloc_strcat.  The ralloc_free in
_mesa_free_shader_program_data can be omitted because freeing the
gl_shader_program in _mesa_delete_shader_program will take care of
this automatically.

A bunch of this code could use a refactor to use ralloc a bit more
effectively.  A bunch of the things that are allocated with malloc and
owned by the gl_shader_program should be allocated with ralloc (using
the gl_shader_program as the context).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
379a32f42e linker: Make linker_{error,warning} generally available
linker_warning is a new function.  It's identical to linker_error
except that it doesn't set LinkStatus=false and it prepends "warning: "
on messages instead of "error: ".

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:01 -07:00
Ian Romanick
586e741ac1 linker: Make linker_error set LinkStatus to false
Remove the other places that set LinkStatus to false since they all
immediately follow a call to linker_error.  The function linker_error
was previously known as linker_error_printf.  The name was changed
because it may seem surprising that a printf function will set an
error flag.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:21:43 -07:00
Kenneth Graunke
81b036b4d7 i965/gen5+: Fix incorrect miptree layout for non-power-of-two cubemaps.
For power-of-two sizes, h0 == mt->height0 since it's already a multiple
of two.  However, for NPOT, they're different; h1 should be computed
based on the original size.

Fixes piglit test "cubemap npot" and oglconform test "textureNPOT".

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-01 23:57:37 -07:00
Stephane Marchesin
f9b2107da6 i915g: Proper indentation of func parameters. 2011-08-02 03:33:02 +02:00
Stephane Marchesin
019c6ccbb4 i915g: Remove heuristic flushing. 2011-08-02 03:31:21 +02:00
Bryan Cain
189e9f12c7 glsl_to_tgsi: copy reladdr in st_src_reg(st_dst_reg) constructor
This is a glsl_to_tgsi port of commit f7cd9a858c.
2011-08-01 17:59:10 -05:00
Bryan Cain
3e7fce9773 glsl_to_tgsi: add each relative address to the previous
This is a glsl_to_tgsi port of commit d6e1a8f714.
2011-08-01 17:59:10 -05:00
Bryan Cain
10d31cb307 glsl_to_tgsi: lower all ir_quadop_vector expressions
Unlike Mesa IR, TGSI doesn't have a SWZ opcode.
2011-08-01 17:59:10 -05:00
Bryan Cain
3354a5b563 glsl_to_tgsi: rework immediate tracking to not use gl_program_parameter_list 2011-08-01 17:59:10 -05:00