summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* main: Warn that geometry shader support is experimental.Paul Berry2013-08-011-0/+6
| | | | | | | | | | | | | | | | | | | Geometry shader support in the Mesa front end is still fairly preliminary. Many features are untested, and the following things are known not to work: - The gl_in interface block - The gl_ClipDistance input - Transform feedback of geometry shader outputs - Constants that are new in GLSL 1.50 (e.g. gl_MaxGeometryInputComponents) This isn't a problem, since no back-end drivers currently enable geometry shaders. However, to make sure no one gets the wrong impression, emit a nasty warning to let the user know that geometry shader support isn't complete. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Export the compiler's GS layout qualifiers to the gl_shader.Eric Anholt2013-08-011-0/+18
| | | | | | | | | | | | | | | | Next step is to validate them at link time. v2 (Paul Berry <[email protected]>): Don't attempt to export the layout qualifiers in the event of a compile error, since some of them are set up by ast_to_hir(), and ast_to_hir() isn't guaranteed to have run in the event of a compile error. Reviewed-by: Kenneth Graunke <[email protected]> v3 (Paul Berry <[email protected]>): Use PRIM_UNKNOWN to represent "not set in this shader". Reviewed-by: Ian Romanick <[email protected]>
* main: Fix delete_shader_cb() for geometry shadersPaul Berry2013-08-011-1/+2
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Validate the drawing primitive against the geometry shader input ↵Fabian Bieler2013-08-011-0/+68
| | | | | | | | primitive type. Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/shaderapi: Allow 0 GEOMETRY_VERTICES_OUT.Fabian Bieler2013-08-011-1/+1
| | | | | | | | | | ARB_geometry_shader4 spec Errors: "The error INVALID_VALUE is generated by ProgramParameteriARB if <pname> is GEOMETRY_VERTICES_OUT_ARB and <value> is negative." Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Copy linked program data for GS.Paul Berry2013-08-012-1/+12
| | | | | | | | | | The documentation for gl_shader_program.Geom and gl_geometry_program says that the former is copied to the latter at link time, but this wasn't happening. This patch causes _mesa_ir_link_shader() to perform the copy, and updates comment accordingly. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Refactor copying of linked program data.Paul Berry2013-08-013-2/+32
| | | | | | | | | | | | | 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]>
* 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-016-7/+16
| | | | | | | | | | | | | | | | | | | | | | 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]>
* 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]>
* 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]>
* mesa,glsl,st/dri: add a new driconf option force_glsl_version for UnigineMarek Olšák2013-07-301-0/+6
| | | | | | | | 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]>
* 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-302-4/+6
| | | | | | | Cc: [email protected] Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[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]>
* 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]>
* 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]>
* 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]>
* mesa: fix rgtc snorm decodingRoland Scheidegger2013-07-241-3/+3
| | | | | | | | | The codeword must be unsigned (otherwise will shift in 1's from above when merging low/high parts so some texels decode wrong). This also affects gallium's util/u_format_rgtc. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Zack Rusin <[email protected]>
* mesa: Dispatch ARB_framebuffer_object and EXT_framebuffer_object differently9.2-branchpointTomasz Lis2013-07-183-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Almost all of the functions between the ARB and the EXT share the same GLX protocol because the functionality is, essentially, identical. However, there are some differences between the extensions: - In the ARB extension, names must come from glGenBuffers. - In the ARB extension, framebuffer objects are not shared (but they are in the EXT). For these reasons, glBindFramebuffer and glBindRenderbuffer have different GLX protocol opcodes than their EXT counterparts. Currently these functions alias each other in the dispatch table. This makes it impossible to be truly spec conformant. This patch enables fixing the conformance issue by splitting glBindFramebuffer / glBindFramebufferEXT and glBindRenderbuffer / glBindRenderbufferEXT into separate dispatch table entries. Patches will be available shortly to: - Fix the conformance issue. - Stop advertising the EXT in OpenGL 3.1 (or core profiles). HOWEVER, this does represent a compatibility break between the loader (libGL or the Xserver GLX module) and the driver. Mesa drivers compiled without this change will request a single dispatch table entry for glBindFramebuffer and glBindFramebufferEXT. Since the updated loader has different entries for each, the request will fail, and the driver will die in a fire. Drivers built with the change should continue to load fine on loaders without the change. In this case, the driver will separately ask for entries for glBindFramebuffer and glBindFramebufferEXT, and the loader will tell it the same location. Since the loader in the server's GLX module is not (yet) updated, this should not be a problem. We also do not advertise the ARB extension from the server, so, again, this should not be a problem for the server. HOWEVER, this means that DRI1 drivers (remember mga_dri.so?) will no longer load with libGL build hereafter. That means this patch will need to be back ported to the 8.0 branch. v2 (idr): Added missing GLX protocol opcodes for the EXT functions and corrected the opcodes for the ARB functions. Updated GLX indirect_api unit test and dispatch sanity unit test. Signed-off-by: Tomasz Lis <[email protected]> Signed-off-by: Bartosz Zawistowski <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ian Romanick <[email protected]> [v1]
* mesa: Remove commas at end of enumerator lists.Vinson Lee2013-07-171-4/+4
| | | | | | | | | | | | | | Fixes these build errors on OpenBSD 5.3. In file included from ../../src/mesa/main/errors.h:47, from ../../src/mesa/main/imports.h:41, from ../../src/mesa/main/ff_fragment_shader.cpp:32: ../../src/mesa/main/mtypes.h:3286: error: comma at end of enumerator list ../../src/mesa/main/mtypes.h:3296: error: comma at end of enumerator list ../../src/mesa/main/mtypes.h:3303: error: comma at end of enumerator list ../../src/mesa/main/mtypes.h:3356: error: comma at end of enumerator list Signed-off-by: Vinson Lee <[email protected]>
* mesa: update glext.h to version 20130708Brian Paul2013-07-124-4/+4
| | | | | | | | | | | | | This update fixes the problem with duplicated typedefs for GLclampf and GLclampd in the previous version. It also changes some parameter types for glDebugMessageCallbackARB() and glTransformFeedbackVaryingsEXT(). Note we should someday update the glapi-gen code so that it understands void pointer parameters. Currently, the Python code only understands "GLvoid *" but not "void *". Luckily, the compilers don't seem to complain about mixing GLvoid and void.
* mesa: simplify some _mesa_IsEnabled() queriesBrian Paul2013-07-121-10/+11
| | | | | | | | No need to test array->Enabled != 0 since the Enabled field can only be 0 or 1. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: whitespace, formatting, 80-column wrappingBrian Paul2013-07-121-12/+18
|
* mesa: s/unsigned/int/ to fix MSVC warning in uniforms.cBrian Paul2013-07-121-1/+1
|
* mesa: s/GLuint/GLint/ to silence MSVC warning in textore.cBrian Paul2013-07-121-1/+1
|
* mesa: add casts to fix MSVC warnings in multisample.cBrian Paul2013-07-121-2/+3
|
* mesa: s/GLint/GLuint/ to fix MSVC warnings in mipmap.cBrian Paul2013-07-121-2/+2
|
* mesa: fix inconsistent function declaration, definitionsBrian Paul2013-07-122-4/+4
| | | | | To silence MSVC warnings that the declaration and definitions were different.
* mesa: add cast to silence MSVC warningBrian Paul2013-07-121-1/+1
|
* mesa: Set ProfileMask properly for core profile.Matt Turner2013-07-091-2/+4
| | | | | | | Fixes MESA_GL_VERSION_OVERRIDE=3.2 egl-create-context-verify-gl-flavor. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa,glsl,gallium: remove GLSLSkipStrictMaxVaryingLimitCheck and dependenciesMarek Olšák2013-07-021-3/+2
| | | | | | Not needed with do_dead_builtin_varyings. Reviewed-by: Ian Romanick <[email protected]>
* mesa: renumber shader indices according to their placement in pipelineMarek Olšák2013-07-022-5/+8
| | | | | | | | | See my explanation in mtypes.h. v2: don't do this in gallium v3: also updated the comment at the gl_shader_type definition Reviewed-by: Ian Romanick <[email protected]>
* mesa: GL_EXT_shadow_funcs is not optional with GL_ARB_shadowIan Romanick2013-06-285-23/+8
| | | | | | | | | Every driver left in Mesa that enables one also enables the other. There's no reason to let it be optional. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_ARB_texture_storage_multisample is not optional with ↵Ian Romanick2013-06-283-4/+3
| | | | | | | | | | | | | | | | | | | GL_ARB_texture_multisample In Mesa, this extension is implemented purely in software. Drivers may *optionally* provide optimized paths. If a driver enables, GL_ARB_texture_multisample, it gets GL_ARB_texture_storage_multisample for free. NOTE: This has the side effect of enabling the extension in Gallium drivers that enable GL_ARB_texture_multisample. v2 (Ken): Still prevent multisample texture targets in TexParameter for implementations that don't support multisampling. Signed-off-by: Ian Romanick <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_ARB_texture_storage is not optionalIan Romanick2013-06-284-13/+3
| | | | | | | | | | | | | | In Mesa, this extension is implemented purely in software. Drivers may *optionally* provide optimized paths. NOTE: This has the side effect of enabling the extension in the radeon, r200, and nouveau drivers. v2: Minor whitespace tidying (suggested by Brian). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_ARB_shading_language_100 is not optionalIan Romanick2013-06-282-3/+1
| | | | | | | | | | | | | | This extension just provides some of the most basic software framework for GLSL. Without GL_ARB_vertex_shader or GL_ARB_fragment_shader, applications still cannot use GLSL. There's no value in conditionalizing support for this extension. NOTE: This has the side effect of enabling the extension in the radeon, r200, and nouveau drivers. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_ARB_shader_objects is not optionalIan Romanick2013-06-286-16/+6
| | | | | | | | | | | | | | This extension just provides some of the most basic software framework for GLSL. Without GL_ARB_vertex_shader or GL_ARB_fragment_shader, applications still cannot use GLSL. There's no value in conditionalizing support for this extension. NOTE: This has the side effect of enabling the extension in the radeon, r200, and nouveau drivers. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_NV_blend_square is not optionalIan Romanick2013-06-283-5/+1
| | | | | | | | | Every driver left in Mesa enables this extension all the time. There's no reason to let it be optional. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_EXT_fog_coord is not optionalIan Romanick2013-06-287-18/+7
| | | | | | | | | Every driver left in Mesa enables this extension all the time. There's no reason to let it be optional. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>