summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Refactor copying of linked program data.Paul Berry2013-08-015-10/+35
| | | | | | | | | | | | | This patch creates a single function to copy the the UsesClipDistance flag from gl_shader_program.Vert to gl_vertex_program. Previously this logic was duplicated in the i965-specific function brw_link_shader() and the core mesa function _mesa_ir_link_shader(). This logic will have to be expanded to support geometry shaders, and I don't want to have to update it in two separate places. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: support compilation of geometry shadersBryan Cain2013-08-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds all of the parsing and semantics for GLSL 150 style geometry shaders. v2 (Paul Berry <[email protected]>): Add a few missing calls to get_pipeline_stage(). Fix some signed/unsigned comparison warnings. Fix handling of NULL consumer in assign_varying_locations(). v3 (Bryan Cain <[email protected]>): fix indexing order of 2D arrays. Also, allow interpolation qualifiers in geometry shaders. v4 (Paul Berry <[email protected]>): Eliminate get_pipeline_stage()--it is no longer needed thanks to 030ca23 (mesa: renumber shader indices according to their placement in pipeline). Remove 2D stuff. Move vertices_per_prim() to ir.h, so that it will be accessible from outside the linker. Remove inject_num_vertices_visitor. Rework for GLSL 1.50. Reviewed-by: Ian Romanick <[email protected]> v5 (Paul Berry <[email protected]>): Split out do_set_program_inouts() argument refactoring to a separate patch. Move geom_array_resizing_visitor to later in the series. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: add ir_emit_vertex and ir_end_primitive instruction typesBryan Cain2013-08-016-0/+56
| | | | | | | | | | | | | | These correspond to the EmitVertex and EndPrimitive functions in GLSL. v2 (Paul Berry <[email protected]>): Add stub implementations of new pure visitor functions to i965's vec4_visitor and fs_visitor classes. v3 (Paul Berry <[email protected]>): Rename classes to be more consistent with the names used in the GL spec. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: account for geometry shader texture fetches in update_texture_stateBryan Cain2013-08-011-5/+13
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* main: Allow for the possibility of GL 3.2 without ARB_geometry_shader4.Paul Berry2013-08-017-8/+17
| | | | | | | | | | | | | | | | | | | | | | Previously, we assumed that the only way Mesa would expose geometry shader support was via the ARB_geometry_shader4 extension. But this extension has some extra complications over GL 3.2 (interactions with compatibility-only features, and link-time initialization of the constant gl_VerticesIn). So we want to allow for the possibility of supporting GL 3.2 (with GLSL 1.50 style geometry shaders) even if ctx->Extensions.ARB_geometry_shader4 is false. This patch adds a new function, _mesa_has_geometry_shaders(), which returns true if either ARB_geometry_shader4 is supported or the GL version is at least 3.2 desktop. Since compute_version() only enables GL 3.2 functionality when GLSL 1.50 support is present, a sufficient way for a back-end to advertise geometry shader support is to set ctx->Const.GLSLVersion >= 150. v2: Remove unnecessary ctx->Const.GeometryShaders150 constant. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* main: Fix geometry shader error messages (missing right paren)Paul Berry2013-08-011-3/+3
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Change do_set_program_inouts' is_fragment_shader arg to shader_type.Paul Berry2013-08-013-4/+3
| | | | | | | | This will allow us to add geometry shader support without having to add another boolean argument. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Delete the BATCH_LOCALS macro.Kenneth Graunke2013-08-012-6/+0
| | | | | | | | | This hasn't done anything in a long time, and it's only used in a couple places...which means we couldn't use it without doing a bunch of work anyway. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* Correct clamping of TEXTURE_{MAX, BASE}_LEVELCorey Richardson2013-08-011-2/+20
| | | | | | | | | | | | | Previously, if TEXTURE_IMMUTABLE_FORMAT was TRUE, the levels were allowed to be set like usual, but ARB_texture_storage states: > if TEXTURE_IMMUTABLE_FORMAT is TRUE, then level_base is clamped to the range > [0, <levels> - 1] and level_max is then clamped to the range [level_base, > <levels> - 1], where <levels> is the parameter passed the call to > TexStorage* for the texture object Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Corey Richardson <[email protected]>
* De-tab and align comments in gl_texture_objectCorey Richardson2013-08-011-22/+23
| | | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Corey Richardson <[email protected]>
* i965 Gen4/5: clip: Don't mangle flat varyingsChris Forbes2013-08-011-21/+32
| | | | | | | | | | | This patch ensures that integers will pass through unscathed. Doing (useless) computations on them is risky, especially when their bit patterns correspond to values like inf or nan. [V1-2]: Signed-off-by: Olivier Galibert <galibert at pobox.com> Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965 Gen4/5: clip: Add support for noperspective varyingsChris Forbes2013-08-013-10/+113
| | | | | | | | | | | | | | | | | | | Adds support for interpolating noperspective varyings linearly in screen space when clipping. Based on Olivier Galibert's patch from last year: http://lists.freedesktop.org/archives/mesa-dev/2012-July/024341.html At this point all -fixed and -vertex interpolation tests work. V5: Add brw_clip_compile.has_noperspective_shading rather than another key flag. V6: Real bools. [V1-2]: Signed-off-by: Olivier Galibert <galibert at pobox.com> Signed-off-by: Chris Forbes <[email protected]> Acked-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965 Gen4/5: clip: correctly handle flat varyingsChris Forbes2013-08-016-54/+30
| | | | | | | | | | | | | | | | Previously we only gave special treatment to the builtin color varyings. This patch adds support for arbitrary flat-shaded varyings, which is required for GLSL 1.30. Based on Olivier Galibert's patch from last year: http://lists.freedesktop.org/archives/mesa-dev/2012-July/024340.html V5: Move key.do_flat_shading to brw_clip_compile.has_flat_shading V6: Real bools. [V1-2]: Signed-off-by: Olivier Galibert <galibert at pobox.com> Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965 Gen4/5: Generalize SF interpolation setup for GLSL1.3Chris Forbes2013-08-014-70/+85
| | | | | | | | | | | | | | | | | | | | Previously the SF only handled the builtin color varying specially. This patch generalizes that support to cover user-defined varyings, driven by the interpolation mode array set up alongside the VUE map. Based on the following patches from Olivier Galibert: - http://lists.freedesktop.org/archives/mesa-dev/2012-July/024335.html - http://lists.freedesktop.org/archives/mesa-dev/2012-July/024339.html With this patch, all the GLSL 1.3 interpolation tests that do not clip (spec/glsl-1.30/execution/interpolation/*-none.shader_test) pass. V5: Move key.do_flat_shading to brw_sf_compile.has_flat_shading; drop vestigial hunks. V6: Real bools. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add helper functions for interpolation mapChris Forbes2013-08-011-0/+18
| | | | | | | V6: real bools Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965 Gen4/5: Introduce 'interpolation map' alongside the VUE mapChris Forbes2013-08-019-2/+120
| | | | | | | | | | | | | | | | | | | | | | The interpolation map (in brw->interpolation_mode) is a new auxiliary structure alongside the post-GS VUE map, which describes the interpolation modes for each VUE slot, for use by the clip and SF stages. This patch introduces a new state atom to compute the interpolation map, and adjusts the program keys for the clip and SF stages, but it is not actually used yet. [V1-2]: Signed-off-by: Olivier Galibert <galibert at pobox.com> V3: Updated for vue_map changes, intel -> brw merge, etc. (Chris Forbes) V4: Compute interpolation map as a new state atom rather than tacking it on the front of the clip setup V5: Rework commit message, make interpolation_mode_map a struct. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/program: remove useless YYIDLaurent Carlier2013-07-311-2/+2
| | | | | | This fixes the build with Bison 3.0. Also works with Bison 2.7.1. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/program: Switch from the deprecated YYLEX_PARAM to %lex-param.Kenneth Graunke2013-07-311-5/+4
| | | | | | | | | | | | | | | | | | | | | YYLEX_PARAM is no longer supported as of Bison 3.0. Instead, the Bison developers recommend using %lex-param. %lex-param takes a type and variable name, similar to %parse-param, so you can't pass an arbitrary expression like state->scanner. But Flex insists on passing the actual scanner object, not an arbitrary object like state. To solve this, the parser defines a wrapper lex() function which accepts "state," and calls Flex's lex() function with state->scanner. Fixes the build with Bison 3.0. Also works with Bison 2.7.1. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Tested-by: Laurent Carlier <[email protected]> Cc: "9.2" [email protected]
* mesa/program: Change the program parser's namespace.Kenneth Graunke2013-07-312-3/+10
| | | | | | | | | | | | Bison 3.0 removes the YYLEX_PARAM macro. In preparation for handling this using %lex-param, the parser needs a wrapper function for the actual Flex lex() function. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Tested-by: Laurent Carlier <[email protected]> Cc: "9.2" [email protected]
* mesa: fix multisampling proxy textures not being queryableMikko Juola2013-07-311-0/+2
| | | | | | | | | | | | The code that checks if some texture target is valid for glGetTexLevelParameter*() was not programmed to check for multisampling proxy textures. This made it impossible(?) to use the proxy textures for their intended purpose as glGetTexLevelParameter*() would just fail on you. Reviewed-by: Brian Paul <[email protected]> Cc: [email protected]
* mesa: fix proxy textures becoming immutable and unusableMikko Juola2013-07-311-1/+1
| | | | | | | | | | | | | | glTexStorage*() functions make textures immutable. This carries on to proxy textures. Error checking in texture storage functions prevents proxy textures from working after first time because internally, they became immutable. This commit makes the error checking ignore the immutability flag when working with proxy textures. Reviewed-by: Brian Paul <[email protected]> Cc: [email protected]
* mesa: fix proxy textures not working with default texture bindingMikko Juola2013-07-311-1/+1
| | | | | | | | | | | | | When working with the glTexStorage*() functions, the error checking checks that a non-default (i.e., non-zero) texture is currently bound. However, this check made glTexStorage*() functions fail with proxy textures when the default texture is bound. Proxy textures do not care about the current texture bindings so for them this check should not be done. Reviewed-by: Brian Paul <[email protected]> Cc: [email protected]
* mesa: fix number of mipmaps calculation for proxy texturesMikko Juola2013-07-311-0/+10
| | | | | | | | | | | | The function _mesa_get_tex_max_num_levels() is supposed to calculate the number of mipmap levels but it was not written to handle proxy textures, at best returning a maximum of 1 mipmap level. Because of this, at least glTexStorage*() calls would incorrectly fail when used with proxy textures with more than one mipmap level. Reviewed-by: Brian Paul <[email protected]> Cc: [email protected]
* mesa: improve free() cleanup in generate_mipmap_compressed()Brian Paul2013-07-311-10/+7
| | | | | | | | | | Free all our temporary buffers in one place at the end of the function. Fixes memory leak detected by Coverity. Note: This is a candidate for the 9.x branches Cc: [email protected] Reviewed-by: José Fonseca <[email protected]>
* i965/vs: Put lod parameter in the correct place for Gen4Chris Forbes2013-07-311-1/+1
| | | | | | | | | This was never visible before due to the bogus sampler state pointer. Fixes remaining vertex texturing breakage on Gen4. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* i965/vs: set up sampler state pointer for Gen4/5.Chris Forbes2013-07-311-6/+21
| | | | | | | | | | Fixes broken filter and lod selection for vertex texturing. (txs/txf only worked properly because they ignore the sampler state completely) Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* st/dri: add a new driconf option disable_shader_bit_encoding for UnigineMarek Olšák2013-07-303-1/+15
| | | | | | | Now Unigine Heaven 3.0 finally works with r600g. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix opcode translation for ARB_shader_bit_encoding functionsMarek Olšák2013-07-301-0/+7
| | | | | | | | | We treat the opcodes as MOVs, but we should at least change the type of the expression, which later affects which TGSI opcode is chosen. Cc: [email protected] Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa,glsl,st/dri: add a new driconf option force_glsl_version for UnigineMarek Olšák2013-07-304-0/+50
| | | | | | | | See documentation in mtypes.h. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add MESA_GLSL debug flag to dump shaders on compile errorMarek Olšák2013-07-302-5/+15
| | | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* driconf: enable app-specific workarounds for all driversMarek Olšák2013-07-302-2/+6
| | | | | | | | | | They were only enabled for i965. Note that drirc must be installed in /etc. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* st/dri: implement the driconf option force_s3tc_enable properlyMarek Olšák2013-07-301-9/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* driconf: remove the unused option allow_large_texturesMarek Olšák2013-07-301-9/+0
| | | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* st/dri: support the driconf option disable_blend_func_extendedMarek Olšák2013-07-301-1/+2
| | | | | | | This is needed for Unigine. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: default texture buffer format should be R8 in the core profileMarek Olšák2013-07-301-2/+2
| | | | | | | | | Cc: [email protected] Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> v2: Since we don't expose the extension in the compatibility profile, the "if (API == CORE) .. else .." statement is removed.
* mesa: default DEPTH_TEXTURE_MODE should be RED in the core profileMarek Olšák2013-07-308-10/+12
| | | | | | | Cc: [email protected] Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: expose EXT_framebuffer_multisample_blit_scaled if MSAA is supportedMarek Olšák2013-07-301-0/+1
| | | | | | Surprisingly all drivers supporting MSAA can already do this (r300g and r600g for sure) and I think Christoph wanted to have this feature for his Nouveau drivers anyway.
* st/mesa: fix sRGB renderbuffers without EXT_framebuffer_sRGB supportMarek Olšák2013-07-302-0/+15
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=59322 Cc: [email protected]
* glsl: Remove redundant writes to prog->LinkStatusPaul Berry2013-07-301-1/+0
| | | | | | | | The linker_error() function sets prog->LinkStatus to false. There's no reason for the caller of linker_error() to also do so. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove broken assertion about enabled texture targets.Kenneth Graunke2013-07-291-4/+2
| | | | | | | | | | | | | | | For GLSL programs, enabledTargets can have more than one bit set. For example, a shader that uses sampler2D and samplerCube uniforms will have both TEXTURE_2D_BIT and TEXTURE_CUBE_BIT set. The code that sets _ReallyEnabled already handles this, selecting the "highest priority" texture target. We should simply use that. Fixes new Piglit test incomplete-textures-of-multiple-types. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62698 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* i965: Don't create a swrast context on ES2+.Kenneth Graunke2013-07-291-1/+1
| | | | | | | | | | | | | | We already skip this for API_OPENGL_CORE; ES2+ is very similar. The primary user of the swrast context is GL_SELECT and GL_FEEDBACK, which have never existed in ES. This saves approximately 18MB of memory in GLBenchmark 2.7 Egypt (ES2). No regressions in es3conform on Ivybridge. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* mesa: Expose OES_surfaceless_context.Matt Turner2013-07-291-0/+1
| | | | | | | | | EGL_KHR_surfaceless_context extension allows contexts to be made current without a default winsys fbo. This extension specifies what ES 1.1 and 2.0 should do (the ES 3.0 spec already does). Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Return GL_FRAMEBUFFER_UNDEFINED if the winsys fbo is incomplete.Matt Turner2013-07-291-2/+6
| | | | | | | Specified by ARB_framebuffer_object, GL 3.0, and ES 3.0. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Disable GL_EXT_framebuffer_object in core profiles and OpenGL 3.1Ian Romanick2013-07-261-1/+1
| | | | | | | | | | | | GL_EXT_framebuffer_object differs from GL_ARB_framebuffer_object in ways that we can't and don't implement in core profiles. Exposing it is a lie, so we shouldn't do that. It's possible the some other GL_EXT_framebuffer_* extensions should be disabled, but it's not quite so clear cut. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Fix flaky texture swizzlingChris Forbes2013-07-271-1/+1
| | | | | | | | | | | | | If any component used the ZERO or ONE swizzle, its corresponding member in the `swizzle` array would never be initialized. We *mostly* got away with this, except when that memory happened to contain a value that clobbered another channel when combined using BRW_SWIZZLE4(). NOTE: This is a candidate for stable branches. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "i965: Delete pre-DRI2.3 viewport hacks."Kenneth Graunke2013-07-253-1/+25
| | | | | | | | | | | | | | | This reverts commit c9db037dc999eadbcaa8816c814e6ec1776d1a40. Eric believes that the viewport hacks are still necessary for EGL; invalidate events aren't hooked up properly. This commit caused a regression where EFL applications wouldn't show anything other than window decorations; GLBenchmark also showed issues. The revert had conflicts due to the intel_context/brw_context merge. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66606 Cc: [email protected]
* i965: Initialize inout_offset parameter to brw_search_cache().Paul Berry2013-07-252-2/+2
| | | | | | | | | | | | | | | | | | | | | | Two callers of brw_search_cache() weren't initializing that function's inout_offset parameter: brw_blorp_const_color_params::get_wm_prog() and brw_blorp_const_color_params::get_wm_prog(). That's a benign problem, since the only effect of not initializing inout_offset prior to calling brw_search_cache() is that the bit corresponding to cache_id in brw->state.dirty.cache may not be set reliably. This is ok, since the cache_id's used by brw_blorp_const_color_params::get_wm_prog() and brw_blorp_blit_params::get_wm_prog() (BRW_BLORP_CONST_COLOR_PROG and BRW_BLORP_BLIT_PROG, respectively) correspond to dirty bits that are not used. However, failing to initialize this parameter causes valgrind to complain. So let's go ahead and fix it to reduce valgrind noise. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66779 Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: implement mipmap generation for compressed 2D array texturesBrian Paul2013-07-241-16/+43
| | | | | | | | | | | | We weren't looping over all the slices in the array. The updated code should also correctly handle 3D compressed textures too, whenever we have that feature. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66850 NOTE: This is a candidate for the 9.x branches Cc: [email protected] Reviewed-by: José Fonseca <[email protected]>
* meta: handle 2D texture arrays in decompress_texture_image()Brian Paul2013-07-241-2/+21
| | | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66850 NOTE: This is a candidate for the 9.x branches. Cc: [email protected] Reviewed-by: José Fonseca <[email protected]>
* mesa: handle 2D texture arrays in get_tex_rgba_compressed()Brian Paul2013-07-241-28/+24
| | | | | | | | | | | If we call glGetTexImage() for a compressed 2D texture array we need to loop over all the slices. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66850 NOTE: This is a candidate for the 9.x branches. Cc: [email protected] Reviewed-by: José Fonseca <[email protected]>