summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* main: Added entry points for glCompressedTextureSubImage*D.Laura Ekstrand2015-01-083-52/+220
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glGetCompressedTextureImage.Laura Ekstrand2015-01-083-45/+134
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glGetTextureImage.Laura Ekstrand2015-01-083-66/+240
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Nameless texture creation and deletion. Does not affect normal ↵Laura Ekstrand2015-01-082-0/+69
| | | | | | | | | | | | | | | | | | | | creation and deletion paths. In implementing ARB_DIRECT_STATE_ACCESS functions, it is often necessary to abstract the functionality of a traditional GL API function into a backend that both the traditional and dsa API functions can share. For instance, glTexParameteri and glTextureParameteri both call _mesa_texture_parameteri, which takes a context object and a texture object as arguments. The existance of such backend functions provides the opportunity for driver internals (such as meta) to pass around the actual texture object rather than its ID or target, saving on texture object storage and look-up overhead. This patch provides nameless texture creation and deletion for meta. This will be used in an upcoming refactor of meta. Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for CopyTextureSubImage*D.Laura Ekstrand2015-01-083-48/+151
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Fixed some comments in texparam.cLaura Ekstrand2015-01-081-2/+2
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glGetTextureParameteriv, Iiv, and Iuiv.Laura Ekstrand2015-01-083-34/+123
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glGetTextureParameterfv.Laura Ekstrand2015-01-083-12/+46
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glGetTextureLevelParameteriv, fv.Laura Ekstrand2015-01-083-32/+117
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: legal_get_tex_level_parameter_target now handles GL_TEXTURE_CUBE_MAP.Laura Ekstrand2015-01-081-2/+13
| | | | | | | ARB_DIRECT_STATE_ACCESS functions allow an effective target of GL_TEXTURE_CUBE_MAP. Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glTextureParameteriv, Iiv, Iuiv.Laura Ekstrand2015-01-083-34/+138
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glTextureParameteri.Laura Ekstrand2015-01-082-11/+52
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glTextureParameterfv.Laura Ekstrand2015-01-083-13/+47
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glTextureParameterf.Laura Ekstrand2015-01-083-10/+60
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added get_texobj_by_name in texparam.c.Laura Ekstrand2015-01-081-13/+51
| | | | | | This is a convenience function for *Texture*Parameter functions. Reviewed-by: Anuj Phogat <[email protected]>
* main: set_tex_parameterf now handles errors according to the OpenGL 4.5 ↵Laura Ekstrand2015-01-081-17/+20
| | | | | | | | | | | Specification. Beginning in the OpenGL 4.3 core specification, certain error handling has changed. One example shown here is that INVALID_ENUM is thrown instead of INVALID_OPERATION when a user attempts to set sampler parameters for a multisample target. Reviewed-by: Anuj Phogat <[email protected]>
* main: set_tex_parameteri now handles errors according to the OpenGL 4.5 ↵Laura Ekstrand2015-01-081-28/+42
| | | | | | | | | | | Specification. Beginning in the OpenGL 4.3 core specification, some error handling has changed (see OpenGL 4.5 core spec, 30.10.2014, Section 8.10 Texture Parameters, pages 228-29). As an example, changing sampler states with a multisample target throws INVALID_ENUM rather than INVALID_OPERATION. Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for BindTextureUnit.Laura Ekstrand2015-01-085-5/+150
| | | | | | | | | | | | | | | | | | | The following preparations were made in texstate.c and texstate.h to better facilitate the BindTextureUnit function: Dylan Noblesmith: mesa: add _mesa_get_tex_unit() mesa: factor out _mesa_max_tex_unit() This is about to appear in a lot more places, so reduce boilerplate copy paste. add _mesa_get_tex_unit_err() checking getter function Reduce boilerplate across files. Laura Ekstrand: Made note of why BindTextureUnit should throw GL_INVALID_OPERATION if the unit is out of range. Added assert(unit > 0) to _mesa_get_tex_unit. Reviewed-by: Anuj Phogat <[email protected]>
* main: Corrected comment on _mesa_is_zero_size_texture.Laura Ekstrand2015-01-081-1/+1
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glTextureSubImage*D.Laura Ekstrand2015-01-083-81/+284
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glTextureStorage*D.Laura Ekstrand2015-01-083-51/+189
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glCreateTextures.Laura Ekstrand2015-01-083-26/+90
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Removed trailing whitespaces in texture code.Laura Ekstrand2015-01-082-28/+28
| | | | | | | | main: Removed trailing whitespace in texstate.c. main: Deleted trailing whitespaces in texobj.c. main: Fixed whitespace errors in teximage.h and teximage.c. Reviewed-by: Anuj Phogat <[email protected]>
* main: Renamed _mesa_get_compressed_teximage to _mesa_GetCompressedTexImage_sw.Laura Ekstrand2015-01-084-8/+8
| | | | | | | | 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: Renamed _mesa_get_teximage to _mesa_GetTexImage_sw.Laura Ekstrand2015-01-084-12/+12
| | | | | | | | 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-084-10/+10
| | | | | | | | | | | | | | 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]>
* main: Moved _mesa_get_current_tex_object from teximage.c to texobj.c.Laura Ekstrand2015-01-084-85/+84
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Moved _mesa_lock_texture and _mesa_unlock_texture to texobj.h from ↵Laura Ekstrand2015-01-085-19/+21
| | | | | | teximage.h. Reviewed-by: Anuj Phogat <[email protected]>
* i965: blit_texture_to_pbo() now accepts TEXTURE_CUBE_MAP.Laura Ekstrand2015-01-081-0/+1
| | | | | | ARB_DIRECT_STATE_ACCESS permits the user to use TEXTURE_CUBE_MAP as a target. Reviewed-by: Anuj Phogat <[email protected]>
* main: Added utility function _mesa_lookup_texture_err().Laura Ekstrand2015-01-082-0/+19
| | | | | | | | | Most ARB_DIRECT_STATE_ACCESS functions take an object's ID and use it to look up the object in its hash table. If the user passes a fake object ID (ie. a non-generated name), the implementation should throw INVALID_OPERATION. This is a convenience function for texture objects. Reviewed-by: Anuj Phogat <[email protected]>
* glapi: Added ARB_direct_state_access.xml file.Laura Ekstrand2015-01-081-0/+1
| | | | | | main: Added ARB_direct_state_access to extensions.c as dummy_false. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Address `assignment makes integer from pointer without a cast` gcc ↵José Fonseca2015-01-081-2/+2
| | | | | | | warning. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/skl: Always use a header for SIMD4x2 sampler messagesKristian Høgsberg2015-01-085-11/+54
| | | | | | | | | | | | SKL+ overloads the SIMD4x2 SIMD mode to mean either SIMD8D or SIMD4x2 depending on bit 22 in the message header. If the bit is 0 or there is no header we get SIMD8D. We always wand SIMD4x2 in vec4 and for fs pull constants, so use a message header in those cases and set bit 22 there. Based on an initial patch from Ken. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Kristian Høgsberg <[email protected]>
* i965/skl: Report more accurate number of samples for formatKristian Høgsberg2015-01-071-0/+2
| | | | | Signed-off-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Don't use _mesa_generic_nop on Windows.José Fonseca2015-01-071-0/+9
| | | | | | | | | | | | | | | | | | | | It doesn't work on Windows because of STDCALL calling convention -- it's the callee responsibility to pop the arguments, and the number of arguments vary with the prototype --, so the stack pointer ends up getting corrupted. This is just a non-invasive stop-gap fix. A proper fix would be more elaborate, and require either: - a variation of __glapi_noop_table which sets GL_INVALID_OPERATION error - stop using APIENTRY on all internal _mesa_* functions. Tested with piglit gl-1.0-beginend-coverage (it now fails instead of crashing). VMware PR1350505 Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix GL_PRIMITIVE_RESTART_FIXED_INDEXMarek Olšák2015-01-071-1/+2
| | | | | Cc: 10.2 10.3 10.4 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* vbo: ignore primitive restart if FixedIndex is enabled in DrawArraysMarek Olšák2015-01-071-1/+2
| | | | | | | | | | | | | | From GL 4.4 Core profile: If both PRIMITIVE_RESTART and PRIMITIVE_RESTART_FIXED_INDEX are enabled, the index value determined by PRIMITIVE_RESTART_FIXED_INDEX is used. If PRIMITIVE_RESTART_FIXED_INDEX is enabled, primitive restart is not performed for array elements transferred by any drawing command not taking a type parameter, including all of the *Draw* commands other than *DrawEle- ments*. Cc: 10.2 10.3 10.4 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: create, use new _mesa_texture_base_format() functionBrian Paul2015-01-056-9/+23
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove unused ctx parameter for _mesa_select_tex_image()Brian Paul2015-01-0512-34/+30
| | | | Reviewed-by: Eric Anholt <[email protected]>
* swrast: use new _mesa_base_tex_image() helperBrian Paul2015-01-056-42/+47
| | | | Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: use new _mesa_base_tex_image() helperBrian Paul2015-01-055-5/+14
| | | | | | This involved adding a new st_texture_image_const() helper also. Reviewed-by: Eric Anholt <[email protected]>
* mesa: add _mesa_base_tex_image() helper functionBrian Paul2015-01-051-0/+10
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: simplify a conditional in detach_shader()Brian Paul2015-01-051-3/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: minor whitespace fixes in shaderapi.cBrian Paul2015-01-051-12/+13
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: make _mesa_reference_shader_program() an inline functionBrian Paul2015-01-052-4/+15
| | | | | | | which wraps _mesa_reference_shader_program_(), similar to what we do for other reference-counted objects. Reviewed-by: Eric Anholt <[email protected]>
* mesa: update comment on delete_shader_program()Brian Paul2015-01-051-2/+3
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: rearrange error handling in glProgramParameteri()Brian Paul2015-01-051-15/+11
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix error strings in shaderapi.cBrian Paul2015-01-051-2/+2
| | | | | | | The _mesa_-prefixed function names should not appear in GL error messages. Reviewed-by: Eric Anholt <[email protected]>
* meta: init var to silence uninitialized variable warningBrian Paul2015-01-051-1/+1
|
* i965: Micro-optimize swizzle_to_scs() and make it inlinable.Kenneth Graunke2015-01-043-27/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | brw_swizzle_to_scs has been showing up in my CPU profiling, which is rather silly - it's a tiny amount of code. It really should be inlined, and can easily be implemented with fewer instructions. The enum translation is as follows: SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W, SWIZZLE_ZERO, SWIZZLE_ONE 0 1 2 3 4 5 4 5 6 7 0 1 SCS_RED, SCS_GREEN, SCS_BLUE, SCS_ALPHA, SCS_ZERO, SCS_ONE which is simply (swizzle + 4) & 7. Haswell needs extra textureGather workarounds to remap GREEN to BLUE, but Broadwell and later do not. This patch replicates swizzle_to_scs in gen7_wm_surface_state.c and gen8_surface_state.c, since the Gen8+ code can be simplified to a mere two instructions. Both copies can be marked static for easy inlining. v2: Put the commit message in the code as comments (requested by Jason Ekstrand). Also fix a typo. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>