summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2016-10-26i965/mesa/st: eliminate gl_tess_ctrl_programTimothy Arceri21-76/+41
We now get all the tcs metadata from shader_info. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-26mesa: set tcs shader_info metadata directlyTimothy Arceri2-7/+1
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-26st/mesa: switch tcs over to shared shader_infoTimothy Arceri2-2/+2
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-26i965: switch tcs over to shared shader_infoTimothy Arceri2-22/+17
Note we access shader_info from the program struct rather than the nir_shader pointer because shader cache won't create a nir_shader. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-26glsl: add temporary copy_shader_info() functionTimothy Arceri8-53/+97
This function is added here to ease refactoring towards using the new shared shader_info. Once refactoring is complete and values are set directly it will be removed. We call it from _mesa_copy_linked_program_data() rather than glsl_to_nir() so that the values will be set for all drivers. In order to do this some calls need to be moved around so that we make sure to call do_set_program_inouts() before _mesa_copy_linked_program_data() Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-26glsl: add a shader info field to the gl_program typeTimothy Arceri3-1/+11
And use this field as the source for shader info in the nir_shader this will allow us to set some of these fields from GLSL directly. It will also simplify restoring from shader cache and allow the removal of duplicate fields from GLSL. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-26nir/i965/anv/radv/gallium: make shader info a pointerTimothy Arceri65-358/+372
When restoring something from shader cache we won't have and don't want to create a nir_shader this change detaches the two. There are other advantages such as being able to reuse the shader info populated by GLSL IR. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-26nir: move nir_shader_info to a common compiler headerTimothy Arceri3-97/+134
This will allow use to stop copying values between structs and will also simplify handling handling these values in the shader cache. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-26mesa: modify _mesa_copy_linked_program_data() to take gl_linked_shaderTimothy Arceri6-32/+34
This allows us to do some small tidy ups, but will also allow us to call a new function that copies values to a shared shader info from here. In order to make this change this function now requires _mesa_reference_program() to have previously been called. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-26vulkan/wsi/wayland: fix ARGB window supportFredrik Höglund1-1/+4
Use an ARGB format for the DRM buffer when the compositeAlpha field in VkSwapchainCreateInfoKHR is set to VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-10-26vulkan/wsi/x11: fix ARGB window supportFredrik Höglund1-4/+15
Pass the correct depth to xcb_dri3_pixmap_from_buffer_checked(). Otherwise xcb_present_pixmap() fails with a BadMatch error. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-10-26radv: mark the fence as submitted and signalled in vkAcquireNextImageKHRFredrik Höglund3-9/+18
This stops the debug layers from complaining when fences are used to throttle image acquisition. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-10-25radv: Replace "abi_versions" with correct "api_version".Matt Turner2-2/+2
git history shows "abi_versions" was used from the outset. Cc: <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98415 Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-10-25anv: Replace "abi_versions" with correct "api_version".Matt Turner2-2/+2
git history shows "abi_versions" was used from the outset. Cc: <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98415 Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-10-25nv50/ir: start LocalCSE with getFirst to merge PHI instructionsKarol Herbst1-1/+1
total instructions in shared programs : 3499888 -> 3499445 (-0.01%) total gprs used in shared programs : 453866 -> 453803 (-0.01%) total local used in shared programs : 21621 -> 21621 (0.00%) total bytes used in shared programs : 32078952 -> 32074936 (-0.01%) local gpr inst bytes helped 0 39 119 119 hurt 0 0 0 0 Signed-off-by: Karol Herbst <karolherbst@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2016-10-25nvc0: use correct bufctx when invalidating CP texturesSamuel Pitoiset1-1/+1
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
2016-10-25vulkan/wsi/x11: Fix behavior of vkGetPhysicalDeviceSurfaceFormatsKHREduardo Lima Mitev1-3/+8
x11_surface_get_formats() is currently asserting that the number of elements in pSurfaceFormats must be greater than or equal to the number of formats available. This is buggy because pSurfaceFormatsCount elements are later copied from the internal formats' array, so if pSurfaceFormatCount is greater, it will overflow it. On top of that, this assertion violates the spec. From the Vulkan 1.0 (revision 32, with KHR extensions), page 579 of the PDF: "If pSurfaceFormats is NULL, then the number of format pairs supported for the given surface is returned in pSurfaceFormatCount. Otherwise, pSurfaceFormatCount must point to a variable set by the user to the number of elements in the pSurfaceFormats array, and on return the variable is overwritten with the number of structures actually written to pSurfaceFormats. If the value of pSurfaceFormatCount is less than the number of format pairs supported, at most pSurfaceFormatCount structures will be written. If pSurfaceFormatCount is smaller than the number of format pairs supported for the given surface, VK_INCOMPLETE will be returned instead of VK_SUCCESS to indicate that not all the available values were returned." So, the correct behavior is: if pSurfaceFormatCount is greater than the internal number of formats, it is clamped to that many formats. But if it is lesser than that, then pSurfaceFormatCount elements are copied, and the call returns VK_INCOMPLETE. Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-10-25mesa: fix error handling in DrawBuffersTapani Pälli1-34/+37
Patch rearranges error checking so that enum checking provided via destmask happens before other checks. It needs to be done in this order because other error checks do not work properly if there were invalid enums passed. Patch also refines one existing check and it's documentation to match GLES 3.0 spec (also in later specs). This was somewhat mysteriously referring to desktop GL but had a check for gles3. Fixes following dEQP tests: dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.draw_buffers no CI regressions observed. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98134 Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-25egl: add check that eglCreateContext gets a valid configTapani Pälli1-1/+3
Fixes following dEQP test: dEQP-EGL.functional.negative_api.create_context v2: don't break EGL_KHR_no_config_context (Eric Engestrom) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
2016-10-25mesa: add missing formats to driGLFormatToImageFormatTapani Pälli1-0/+2
Fixes following dEQP tests: dEQP-EGL.functional.image.api.create_image_gles2_tex2d_luminance dEQP-EGL.functional.image.api.create_image_gles2_tex2d_luminance_alpha Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98328
2016-10-25egl: fix type mismatch error type in _eglInitSurfaceTapani Pälli1-1/+1
EGL spec defines EGL_BAD_MATCH for windows, pixmaps and pbuffers in case where user creates a surface but config does not support rendering to such surface type. Following quotes are from EGL 1.5 spec 3.5 "Rendering Surfaces" : for eglCreatePlatformWindowSurface, eglCreateWindowSurface: "If config does not support rendering to windows (the EGL_SURFACE_TYPE attribute does not contain EGL_WINDOW_BIT ), an EGL_BAD_MATCH error is generated." for eglCreatePbufferSurface: "If config does not support pbuffers, an EGL_BAD_MATCH error is generated." for eglCreatePlatformPixmapSurface, eglCreatePixmapSurface: "If config does not support rendering to pixmaps (the EGL_SURFACE_TYPE attribute does not contain EGL_PIXMAP_BIT ), an EGL_BAD_MATCH error is generated." Fixes following dEQP test: dEQP-EGL.functional.negative_api.create_pbuffer_surface Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-10-25Revert "egl/android: Set EGL_MAX_PBUFFER_WIDTH and EGL_MAX_PBUFFER_HEIGHT"Tapani Pälli1-2/+0
This reverts commit b1d636aa007c0c354a217024b4befe15cfb5149f, previous commit sets these values for all egl configs. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> Suggested-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-25egl/dri2: set max values for pbuffer width and heightTapani Pälli1-0/+9
While these max values were previously fixed for pbuffer creation, this change makes also eglGetConfigAttrib() return correct values. Fixes following dEQP tests: dEQP-EGL.functional.create_surface.pbuffer.rgb888_no_depth_no_stencil dEQP-EGL.functional.create_surface.pbuffer.rgb888_depth_stencil dEQP-EGL.functional.create_surface.pbuffer.rgba8888_no_depth_no_stencil dEQP-EGL.functional.create_surface.pbuffer.rgba8888_depth_stencil Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98326 Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
2016-10-24gallium/stapi: fix comment for st_visual::buffer_maskBrian Paul1-1/+1
Trivial.
2016-10-24isl/format: Correct ASTC entries of format info tableNanley Chery1-28/+42
With the isl_format_supports* helpers, we can now conveniently report support for this format on Cherry View. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92925 Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-24i965: Drop nir_inputs from fs_visitor.Kenneth Graunke1-1/+0
It's unused. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-10-24i965: Don't use nir_assign_var_locations for VS/TES/GS outputs.Kenneth Graunke5-62/+12
Fixes spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3. v2: Remove nir_outputs field from fs_visitor (caught by Tim and Iago). Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-10-24i965: Make split_virtual_grfs() call compact_virtual_grfs().Kenneth Graunke1-0/+6
Post-splitting, VGRFs have a maximum size (MAX_VGRF_SIZE). This is required by the register allocator, as we have to create classes for each size of VGRF. We can (and do) allocate virtual registers larger than MAX_VGRF_SIZE, but we must ensure that they are splittable. split_virtual_grfs() asserts that the post-splitting register size is in range. Unfortunately, these trip for completely dead registers which are too large - we only set split points for live registers. So dead ones are never split, and if they happened to be too large, they'd trip asserts. To fix this, call compact_virtual_grfs() to eliminate dead registers before splitting. v2: Add a comment written by Iago. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-10-24i965: Drop unnecessary switch statement in nir_setup_outputs()Kenneth Graunke1-12/+3
TCS and FS are skipped above. CS has no output variables. All remaining cases take the same path. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-10-24tgsi: trivial build fix for MSVCBrian Paul1-1/+1
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-24nv50/ir: do not perform global membar for shared memorySamuel Pitoiset1-1/+4
Shared memory is local to CTA, thus we should only wait for prior memory writes which are visible to other threads in the same CTA, and not at global level. This should speedup compute shaders which use shared memory. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-24st/nine: Fix locking CubeTexture surfaces.Axel Davy1-0/+1
Only one face of Cubetextures was locked when in DEFAULT Pool. Fixes: https://github.com/iXit/Mesa-3D/issues/129 CC: "12.0 13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-10-24st/nine: Fix mistake in Volume9 UnlockBoxAxel Davy1-1/+1
In the format fallback path, the height was used instead of the depth. CC: "12.0 13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-10-24st/nine: Use align_calloc instead of align_mallocAxel Davy5-7/+7
We are not sure exactly what needs to be 0 initialized, but we are missing some cases. 0 initialize all our current aligned allocation. Fixes Tree of Savior visual issues. Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-10-24gallium/util: Add align_callocAxel Davy1-0/+8
Add implementation for align_calloc, which is align_malloc + memset. v2: add if (ptr) before memset. Fix indentation. Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-24st/nine: Fix leak with integer and boolean constantsAxel Davy1-21/+18
Leak introduced by: a83dce01284f220b1bf932774730e13fca6cdd20 The patch also moves the part to release changed.vs_const_i and changed.vs_const_b before the if (!cb.buffer_size) check, to avoid reuploading every draw call if integer or boolean constants are dirty, but the shaders use no constants. Signed-off-by: Axel Davy <axel.davy@ens.fr> CC: "13.0" <mesa-stable@lists.freedesktop.org>
2016-10-24tgsi/scan: scan texture offset operandsMarek Olšák1-0/+16
This seems important considering how much we depend on some of the flags. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-24tgsi/scan: move src operand processing into a separate functionMarek Olšák1-171/+183
the next commit will need this Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-24tgsi/scan: get information about shader buffer usageMarek Olšák2-0/+23
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-24tgsi/scan: handle indirect image indexing correctlyMarek Olšák2-8/+17
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-24tgsi/scan: don't treat RESQ etc. as memory instructionsMarek Olšák1-5/+13
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-24tgsi/scan: get information about indirect 2D file accessMarek Olšák2-0/+7
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-24tgsi/scan: get information about indirect CONST accessMarek Olšák2-0/+15
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-24i965/gen8: Don't enable alpha test and alpha to coverage if draw bufer zero ↵Anuj Phogat1-6/+9
is integer type We follow this rule at multiple places in i965 driver. This patch doesn't fix any testcase. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-24i965/gen8: Use DrawBuffer->_IntegerBuffers in gen8_upload_ps_blend()Anuj Phogat1-5/+2
No functional changes in this patch. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-24i965/gen8: Use DrawBuffer->_IntegerBuffers in gen8_upload_blend_state()Anuj Phogat1-8/+2
No functional changes in this patch. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-24nv50/ir: display OP_BAR subops in debug modeSamuel Pitoiset1-0/+9
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-24glsl: add matrix layout information to interface block typesIago Toral Quiroga9-12/+43
So far we have been checking that interface block definitions had matching matrix layouts by comparing the definitions of their fields, however, this does not cover the case where the interface blocks are defined with mismatching matrix layouts but don't define any field with a matrix type. In this case Mesa will not fail to link because none of the fields will inherit the mismatching layout qualifier. This patch fixes the problem in the same way we fixed it for packing layout information: we add the the layout information to the interface type and then we check it matches during the uniform block linking process. v2: Fix unit tests so they pass the new parameter to glsl_type::get_interface_instance() Fixes: dEQP-GLES31.functional.shaders.linkage.uniform.block.layout_qualifier_mismatch_3 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98245 Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
2016-10-24st/mesa: cleanup and fix primitive restart for indirect drawsNicolai Hähnle1-17/+28
There are three intended functional changes here: 1. OpenGL 4.5 clarifies that primitive restart should only apply with index buffers, so make that change explicit in the indirect draw path. 2. Make PrimitiveRestartFixedIndex work with indirect draws. 3. The change where primitive_restart is only set when the restart index can actually have an effect (based on the size of indices) is also applied for indirect draws. Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-24glsl/mesa: remove unused namespace support from the symbol tableTimothy Arceri6-265/+128
Namespace support seems to have been unused for a very long time. Previously the hash table entry was never removed and the symbol name wasn't freed until the symbol table was destroyed. In theory this could reduced the number of times we need to copy a string as duplicate names are reused. However in practice there is likely only a limited number of symbols that are the same and this is likely to cause other less than optimal behaviour such as the hash_table continuously growing. Along with dropping namespace support this change removes entries from the hash table as they become unused. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>