aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common/driverfuncs.c
Commit message (Collapse)AuthorAgeFilesLines
* main: Renamed _mesa_get_compressed_teximage to _mesa_GetCompressedTexImage_sw.Laura Ekstrand2015-01-081-1/+1
| | | | | | | | This reflects the new naming convention for software fallbacks. To avoid confusion with ARB_DIRECT_STATE_ACCESS backend functions, software fallbacks now have the form _mesa_[Driver function name]_sw. Reviewed-by: Anuj Phogat <[email protected]>
* main: Changed _mesa_alloc_texture_storage to _mesa_AllocTextureStorage_sw.Laura Ekstrand2015-01-081-1/+1
| | | | | | | | | | | | | | In order to implement ARB_DIRECT_STATE_ACCESS, many GL API functions must now rely on a backend that both traditional and DSA functions can use. For instance, _mesa_TexStorage2D and _mesa_TextureStorage2D both call a backend function _mesa_texture_storage that takes a context and a texture object as arguments. The backend is named _mesa_texture_storage so that Meta can call it and avoid looking up the context and the texture object. However, backend names often look very close to the names of software fallbacks (ie. _mesa_alloc_texture_storage). For this reason, software fallbacks have been renamed for clarity to have the form _mesa_[Driver function name]_sw. Reviewed-by: Anuj Phogat <[email protected]>
* meta: Add a meta implementation of GL_ARB_clear_textureNeil Roberts2014-07-231-0/+1
| | | | | | | | | | | | | | | | | | | | Adds an implementation of the ClearTexSubImage driver entry point that tries to set up an FBO to render to the texture and then calls glClearBuffer with a scissor to perform the actual clear. If an FBO can't be created for the texture then it will fall back to using _mesa_store_ClearTexSubImage. When used in combination with _mesa_store_ClearTexSubImage this should provide an implementation that works for all DRI-based drivers. However as this has only been tested with the i965 driver it is currently only enabled there. v2: Only enable the extension for the i965 driver instead of all DRI drivers. Remove an unnecessary goto. Don't require GL_ARB_framebuffer_object. Add some more comments. v3: Use glClearBuffer* to avoid having to modify glClearColor and friends. Handle sRGB textures. Explicitly disable dithering. Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
* mesa: Rename _mesa_..._array_obj functions to _mesa_..._vao.Kenneth Graunke2014-02-031-2/+2
| | | | | | | | | | | | | | | _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 <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Update gl_scissor_attrib to support ARB_viewport_arrayCourtney Goeltzenleuchter2014-01-201-1/+1
| | | | | | | | | | | | | | | | | | Update Mesa and drivers to access updated gl_scissor_attrib. Now have an enable bitfield and array of gl_scissor_rects. Drivers have been updated to the new scissor enable state attribute (gl_context.scissor.EnableFlags) but still treat it as a single boolean which is okay as mesa will only use bit 0 when communicating with a driver that does not support ARB_viewport_array. v2 (idr): Rebase fixes. v3 (idr): Small code formatting fix suggsted by Ken. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Eliminate parameters to dd_function_table::ScissorIan Romanick2014-01-151-2/+1
| | | | | | | | The i830 and i915 drivers used them, but they didn't really need to. They will just be annoying in future patches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add driver entry point for ARB_texture_viewCourtney Goeltzenleuchter2013-12-131-0/+3
| | | | | | Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove Driver.GetBufferSize and its callers.Eric Anholt2013-06-251-1/+0
| | | | | | | | Only the GDI driver set it to non-NULL any more, and that driver has a Viewport hook that should keep it limping along as well as it ever has. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove outdated version lines in commentsRico Schüller2013-06-051-1/+0
| | | | Signed-off-by: Brian Paul <[email protected]>
* mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke2013-04-231-3/+4
| | | | | | | | | | | | | | The previous commit introduced extra words, breaking the formatting. This text transformation was done automatically via the following shell command: $ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript where 'vimscript' is a file containing: /THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * ' :wq Reviewed-by: Brian Paul <[email protected]>
* mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | This brings the license text in line with the MIT License as published on the Open Source Initiative website: http://opensource.org/licenses/mit-license.php Generated automatically be the following shell command: $ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {} This introduces some wrapping issues, to be fixed in the next commit. Reviewed-by: Brian Paul <[email protected]>
* mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | | Generated automatically be the following shell command: $ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/BRIAN PAUL/THE AUTHORS/' {} The intention here is to protect all authors, not just Brian Paul. I believe that was already the sensible interpretation, but spelling it out is probably better. More practically, it also prevents people from accidentally copy & pasting the license into a new file which says Brian is not liable when he isn't even one of the authors. Reviewed-by: Brian Paul <[email protected]>
* mesa: Generalize TexStorage allocator between swrast and intel.Eric Anholt2013-04-211-1/+2
| | | | | | | | | | This should be reusable for other non-gallium drivers, so we can make the extension always be available. v2: Add a more detailed comment than the old function had (recommended by Brian). Reviewed-by: Brian Paul <[email protected]> (v1)
* mesa: provide default implementation of QuerySamplesForFormatChris Forbes2013-03-291-1/+2
| | | | | | | | | | | | | | Previously at least i915 failed to provide an implementation, but exposed ARB_internalformat_query anyway, leading to crashes when QueryInternalformativ was called. Default implementation just returns 1 for everything, so is suitable for any driver which does not support multisampling. V2: - Move from intel to core mesa. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: implement GetMultisamplefvChris Forbes2013-03-021-0/+3
| | | | | | | | | | | | | | | Actual sample locations deferred to a driverfunc since only the driver really knows where they will be. V2: - pass the draw buffer to the driverfunc; don't fallback to pixel center if driverfunc is missing. - rename GetSampleLocation to GetSamplePosition - invert y sample position for winsys FBOs, at Paul's suggestion Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* gles2: a stub implementation for GL_EXT_discard_framebufferTapani Pälli2013-02-201-0/+1
| | | | | | | | | | | This patch implements a stub for GL_EXT_discard_framebuffer with required checks listed by the extension specification. This extension is required by GLBenchmark 2.5 when compiled with OpenGL ES 2.0 as the rendering backend. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-and-tested-by: Chad Versace <[email protected]>
* mesa: remove ctx->Driver.Error() hookBrian Paul2013-01-291-1/+0
| | | | | | Not used by any driver anymore. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove the dead PrepareExecBegin() driver hook.Eric Anholt2013-01-211-1/+0
| | | | | | | This was used in i965 for a while, but no more. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add driver method to determine the possible sample countsIan Romanick2013-01-151-0/+1
| | | | | | | | | | | | | | Use this method in _mesa_GetInternalformativ for both GL_SAMPLES and GL_NUM_SAMPLE_COUNTS. v2: internalFormat may not be color renderable by the driver, so zero can be returned as a sample count. Require that drivers supporting the extension provide a QuerySamplesForFormat function. The later was suggested by Eric Anholt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: consolidate internal glCompressedTexSubImage1/2/3D codeBrian Paul2012-06-061-3/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: consolidate internal glCompressedTexImage1/2/3D codeBrian Paul2012-06-061-3/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: consolidate internal glCopyTexSubImage1/2/3D codeBrian Paul2012-06-061-3/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: consolidate internal glTexSubImage1/2/3D codeBrian Paul2012-06-061-3/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: consolidate internal glTexImage1/2/3D codeBrian Paul2012-06-061-3/+1
| | | | | | | The functions for handling 1D, 2D and 3D texture images were nearly identical. This folds them all together. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove ctx->Driver.ClearColor() hookBrian Paul2012-03-121-1/+0
| | | | | | | The driver Clear() function should just grab the clear color out of the context. Reviewed-by: Dave Airlie <[email protected]>
* mesa: remove ctx->Driver.ClearDepth(), ClearStencil() driver hooksBrian Paul2012-03-121-2/+0
| | | | | | | Not used by any drivers. Drivers can easily access the values from the Mesa context at glClear() time. Reviewed-by: Dave Airlie <[email protected]>
* mesa: remove ctx->Driver.Map/UnmapTexture() hooksBrian Paul2012-01-241-2/+0
| | | | No longer used anywhere.
* mesa/drivers: use new swrast renderbuffer functionsBrian Paul2011-12-081-3/+4
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: rewrite accum buffer supportBrian Paul2011-12-081-1/+2
| | | | | | | | | | | | | Implemented in terms of renderbuffer mapping/unmapping and format packing/unpacking functions. The swrast and state tracker code for implementing accumulation are unused and will be removed in the next commit. v2: don't use memcpy() in _mesa_clear_accum_buffer() v3: don't allocate MAX_WIDTH arrays, be more careful with mapping flags Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove the ctx->Driver.IsTextureResident() hookBrian Paul2011-12-081-1/+0
| | | | | | | No driver implemented this and we always returned "True" for residence queries. Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove TextureMemCpy driver hookBrian Paul2011-12-081-1/+0
| | | | There's probably no reason to use a special version of memcpy() anymore.
* mesa: use _mesa_readpixels() as default driver hookBrian Paul2011-11-151-1/+2
| | | | Acked-by: Eric Anholt <[email protected]>
* Add MapRenderbuffer implementations for software drivers.Eric Anholt2011-11-011-0/+2
| | | | | | | | | | Mesa core's is generic for things like osmesa. For swrast_dri.so, we have to do Y flipping. The front-buffer path isn't actually tested, though, because both before and after it fails with a BadMatch in XGetImage. Reviewed-by: Brian Paul <[email protected]>
* swrast: implement GL_ARB_texture_storageBrian Paul2011-10-311-0/+3
|
* meta: add _mesa_meta_DrawTex()Chia-I Wu2011-10-301-0/+1
| | | | | | | | It is set to dd->DrawTex. Reviewed-by: Brian Paul <[email protected]> [olv: set dd->DrawTex in _mesa_init_driver_functions]
* mesa: Add dd_function_table::PrepareExecBeginChad Versace2011-10-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This hook allows the driver to prepare for a glBegin/glEnd. i965 will use the hook to avoid avoid recursive calls to FLUSH_VERTICES during a buffer resolve meta-op. Detailed Justification ---------------------- When vertices are queued during a glBegin/glEnd block, those vertices must of course be drawn before any rendering state changes. To enusure this, Mesa calls FLUSH_VERTICES as a prehook to such state changes. Therefore, FLUSH_VERTICES itself cannot change rendering state without falling into a recursive trap. This precludes meta-ops, namely i965 buffer resolves, from occuring while any vertices are queued. To avoid that situation, i965 must satisfy the following condition: that it queues no vertex if a buffer needs resolving. To satisfy this, i965 will use the PrepareExecBegin hook to resolve all buffers on entering a glBegin/glEnd block. -------- v2: Don't add dd_function_table::CleanupExecEnd. Anholt and I discovered that hook to be unnecessary. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: Remove unused tnl items from dd_functionsChad Versace2011-09-301-2/+0
| | | | | | | Remove NeedValidate and ValidateTnlModule. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: plug in swrast texture image alloc/free functionsBrian Paul2011-09-171-1/+2
| | | | Use the swrast allocation/free functions instead of core Mesa.
* swrast: plug in _swrast_new/delete_texture_image() functionsBrian Paul2011-09-171-2/+2
|
* mesa: add new DeleteTextureImage() driver hookBrian Paul2011-09-171-0/+1
| | | | | | Matches the NewTextureImage() hook. With new subclasses of gl_texture_image coming we need a new hook to properly delete objects of those subclasses.
* meta: added _mesa_meta_GetTexImage()Brian Paul2011-09-081-1/+1
| | | | | If the texture is compressed, call the meta decompress_texture_image() function. Otherwise, call the core _mesa_get_teximage() function.
* mesa: Remove dd_function_table::CopyColorTable, ::CopyColorSubTable, and ↵Ian Romanick2011-09-061-5/+0
| | | | | | | | | | ::UpdateTexturePalette There's nothing left that can call any of these functions. This also removes the meta-ops code that implemented the first two. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* swrast: Add implementation of MapTextureImage/UnmapTextureImage.Brian Paul2011-08-291-0/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Rename FreeTexImageData to FreeTextureImageBuffer.Eric Anholt2011-08-291-1/+1
| | | | | | | | 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]>
* mesa: fix initialization of GL_FOG_MODE in _mesa_init_driver_state()Brian Paul2011-08-111-1/+4
|
* mesa: fix ColorMask array index in _mesa_init_driver_state()Brian Paul2011-08-111-4/+4
| | | | | This doesn't really make any difference because all the colormasks are the same upon context set-up, but it makes more sense.
* meta: remove _mesa_meta_CopyTexImage1D/2D()Brian Paul2011-07-191-2/+0
|
* mesa: move texrender.c to swrastBrian Paul2011-06-131-3/+2
| | | | | | | This stuff is really for software rendering, it's not core Mesa. A small step toward pushing the FetchTexel() stuff down into swrast. Reviewed-by: Eric Anholt <[email protected]>
* intel: Add support for ARB_sampler_objects.Eric Anholt2011-04-231-0/+3
| | | | | | | | | | | | This extension support consists of replacing "gl_texture_obj->Sampler." with "_mesa_get_samplerobj(ctx, unit)->". One instance of referencing the texture's base sampler remains in the initial miptree allocation, where I'm not sure we have a clear association with any texture unit. Tested with piglit ARB_sampler_objects/sampler-objects. Reviewed-by: Brian Paul <[email protected]>
* mesa: add NV_texture_barrierMarek Olšák2011-03-151-0/+3
|