summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Add driver hooks for texture image mapping/unmapping.Brian Paul2011-08-291-0/+19
| | | | | | | | | ctx->Driver.MapTextureImage() / UnmapTextureImage() will be called by the glTex[Sub]Image(), glGetTexImage() functions, etc. when we're accessing texture data, and also for software rendering when accessing texture data. Reviewed-by: Brian Paul <[email protected]>
* mesa: Don't check for image->Data when freeing an image's contents.Eric Anholt2011-08-292-10/+4
| | | | | | | | | | | | | | | | | | | | | All driver implementations of FreeTextureImageBuffer already check that Data != NULL and free it. However, this means that we will also free driver storage if the driver storage wasn't in the form of a Data pointer. This was produced by the following semantic patch: @@ expression C; expression T; @@ - if (T->Data) { - C->Driver.FreeTextureImageBuffer(C, T); + C->Driver.FreeTextureImageBuffer(C, T); - } Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Rename FreeTexImageData to FreeTextureImageBuffer.Eric Anholt2011-08-294-11/+11
| | | | | | | | This was produced by sed, except for one hunk in driverfuncs.c where trailing whitespace was dropped. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mapi: Commit generated files modified by previous commitIan Romanick2011-08-262-3638/+3643
| | | | | Some of the changes are spurious because somebody forgot to do this when adding glFramebufferTextureLayerARB.
* glsl: Implement the GL_ARB_conservative_depth extension.Kenneth Graunke2011-08-251-0/+1
| | | | | | | It's the same as GL_AMD_conservative_depth. The specs have slight differences in wording, but don't differ in content or behavior. Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: add gl_texture_image::Face, Level fieldsBrian Paul2011-08-242-0/+5
| | | | | | | Several drivers have these fields in their subclasses of gl_texture_image. They'll be useful for core Mesa too... Reviewed-by: Ian Romanick <[email protected]>
* mesa: Eliminate dd_function_table::MapBufferIan Romanick2011-08-237-54/+33
| | | | | | | | | | Replace all calls to dd_function_table::MapBuffer with appropriate calls to dd_function_table::MapBufferRange, then remove all the cruft. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Fix incorrect access parameter passed to MapBufferIan Romanick2011-08-231-3/+1
| | | | | | | | | | | | | | | | | The code previously passed GL_DYNAMIC_DRAW for the access parameter. By inspection, I believe that all drivers would treat this as GL_READ_WRITE because it's not GL_READ_ONLY and it's not GL_WRITE_ONLY. It appears the i965 code wants GL_WRITE_ONLY (it's about to write a bunch of data in, never read data), while the arrayelt code is GL_READ_ONLY (just dereffed as arguments to CALL_Whatever*v). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Keith Whitwell <[email protected]>
* mesa: Remove target parameter from dd_function_table::FlushMappedBufferRangeIan Romanick2011-08-232-4/+3
| | | | | | | | | | No driver used that parameter, and most drivers ended up with a bunch of unused-parameter warnings because it was there. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove target parameter from dd_function_table::MapBufferRangeIan Romanick2011-08-232-5/+3
| | | | | | | | | | No driver used that parameter, and most drivers ended up with a bunch of unused-parameter warnings because it was there. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove target parameter from dd_function_table::GetBufferSubDataIan Romanick2011-08-232-5/+4
| | | | | | | | | | No driver used that parameter, and most drivers ended up with a bunch of unused-parameter warnings because it was there. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove target parameter from dd_function_table::BufferSubDataIan Romanick2011-08-232-4/+4
| | | | | | | | | | No driver used that parameter, and most drivers ended up with a bunch of unused-parameter warnings because it was there. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove target parameter from dd_function_table::MapBufferIan Romanick2011-08-237-23/+14
| | | | | | | | | | No driver used that parameter, and most drivers ended up with a bunch of unused-parameter warnings because it was there. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove target parameter from dd_function_table::UnmapBufferIan Romanick2011-08-238-25/+16
| | | | | | | | | | No driver used that parameter, and most drivers ended up with a bunch of unused-parameter warnings because it was there. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: call _mesa_set_vp_override in glDrawTex*Chia-I Wu2011-08-231-0/+4
| | | | | | | The driver may install its own vertex shader. _mesa_set_vp_override must be called so that core mesa can generate correct fragment program.. Reviewed-by: Brian Paul <[email protected]>
* mesa: android has no log2f nor ffsChia-I Wu2011-08-211-1/+7
| | | | | | Define log2f(v) to be logf(v) / M_LN2 and ffs to __builtin_ffs. Reviewed-by: Chad Versace <[email protected]>
* mesa, glsl_to_tgsi: Add new gl_context::NativeIntegers flag.Kenneth Graunke2011-08-192-9/+15
| | | | | | | | | | | | | | | | | | | Previously, native integer support was based on whether the driver advertised GLSL 1.30 or not. However, drivers that natively support integers may wish to do so for older GLSL versions as well. Adding this new opt-in flag allows them to do so. Currently disabled by default on all drivers, which was the existing behavior (no drivers currently implement GLSL 1.30). Fixes piglit tests on i965 with INTEL_GLSL_VERSION=130 set: - spec/glsl-1.10/fs-uniform-int-110.shader_test - spec/glsl-1.30/fs-uniform-int-130.shader_test (it was doubly converting the data) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: handle array textures in GenerateMipmap(), FramebufferTexture1/2D()Brian Paul2011-08-191-3/+21
| | | | | | | | | This was an unfinished to-do item before. With this patch and the two preceeding patches, piglit's fbo-generatemipmap-array test runs and passes instead of generating a GL error and dying on an assertion. Reviewed-by: Ian Romanick <[email protected]>
* mesa: restructure error checking in _mesa_FramebufferTexture1D/2DEXT()Brian Paul2011-08-191-11/+45
| | | | | | In anticipation of adding more texture targets. Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix incorrect error code in _mesa_FramebufferTexture1D/3DEXT()Brian Paul2011-08-181-2/+2
| | | | | The spec says GL_INVALID_OPERATION is generated when texture!=0 and textarget is not a legal value. We had this right for the 2D function.
* glapi: update .gitignore for generated ES dispatch headersPaul Berry2011-08-181-0/+4
| | | | | | | | | | | Commit 6eff33dc (glapi: generate ES dispatch headers from core mesa) replaced the autogenerated files src/mapi/es1api/main/{dispatch,remap_helper}.h with new autogenerated files src/mesa/main/api_exec_es{1,2}_{dispatch,remap_helper}.h. This patch updates the .gitignore files to properly ignore the new autogenerated files, and stop ignoring the old autogenerated files. Reviewed-by: Chia-I Wu <[email protected]>
* mesa: Add Android to list of platforms that define fpclassify()Chad Versace2011-08-161-1/+1
| | | | | | This is a fix for the Android build. Signed-off-by: Chad Versace <[email protected]>
* mesa: Fix Android build by #ifdef'ing out locale supportChad Versace2011-08-161-1/+2
| | | | | | | Bionic does not support locales. This commit #ifdef's out the locale usage in _mesa_strtof(). Signed-off-by: Chad Versace <[email protected]>
* mesa: Remove use of fpu_control.hChad Versace2011-08-162-14/+0
| | | | | | | | | | | Remove the inclusion of fpu_control.h from compiler.h. Since Bionic lacks fpu_control.h, this fixes the Android build. Also remove the sole use of the fpu_control bits, which was in debug.c. Those were brianp's debug bits, and he approved of their removal. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: ChooseTextureFormat() returns gl_format, not GLuintBrian Paul2011-08-161-1/+1
|
* glapi: generate ES dispatch headers from core mesaChia-I Wu2011-08-131-2/+2
| | | | | | | | | | GLESv1 and GLESv2 have their own dispatch.h and remap_helper.h. These headers are only used by api_exec_es1.c and api_exec_es2.c in core mesa. Move the rules to generate them from glapi to core mesa. Reviewed-by: Brian Paul <[email protected]> [olv: updated after reviewing to fix SCons build]
* mesa: In validate_program(), initialize errMsg for safety.Kenneth Graunke2011-08-051-1/+1
| | | | | | | | | | | | | | | validate_program relies on validate_shader_program to fill in errMsg; empirically, there exist cases where that doesn't happen. While tracking those down may be worthwhile, initializing the string so we don't try to ralloc_strdup random garbage also seems wise. Fixes issues caught by valgrind while running some test case. NOTE: This is a candidate for stable release branches. Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: Remove dead "MemPool" field of gl_shader_state.Eric Anholt2011-08-051-2/+0
|
* mesa: Remove MSVC stdint typedefs from compiler.h.Vinson Lee2011-08-041-23/+1
| | | | MSVC can now include the stdint.h at include/c99/stdint.h.
* mesa: use gl_constant_value type in _mesa_[Get]ProgramNamedParameter4fNV()Brian Paul2011-08-041-10/+10
|
* mesa: fix out of bounds array access in rtgc debug codeBrian Paul2011-08-041-1/+1
| | | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39841 This would only be hit if someone set RGTC_DEBUG=1.
* mesa: don't use K&R style function pointer callsBrian Paul2011-08-041-3/+3
|
* Merge branch 'glsl-to-tgsi'Bryan Cain2011-08-043-23/+36
|\ | | | | | | | | | | Conflicts: src/mesa/state_tracker/st_atom_pixeltransfer.c src/mesa/state_tracker/st_program.c
| * mesa, glsl_to_tgsi: add native support for integers in shadersBryan Cain2011-08-011-13/+25
| | | | | | | | | | Disabled by default on all drivers. To enable it, change ctx->GLSLVersion to 130 in st_extensions.c. Currently, softpipe is the only driver with integer support.
| * mesa: support boolean and integer-based parameters in prog_parameterBryan Cain2011-08-013-12/+13
| | | | | | | | | | | | The functionality is not used by anything yet, and the glUniform functions will need to be reworked before this can reach its full usefulness. It is nonetheless a step towards integer support in the state tracker and classic drivers.
* | mesa: minor comment updates in enable.cBrian Paul2011-08-041-9/+2
| |
* | mesa: whitespace, formatting fixes in GetTexParameter() codeBrian Paul2011-08-041-8/+6
| |
* | mesa: add null ptr checks in GetTexParameterI[u]iv() functionsBrian Paul2011-08-041-0/+4
| |
* | mesa: condense GL_TEXTURE_RESIDENT query codeBrian Paul2011-08-041-16/+4
| |
* | mesa: make error handling in glGetTexParameter() a bit more conciseBrian Paul2011-08-041-170/+96
| |
* | mesa: Ensure that gl_shader_program::InfoLog is never NULLIan Romanick2011-08-021-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This prevents assertion failures in ralloc_strcat. The ralloc_free in _mesa_free_shader_program_data can be omitted because freeing the gl_shader_program in _mesa_delete_shader_program will take care of this automatically. A bunch of this code could use a refactor to use ralloc a bit more effectively. A bunch of the things that are allocated with malloc and owned by the gl_shader_program should be allocated with ralloc (using the gl_shader_program as the context). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* | mesa: minor comment changes in teximage.cBrian Paul2011-07-291-7/+2
| |
* | mesa: add missing breaks for GL_TEXTURE_CUBE_MAP_SEAMLESS queriesBrian Paul2011-07-291-6/+8
| | | | | | | | | | | | And fix indentation. NOTE: This is a candidate for the 7.11 branch.
* | mesa: Fix ff fragment shader inputs calculation when enabling a VS.Eric Anholt2011-07-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FF VS generation happens just after the FF FS generation in state.c, so the ctx->VP._Current value is for the previous state update's vertex shader, not the one that will be chosen as a result of this state update. The vertexShader and vertexProgram variables should be accurately telling us whether there's going to be a ctx->VP._Current (except on _MaintainTnlProgram drivers, where it's always true). The glsl-vs-statechange-1 test was created to test for this, but it turns out that the bug is hidden by the fact that we call _mesa_update_state() twice per draw call -- once from _mesa_valid_to_render() and once from vbo_draw_arrays(), and the second one was fixing up the first one. Reviewed-by: Brian Paul <[email protected]>
* | mesa: test against MESA_FORMAT_NONE in _mesa_GetTexLevelParameteriv()Brian Paul2011-07-281-1/+1
| |
* | mesa: don't forget about sampleBuffers in framebuffer visual updateChristoph Bumiller2011-07-271-0/+1
| | | | | | | | | | | | | | Otherwise multisample will never been enabled for multisample renderbuffers. Reviewed-by: Brian Paul <[email protected]>
* | mesa: Make _mesa_get_compressed_formats match the texture compression specsIan Romanick2011-07-253-30/+93
| | | | | | | | | | | | | | | | | | | | | | The implementation deviated slightly from the GL_EXT_texture_sRGB spec and from other implementations. A giant comment block was added to justify the somewhat odd behavior of this function. In addition, the interface had unnecessary cruft. The 'all' parameter was false at all callers, so it has been removed. Reviewed-by: Brian Paul <[email protected]>
* | mesa: Return the correct internal fmt when a generic compressed fmt was usedIan Romanick2011-07-251-3/+17
| | | | | | | | | | | | | | | | | | | | If an application requests a generic compressed format for a texture and the driver does not pick a specific compressed format, return the generic base format (e.g., GL_RGBA) for the GL_TEXTURE_INTERNAL_FORMAT query. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3165 Reviewed-by: Brian Paul <[email protected]>
* | mesa: Add utility function to get base format from a GL compressed formatIan Romanick2011-07-252-0/+91
| | | | | | | | Reviewed-by: Brian Paul <[email protected]>
* | mesa: Add an ifndef guard around the definition of the INLINE macroPaul Berry2011-07-221-20/+22
| | | | | | | | | | | | | | | | | | Several Mesa headers redundantly define the INLINE macro. Adding this guard prevents the compiler from complaining about macro redefinition. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>