Commit Graph

93662 Commits

Author SHA1 Message Date
Juan A. Suarez Romero
be5fe2153b intel: automake: include Makefile.drm.am
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-06-29 10:03:40 +02:00
Kenneth Graunke
40f842ab57 mesa: Require mipmap completeness for glCopyImageSubData() at times.
This patch makes glCopyImageSubData require mipmap completeness when the
texture object's built-in sampler object has a mipmapping MinFilter.
This is apparently the de facto behavior and mandated by Android's CTS.

One exception is that we ignore format based completeness rules
(specifically integer formats with linear filtering), as this is
also the de facto behavior that until recently was mandated by the
OpenGL 4.5 CTS.

This was discussed with both the OpenGL and OpenGL ES working groups,
and while everyone agrees this behavior is unfortunate and complicated,
it is what it is at this point.  There was little appetite for relaxing
restrictions given that all conformant Android drivers followed the
mipmapping rule, and all conformant GL 4.5 implementations ignored the
integer/linear rule.

Fixes (on i965):
dEQP-GLES31.functional.debug.negative_coverage.*.buffer.copy_image_sub_data

Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16224
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-06-28 22:29:41 -07:00
Timothy Arceri
6120fbc444 mesa: tidy up white space in pixelstore.c 2017-06-29 14:14:03 +10:00
Ian Romanick
e0acd62536 mesa: Refactor error checking for GL_TEXTURE_BASE_LEVEL vs texture targets
Add a big spec quotation justifying the error generated, which has
changed over the GL versions.

v2: Compact the spec quote based on a Khronos bug and discussion with Jason.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2017-06-28 16:38:05 -07:00
Kenneth Graunke
d2c4f714d1 i965: Drop index buffer re-alignment code.
This shouldn't ever happen - GL requires it to be aligned:

   "Clients must align data elements consistent with the requirements
    of the client platform, with an additional base-level requirement
    that an offset within a buffer to a datum comprising N basic
    machine units be a multiple of N."

Mesa should reject unaligned index buffers for us - we shouldn't have
to handle them in the driver.

Note that Gallium already makes this assumption.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2017-06-28 16:21:44 -07:00
Timothy Arceri
c1b1cad586 mesa: add KHR_no_error support for glBlendFunc*()
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:11 +10:00
Timothy Arceri
f21a764092 mesa: create some glBlendFunc*() helper functions
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:11 +10:00
Timothy Arceri
87bc32166a mesa: add KHR_no_error support for glBindFragDataLocation*()
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:11 +10:00
Timothy Arceri
aed0fc5efd mesa: add bind_frag_data_location() helper
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:11 +10:00
Timothy Arceri
cb209dae99 mesa: add KHR_no_error support for glGetUniformLocation()
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:11 +10:00
Timothy Arceri
cc88eb97e0 mesa: inline _mesa_finish()
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:11 +10:00
Timothy Arceri
d8143a4bde mesa: add KHR_no_error support for glDisableVertexA*A*()
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:11 +10:00
Timothy Arceri
73e0140acc mesa: move error handling into disable_vertex_array_attrib() callers
This will let us just call disable_vertex_array_attrib() for
KHR_no_error support.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:11 +10:00
Timothy Arceri
d731b18933 mesa: add KHR_no_error support for glEnableVertexA*A*()
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:11 +10:00
Timothy Arceri
8e77fceedb mesa: add KHR_no_error support for glLogicOp()
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:10 +10:00
Timothy Arceri
ccbcb3ca17 mesa: add logic_op() helper
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:10 +10:00
Timothy Arceri
774580c8b9 mesa: add KHR_no_error support for glPixelStore*()
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:10 +10:00
Timothy Arceri
9853ca6037 mesa: add pixel_storei() helper
Will be used to add KHR_no_error support.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:10 +10:00
Timothy Arceri
7d8937d23c mesa: remove redundant error check
We do the same check in the shared code in the set_tex_parameterf()
call.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-06-29 08:54:10 +10:00
Ian Romanick
2e3f40272e mesa: GL_TEXTURE_BORDER_COLOR exists in OpenGL 1.0, so don't depend on GL_ARB_texture_border_clamp
On NV20 (and probably also on earlier NV GPUs that lack
GL_ARB_texture_border_clamp) fixes the following piglit tests:

    gl-1.0-beginend-coverage gltexparameter[if]{v,}
    push-pop-texture-state
    texwrap 1d
    texwrap 1d proj
    texwrap 2d proj
    texwrap formats

All told, 49 more tests pass on NV20 (10de:0201).

No changes on Intel CI run or RV250 (1002:4c66).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2017-06-28 14:51:05 -07:00
Ian Romanick
36bd4a5f21 genxml: Silence about a billion unused parameter warnings
v2: Use textwrap.dedent to make the source line a lot shorter.
Shortening (?) the line was requested by Jason.

v3: Simplify the texwrap.dedent usage.  Suggested by Dylan.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2017-06-28 14:50:14 -07:00
Chad Versace
a56f0203c3 mesa: Fix Android build
The format_fallback.py script wants two arguments: 'csv-file' and
'out-file'.

Fixes: 20c99eaece "mesa: Add _mesa_format_fallback_rgbx_to_rgba() [v2]"
Reported-by: Rob Herring <robh@kernel.org>
2017-06-28 14:41:45 -07:00
Eero Tamminen
c35fd58688 i965: Fix anisotropic filtering for mag filter
Commit f8d69beed4 moving sampler
handling to genxml messed up change done by commit
6a7c5257ca.

