Commit Graph

67475 Commits

Author SHA1 Message Date
Eric Anholt 92a0b0bd70 vc4: Pack VPM attr contents according to just the size of the attribute.
total instructions in shared programs: 40960 -> 39753 (-2.95%)
instructions in affected programs:     20871 -> 19664 (-5.78%)
2015-01-10 13:54:12 +13:00
Eric Anholt 72cb6619cb vc4: Restructure color packing as a series of channel replacements.
I'm using this in some WIP commits for doing blending in 8888 instead of
vec4.  But it also gives us these results immediately, thanks to allowing
more uniforms/immediates in the arguments:

total instructions in shared programs: 41027 -> 40960 (-0.16%)
instructions in affected programs:     4381 -> 4314 (-1.53%)
2015-01-10 13:54:12 +13:00
Eric Anholt 3093bfacf0 vc4: Fix the no-copy-propagating-from-TLB_COLOR_READ check.
Our MOV's dst obviously won't be the TLB_COLOR_READ's def, because we're
ssa.
2015-01-10 13:54:12 +13:00
Eric Anholt 1d04432677 vc4: Move global seqno short-circuiting to vc4_wait_seqno().
Any other caller would want it, too.
2015-01-10 13:54:12 +13:00
Eric Anholt 24d9487432 state_tracker: Fix assertion failures in conditional block movs.
If you had a conditional assignment of an array or struct (say, from the
if-lowering pass), we'd try doing swizzle_for_size() on the aggregate
type, and it would assertion fail due to vector_elements==0.  Instead,
extend emit_block_mov() to handle emitting the conditional operations,
which also means we'll have appropriate writemasks/swizzles on the CMPs
within a struct containing various-sized members.

Fixes 20 testcases in es3conform on vc4.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-01-10 13:54:12 +13:00
Matt Turner 3d8188d4f8 i965: Consider SEL.{GE,L} to be commutative operations.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-01-08 15:38:16 -08:00
Matt Turner 7f813bf53d i965/cfg: Fix end_ip of last basic block.
start_ip and end_ip are inclusive.

