Bryan Cain [Wed, 27 Jul 2011 20:45:16 +0000 (15:45 -0500)]
glsl_to_tgsi: lower all ir_quadop_vector expressions
Unlike Mesa IR, TGSI doesn't have a SWZ opcode.
Bryan Cain [Wed, 27 Jul 2011 20:20:19 +0000 (15:20 -0500)]
glsl_to_tgsi: rework immediate tracking to not use gl_program_parameter_list
Bryan Cain [Fri, 22 Jul 2011 18:24:42 +0000 (13:24 -0500)]
glsl_to_tgsi: update comments
Bryan Cain [Fri, 22 Jul 2011 18:23:26 +0000 (13:23 -0500)]
glsl_to_tgsi: make coding style more consistent
Bryan Cain [Thu, 21 Jul 2011 21:29:56 +0000 (16:29 -0500)]
glsl_to_tgsi: make assignment hack safer
Fixes an assertion failure in piglit test glsl-texcoord-array.
Bryan Cain [Thu, 21 Jul 2011 20:49:26 +0000 (15:49 -0500)]
glsl_to_tgsi: separate immediates from array constants during IR translation
Before, if any uniform or constant array was accessed with indirect
addressing, st_translate_program() would emit uniform constants in the place
of immediates. This behavior was unavoidable with ir_to_mesa/mesa_to_tgsi, but
glsl_to_tgsi can work around it since the GLSL IR backend and the TGSI
emission are both inside the state tracker.
Bryan Cain [Sun, 10 Jul 2011 22:36:04 +0000 (17:36 -0500)]
glsl_to_tgsi: fix mistakes in get_pixel_transfer_visitor()
I noticed these issues while working on get_bitmap_visitor().
Bryan Cain [Sun, 10 Jul 2011 22:17:38 +0000 (17:17 -0500)]
st/mesa, glsl_to_tgsi: support glBitmap with a GLSL fragment shader active
Bryan Cain [Sat, 9 Jul 2011 02:12:08 +0000 (21:12 -0500)]
st/mesa, glsl_to_tgsi: support glDrawPixels/glCopyPixels with a GLSL fragment shader active
Since this was previously implemented using Mesa IR and _mesa_combine_programs,
this commit adds a new code path that works with glsl_to_tgsi.
Bryan Cain [Mon, 4 Jul 2011 13:44:12 +0000 (08:44 -0500)]
glsl_to_tgsi: replace MAX_PROGRAM_TEMPS (256) with MAX_TEMPS (4096)
Bryan Cain [Thu, 30 Jun 2011 18:42:37 +0000 (13:42 -0500)]
r200, r600c, i965: fix build
Bryan Cain [Mon, 27 Jun 2011 22:40:10 +0000 (17:40 -0500)]
glsl_to_tgsi: always run copy_propagate() and eliminate_dead_code_advanced()
These two passes are written to handle indirect addressing properly.
Bryan Cain [Mon, 27 Jun 2011 22:25:50 +0000 (17:25 -0500)]
glsl_to_tgsi: fix mistake in new dead code elimination pass
The conditions of IF opcodes were not being counted as reads, which sometimes
led to the condition register being wrong or undefined.
Bryan Cain [Mon, 27 Jun 2011 22:11:07 +0000 (17:11 -0500)]
glsl_to_tgsi: improve assignment handling
This is a hack, but it's better than emitting an unnecessary MOV instruction
and hoping the optimization passes clean it up.
Bryan Cain [Sat, 25 Jun 2011 04:17:30 +0000 (23:17 -0500)]
glsl_to_tgsi: improve eliminate_dead_code_advanced()
Bryan Cain [Sat, 25 Jun 2011 03:32:26 +0000 (22:32 -0500)]
glsl_to_tgsi: use the correct writemask in try_emit_mad() and try_emit_sat()
Bryan Cain [Sat, 25 Jun 2011 01:37:53 +0000 (20:37 -0500)]
glsl_to_tgsi: use a more specific condition for gl_FragDepth hack in generating assignments
This reduces the number of instructions in the fragment shader of
glsl-fs-atan-2 from 174 to 146 with EmitNoIfs enabled.
Bryan Cain [Fri, 24 Jun 2011 23:45:04 +0000 (18:45 -0500)]
glsl_to_tgsi: add a better, more advanced dead code elimination pass
Bryan Cain [Fri, 24 Jun 2011 00:53:37 +0000 (19:53 -0500)]
glsl_to_tgsi: remove handling of XPD opcode in compile_tgsi_instruction()
The opcode is never emitted by the glsl_to_tgsi_visitor, so its special case in
compile_tgsi_instruction() was dead code.
Bryan Cain [Fri, 24 Jun 2011 00:35:36 +0000 (19:35 -0500)]
glsl_to_tgsi: use swizzle_for_size for src reg in conditional moves
This prevents the copy propagation pass from being confused by undefined
channels and thus missing optimization opportunities.
Emil Velikov [Tue, 21 Jun 2011 20:52:19 +0000 (21:52 +0100)]
glsl_to_tgsi: execute merge_registers() after eliminate_dead_code()
Fixes a regression unintentionally introduced by "glsl_to_tgsi: fix shaders with
indirect addressing of temps" that caused missing leaves in 3dmark01 test 4 (Nature)
and missing/displaced textures on human models in Counter-Strike: Source.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Bryan Cain <bryancain3@gmail.com>
Bryan Cain [Thu, 16 Jun 2011 23:36:16 +0000 (18:36 -0500)]
glsl_to_tgsi: implement simplify_cmp pass needed by r300g
Bryan Cain [Thu, 16 Jun 2011 18:42:57 +0000 (13:42 -0500)]
glsl_to_tgsi: fix compile error with g++ 4.6
Bryan Cain [Wed, 15 Jun 2011 22:31:51 +0000 (17:31 -0500)]
glsl: remove glsl_type::get_vec4_type()
Thanks to Kenneth Graunke for pointing out that glsl_type::get_instance(base, 4, 1)
is the same as glsl_type::get_vec4_type(base).
The function was only used in st_glsl_to_tgsi, and this commit replaces that usage
with get_instance.
Bryan Cain [Wed, 15 Jun 2011 19:45:03 +0000 (14:45 -0500)]
glsl_to_tgsi: silence compiler warning
Bryan Cain [Tue, 14 Jun 2011 23:17:40 +0000 (18:17 -0500)]
glsl_to_tgsi: finish some loose ends
Bryan Cain [Tue, 14 Jun 2011 22:38:14 +0000 (17:38 -0500)]
glsl-to-tgsi: fix piglit tests
This commit fixes all of the piglit tests regressed by "mesa, glsl_to_tgsi: add
native support for integers in shaders" on softpipe.
Bryan Cain [Mon, 13 Jun 2011 23:12:56 +0000 (18:12 -0500)]
mesa, glsl_to_tgsi: add native support for integers in shaders
Disabled by default on all drivers. To enable it, change ctx->GLSLVersion to 130
in st_extensions.c. Currently, softpipe is the only driver with integer support.
Bryan Cain [Mon, 13 Jun 2011 22:52:54 +0000 (17:52 -0500)]
tgsi: add support for TGSI_OPCODE_MOD in tgsi_exec
Bryan Cain [Tue, 17 May 2011 22:13:20 +0000 (17:13 -0500)]
mesa: support boolean and integer-based parameters in prog_parameter
The functionality is not used by anything yet, and the glUniform functions will
need to be reworked before this can reach its full usefulness. It is
nonetheless a step towards integer support in the state tracker and classic drivers.
Bryan Cain [Fri, 6 May 2011 02:10:28 +0000 (21:10 -0500)]
gallium: add PIPE_SHADER_CAP_INTEGERS
Bryan Cain [Tue, 3 May 2011 04:12:18 +0000 (23:12 -0500)]
glsl_to_tgsi: fix shaders with indirect addressing of temps
Fixes several Piglit tests, although it's a step backwards for optimization.
Bryan Cain [Mon, 2 May 2011 02:49:21 +0000 (21:49 -0500)]
glsl_to_tgsi: use TGSI opcodes when converting from GLSL IR
Before, the translator used Mesa IR opcodes (a holdover from ir_to_mesa) and
converted them to TGSI opcodes during TGSI emission.
Bryan Cain [Sun, 1 May 2011 16:55:03 +0000 (11:55 -0500)]
glsl_to_tgsi: support DDY (ir_unop_dFdy)
Bryan Cain [Sun, 1 May 2011 04:17:11 +0000 (23:17 -0500)]
glsl_to_tgsi: lower noise opcodes when converting from GLSL IR, not when generating TGSI
Bryan Cain [Sun, 1 May 2011 02:17:38 +0000 (21:17 -0500)]
glsl_to_tgsi: define the sampler objects used
Fixes the Nexuiz title screen and the water in 0 A.D.
Bryan Cain [Sat, 30 Apr 2011 18:44:32 +0000 (13:44 -0500)]
glsl_to_tgsi: remove a bad assertion
It was triggered by Alien Arena.
Bryan Cain [Sat, 30 Apr 2011 18:03:33 +0000 (13:03 -0500)]
glsl_to_tgsi: remove reads to output registers
Fixes a regression in 0 A.D. introduced by
809a11c77073e999fd47.
Bryan Cain [Sat, 30 Apr 2011 00:24:57 +0000 (19:24 -0500)]
glsl_to_tgsi: stop generating Mesa IR
Before, it was still generating unused Mesa IR as a remnant of ir_to_mesa, and
depended on some of the information from it.
Bryan Cain [Sat, 30 Apr 2011 00:00:24 +0000 (19:00 -0500)]
mesa: fix segfault when no Mesa IR is generated
Bryan Cain [Tue, 26 Apr 2011 04:37:47 +0000 (23:37 -0500)]
st/mesa: Add a GLSL IR to TGSI translator.
It is still a work in progress at this point, but it produces working and
reasonably well-optimized code.
Originally based on ir_to_mesa and st_mesa_to_tgsi, but does not directly use
Mesa IR instructions in TGSI generation, instead generating TGSI from the
intermediate class glsl_to_tgsi_instruction. It also has new optimization
passes to replace _mesa_optimize_program.
Paul Berry [Wed, 27 Jul 2011 22:53:31 +0000 (15:53 -0700)]
glsl: improve the accuracy of the atan(x,y) builtin function.
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.
Paul Berry [Wed, 27 Jul 2011 21:34:12 +0000 (14:34 -0700)]
glsl: improve the accuracy of the asin() builtin function.
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-*
Chad Versace [Mon, 1 Aug 2011 16:36:08 +0000 (09:36 -0700)]
glsl: Remove duplicate comment
Remove duplicate doxgen comment for
ir_function.cpp:parameter_lists_match().
Signed-off-by: Chad Versace <chad@chad-versace.us>
Jeremy Huddleston [Sun, 31 Jul 2011 16:31:48 +0000 (09:31 -0700)]
darwin: Use machine/endian.h to determine endianness
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Jeremy Huddleston [Sun, 31 Jul 2011 16:21:56 +0000 (09:21 -0700)]
Fix PPC detection on darwin
Fixes regression introduced by
7004582c1894ede839c44e292b413fe4916d7e9e
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Chad Versace [Wed, 27 Jul 2011 19:37:51 +0000 (12:37 -0700)]
glsl: Clarify ir_function::matching_sigature()
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 <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
Chad Versace [Wed, 27 Jul 2011 20:00:02 +0000 (13:00 -0700)]
glsl: Fix conversions in array constructors
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 <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
Chad Versace [Wed, 27 Jul 2011 19:32:10 +0000 (12:32 -0700)]
glsl: Remove ir_function.cpp:type_compare()
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 <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
Chad Versace [Wed, 27 Jul 2011 19:31:10 +0000 (12:31 -0700)]
glsl: Fix implicit conversions in non-constructor function calls
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 <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
Chad Versace [Wed, 27 Jul 2011 19:21:27 +0000 (12:21 -0700)]
glsl: Add method glsl_type::can_implicitly_convert_to()
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 <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
Brian Paul [Fri, 29 Jul 2011 22:49:55 +0000 (16:49 -0600)]
mesa: minor comment changes in teximage.c
Brian Paul [Fri, 29 Jul 2011 22:49:55 +0000 (16:49 -0600)]
mesa: add missing breaks for GL_TEXTURE_CUBE_MAP_SEAMLESS queries
And fix indentation.
NOTE: This is a candidate for the 7.11 branch.
Eric Anholt [Fri, 22 Jul 2011 23:52:54 +0000 (16:52 -0700)]
i965/fs: Allow register coalescing where the source is a uniform.
Removes 0.8% of the fragment shader instructions on Unigine Tropics.
Eric Anholt [Fri, 22 Jul 2011 23:45:15 +0000 (16:45 -0700)]
i965/fs: Optimize a * 1.0 -> a.
This appears in our instruction stream as a result of the
brw_vs_constval.c handling.
Eric Anholt [Fri, 22 Jul 2011 23:18:39 +0000 (16:18 -0700)]
i965/fs: If we see a RCP of a constant, try to constant fold it.
Eric Anholt [Fri, 22 Jul 2011 22:56:46 +0000 (15:56 -0700)]
i965/fs: Port texture projection avoidance optimization from the old backend.
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.
Eric Anholt [Fri, 22 Jul 2011 22:48:53 +0000 (15:48 -0700)]
Revert "i965: Don't compute brw->wm.input_size_masks when it's unused."
This reverts commit
3412069e23b7fa5656262f3dd1aa86f66980594d. We're
about to start using it in fragment shaders to handle avoiding
projection for fixed function.
Eric Anholt [Fri, 29 Jul 2011 18:52:39 +0000 (11:52 -0700)]
i965/fs: Stop using the exec_list iterator.
The old style has gone out of favor in the project, but I kept copy
and pasting from existing iterator code.
Alex Deucher [Fri, 29 Jul 2011 15:29:53 +0000 (11:29 -0400)]
r600g: fix up vs export handling
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 <alexander.deucher@amd.com>
Chia-I Wu [Fri, 29 Jul 2011 01:59:18 +0000 (10:59 +0900)]
st/egl: create pbuffers with PIPE_BIND_SAMPLER_VIEW
So that eglBindTexImage works.
Eric Anholt [Tue, 26 Jul 2011 01:50:43 +0000 (18:50 -0700)]
i965/fs: Respect ARB_color_buffer_float clamping.
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 <kenneth@whitecape.org>
Eric Anholt [Wed, 13 Jul 2011 21:24:41 +0000 (14:24 -0700)]
mesa: Fix ff fragment shader inputs calculation when enabling a VS.
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 <brianp@vmware.com>
Chia-I Wu [Fri, 29 Jul 2011 00:58:18 +0000 (09:58 +0900)]
targets/{egl,gbm}: omit unneeded libdrm_radeon
Chia-I Wu [Thu, 28 Jul 2011 07:03:11 +0000 (16:03 +0900)]
egl: EGL_MATCH_NATIVE_NATIVE_PIXMAP cannot be EGL_DONT_CARE
Chia-I Wu [Thu, 28 Jul 2011 04:33:55 +0000 (13:33 +0900)]
egl: make pixmaps and pbuffers EGL_BUFFER_PRESERVED
eglSwapBuffers is no-op to these surface types anyway.
Eric Anholt [Sat, 23 Jul 2011 01:42:21 +0000 (18:42 -0700)]
Add dependency generation for Mesa and GLSL dricore objects.
Reviewed-By: Christopher James Halse Rogers
<christopher.halse.rogers@canonical.com>
Eric Anholt [Wed, 13 Jul 2011 23:08:42 +0000 (16:08 -0700)]
softpipe: When doing write_all_cbufs, don't stomp over the color.
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 <brianp@vmware.com>
Brian Paul [Thu, 28 Jul 2011 15:51:30 +0000 (09:51 -0600)]
mesa: fix format selection for meta CopyTexSubImage()
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 <ian.d.romanick@intel.com>
Brian Paul [Thu, 28 Jul 2011 15:43:09 +0000 (09:43 -0600)]
mesa: test against MESA_FORMAT_NONE in _mesa_GetTexLevelParameteriv()
Brian Paul [Wed, 27 Jul 2011 21:49:39 +0000 (15:49 -0600)]
st/mesa: fix comment language
Vadim Girlin [Thu, 28 Jul 2011 20:33:31 +0000 (00:33 +0400)]
r600g: fix vs export count
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39572
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Kenneth Graunke [Tue, 26 Jul 2011 04:13:43 +0000 (21:13 -0700)]
i965: Remove the now unused intel_renderbuffer::draw_offset field.
The previous commit removed the last use of this field.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Tue, 26 Jul 2011 00:06:13 +0000 (17:06 -0700)]
i965: Check actual tile offsets in Gen4 miptree workaround.
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 <eric@anholt.net>
Reviewed-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Mon, 25 Jul 2011 21:27:07 +0000 (14:27 -0700)]
i965/gen4: Fix message parameter loading for 1D TXD sampling.
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 <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Paul Berry [Wed, 27 Jul 2011 17:35:17 +0000 (10:35 -0700)]
glsl: improve the accuracy of the radians() builtin function
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 <kenneth@whitecape.org>
Marek Olšák [Mon, 25 Jul 2011 23:05:51 +0000 (01:05 +0200)]
configure.ac: add DLOPEN_LIBS to xlib build
Otherwise xlib-based llvmpipe fails to link.
NOTE: This is a candidate for the 7.11 branch.
Marek Olšák [Mon, 25 Jul 2011 23:05:13 +0000 (01:05 +0200)]
configure.ac: fix xlib-based softpipe build
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
NOTE: This is a candidate for the 7.11 branch.
Ian Romanick [Wed, 27 Jul 2011 18:37:30 +0000 (11:37 -0700)]
glsl: Add source location tracking to TODO list
Ian Romanick [Wed, 27 Jul 2011 18:35:31 +0000 (11:35 -0700)]
glsl: Remove completed items from the TODO list
Christoph Bumiller [Wed, 27 Jul 2011 10:13:37 +0000 (12:13 +0200)]
mesa: don't forget about sampleBuffers in framebuffer visual update
Otherwise multisample will never been enabled for multisample
renderbuffers.
Reviewed-by: Brian Paul <brianp@vmware.com>
Benjamin Franzke [Wed, 27 Jul 2011 08:04:51 +0000 (10:04 +0200)]
wayland-drm: Add copyright notice to protocol
Fixes build since wayland
986703ac7365bc87a5501714adb9fc73157c62b7.
Tobias Droste [Thu, 14 Jul 2011 20:32:58 +0000 (22:32 +0200)]
egl/gallium: fix build without softpipe and llvmpipe
Signed-off-by: Tobias Droste <tdroste@gmx.de>
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Marek Olšák [Tue, 26 Jul 2011 19:15:05 +0000 (21:15 +0200)]
r300g: copy the compiler from r300c
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.
Bryan Cain [Wed, 20 Jul 2011 22:35:22 +0000 (17:35 -0500)]
util: enable S3TC support when the force_s3tc_enable env var is set to "true"
NOTE: This is a candidate for the 7.10 and 7.11 branches.
Bryan Cain [Mon, 25 Jul 2011 18:30:17 +0000 (13:30 -0500)]
st/mesa: respect force_s3tc_enable environment variable
NOTE: This is a candidate for the 7.10 and 7.11 branches.
Ian Romanick [Fri, 22 Jul 2011 23:45:50 +0000 (16:45 -0700)]
mesa: Make _mesa_get_compressed_formats match the texture compression specs
The implementation deviated slightly from the GL_EXT_texture_sRGB spec
and from other implementations. A giant comment block was added to
justify the somewhat odd behavior of this function.
In addition, the interface had unnecessary cruft. The 'all' parameter
was false at all callers, so it has been removed.
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Fri, 22 Jul 2011 22:26:24 +0000 (15:26 -0700)]
mesa: Return the correct internal fmt when a generic compressed fmt was used
If an application requests a generic compressed format for a texture
and the driver does not pick a specific compressed format, return the
generic base format (e.g., GL_RGBA) for the GL_TEXTURE_INTERNAL_FORMAT
query.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3165
Reviewed-by: Brian Paul <brianp@vmware.com>
Ian Romanick [Fri, 22 Jul 2011 22:25:55 +0000 (15:25 -0700)]
mesa: Add utility function to get base format from a GL compressed format
Reviewed-by: Brian Paul <brianp@vmware.com>
Eric Anholt [Mon, 25 Jul 2011 22:39:03 +0000 (15:39 -0700)]
i965/fs: Fix MRT drawing since the m0->m2 move for shader debug.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Ian Romanick [Tue, 26 Jul 2011 01:33:40 +0000 (18:33 -0700)]
glsl: Correctly return progress from lower_variable_index_to_cond_assign
lower_variable_index_to_cond_assign runs until it can't make any more
progress. It then returns the result of the last pass which will
always be false. This caused the lowering loop in
_mesa_ir_link_shader to end before doing one last round of
lower_if_to_cond_assign. This caused several if-statements (resulting
from lower_variable_index_to_cond_assign) to be left in the IR.
In addition to this change, lower_variable_index_to_cond_assign should
take a flag indicating whether or not it should even generate
if-statements. This is easily controlled by
switch_generator::linear_sequence_max_length. This would generate
much better code on architectures without any flow contol.
Fixes i915 piglit regressions glsl-texcoord-array and
glsl-fs-vec4-indexing-temp-src.
Reviewed-by: Eric Anholt <eric@anholt.net>
Marek Olšák [Sat, 23 Jul 2011 13:57:51 +0000 (15:57 +0200)]
configure.ac: do not check for llvm-config if llvm is disabled
NOTE: This is a candidate for the 7.11 branch.
Tobias Droste [Mon, 18 Jul 2011 05:14:06 +0000 (07:14 +0200)]
r300/compiler: simplify code in peephole_add_presub_add
Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
Marek Olšák [Sun, 24 Jul 2011 21:59:44 +0000 (23:59 +0200)]
winsys/radeon: fix typos in the driver interface
Marek Olšák [Fri, 22 Jul 2011 20:14:39 +0000 (22:14 +0200)]
winsys/radeon: manage constant buffers by the cache bufmgr too
Marek Olšák [Sat, 23 Jul 2011 02:11:31 +0000 (04:11 +0200)]
winsys/radeon: remove usage parameter from buffer_create
Marek Olšák [Fri, 22 Jul 2011 17:22:50 +0000 (19:22 +0200)]
winsys/radeon: fix int->boolean conversion in radeon_bo_is_referenced_by_any_cs
Marek Olšák [Fri, 22 Jul 2011 17:20:25 +0000 (19:20 +0200)]
winsys/radeon: little change in radeon_bo_is_referenced_by_cs
Marek Olšák [Fri, 22 Jul 2011 17:14:23 +0000 (19:14 +0200)]
winsys/radeon: add R300 infix to winsys feature names
Marek Olšák [Fri, 22 Jul 2011 16:58:30 +0000 (18:58 +0200)]
winsys/radeon: simplify how value queries work
This drops the get_value query and adds a function query_info, which returns
all the values in one nice structure.