This broke rendering in SynMark CSDof and TexFilterAniso tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101607

Thanks to Kevin, who spotted the actual typo!
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-06-28 13:33:28 -07:00
Lucas Stach
ec43605189 etnaviv: fix shader miscompilation with more than 16 labels
The labels array may change its virtual address on a reallocation, so
it is invalid to cache pointers into the array. Rather than using the
pointer directly, remember the array index.

Fixes miscompilation of shaders in glmark2 ideas, leading to GPU hangs.

Fixes: c9e8b49b (etnaviv: gallium driver for Vivante GPUs)
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-06-28 22:04:30 +02:00
Dave Airlie
ff422500cc ac/nir: remove last remnants of v16i8
llvm doesn't need this workaround anymore.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-06-28 20:22:30 +01:00
Alex Smith
909184ac9c ac/nir: Use correct LLVM intrinsics for atomic ops on imageBuffers
The buffer intrinsics should be used instead of the image ones.

Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-06-28 21:05:04 +02:00
James Legg
69a17da037 ac/nir: assert printfs will fit
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-06-28 21:05:04 +02:00
James Legg
6fc41bb4d5 ac/nir: Make intrinsic_name buffer long enough
When using cmpswap on an image, it was being trunctated to
lvm.amdgcn.image.atomic.cmpswa, with the coords type missing entirely.

v2: Add stable CC

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-06-28 21:05:04 +02:00
Chad Versace
2cde8ff545 i965/dri: Support R8G8B8A8 and R8G8B8X8 configs
The Android framework requires support for EGLConfigs with
HAL_PIXEL_FORMAT_RGBX_8888 and HAL_PIXEL_FORMAT_RGBA_8888.

Even though all RGBX formats are disabled on gen9 by
brw_surface_formats.c, the new configs work correctly on Broxton thanks
to _mesa_format_fallback_rgbx_to_rgba().

On GLX, this creates no new configs, and therefore breaks no existing
apps. See in-patch comments for explanation. I tested with glxinfo and
glxgears on Skylake.

On Wayland, this also creates no new configs, and therfore breaks no
existing apps. (I tested with mesa-demos' eglinfo and es2gears_wayland
on Skylake). The reason differs from GLX, though. In
dri2_wl_add_configs_for_visual(), the format table contains only
B8G8R8X8, B8G8R8A8, and B5G6B5; and dri2_add_config() correctly matches
EGLConfig to format by inspecting channel masks.

On Android, in Chrome OS, I tested this on a Broxton device. I confirmed
that the Google Play Store's EGLSurface used HAL_PIXEL_FORMAT_RGBA_8888,
and that an Asteroid game's EGLSurface used HAL_PIXEL_FORMAT_RGBX_8888.
Both apps worked well. (Disclaimer: I didn't test this patch on Android
with Mesa master. I backported this patch series to an older Android
branch).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-06-28 09:42:27 -07:00
Juan A. Suarez Romero
89d4008ac8 mesa: do not use format string as literal string
This fixes a couple of  errors when building in Android:

external/mesa3d/src/mesa/main/shaderapi.c:293:49: error: format string
is not a string literal (potentially insecure)
[-Werror,-Wformat-security]
         _mesa_error(ctx, GL_INVALID_OPERATION, caller);
                                                ^~~~~~
external/mesa3d/src/mesa/main/shaderapi.c:293:49: note: treat the string
as an argument to avoid this
         _mesa_error(ctx, GL_INVALID_OPERATION, caller);
                                                ^
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
2017-06-28 16:19:55 +02:00
Brian Paul
7bbcf3ac70 scons: add code to generate format_fallback.c file
Fixes: a1983223d8 "mesa: Add _mesa_format_fallback_rgbx_to_rgba() [v2]"

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-06-28 04:12:25 -06:00
Samuel Pitoiset
e529ade0ea mesa: add KHR_no_error support for glClear()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
34e8d0e4ba mesa: add clear() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
48400e0bd6 mesa: add KHR_no_error support for glBindAttribLocation()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
34e5b39f37 mesa: add bind_attrib_location() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
352adb53db mesa: add KHR_no_error support for gl*ReadBuffer()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
91fcba9914 mesa: create read_buffer_err() and always inline read_buffer()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
89bc3ed7a3 mesa: add KHR_no_error support for glVertex*AttribBinding()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
401fa69132 mesa: add KHR_no_error support for glShaderStorageBlockBinding()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
edd5082861 mesa: add shader_storage_block_binding() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
6a2c1e76f2 mesa: add KHR_no_error support for glUniformBlockBinding()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
277135c1ed mesa: add uniform_block_binding() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
f543107256 mesa: add KHR_no_error support for glFenceSync()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
dd71fd1dd3 mesa: add fence_sync() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
6e0cd29132 mesa: add KHR_no_error support for glClientWaitSync()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
20ff1f9db7 mesa: add client_wait_sync() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
78d3510f0c mesa: add KHR_no_error support for glCheckFramebufferStatus()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
b87a2cbec4 mesa: add KHR_no_error support for gl*Renderbuffers()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
beb74c9b87 mesa: prepare create_render_buffers() for KHR_no_error support
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00
Samuel Pitoiset
836b48a836 mesa: add KHR_no_error support for gl*ProgramPipelines()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-28 10:25:13 +02:00