Marek Olšák [Wed, 27 Jun 2012 03:45:47 +0000 (05:45 +0200)]
vbo: don't call twice _mesa_valid_to_render in DrawArraysInstancedBaseInstance
It's called in _mesa_validate_DrawArraysInstanced already.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Sun, 18 Dec 2011 01:13:17 +0000 (02:13 +0100)]
mesa: rename MaxTransformFeedbackSeparateAttribs to MaxTransformFeedbackBuffers
This is a cleanup for ARB_transform_feedback3, where
GL_MAX_TRANSFORM_FEEDBACK_BUFFERS is introduced for interleaved attribs and
has the same meaning as GL_MAX_.._SEPARATE_ATTRIBS for separate attribs.
Also, the maximum number of TFB buffers is reduced from 32 to 4, which makes
this patch useful even without the extension.
I don't know of any hardware which can do more than 4.
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Thu, 28 Jun 2012 17:07:10 +0000 (18:07 +0100)]
gallivm: Refactor lp_build_broadcast(_scalar) to share code.
Doesn't really change the generated assembly, but produces more compact IR,
and of course, makes code more consistent.
Reviewed-by: Brian Paul <brianp@vmware.com>
Johannes Obermayr [Thu, 28 Jun 2012 08:16:47 +0000 (10:16 +0200)]
gallivm: Fix potential buffer overflowing in strncat.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Marcin Slusarz [Wed, 27 Jun 2012 12:45:17 +0000 (14:45 +0200)]
nv50: dynamically allocate space for shader local storage
Fixes 21 piglit tests:
spec/glsl-1.10/execution/variable-indexing/
fs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-row-wr
spec/glsl-1.20/execution/variable-indexing/
fs-temp-array-mat3-index-col-row-rd
fs-temp-array-mat3-index-row-rd
fs-temp-array-mat4-col-row-wr
fs-temp-array-mat4-index-col-row-rd
fs-temp-array-mat4-index-col-row-wr
fs-temp-array-mat4-index-row-rd
fs-temp-array-mat4-index-row-wr
vs-temp-array-mat3-index-col-row-rd
vs-temp-array-mat3-index-col-row-wr
vs-temp-array-mat3-index-row-rd
vs-temp-array-mat3-index-row-wr
vs-temp-array-mat4-col-row-wr
vs-temp-array-mat4-index-col-row-rd
vs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-col-wr
vs-temp-array-mat4-index-row-rd
vs-temp-array-mat4-index-row-wr
vs-temp-array-mat4-index-wr
... and prevents a lot of GPU lockups
Marcin Slusarz [Tue, 26 Jun 2012 14:22:43 +0000 (16:22 +0200)]
nv50: streamline screen_create error handling
Remove macro which changes control flow (it's evil).
Make all fail paths print (correct) error message.
Marcin Slusarz [Tue, 26 Jun 2012 13:02:55 +0000 (15:02 +0200)]
nv50/ir: make colorful ir dump output optional
Brian Paul [Wed, 27 Jun 2012 16:52:55 +0000 (10:52 -0600)]
mesa: more const qualifiers to match the latest glext.h
For some reason regular gcc on Linux didn't catch these but the mingw
compiler did (generated errors, not warnings).
v2: include the changes in src/mapi/ too
Brian Paul [Wed, 27 Jun 2012 16:23:54 +0000 (10:23 -0600)]
glapi: add const qualifier to glShaderSourceARB() parameter
Fixes the es2 build with gcc.
Note: in glext.h the prototypes for glShaderSource() and glShaderSourceARB()
disagree: only the former has the extra const qualifier.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Jordan Justen [Sun, 27 May 2012 17:48:47 +0000 (10:48 -0700)]
i965: enable ARB_instanced_arrays extension
Set the step_rate value when drawing to implement
ARB_instanced_arrays for gen >= 4.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Brian Paul [Tue, 26 Jun 2012 19:06:47 +0000 (13:06 -0600)]
glsl: be more careful about counting varying vars in the linker
Previously, we were counting gl_FrontFacing, gl_FragCoord and gl_PointCoord
against the limit of varying variables. This prevented some valid shaders
from linking.
The other potential solution to this is to have the driver advertise
more varying vars or set the GLSLSkipStrictMaxVaryingLimitCheck flag.
But the above-mentioned variables aren't conventional varying attributes
so it doesn't seem right to count them.
Reviewed-by: Eric Anholt <eric@anholt.net>
Andreas Boll [Tue, 26 Jun 2012 18:47:05 +0000 (20:47 +0200)]
docs/helpwanted: add some useful todo lists
Signed-off-by: Brian Paul <brianp@vmware.com>
Brian Paul [Tue, 26 Jun 2012 20:47:19 +0000 (14:47 -0600)]
softpipe: fix numFragsEmitted debug code
Brian Paul [Tue, 26 Jun 2012 20:47:19 +0000 (14:47 -0600)]
gallium: minor whitespace, comment changes
Brian Paul [Tue, 26 Jun 2012 20:47:19 +0000 (14:47 -0600)]
mesa: update glext.h to version 81
Brian Paul [Tue, 26 Jun 2012 20:47:19 +0000 (14:47 -0600)]
mesa: update glxext.h to version 33
Brian Paul [Tue, 26 Jun 2012 20:47:19 +0000 (14:47 -0600)]
mesa: make _mesa_reference_array_object() an inline function
As we do for texture objects, buffer objects, etc.
Brian Paul [Tue, 26 Jun 2012 20:47:19 +0000 (14:47 -0600)]
mesa: look up enum name for glEnable/Disable errors
Brian Paul [Tue, 26 Jun 2012 20:47:19 +0000 (14:47 -0600)]
mesa: move TEXGEN defines closer to gl_texgen struct
Brian Paul [Tue, 26 Jun 2012 20:47:19 +0000 (14:47 -0600)]
mesa: rename ColorMaterialBitmask to _ColorMaterialBitmask
Since it's a derived field.
Brian Paul [Tue, 26 Jun 2012 20:47:19 +0000 (14:47 -0600)]
mesa: re-order, update comments on lighting-related structs
José Fonseca [Wed, 27 Jun 2012 10:15:53 +0000 (11:15 +0100)]
gallium/util: Fix parsing of options with underscore.
For example
GALLIVM_DEBUG=no_brilinear
which was being parsed as two options, "no" and "brilinear".
James Benton [Tue, 26 Jun 2012 14:00:14 +0000 (15:00 +0100)]
gallivm: Added a generic lp_build_print_value which prints a LLVMValueRef.
Updated lp_build_printf to share common code.
Removed specific lp_build_print_vecX.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Stéphane Marchesin [Tue, 26 Jun 2012 02:45:56 +0000 (19:45 -0700)]
i915g: Implement sRGB textures
Since we don't have them in hw we emulate them in the shader. Although not
recommended by the spec it is legit.
As a side effect we also get GL 2.1. I think this is as far as we can take
the i915.
Brian Paul [Tue, 26 Jun 2012 22:37:33 +0000 (16:37 -0600)]
svga: return 120 for PIPE_CAP_GLSL_FEATURE_LEVEL
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Brian Paul [Tue, 26 Jun 2012 22:37:22 +0000 (16:37 -0600)]
llvmpipe: return 120 for PIPE_CAP_GLSL_FEATURE_LEVEL
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Carl Worth [Sat, 9 Jun 2012 23:37:08 +0000 (16:37 -0700)]
glsl: glcpp: Extend testing of #line directives
The most recent commit adds support for comments and macro expansion
on #line directives. Add testing to verify the new features.
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Carl Worth [Sat, 9 Jun 2012 23:31:06 +0000 (16:31 -0700)]
glsl: glcpp: Move handling of #line directives from lexer to parser.
The GLSL specification requires that #line directives be interpreted
after macro expansion. Our existing implementation of #line macros in
the lexer prevents conformance on this point.
Moving the handling of #line from the lexer to the parser gives us the
macro expansion we need. An additional benefit is that the
preprocessor also now supports comments on the same line as #line
directives.
Finally, the preprocessor now emits the (fully-macro-expanded) #line
directives into the output. This allows the full GLSL compiler to also
see and interpret these directives so it can also generate correct
line numbers in error messages.
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Carl Worth [Sat, 9 Jun 2012 23:29:38 +0000 (16:29 -0700)]
glsl: glcpp: Rename and document _glcpp_parser_expand_if
This function is currently used only in the expansion of #if lines,
but we will soon be using it more generally (for the expansion of
(_glcpp_parser_expand_and_lex_from) and some more documentation.
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Carl Worth [Sat, 9 Jun 2012 16:45:56 +0000 (09:45 -0700)]
glsl: Consistently use length-based ralloc string functions for info_log.
Commit
b823b99ec0f13af257dcd885f436a4d294c6222a switched from using
functions such as ralloc_asprintf and ralloc_strcat to
ralloc_asprintf_rewrite_tail. This change maintains the string's
length as a aparamter that is updated by the ralloc functions (rather
than recomputing it with strlen over and over).
However, the change failed to updated two locations (glcpp_error and
glcpp_warning), with the result that the string's length wasn't
updated by these calls. Then, subsequent calls to other
ralloc_asprintf_rewrite_tail would overwrite the text appended by
glcpp_error.
This commit fixes the two missing updates, and restores line numbers
to the output of glcpp error messages, (as noticed by a glcpp unit
test case that has been failing since the above-mentioned commit).
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Carl Worth [Fri, 8 Jun 2012 22:00:49 +0000 (15:00 -0700)]
glsl: glcpp: Allow "#if undefined-macro' to evaluate to false.
A strict reading of the GLSL specification would have this be an
error, but we've received reports from users who expect the
preprocessor to interepret undefined macros as 0. This is the standard
behavior of the rpeprocessor for C, and according to these user
reports is also the behavior of other OpenGL implementations.
So here's one of those cases where we can make our users happier by
ignoring the specification. And it's hard to imagine users who really,
really want to see an error for this case.
The two affected tests cases are updated to reflect the new behavior.
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jerome Glisse [Tue, 26 Jun 2012 16:24:08 +0000 (12:24 -0400)]
r600g: enable DUAL_EXPORT mode when possible on r6xx/r7xx
DUAL_EXPORT can be enabled on r6xx/r7xx when all CBs use 16-bit export
and there is no depth/stencil export.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Vadim Girlin [Tue, 26 Jun 2012 16:23:31 +0000 (12:23 -0400)]
r600g: enable DUAL_EXPORT mode when possible
It seems DUAL_EXPORT on evergreen may be enabled when all CBs use 16-bit export
mode (EXPORT_4C_16BPC), also there should be at least one CB, and the PS
shouldn't export depth/stencil.
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Vadim Girlin [Tue, 26 Jun 2012 18:47:27 +0000 (22:47 +0400)]
r600g: avoid unnecessary shader exports v2
In some cases TGSI shader has more color outputs than the number of CBs,
so it seems we need to limit the number of color exports. This requires
different shader variants depending on the nr_cbufs, but on the other hand
we are doing less exports, which are very costly.
v2: fix various piglit regressions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Vadim Girlin [Mon, 11 Jun 2012 09:11:47 +0000 (13:11 +0400)]
r600g: cache shader variants instead of rebuilding v3
Shader variants are stored in the list, the key for lookup is based on the
states that require different hw shaders - currently it's rctx->two_side (all
gpus) and rctx->nr_cbufs (evergreen/cayman, when writes_all property is set).
v2:
- use simple list instead of keymap as suggested by Marek on irc
- call r600_adjust_gprs from r600_bind_vs_shader for r6xx/r7xx
(r600_shader_select isn't used for vertex shaders currently)
v3:
- fix call to r600_adjust_gprs - do it after updating current shader
Improves performance for some apps, e.g. FlightGear -
see https://bugs.freedesktop.org/show_bug.cgi?id=50360
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Brian Paul [Tue, 26 Jun 2012 20:41:46 +0000 (14:41 -0600)]
svga: handle missing PIPE_CAP_x queries
And fix incorrect error message for a bad shader type/number.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Brian Paul [Tue, 26 Jun 2012 20:11:00 +0000 (14:11 -0600)]
llvmpipe: handle more PIPE_CAP_x queries
As with the previous commit for softpipe.
v2: remove 'default' case to get compile-time warning
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Brian Paul [Tue, 26 Jun 2012 20:02:43 +0000 (14:02 -0600)]
softpipe: handle more PIPE_CAP_x queries
These all return zero. Add a debug_printf() to catch the default case so
we don't accidently mishandle something important in the future.
v2: remove 'default' case to get compile-time warning
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Brian Paul [Tue, 26 Jun 2012 18:59:30 +0000 (12:59 -0600)]
svga: return 1 for PIPE_CAP_MIXED_COLORBUFFER_FORMATS
This is actually required for GL_ARB_framebuffer_object, but the state
tracker doesn't currently check it.
Direct3D 9 allows mixed format color buffers with some restrictions.
Setting this allows Unigine Heaven 2.5 and 3.0 to run. Tested both on
GL and D3D hosts.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Brian Paul [Tue, 26 Jun 2012 15:45:29 +0000 (09:45 -0600)]
glsl: fix comment typo
Olivier Galibert [Mon, 25 Jun 2012 16:50:13 +0000 (18:50 +0200)]
u2f_emit: Fix type parameter in LLVM call.
The type is the destination type (i.e. float vector) and not the
source type. Fixes piglit fs-{in,de}crement-uint.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Paul Berry [Mon, 25 Jun 2012 23:57:10 +0000 (16:57 -0700)]
i965/msaa: Set KILL_ENABLE when GL_ALPHA_TO_COVERAGE enabled.
i965 hardware needs to be informed of situations in which it's
possible for pixels (or samples) to be discarded for reasons other
than depth/stencil testing (e.g. due to an explicit "discard" in the
fragment shader). One of these situations is when
GL_ALPHA_TO_COVERAGE is enabled, since that can cause samples to be
discarded by the color calculator when the pixel's alpha value is less
than 1.0.
Without this patch, GL_ALPHA_TO_COVERAGE does not take effect on depth
buffers.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Paul Berry [Sat, 23 Jun 2012 03:27:18 +0000 (20:27 -0700)]
i965/msaa: Implement GL_SAMPLE_ALPHA_TO_{COVERAGE,ONE}.
This patch enables the multisampling parameters
GL_SAMPLE_ALPHA_TO_COVERAGE and GL_SAMPLE_ALPHA_TO_ONE, which allow
the fragment shader's alpha output to be converted into a sample
coverage mask and ignored for blending. i965 supports these
parameters through the BLEND_STATE structure.
The GL spec allows, but does not require, the implementation to dither
the conversion from alpha to a sample coverage mask, so that alpha
values that aren't a multiple of 1/num_samples result in the correct
proportion of samples being lit. A bit exists in the BLEND_STATE
structure to enable this functionality, but according to the hardware
docs it must be disabled on Sandy Bridge (see the Sandy Bridge PRM,
Vol2, Part1, p379: AlphaToCoverage Dither Enable). So it is enabled
for Gen7 only.
Fixes piglit tests
"EXT_framebuffer_multisample/sample-alpha-to-{coverage,one} {2,4}".
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Paul Berry [Sat, 23 Jun 2012 03:45:49 +0000 (20:45 -0700)]
i965/msaa: Implement glSampleCoverage.
This patch enables glSampleCoverage() functionality, which allows the
client program to specify that only a portion of the samples be lit up
when performing multisampled rendering. i965 supports
glSampleCoverage() through the 3DSTATE_SAMPLE_MASK command packet,
which allows the driver to specify a bitfield indicating which samples
to light up.
Fixes piglit tests "EXT_framebuffer_multisample/sample-coverage {2,4}
{inverted,non-inverted}".
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
José Fonseca [Tue, 26 Jun 2012 09:13:28 +0000 (10:13 +0100)]
st/wgl: Add a few more comments.
Marek Olšák [Tue, 26 Jun 2012 01:35:25 +0000 (03:35 +0200)]
r600g: don't disable streamout if it hasn't been started
Marek Olšák [Tue, 26 Jun 2012 01:33:16 +0000 (03:33 +0200)]
u_blitter: disable streamout before rendering
This fixes piglit EXT_transform_feedback tests:
- intervening-read output
- intervening-read prims_written
Chad Versace [Thu, 21 Jun 2012 18:35:03 +0000 (11:35 -0700)]
i965/fs: Fix conversions float->bool, int->bool
Fixes gles2conform GL.equal.equal_bvec2_frag.
This fixes brw_fs_visitor's translation of ir_unop_f2b. It used CMP to
convert the float to one of 0 or ~0. However, the convention in the
compiler is that true is represented by 1, not ~0. This patch adds an AND
to convert ~0 to 1.
By inspection, a similar problem existed with ir_unop_i2b, with a similar
fix.
[v2 kayden]: eliminate extra temporary register.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49621
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Brian Paul [Mon, 25 Jun 2012 20:57:41 +0000 (14:57 -0600)]
st/wgl: 80-column wrapping
Andreas Boll [Mon, 25 Jun 2012 19:54:13 +0000 (21:54 +0200)]
docs/lists: add piglit mailing list
Signed-off-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Mon, 25 Jun 2012 19:54:08 +0000 (21:54 +0200)]
docs/helpwanted: update some info
Signed-off-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Mon, 25 Jun 2012 19:54:03 +0000 (21:54 +0200)]
docs/sourcetree: update some info
Signed-off-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Mon, 25 Jun 2012 19:53:06 +0000 (21:53 +0200)]
docs/devinfo: update release info
Signed-off-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Mon, 25 Jun 2012 19:53:01 +0000 (21:53 +0200)]
docs/systems: add some useful driver links
Signed-off-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Mon, 25 Jun 2012 19:52:51 +0000 (21:52 +0200)]
docs: update some broken/old links
Signed-off-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Mon, 25 Jun 2012 19:52:47 +0000 (21:52 +0200)]
docs: whitespace cleanup
Signed-off-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Mon, 25 Jun 2012 19:52:10 +0000 (21:52 +0200)]
docs: escape html special char
Signed-off-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Mon, 25 Jun 2012 19:51:53 +0000 (21:51 +0200)]
docs: add missing target attribute
target is needed for the frame based layout
Signed-off-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Mon, 25 Jun 2012 19:51:28 +0000 (21:51 +0200)]
docs/shading: use proper markup
use dl instead of ul
Signed-off-by: Brian Paul <brianp@vmware.com>
Brian Paul [Mon, 25 Jun 2012 17:44:44 +0000 (11:44 -0600)]
docs: document the GALLIUM_LOG_FILE env var
Brian Paul [Mon, 25 Jun 2012 17:43:03 +0000 (11:43 -0600)]
mesa: new MESA_LOG_FILE env var to log errors, warnings, etc., to a file
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Marek Olšák [Mon, 25 Jun 2012 21:48:33 +0000 (23:48 +0200)]
docs: update GL3.3 status
Marek Olšák [Mon, 25 Jun 2012 20:53:21 +0000 (22:53 +0200)]
r600g: inline r600_blit_push_depth and use resource_copy_region
We are going to have a separate resource for depth texturing and transfers
and this is just a transfer thing.
Marek Olšák [Mon, 25 Jun 2012 10:45:32 +0000 (12:45 +0200)]
r600g: split flushed depth texture creation and flushing
Paul Berry [Mon, 18 Jun 2012 20:52:02 +0000 (13:52 -0700)]
i965/msaa: Add backend support for centroid interpolation.
This patch causes the fragment shader to be configured correctly (and
the correct code to be generated) for centroid interpolation. This
required two changes: brw_compute_barycentric_interp_modes() needs to
determine when centroid barycentric coordinates need to be included in
the pixel shader thread payload, and
fs_visitor::emit_general_interpolation() needs to interpolate using
the correct set of barycentric coordinates.
Fixes piglit tests "EXT_framebuffer_multisample/interpolation {2,4}
centroid-edges" on i965.
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Thu, 21 Jun 2012 18:33:22 +0000 (11:33 -0700)]
i965/fs: Refactor interpolation code to prepare for adding centroid support.
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Mon, 18 Jun 2012 18:23:01 +0000 (11:23 -0700)]
i965/msaa: Adapt clip setup for centroid noperspective interpolation.
To save time, we only instruct the clip stage of the pipeline to
compute noperspective barycentric coordinates if those coordinates are
needed by the fragment shader. Previously, we would determine whether
the coordinates were needed by seeing whether the fragment shader used
the BRW_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC interpolation mode.
However, with MSAA, it's possible that the fragment shader might use
BRW_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC instead. In the future,
when we support ARB_sample_shading, it might use
BRW_WM_NONPERSPECTIVE_SAMPLE_BARYCENTRIC.
This patch modifies the upload_clip_state() functions to check for all
three possible noperspective interpolation modes.
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Mon, 18 Jun 2012 19:10:13 +0000 (12:10 -0700)]
glsl: Add IsCentroid bitfield to gl_fragment_program.
This bitfield tells the back-ends which of a fragment shader's inputs
require centroid interpolation. It is only set for GLSL fragment
shaders, since assembly fragment shaders don't support centroid
interpolation.
Reviewed-by: Eric Anholt <eric@anholt.net>
Brian Paul [Mon, 25 Jun 2012 17:28:03 +0000 (11:28 -0600)]
st/mesa: added some simple fbo debugging/helper code
Brian Paul [Fri, 22 Jun 2012 19:06:40 +0000 (13:06 -0600)]
llvmpipe: fix the LP_NO_RAST debug option
It was only no-oping the clear() function, not actual triangle
rasterization. Move the no_rast field from lp_context down into
lp_rasterizer so it's accessible where it's needed.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Vinson Lee [Tue, 19 Jun 2012 07:02:53 +0000 (00:02 -0700)]
scons: Add glsl/glcpp to the include path.
Fixes this build failure on Solaris.
Compiling build/sunos-debug/glsl/glcpp/glcpp-lex.c ...
"src/glsl/glcpp/glcpp-lex.l", line 30: cannot find include file: "glcpp-parse.h"
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Laurent Carlier [Fri, 22 Jun 2012 13:03:49 +0000 (15:03 +0200)]
automake: add missing inclusion of GL headers
Building fail when GL headers are not installed in the system,
so add inclusion of these headers.
Signed-off-by: Brian Paul <brianp@vmware.com>
Brian Paul [Fri, 22 Jun 2012 16:16:25 +0000 (10:16 -0600)]
mesa: #define fprintf to be __mingw_fprintf() on Mingw32
So that formats such as "%llx" are understood.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Fri, 22 Jun 2012 15:43:18 +0000 (09:43 -0600)]
svga: init pointer to NULL to silence MSVC warning
Tom Stellard [Fri, 15 Jun 2012 20:52:16 +0000 (16:52 -0400)]
clover: Add --with-clang-libdir option and verify CLANG_RESOURCE_DIR
$CLANG_RESOURCE_DIR is the directory that contains all resources
needed by clang to compile programs. When clover uses clang to
compile kernels it needs to specify a resource dir, so that clang
can find its internal headers (e.g. stddef.h).
clang defines $CLANG_RESOURCE_DIR as $CLANG_LIBDIR/clang/$CLANG_VERSION
This patch adds the --with-clang-libdir option in order to accommodate
clang intalls to non-standard locations, and it also adds a check
to the configure script to verify that $CLANG_RESOURCE_DIR/include
contains the necessary header files.
Paul Berry [Wed, 20 Jun 2012 20:40:45 +0000 (13:40 -0700)]
i965: Compute dFdy() correctly for FBOs.
On i965, dFdx() and dFdy() are computed by taking advantage of the
fact that each consecutive set of 4 pixels dispatched to the fragment
shader always constitutes a contiguous 2x2 block of pixels in a fixed
arrangement known as a "sub-span". So we calculate dFdx() by taking
the difference between the values computed for the left and right
halves of the sub-span, and we calculate dFdy() by taking the
difference between the values computed for the top and bottom halves
of the sub-span.
However, there's a subtlety when FBOs are in use: since FBOs use a
coordinate system where the origin is at the upper left, and window
system framebuffers use a coordinate system where the origin is at the
lower left, the computation of dFdy() needs to be negated for FBOs.
This patch modifies the fragment shader back-ends to negate the value
of dFdy() when an FBO is in use. It also modifies the code that
populates the program key (brw_wm_populate_key() and
brw_fs_precompile()) so that they always record in the program key
whether we are rendering to an FBO or to a window system framebuffer;
this ensures that the fragment shader will get recompiled when
switching between FBO and non-FBO use.
This will result in unnecessary recompiles of fragment shaders that
don't use dFdy(). To fix that, we will need to adapt the GLSL and
NV_fragment_program front-ends to record whether or not a given shader
uses dFdy(). I plan to implement this in a future patch series; I've
left FIXME comments in the code as a reminder.
Fixes Piglit test "fbo-deriv".
NOTE: This is a candidate for stable release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Fri, 22 Jun 2012 14:48:45 +0000 (08:48 -0600)]
mesa: minor transform feedback comments
Brian Paul [Fri, 22 Jun 2012 14:43:58 +0000 (08:43 -0600)]
mesa: fix comments on UBO buffer binding functions
The old comments were for transform feedback.
Olivier Galibert [Thu, 21 Jun 2012 17:39:20 +0000 (19:39 +0200)]
draw: Handle the case when there isn't a fragment shader.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Zack Rusin [Thu, 21 Jun 2012 21:25:09 +0000 (17:25 -0400)]
mesa: update the emacs indent files
dirvars package has been replaced by built-in functionality of
dir-locals. preserve the settings in the new infrastructure
Tom Stellard [Thu, 7 Jun 2012 19:22:47 +0000 (15:22 -0400)]
r600g: Unify SURFACE_SYNC packet emission for 3D and compute
Drop the compute specific evergreen_set_buffer_sync() function and
instead use the r600_surface_sync_command atom for emitting SURFACE_SYNC
packets.
Tom Stellard [Wed, 6 Jun 2012 23:44:09 +0000 (19:44 -0400)]
r600g: Enable reusing of compute state
Tom Stellard [Wed, 6 Jun 2012 22:31:00 +0000 (18:31 -0400)]
r600g: Fix reading vtx instruction offset from bytestream
Tom Stellard [Wed, 20 Jun 2012 21:43:11 +0000 (17:43 -0400)]
radeon/llvm: Turn on the BitExtract peephole optimization
Thie BitExtract optimization folds a mask and shift operation together
into a single instruction (BFE_UINT).
Tom Stellard [Wed, 20 Jun 2012 20:28:01 +0000 (16:28 -0400)]
radeon/llvm: Lower ROTL to BIT_ALIGN
Tom Stellard [Tue, 19 Jun 2012 22:47:18 +0000 (18:47 -0400)]
radeon/llvm: Use the VLIW Scheduler for R600->NI
It's not optimal, but it's better than the register pressure scheduler
that was previously being used. The VLIW scheduler currently ignores
all the complicated instruction groups restrictions and just tries to
fill the instruction groups with as many instructions as possible.
Though, it does know enough not to put two trans only instructions in
the same group.
We are able to ignore the instruction group restrictions in the LLVM
backend, because the finalizer in r600_asm.c will fix any illegal
instruction groups the backend generates.
Enabling the VLIW scheduler improved the run time for a sha1 compute
shader by about 50%. I'm not sure what the impact will be for graphics
shaders. I tested Lightsmark with the VLIW scheduler enabled and the
framerate was about the same, but it might help apps that use really
big shaders.
Brian Paul [Thu, 21 Jun 2012 19:08:34 +0000 (13:08 -0600)]
mesa: set GL_ARB_uniform_buffer_object extension year to 2009
Eric Anholt [Mon, 18 Jun 2012 23:20:11 +0000 (16:20 -0700)]
mesa: Add a comment explaining my thoughts on glBindBufferBase().
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Mon, 18 Jun 2012 22:59:13 +0000 (15:59 -0700)]
mesa: Add support for glGetIntegeri_v from GL_ARB_uniform_buffer_object.
Fixes piglit ARB_uniform_buffer_object/getintegeri_v.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Fri, 15 Jun 2012 02:48:02 +0000 (19:48 -0700)]
mesa: Add support for glBindBufferBase/Range on GL_UNIFORM_BUFFER.
Fixes piglits:
GL_ARB_uniform_buffer_object/bindbuffer-general-point.
GL_ARB_uniform_buffer_object/negative-bindbuffer-buffer
GL_ARB_uniform_buffer_object/negative-bindbuffer-index
GL_ARB_uniform_buffer_object/negative-bindbuffer-target
GL_ARB_uniform_buffer_object/negative-bindbufferrange-range
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Thu, 14 Jun 2012 23:55:56 +0000 (16:55 -0700)]
mesa: Move glBindBufferBase and glBindBufferRange() to bufferobj.
The rest of the TFB implementation remains in transformfeedback.c, and
this will be shared with UBOs.
v2: Move the size/offset checks shared with UBOs to common code as
well. (Kenneth's review)
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Thu, 14 Jun 2012 23:47:39 +0000 (16:47 -0700)]
mesa: Move buffer object dispatch setup to bufferobj.c.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Thu, 14 Jun 2012 23:37:22 +0000 (16:37 -0700)]
mesa: Add indexed binding points for uniform buffer objects.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Mon, 18 Jun 2012 18:17:04 +0000 (11:17 -0700)]
mesa: Add support for the GL_UNIFORM_BUFFER general binding point.
Fixes piglit ARB_uniform_buffer_object/buffer-targets.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Thu, 14 Jun 2012 16:55:26 +0000 (09:55 -0700)]
mesa: Add state and getters for the GL_ARB_uniform_buffer_object maximums.
Fixes piglit GL_ARB_uniform_buffer_object/minmax.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Vincent Lejeune [Sun, 25 Dec 2011 18:17:01 +0000 (19:17 +0100)]
glapi: Add uniform buffer object API
v2: Fix a typo spotted by Eric Anholt.
v3: Fix missing "GL" on types, fix style, fix Studly_Caps extension name,
drop commented code duplicated with GL3x.xml [anholt]
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Tue, 12 Jun 2012 20:37:58 +0000 (13:37 -0700)]
dricore: Turn it into a normal library.
Our intention is still that it's not abi stable, so make the package
version number get included in the library name. Now you can parallel
install dricore-using drivers from multiple mesa versions. We can put
it into lib now that we're following library versioning rules
(assuming that ABIs don't change within a single Mesa point release).
LD_LIBRARY_PATH still doesn't work with a non-/, non-/usr prefix
because libtool uses rpath instead of runpath for nonstandard
prefixes.
Eric Anholt [Tue, 12 Jun 2012 20:10:08 +0000 (13:10 -0700)]
automake: Convert Mesa built sources generation to automake.
Eric Anholt [Tue, 12 Jun 2012 19:51:32 +0000 (12:51 -0700)]
mesa: Move GL header installation to automake.
This cuts some cruft related to osmesa where we were being careful to
not install headers twice.
Eric Anholt [Tue, 12 Jun 2012 19:29:44 +0000 (12:29 -0700)]
automake: Move mesa subdirs processing to automake.