summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* i915: Fail without crashing if a Mesa IR program uses too many registersIan Romanick2011-08-021-2/+13
| | | | | | | | | | 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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* ir_to_mesa: Emit warnings instead of errors for IR that can't be loweredIan Romanick2011-08-021-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* ir_to_mesa: Use Add linker_error instead of fail_linkIan Romanick2011-08-021-31/+22
| | | | | | | | The functions were almost identical. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Ensure that gl_shader_program::InfoLog is never NULLIan Romanick2011-08-022-5/+7
| | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* linker: Make linker_{error,warning} generally availableIan Romanick2011-08-024-3/+22
| | | | | | | | | | 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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* linker: Make linker_error set LinkStatus to falseIan Romanick2011-08-024-100/+90
| | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/gen5+: Fix incorrect miptree layout for non-power-of-two cubemaps.Kenneth Graunke2011-08-011-1/+1
| | | | | | | | | | | | | 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 <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: improve the accuracy of the atan(x,y) builtin function.Paul Berry2011-08-011-1/+3
| | | | | | | | | | The previous formula for atan(x,y) returned a value of +/- pi whenever |x|<0.0001, and used a formula based on atan(y/x) otherwise. This broke in cases where both x and y were small (e.g. atan(1e-5, 1e-5)). This patch modifies the formula so that it returns a value of +/- pi whenever |x|<1e-8*|y|, and uses the formula based on atan(y/x) otherwise.
* glsl: improve the accuracy of the asin() builtin function.Paul Berry2011-08-011-28/+40
| | | | | | | | | | | | | | | | | | | | | | | | The previous formula for asin(x) was algebraically equivalent to: sign(x)*(pi/2 - sqrt(1-|x|)*(A + B|x| + C|x|^2)) where A, B, and C were arbitrary constants determined by a curve fit. This formula had a worst case absolute error of 0.00448, an unbounded worst case relative error, and a discontinuity near x=0. Changed the formula to: sign(x)*(pi/2 - sqrt(1-|x|)*(pi/2 + (pi/4-1)|x| + A|x|^2 + B|x|^3)) where A and B are arbitrary constants determined by a curve fit. This has a worst case absolute error of 0.00039, a worst case relative error of 0.000405, and no discontinuities. I don't expect a significant performance degradation, since the extra multiply-accumulate should be fast compared to the sqrt() computation. Fixes piglit tests {vs,fs}-asin-float and {vs,fs}-atan-*
* glsl: Remove duplicate commentChad Versace2011-08-011-8/+0
| | | | | | | Remove duplicate doxgen comment for ir_function.cpp:parameter_lists_match(). Signed-off-by: Chad Versace <[email protected]>
* darwin: Use machine/endian.h to determine endiannessJeremy Huddleston2011-07-311-0/+9
| | | | Signed-off-by: Jeremy Huddleston <[email protected]>
* Fix PPC detection on darwinJeremy Huddleston2011-07-311-2/+2
| | | | | | Fixes regression introduced by 7004582c1894ede839c44e292b413fe4916d7e9e Signed-off-by: Jeremy Huddleston <[email protected]>
* glsl: Clarify ir_function::matching_sigature()Chad Versace2011-07-301-20/+33
| | | | | | | | | | | The function used a variable named 'score', which was an outright lie. A signature matches or it doesn't; there is no fuzzy scoring. Change the return type of parameter_lists_match() to an enum, and let ir_function::matching_sigature() switch on that enum. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* glsl: Fix conversions in array constructorsChad Versace2011-07-301-2/+10
| | | | | | | | | | | | | | | | | | | | | | Array constructors obey narrower conversion rules than other constructors [1] --- they use the implicit conversion rules [2] instead of the scalar constructor conversions [3]. But process_array_constructor() was incorrectly applying the broader rules. [1] GLSL 1.50 spec, Section 5.4.4 Array Constructors, page 52 (58 of pdf) [2] GLSL 1.50 spec, Section 4.1.10 Implicit Conversions, page 25 (31 of pdf) [3] GLSL 1.50 spec, Section 5.4.1 Conversion, page 48 (54 of pdf) To fix this, first check (with glsl_type::can_be_implicitly_converted_to) if an implicit conversion is legal before performing the conversion. Fixes: piglit:spec/glsl-1.20/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-float.vert piglit:spec/glsl-1.20/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec*-vec*.vert Note: This is a candidate for the 7.10 and 7.11 branches. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* glsl: Remove ir_function.cpp:type_compare()Chad Versace2011-07-301-61/+0
| | | | | | | | | The function is no longer used and has been replaced by glsl_type::can_implicitly_convert_to(). Note: This is a candidate for the 7.10 and 7.11 branches. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* glsl: Fix implicit conversions in non-constructor function callsChad Versace2011-07-301-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Context ------- In ast_function_expression::hir(), parameter_lists_match() checks if the function call's actual parameter list matches the signature's parameter list, where the match may require implicit conversion of some arguments. To check if an implicit conversion exists between individual arguments, type_compare() is used. Problems -------- type_compare() allowed the following illegal implicit conversions: bool -> float bvecN -> vecN int -> uint ivecN -> uvecN uint -> int uvecN -> ivecN Change ------ type_compare() is buggy, so replace it with glsl_type::can_be_implicitly_converted_to(). This comprises a rewrite of parameter_lists_match(). Fixes piglit:spec/glsl-1.20/compiler/built-in-functions/outerProduct-bvec*.vert Note: This is a candidate for the 7.10 and 7.11 branches. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* glsl: Add method glsl_type::can_implicitly_convert_to()Chad Versace2011-07-302-0/+51
| | | | | | | | | | | | | | This method checks if a source type is identical to or can be implicitly converted to a target type according to the GLSL 1.20 spec, Section 4.1.10 Implicit Conversions. The following commits use the method for a bugfix: glsl: Fix implicit conversions in non-constructor function calls glsl: Fix implicit conversions in array constructors Note: This is a candidate for the 7.10 and 7.11 branches. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: minor comment changes in teximage.cBrian Paul2011-07-291-7/+2
|
* mesa: add missing breaks for GL_TEXTURE_CUBE_MAP_SEAMLESS queriesBrian Paul2011-07-291-6/+8
| | | | | | And fix indentation. NOTE: This is a candidate for the 7.11 branch.
* i965/fs: Allow register coalescing where the source is a uniform.Eric Anholt2011-07-291-10/+14
| | | | Removes 0.8% of the fragment shader instructions on Unigine Tropics.
* i965/fs: Optimize a * 1.0 -> a.Eric Anholt2011-07-292-0/+44
| | | | | This appears in our instruction stream as a result of the brw_vs_constval.c handling.
* i965/fs: If we see a RCP of a constant, try to constant fold it.Eric Anholt2011-07-291-0/+14
|
* i965/fs: Port texture projection avoidance optimization from the old backend.Eric Anholt2011-07-291-3/+15
| | | | | | | This is part of fixing a ~1% performance regression in OpenArena when changing the fixed function fragment shader to using the new backend. Right now this just avoids the LINTERP of the projector, not the math using it.
* Revert "i965: Don't compute brw->wm.input_size_masks when it's unused."Eric Anholt2011-07-291-11/+1
| | | | | | This reverts commit 3412069e23b7fa5656262f3dd1aa86f66980594d. We're about to start using it in fragment shaders to handle avoiding projection for fixed function.
* i965/fs: Stop using the exec_list iterator.Eric Anholt2011-07-296-71/+67
| | | | | The old style has gone out of favor in the project, but I kept copy and pasting from existing iterator code.
* r600g: fix up vs export handlingAlex Deucher2011-07-294-4/+27
| | | | | | | | | | | | | Certain attributes (position, psize, etc.) don't count as params; they are handled separately by the hw. However, the VS is required to export at least one param and r600_shader_from_tgsi() takes care of adding a dummy export if there is none. Make sure the VS param export count in the SPI properly accounts for this. Note: This is a candidate for the 7.11 branch. Signed-off-by: Alex Deucher <[email protected]>
* st/egl: create pbuffers with PIPE_BIND_SAMPLER_VIEWChia-I Wu2011-07-291-3/+4
| | | | So that eglBindTexImage works.
* i965/fs: Respect ARB_color_buffer_float clamping.Eric Anholt2011-07-281-6/+15
| | | | | | | This was done in the old codegen path, but not the new one. Caught by piglit fbo tests after the conversion to GLSL ff_fragment_shader. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix ff fragment shader inputs calculation when enabling a VS.Eric Anholt2011-07-281-2/+1
| | | | | | | | | | | | | | | | | | The FF VS generation happens just after the FF FS generation in state.c, so the ctx->VP._Current value is for the previous state update's vertex shader, not the one that will be chosen as a result of this state update. The vertexShader and vertexProgram variables should be accurately telling us whether there's going to be a ctx->VP._Current (except on _MaintainTnlProgram drivers, where it's always true). The glsl-vs-statechange-1 test was created to test for this, but it turns out that the bug is hidden by the fact that we call _mesa_update_state() twice per draw call -- once from _mesa_valid_to_render() and once from vbo_draw_arrays(), and the second one was fixing up the first one. Reviewed-by: Brian Paul <[email protected]>
* targets/{egl,gbm}: omit unneeded libdrm_radeonChia-I Wu2011-07-292-4/+0
|
* egl: EGL_MATCH_NATIVE_NATIVE_PIXMAP cannot be EGL_DONT_CAREChia-I Wu2011-07-291-2/+3
|
* egl: make pixmaps and pbuffers EGL_BUFFER_PRESERVEDChia-I Wu2011-07-291-1/+3
| | | | eglSwapBuffers is no-op to these surface types anyway.
* Add dependency generation for Mesa and GLSL dricore objects.Eric Anholt2011-07-282-2/+4
| | | | | Reviewed-By: Christopher James Halse Rogers <[email protected]>
* softpipe: When doing write_all_cbufs, don't stomp over the color.Eric Anholt2011-07-281-4/+12
| | | | | | | We have to make it through this loop processing the color multiple times, so we can't go overwriting it on our first color buffer. Reviewed-by: Brian Paul <[email protected]>
* mesa: fix format selection for meta CopyTexSubImage()Brian Paul2011-07-281-0/+10
| | | | | | | | | | | | | When we do a glReadPixels into the temporary buffer, we don't want to use GL_LUMINANCE, GL_LUMINANCE_ALPHA or GL_INTENSITY since they will compute L=R+G+B which is not what we want. This bug has existed all along but was only exposed by the elimination of the driver hook for glCopyTexImage() in 5874890c26f434f54e9218b83fae4eb8175c24e9. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39604 Tested-by: Ian Romanick <[email protected]>
* mesa: test against MESA_FORMAT_NONE in _mesa_GetTexLevelParameteriv()Brian Paul2011-07-281-1/+1
|
* st/mesa: fix comment languageBrian Paul2011-07-281-3/+3
|
* r600g: fix vs export countVadim Girlin2011-07-282-2/+2
| | | | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39572 Signed-off-by: Vadim Girlin <[email protected]>
* i965: Remove the now unused intel_renderbuffer::draw_offset field.Kenneth Graunke2011-07-282-2/+0
| | | | | | | The previous commit removed the last use of this field. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Check actual tile offsets in Gen4 miptree workaround.Kenneth Graunke2011-07-281-2/+17
| | | | | | | | | | | | | | | | | | | | | | | The purpose of the (irb->draw_offset & 4095) != 0 check was to ensure that we don't have XYy offsets into a tile, since Gen4 hardware doesn't support that. However, it's insufficient: there are cases where draw_offset & 4095 is 0 but we still have a Y-offset. This leads to an assertion failure in brw_update_renderbuffer_surface with tile_y != 0. Instead, simply call intel_renderbuffer_tile_offsets to compute the actual X/Y offsets and check if either are non-zero. This makes both the workaround and the assertion check the same things. Fixes piglit test fbo-generatemipmap-formats, and should also fix bugs #34009 and #39487. NOTE: This is a candidate for stable release branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34009 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39487 Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965/gen4: Fix message parameter loading for 1D TXD sampling.Kenneth Graunke2011-07-281-2/+4
| | | | | | | | | | | | | We were neglecting to load dvdx and dvdy. v is not optional. Fixes glslparsertests tex-grad-0[12345].frag on Broadwater/Crestline. (We still need an execution test using sampler1D.) NOTE: This is a candidate for the 7.11 branch. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: improve the accuracy of the radians() builtin functionPaul Berry2011-07-281-4/+4
| | | | | | | | | | | The constant used in the radians() function didn't have enough precision, causing a relative error of 1.676e-5, which is far worse than the precision of 32-bit floats. This patch reduces the relative error to 1.14e-9, which is the best we can do in 32 bits. Fixes piglit tests {fs,vs}-radians-{float,vec2,vec3,vec4}. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add source location tracking to TODO listIan Romanick2011-07-271-0/+5
|
* glsl: Remove completed items from the TODO listIan Romanick2011-07-271-16/+0
|
* mesa: don't forget about sampleBuffers in framebuffer visual updateChristoph Bumiller2011-07-271-0/+1
| | | | | | | Otherwise multisample will never been enabled for multisample renderbuffers. Reviewed-by: Brian Paul <[email protected]>
* wayland-drm: Add copyright notice to protocolBenjamin Franzke2011-07-271-0/+27
| | | | Fixes build since wayland 986703ac7365bc87a5501714adb9fc73157c62b7.
* egl/gallium: fix build without softpipe and llvmpipeTobias Droste2011-07-271-3/+9
| | | | | | Signed-off-by: Tobias Droste <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* r300g: copy the compiler from r300cMarek Olšák2011-07-2669-25/+17038
| | | | | | | | What a beast. r300g doesn't depend on files from r300c anymore, so r300c is now left to its own fate. BTW 'make test' can be invoked from the gallium/r300 directory to run some compiler unit tests.
* util: enable S3TC support when the force_s3tc_enable env var is set to "true"Bryan Cain2011-07-261-2/+9
| | | | NOTE: This is a candidate for the 7.10 and 7.11 branches.
* st/mesa: respect force_s3tc_enable environment variableBryan Cain2011-07-261-1/+10
| | | | NOTE: This is a candidate for the 7.10 and 7.11 branches.