Increases instruction counts in 64 shaders in shader-db, likely
indicative of them previously being misoptimized.
2015-01-08 15:38:16 -08:00
Brian Paul df461ac952 mesa: compute row stride outside of loop and fix MSVC compilation error
Can't do void pointer arithmetic with MSVC.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-01-08 14:35:16 -07:00
Brian Paul e2bf5b183b mesa: fix MSVC compilation errors
Move assertions after declarations and don't use void pointer arithmetic.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-01-08 14:35:07 -07:00
Laura Ekstrand 8d2542fc9d main: Checking for cube completeness in TextureSubImage.
This is part of a potential solution to a spec bug.  Cube completeness
is a concept from glGenerateMipmap, but it seems reasonable to check for it in
TextureSubImage when target=GL_TEXTURE_CUBE_MAP.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:30 -08:00
Laura Ekstrand efbc1c86a6 main: Checking for cube completeness in GetTextureImage.
This is part of a potential solution to a spec bug.  Cube completeness
is a concept from glGenerateMipmap, but it seems reasonable to check for it in
GetTextureImage when the target is GL_TEXTURE_CUBE_MAP.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:30 -08:00
Laura Ekstrand b66dd38a37 main: Added _mesa_cube_level_complete to check for the completeness of an arbitrary cube map level.
Reviewed-by: Chad Versace <chad.versace@intel.com>
2015-01-08 11:37:30 -08:00
Laura Ekstrand 2546d901be main: glDeleteTextures now throws GL_INVALID_VALUE if n is negative.
This is in conformance with the OpenGL spec.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:30 -08:00
Laura Ekstrand 50d679381d main: Refactor in teximage.c to handle NULL from _mesa_get_current_tex_object.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:30 -08:00
Laura Ekstrand 98e64e538a main: Added entry point for glTextureBuffer.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:30 -08:00
Laura Ekstrand 499004e56a main: Fix texObj->Immutable flag update in _mesa_texture_image_multisample.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand a7d69516b8 main: Added entry points for glTextureStorage[23]DMultisample.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand 91089d6d65 main: Added entry point for glGenerateTextureMipmap.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand 239e3fb876 main: Added entry points for glCompressedTextureSubImage*D.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand 8b5482ec03 main: Added entry point for glGetCompressedTextureImage.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand a739bdeb1d main: Added entry point for glGetTextureImage.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand f51f6805f5 main: Nameless texture creation and deletion. Does not affect normal 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 <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand d6b7c40cec main: Added entry points for CopyTextureSubImage*D.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand bad39f6c1e main: Fixed some comments in texparam.c
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand c2c5077864 main: Added entry points for glGetTextureParameteriv, Iiv, and Iuiv.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand 89912d04a1 main: Added entry point for glGetTextureParameterfv.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand 86bb3be319 main: Added entry points for glGetTextureLevelParameteriv, fv.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand bf5c588cde main: legal_get_tex_level_parameter_target now handles GL_TEXTURE_CUBE_MAP.
ARB_DIRECT_STATE_ACCESS functions allow an effective target of
GL_TEXTURE_CUBE_MAP.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand d954f6023b main: Added entry points for glTextureParameteriv, Iiv, Iuiv.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand 354d789f3b main: Added entry point for glTextureParameteri.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand 2ce5db3930 main: Added entry point for glTextureParameterfv.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand abc688e33a main: Added entry point for glTextureParameterf.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand 5ad5393f3b main: Added get_texobj_by_name in texparam.c.
This is a convenience function for *Texture*Parameter functions.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand 795ba44754 main: set_tex_parameterf now handles errors according to the OpenGL 4.5 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 <anuj.phogat@gmail.com>
2015-01-08 11:37:29 -08:00
Laura Ekstrand f4dce7a6a6 main: set_tex_parameteri now handles errors according to the OpenGL 4.5 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 <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand 77aabd8be2 main: Added entry point for BindTextureUnit.
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 <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand 4b381e84db main: Corrected comment on _mesa_is_zero_size_texture.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand b8939fd3d1 main: Added entry points for glTextureSubImage*D.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand 5a5fe9f308 main: Added entry points for glTextureStorage*D.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand 97c838cf85 main: Added entry point for glCreateTextures.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand 15ddc2d94b main: Removed trailing whitespaces in texture code.
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 <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand ea1fb258ba main: Renamed _mesa_get_compressed_teximage to _mesa_GetCompressedTexImage_sw.
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 <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand 460365cde3 main: Renamed _mesa_get_teximage to _mesa_GetTexImage_sw.
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 <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand 16f6d9cf5f main: Changed _mesa_alloc_texture_storage to _mesa_AllocTextureStorage_sw.
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 <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand 35371d6560 main: Moved _mesa_get_current_tex_object from teximage.c to texobj.c.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand d7528fce5a main: Moved _mesa_lock_texture and _mesa_unlock_texture to texobj.h from teximage.h.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand 838ef5b781 i965: blit_texture_to_pbo() now accepts TEXTURE_CUBE_MAP.
ARB_DIRECT_STATE_ACCESS permits the user to use TEXTURE_CUBE_MAP as a target.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand 60e3bfddaf main: Added utility function _mesa_lookup_texture_err().
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 <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
Laura Ekstrand 56875181c7 glapi: Added ARB_direct_state_access.xml file.
main: Added ARB_direct_state_access to extensions.c as dummy_false.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-01-08 11:37:28 -08:00
José Fonseca 6c9b695a9c st/wgl: Ignore ulVersion in DrvValidateVersion.
We never used ulVersion for proper version checks.

Most 3rd party drivers use version 1, but recently NVIDIA OpenGL driver
started using a different version number, so the handy trick of renaming
Mesa's ICDs as nvoglv32.dll on Windows machines with NVIDIA hardware for
quick testing of Mesa software renderers stopped working.

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-01-08 18:57:04 +00:00