summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Handle binding of uniforms to image units with glUniform*().Francisco Jerez2014-02-121-0/+36
| | | | | | | | v2: Set driver-specified flag in NewDriverState when glUniform* is used to bind an image unit. v3: Abbreviate argument type check. Reviewed-by: Paul Berry <stereotype441@gmail.com>
* mesa: Preserve the NewArrays state when copying a VAOFredrik Höglund2014-02-121-0/+1
| | | | | | | Cc: "10.1" "10.0" <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72895 Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: GL_ARB_half_float_pixel is not optionalIan Romanick2014-02-115-37/+9
| | | | | | | | | | | | | | | | | Almost every driver already supported it. All current and future Gallium drivers always support it, and most existing classic drivers support it. This only changes radeon and nouveau. This extension only adds data types that can be passed to, for example, glTexImage2D. It does not add internal formats. Since you can already pass GL_FLOAT to glTexImage2D this shouldn't pose any additional issues with those drivers. Note that r200 and i915 already supported this extension, and they don't support floating-point textures either. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: Fix extension dependency for half-float TexBOsIan Romanick2014-02-111-1/+12
| | | | | | | | | | | Half-float TexBOs should require both GL_ARB_half_float_pixel and GL_ARB_texture_float. This doesn't matter much in practice. Every driver that supports GL_ARB_texture_buffer_object already supports GL_ARB_half_float_pixel. We only expose the TexBO extension in core profiles, and those require GL_ARB_texture_float. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: Fix MESA_FORMAT_Z24_UNORM_S8_UINT vs. X8_UINT mix-up.Kenneth Graunke2014-02-097-35/+35
| | | | | | | | | | | | | | | | | | | | In commit eeed49f5f290793870c60b5b635b977a732a1eb4, Mark accidentally renamed MESA_FORMAT_S8_Z24 to MESA_FORMAT_Z24_UNORM_X8_UINT and MESA_FORMAT_X8_Z24 to MESA_FORMAT_Z24_UNORM_S8_UINT, reversing their sense. The commit message was correct, but what sed commands actually got run didn't match that. This patch swaps the two enum names, reversing them. This should undo the damage, but might break things if people have manually fixed a few instances in the meantime... Mark's commit also failed to mention renames: s/MESA_FORMAT_ARGB2101010_UINT\b/MESA_FORMAT_B10G10R10A2_UINT/g s/MESA_FORMAT_ABGR2101010\b/MESA_FORMAT_R10G10B10A2_UNORM/g but those seem okay. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* mesa: remove duplicated init of MaxViewportsMaxence Le Doré2014-02-091-3/+0
| | | | | | | Already declared 5 lines before. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: Removed unnecessary check for NULL pointer when freeing memorySiavash Eliasi2014-02-091-2/+1
| | | | | | | | | Note that it is OK to pass NULL pointers to this function since this commit: mesa: modified _mesa_align_free() to accept NULL pointer http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0cc59d68a9f5231e8e2111393a1834858820735 Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* mesa: update assertion in detach_shader() for geom shadersBrian Paul2014-02-081-0/+1
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74723 Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org> Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
* mesa: allocate gl_debug_state on demandBrian Paul2014-02-087-150/+262
| | | | | | | | | | | | We don't need to allocate all the state related to GL_ARB_debug_output until some aspect of that extension is actually needed. The sizeof(gl_debug_state) is huge (~285KB on 64-bit systems), not even counting the 54(!) hash tables and lists that it contains. This change reduces the size of gl_context alone from 431KB bytes to 145KB bytes on 64-bit systems and from 277KB bytes to 78KB bytes on 32-bit systems. Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: trivial clean-ups in errors.cBrian Paul2014-02-081-41/+84
| | | | | | | Whitespace changes, 78-column rewrapping, comment clean-ups, add some braces, etc. Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: remove _mesa_ prefix from some static functionsBrian Paul2014-02-081-27/+23
| | | | Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* main/get: support ARB_gpu_shader5Jordan Justen2014-02-065-1/+26
| | | | | | | | If a driver enables ARB_gpu_shader5 and sets Const.MaxVertexSteams >= 4, then piglit's arb_gpu_shader5-minmax test should now pass. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* mesa: re-wrap, fix-up comment text in formats.hBrian Paul2014-02-051-14/+19
| | | | | Wrap to 78 columns, fix comment formatting. Trivial.
* main/cs: Implement query for COMPUTE_WORK_GROUP_SIZE.Paul Berry2014-02-051-0/+18
| | | | | | v2: Improve error message. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* mesa/cs: Handle compute shader local size during linking.Paul Berry2014-02-052-0/+24
| | | | Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* glsl/cs: Handle compute shader local_size_{x,y,z} declaration.Paul Berry2014-02-051-0/+11
| | | | Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_COUNT constant.Paul Berry2014-02-053-0/+12
| | | | | | | | v2: Document that the 3-element array MaxComputeWorkGroupCount is indexed by dimension. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_INVOCATIONS constant.Paul Berry2014-02-054-0/+6
| | | | | | | | Reviewed-by: Matt Turner <mattst88@gmail.com> v2: Use CONTEXT_INT rather than CONTEXT_ENUM. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_SIZE constant.Paul Berry2014-02-053-0/+16
| | | | | | | | v2: Document that the 3-element array MaxComputeWorkGroupSize is indexed by dimension. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* mesa/cs: Create the gl_compute_program struct, and the code to initialize it.Paul Berry2014-02-051-0/+7
| | | | Reviewed-by: Matt Turner <mattst88@gmail.com>
* mesa/cs: Handle compute shaders in _mesa_use_program().Paul Berry2014-02-051-0/+1
| | | | | | v2: do cs after the ordered pipeline stages for consistency. Reviewed-by: Matt Turner <mattst88@gmail.com>
* mesa/cs: Add a MESA_SHADER_COMPUTE stage and update switch statements.Paul Berry2014-02-054-1/+17
| | | | | | | | | This patch adds MESA_SHADER_COMPUTE to the gl_shader_stage enum. Also, where it is trivial to do so, it adds a compute shader case to switch statements that switch based on the type of shader. This avoids "unhandled switch case" compiler warnings. Reviewed-by: Matt Turner <mattst88@gmail.com>
* mesa/cs: Add dispatch API stubs for ARB_compute_shader.Paul Berry2014-02-053-2/+94
| | | | Reviewed-by: Matt Turner <mattst88@gmail.com>
* mesa/cs: Add extension enable flags for ARB_compute_shader.Paul Berry2014-02-052-0/+2
| | | | Reviewed-by: Matt Turner <mattst88@gmail.com>
* mesa: remove stray bits of GL_EXT_cull_vertexBrian Paul2014-02-042-15/+1
| | | | | | | GL_EXT_cull_vertex was removed back in 2010 in commit 02984e3536 but these bits still lingered. Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: Drop unnecessary (void) ctx from VAO code.Kenneth Graunke2014-02-031-1/+0
| | | | | | | | | ctx is always used, even on release builds. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Remove "APPLE" from some VAO error messages.Kenneth Graunke2014-02-031-3/+3
| | | | | | | | | Chances are, people will be using the core names these days. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Update some comments relating to VAOs.Kenneth Graunke2014-02-032-5/+15
| | | | | | | Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Rename ElementArrayBufferObj to IndexBufferObj.Kenneth Graunke2014-02-037-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | DirectX and most hardware documentation use the term "Index Buffer" to refer to a buffer containing indexes into arrays of vertex data, which allows random access to vertex data, rather than sequential access. OpenGL uses a different term for this concept: "Element Array Buffer". However, "Index Buffer" has become much more widespread. A quick Google search shows 29,300 hits for "Element Array Buffer" vs. 82,300 hits for "Index Buffer." Arguably, "Index Buffer" is clearer: an "element of an array" (or list) usually refers to an actual item stored in the array, not the index used to refer to it. The terminology is also already used in Mesa: some VBO module code for dealing with ElementArrayBufferObj names local variables "ib". Completely generated by: $ find . -type f -print0 | xargs -0 sed -i \ 's/ElementArrayBufferObj/IndexBufferObj/g' Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Rename _mesa_lookup_arrayobj to _mesa_lookup_vao.Kenneth Graunke2014-02-033-6/+6
| | | | | | | | | | | | | For consistency with the previous renames. Completely generated by: $ find . -type f -print0 | xargs -0 sed -i \ 's/_mesa_lookup_arrayobj/_mesa_lookup_vao/g' Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Rename _mesa_..._array_obj functions to _mesa_..._vao.Kenneth Graunke2014-02-037-42/+41
| | | | | | | | | | | | | | | _mesa_update_vao_client_arrays() is less of a mouthful than _mesa_update_array_object_client_arrays(), and generally clearer. Generated by: $ find . -type f -print0 | xargs -0 sed -i \ 's/_mesa_\([^_]*\)_array_object/_mesa_\1_vao/g' with manual whitespace and indentation fixes applied. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Rename "struct gl_array_object" to gl_vertex_array_object.Kenneth Graunke2014-02-0312-68/+68
| | | | | | | | | | | | | | | | | | I considered replacing it with "gl_vao", but spelling it out seemed to fit better with Mesa's traditional style. Mesa doesn't shy away from long type names - consider gl_transform_feedback_object, gl_fragment_program_state, gl_uniform_buffer_binding, and so on. Completely generated by: $ find . -type f -print0 | xargs -0 sed -i \ 's/gl_array_object/gl_vertex_array_object/g' v2: Rerun command to resolve conflicts with Ian's meta patches. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Rename "arrayObj" local variables to "vao".Kenneth Graunke2014-02-036-122/+122
| | | | | | | | | | | | | Now that the field is named "VAO" instead of "ArrayObj", it makes sense to call the local variables "vao" instead of "arrayObj". Completely generated by: $ find . -type f -print0 | xargs 0 sed -i 's/arrayObj/vao/g' Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Rename ArrayObj to VAO and DefaultArrayObj to DefaultVAO.Kenneth Graunke2014-02-0313-107/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When reading through the Mesa drawing code, it's not immediately obvious to me that "ArrayObj" (gl_array_object) is the Vertex Array Object (VAO) state. The comment above the structure explains this, but readers still have to remember this and translate accordingly. Out of context, "array object" is a fairly vague. Even in context, "array" has a lot of meanings: glDrawArrays, vertex data stored in user arrays, gl_client_arrays, gl_vertex_attrib_arrays, and so on. Using the term "VAO" immediately associates these fields with the OpenGL concept, clarifying the situation and aiding programmer sanity. Completely generated by: $ find . -type f -print0 | xargs -0 sed -i \ -e 's/ArrayObj;/VAO;/g' \ -e 's/->ArrayObj/->VAO/g' \ -e 's/Array\.ArrayObj/Array.VAO/g' \ -e 's/Array\.DefaultArrayObj/Array.DefaultVAO/g' v2: Rerun command to resolve conflicts with Ian's meta patches. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Use common _mesa_tex_target_to_index in tex param codeIan Romanick2014-02-021-58/+8
| | | | | | | | TEXTURE_BUFFER_INDEX has to be specially called out because it is not allowed in any of the glTexParameter or glGetTexParameter functions. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Make target_enum_to_index available outside texobj.cIan Romanick2014-02-022-3/+6
| | | | | | | | | | The next patch will use this function in another file. v2: Rename _mesa_target_enum_to_index to _mesa_tex_target_to_index. Suggested by Brian. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: make several FBO functions staticBrian Paul2014-02-022-55/+35
| | | | | | The four functions in question weren't called from any other file. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: move glGenerateMipmap() code into new genmipmap.c fileBrian Paul2014-02-024-96/+167
| | | | | | | Mipmap generation has nothing to do with FBOs. v2: update gl_genexec.py too (not api_exec.c) Acked-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: move glBlitFramebuffer code into new blit.c fileBrian Paul2014-02-024-478/+552
| | | | | | | Just for better organization. v2: update gl_genexec.py too (not api_exec.c) Acked-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: don't signal _NEW_TEXTURE in TexSubImage() functionsBrian Paul2014-02-021-3/+9
| | | | | | | | | | | glTexSubImage(), glCopyTexSubImage() and glCompressedTexSubImage() only change the texel data, not other state like texture size or format. If a driver really needs do something special it can hook into the corresponding driver functions or Map/UnmapTextureImage(). This should avoid some needless state validation effort. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* mesa: add some comments about mipmap generationBrian Paul2014-02-022-0/+9
| | | | Trivial.
* mesa: simplify comment in texstorage.cBrian Paul2014-02-021-3/+2
| | | | Trivial.
* mesa: formatting fixes, 78-column wrappings in dd.hBrian Paul2014-02-021-33/+56
| | | | Trivial.
* mesa: remove target param from ctx->Driver.TexParameter()Brian Paul2014-02-023-10/+10
| | | | | | Not really used anywhere. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: make _mesa_get_proxy_target() staticBrian Paul2014-02-022-8/+5
| | | | | | Wasn't used in any other file. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: remove unused _mesa_select_tex_object() functionBrian Paul2014-02-022-27/+6
| | | | | | | The _mesa_get_current_tex_object() function is now used everywhere that _mesa_select_tex_object() was formerly used. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: use _mesa_get_current_tex_object() in GetTexLevelParameteriv()Brian Paul2014-02-021-6/+3
| | | | | | And update a related comment. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: use _mesa_align_free() in _mesa_delete_buffer_object()Brian Paul2014-01-311-1/+1
| | | | | | | To match _mesa_align_malloc() call in _mesa_buffer_data(). Found by Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Brian Paul <brianp@vmware.com>
* mesa: Add warning to _REV pack/unpack functions with incorrect behaviorMark Mueller2014-01-312-1/+18
| | | | | Signed-off-by: Mark Mueller <MarkKMueller@gmail.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
* mesa: Return after ScissorArrayv or ScissorIndexed detect a parameter errorCourtney Goeltzenleuchter2014-01-291-0/+2
| | | | | | | | Fixes piglit arb_viewport_array-scissor-ignore. Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jon Ashburn <jon@lunarg.com>