summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* automake: add missing inclusion of GL headersLaurent Carlier2012-06-222-0/+2
| | | | | | | Building fail when GL headers are not installed in the system, so add inclusion of these headers. Signed-off-by: Brian Paul <[email protected]>
* mesa: #define fprintf to be __mingw_fprintf() on Mingw32Brian Paul2012-06-221-0/+10
| | | | | | So that formats such as "%llx" are understood. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Compute dFdy() correctly for FBOs.Paul Berry2012-06-226-9/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]>
* mesa: minor transform feedback commentsBrian Paul2012-06-221-0/+2
|
* mesa: fix comments on UBO buffer binding functionsBrian Paul2012-06-221-4/+7
| | | | The old comments were for transform feedback.
* mesa: set GL_ARB_uniform_buffer_object extension year to 2009Brian Paul2012-06-211-1/+1
|
* mesa: Add a comment explaining my thoughts on glBindBufferBase().Eric Anholt2012-06-211-0/+26
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add support for glGetIntegeri_v from GL_ARB_uniform_buffer_object.Eric Anholt2012-06-211-0/+24
| | | | | | | Fixes piglit ARB_uniform_buffer_object/getintegeri_v. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add support for glBindBufferBase/Range on GL_UNIFORM_BUFFER.Eric Anholt2012-06-211-0/+85
| | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move glBindBufferBase and glBindBufferRange() to bufferobj.Eric Anholt2012-06-214-59/+103
| | | | | | | | | | | 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 <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move buffer object dispatch setup to bufferobj.c.Eric Anholt2012-06-213-11/+21
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add indexed binding points for uniform buffer objects.Eric Anholt2012-06-212-0/+51
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add support for the GL_UNIFORM_BUFFER general binding point.Eric Anholt2012-06-213-0/+22
| | | | | | | Fixes piglit ARB_uniform_buffer_object/buffer-targets. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add state and getters for the GL_ARB_uniform_buffer_object maximums.Eric Anholt2012-06-213-0/+51
| | | | | | | Fixes piglit GL_ARB_uniform_buffer_object/minmax. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* dricore: Turn it into a normal library.Eric Anholt2012-06-211-9/+9
| | | | | | | | | | | | 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.
* automake: Convert Mesa built sources generation to automake.Eric Anholt2012-06-212-61/+65
|
* mesa: Move GL header installation to automake.Eric Anholt2012-06-212-12/+4
| | | | | This cuts some cruft related to osmesa where we were being careful to not install headers twice.
* automake: Move mesa subdirs processing to automake.Eric Anholt2012-06-212-45/+4
|
* automake: Move .pc installation to automake.Eric Anholt2012-06-212-10/+10
|
* automake: Move the master Mesa makefile to Makefile.old.Eric Anholt2012-06-213-9/+34
| | | | | This will let me incrementally move stuff to automake without converting libmesa.a all at once.
* automake: Convert osmesa.pc to be generated by configure.Eric Anholt2012-06-212-21/+5
|
* mesa: Convert gl.pc to be generated by configure.Eric Anholt2012-06-212-18/+6
| | | | This saves a step of mashing variables around in our Makefile.
* automake: Convert src/mesa/drivers/x11/Makefile to automake.Eric Anholt2012-06-214-86/+76
| | | | | | | | | The weird versioning of the libGL where the package version was sort of expressed as a big integer is dropped. libtool didn't like the 0 prefix, and it didn't really make sense anyway -- if you interpret it as an integer version number, old Mesa 071200 was bigger than current Mesa 08100. Instead, just bump the minor version and drop the patchlevel.
* automake: Convert src/mesa/drivers/Makefile to automake.Eric Anholt2012-06-213-29/+23
|
* automake: Convert gen_matypes building to automake.Eric Anholt2012-06-217-75/+84
|
* make: Drop HOST_CC and HOST_CFLAGS.Eric Anholt2012-06-211-1/+1
| | | | | | Except for the deleted linux-cell target, these were just the target cc/cflags. The only usage was for gen_matypes, which wants the target's structure packing, not the host, anyway.
* make: Fold ASM_CFLAGS into DEFINES.Eric Anholt2012-06-219-12/+5
| | | | | | Every place that uses ASM_FLAGS already uses DEFINES. Not including it in DEFINES is just a way to screw up potential users, as I've done several times while working on the build system.
* st/mesa: fix transform feedback of unsubscripted gl_ClipDistance arrayMarcin Slusarz2012-06-202-44/+6
| | | | | | | | | | | | | | | | | | | | | | | | | gl_ClipDistance needs special treatment in form of lowering pass which transforms gl_ClipDistance representation from float[] to vec4[]. There are 2 implementations - at glsl linker level (enabled by LowerClipDistance option) and at glsl_to_tgsi level (enabled unconditionally for gallium drivers). Second implementation is incomplete - it does not take into account transform feedback (see commit 642e5b413e0890b2070ba78fde42db381eaf02e5 "mesa: Fix transform feedback of unsubscripted gl_ClipDistance array" for details). There are 2 possible fixes: - adding transform feedback support into glsl_to_tgsi version - ripping gl_ClipDistance support from glsl_to_tgsi and enabling gl_ClipDistance lowering on glsl linker side This patch implements 2nd option. All it does is: - reverts most of the commit 59be691638200797583bce39a83f641d30d97492 "st/mesa: add support for gl_ClipDistance" - changes LowerClipDistance to true Fixes Piglit tests "EXT_transform_feedback/builtin-varyings gl_ClipDistance[{2,3,4,5,6,7,8}]-no-subscript" at least on nv50 and evergreen cards.
* i965/msaa: Only do multisample rasterization if GL_MULTISAMPLE enabled.Paul Berry2012-06-204-18/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | From the GL 3.0 spec (p.116): "Multisample rasterization is enabled or disabled by calling Enable or Disable with the symbolic constant MULTISAMPLE." Elsewhere in the spec, where multisample rasterization is described (sections 3.4.3, 3.5.4, and 3.6.6), the following text is consistently used: "If MULTISAMPLE is enabled, and the value of SAMPLE_BUFFERS is one, then..." So, in other words, disabling GL_MULTISAMPLE should prevent multisample rasterization from occurring, even if the draw framebuffer is multisampled. This patch implements that behaviour by setting the WM and SF stage's "multisample rasterization mode" to MSRAST_ON_PATTERN only when the draw framebuffer is multisampled *and* GL_MULTISAMPLE is enabled. Fixes piglit test spec/EXT_framebuffer_multisample/enable-flag. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/msaa: Disable unsupported formats.Paul Berry2012-06-201-0/+13
| | | | | | | | | | | | | | | | | | | | | | | Due to hardware limitations, MSAA is unsupported on Gen6 for formats containing >64 bits of data per pixel. From the Sandy Bridge PRM, vol4 part1, p72 ("Surface Format"): If Number of Multisamples is set to a value other than MULTISAMPLECOUNT_1, this field cannot be set to the following formats: - any format with greater than 64 bits per element - any compressed texture format (BC*) - any YCRCB* format Gen7 has a similar, but less stringent limitation: formats with >64 bits of data per pixel only support 4x MSAA. This patch causes the unsupported formats to report GL_FRAMEBUFFER_UNSUPPORTED. Fixes piglit "multisample-formats" tests on Gen6. Acked-by: Kenneth Graunke <[email protected]>
* i965: Don't set brw_wm_prog_key::iz_lookup on Gen6+.Kenneth Graunke2012-06-191-18/+20
| | | | | | | | Sandy Bridge and later don't use this field, so there's no point in setting it. It can only cause harmful state-based recompiles. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: clamp glDrawPixels size to max texture sizeBrian Paul2012-06-191-0/+31
|
* st/mesa: move st_validate_state() call earlier in st_DrawPixels()Brian Paul2012-06-191-5/+5
|
* st/mesa: Add support for GL_ARB_base_instanceFredrik Höglund2012-06-192-0/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Add support for GL_ARB_base_instanceFredrik Höglund2012-06-1910-11/+173
| | | | Reviewed-by: Brian Paul <[email protected]>
* i965: Fix brw_swap_cmod() for LE/GE comparisons.Kenneth Graunke2012-06-181-4/+4
| | | | | | | | | | | | | | | | | | | | | The idea here is to rewrite comparisons like 2 >= x with x <= 2; we want to simply exchange arguments, not negate the condition. If equality was part of the original comparison, it should remain part of the swapped version. This is the true cause of bug #50298. It didn't manifest itself on Sandybridge because we embed the conditional modifier in the IF instruction rather than emitting a CMP. All other platforms use CMP. It also didn't manifest itself on the master branch because commit be5f27a84d ("glsl: Refine the loop instruction counting.") papered over the problem. NOTE: This is a candidate for stable release branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50298 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gles2: Add GL_NV_read_buffer extensionKristian Høgsberg2012-06-184-1/+36
| | | | | | | This lets us select the front buffer for reading under GLES2. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* get.c: Rename EXTRA_VERSION_ES2 to EXTRA_API_ES2Kristian Høgsberg2012-06-181-5/+5
| | | | | | | | This extra condition checks the API not the version of the API, so rename to reflect that. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: properly allocate MSAA renderbuffersMarek Olšák2012-06-161-3/+31
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: make unsupported renderbuffer formats always fail as FBO incompleteMarek Olšák2012-06-161-4/+10
| | | | | | | | | instead of failing to allocate a renderbuffer. This also fixes piglit/get-renderbuffer-internalformat with non-renderable formats. Reviewed-by: Brian Paul <[email protected]>
* st/mesa: separate sw renderbuffer allocation from hw oneMarek Olšák2012-06-161-75/+93
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: if AllocStorage doesn't choose a format, report FRAMEBUFFER_UNSUPPORTEDMarek Olšák2012-06-161-1/+10
| | | | | | | | | | | This allows drivers not to do any allocation in AllocStorage if the storage cannot be allocated because of an unsupported internalformat + samples combo. The little ugliness is that AllocStorage is expected to return TRUE in this case. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: don't do srgb->linear conversion in decompress_with_blitMarek Olšák2012-06-151-0/+1
| | | | | | | | This fixes piglit/getteximage-formats on r600g. NOTE: This is a candidate for stable branches. Reviewed-by: Brian Paul <[email protected]>
* gallium: Add support for ir_unop_f2u to tgsi backend.Paul Berry2012-06-151-0/+6
| | | | | Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* ir_to_mesa: Add support for ir_unop_f2u to ir_to_mesa backend.Paul Berry2012-06-151-0/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add support for ir_unop_f2u to i965 backend.Paul Berry2012-06-153-0/+3
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/blorp: Implement source clipping.Paul Berry2012-06-151-3/+11
| | | | | | | | | | | | | | | | | This patch modifies blorp blits (which are used for MSAA) to properly account for clipping of source coordinates. Previously, if we detected the possibility of source clipping, we would fall back to the blit meta-op, which doesn't support MSAA and is very slow for depth and stencil buffers. Fixes piglit tests "EXT_framebuffer_multisample/clip-and-scissor-blit" on i965/Gen6+. Also substantially speeds up the Humble Bundle V game "Psychonauts" on Gen6+ (without this patch, the game's depth buffer blits use the slow blit meta-op). Reviewed-by: Carl Worth <[email protected]>
* scons: add st_atom_array.c to the buildBrian Paul2012-06-151-0/+1
|
* st/mesa: atomize vertex array stateMarek Olšák2012-06-157-578/+625
| | | | This moves the state validation to where all the other states are validated.
* st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color outputBrian Paul2012-06-141-2/+11
| | | | | | | | | When drawing a depth image the fragment shader also needs to emit the current raster color. The new piglit drawpix-z test exercises this. NOTE: This is a candiate for the 8.0 branch.