summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* swr: invalidate attachment on transition changeGeorge Kyriazis2017-06-223-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider the following RT attachment order: 1. Attach surfaces attachments 0 & 1, and render with them 2. Detach 0 & 1 3. Re-attach 0 & 1 to different surfaces 4. Render with the new attachment The definition of a tile being resolved is that local changes have been flushed out to the surface, hence there is no need to reload the tile before it's written to. For an invalid tile, the tile has to be reloaded from the surface before rendering. Stage (2) was marking hot tiles for attachements 0 & 1 as RESOLVED, which means that the hot tiles can be written out to memory with no need to read them back in (they are "clean"). They need to be marked as resolved here, because a surface may be destroyed after a detach, and we don't want to have un-resolved tiles that may force a readback from a NULL (destroyed) surface. (Part of a destroy is detach all attachments first) Stage (3), during the no att -> att transition, we need to realize that the "new" surface tiles need to be fetched fresh from the new surface, instead of using the resolved tiles, that belong to a stale attachment. This is done by marking the hot tiles as invalid in stage (3), when we realize that a new attachment is being made, so that they are re-fetched during rendering in stage (4). Also note that hot tiles are indexed by attachment. - Fixes VTK dual depth-peeling tests. - No piglit changes Reviewed-by: Tim Rowley <[email protected]>
* Revert "getteximage: Return correct error value when texure object is not found"Juan A. Suarez Romero2017-06-221-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | From OpenGL 4.5 spec PDF, section '8.11. Texture Queries', page 236: "An INVALID_VALUE error is generated if texture is not the name of an existing texture object." Same wording applies to the compressed version. But turns out this is a spec bug, and Khronos is fixing it for the next revisions. The proposal is to return INVALID_OPERATION in these cases. This reverts commit 633c959faeae5099fd095f27da7b954e4a36254b. v2: - Use _mesa_lookup_texture_err (Samuel Pitoiset) v3: - _mesa_lookup_texture_err() already handles texture > 0 (Samuel Pitoiset) - Just revert 633c959fae (Juan A. Suarez) Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Juan A. Suarez Romero <[email protected]>
* egl: properly count configsEric Engestrom2017-06-225-6/+12
| | | | | | | | | | dri2_conf represents another config (which shouldn't be counted) if it doesn't have the requested ID. Reported-by: Liu Zhiquan <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Cc: <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/android: Change order of EGLConfig generation (v2)Chad Versace2017-06-221-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | Many Android apps (such as Google's official NDK GLES2 example app), and even portions the core framework code (such as SystemServiceManager in Nougat), incorrectly choose their EGLConfig. They neglect to match the EGLConfig's EGL_NATIVE_VISUAL_ID against the window's native format, and instead choose the first EGLConfig whose channel sizes match those of the native window format while ignoring the channel *ordering*. We can detect such buggy clients in logcat when they call eglCreateSurface, by detecting the mismatch between the EGLConfig's format and the window's format. As a workaround, this patch changes the order of EGLConfig generation such that all EGLConfigs for HAL pixel format i precede those for HAL pixel format i+1. In my (chadversary) testing on Android Nougat, this was good enough to pacify the buggy clients. v2: Rebase to make patch cherry-pickable to stable. Cc: [email protected] Cc: Tomasz Figa <[email protected]> Cc: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* i915: Fix gl_Fragcoord interpolationVille Syrjälä2017-06-225-16/+21
| | | | | | | | | | | | | | | | gl_FragCoord contains the window coordinates so it seems to me that we should not use perspective correct interpolation for it. At least now I get similar output as i965/swrast/llvmpipe produce. This fixes dEQP-GLES2.functional.shaders.builtin_variable.fragcoord_w. dEQP-GLES2.functional.shaders.builtin_variable.fragcoord_xyz was already passing, though I'm not quite sure how it managed to do that. v2: Add definitons for the S3 "wrap shortest" bits as well (Ian) Cc: [email protected] Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]>
* egl: simplify dri_config conditionalsEric Engestrom2017-06-222-17/+11
| | | | | | | | | | | | | In the same spirit as 858f2f2ae6 (egl/dri2: ease srgb __DRIconfig conditionals), let's merge dri_single_config and dri_double_config into a single dri_config[2]. This moves the `if (double) dri_double_config else dri_single_config` logic to `dri_config[double]`, reducing code duplication and making it easier to read. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* radeonsi/gfx9: enable DCC fast clearMarek Olšák2017-06-221-4/+0
| | | | | | It seems to work now. Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi/gfx9: don't ever flush the TC metadata cacheMarek Olšák2017-06-221-10/+3
| | | | | | | | The closed Vulkan driver doesn't do it either. Also remove some old comments that aren't useful. Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi/gfx9: use TC L2 for fast color clear with CP DMAMarek Olšák2017-06-221-2/+5
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: fix DCC fast clear for luminance and alpha formatsMarek Olšák2017-06-221-1/+10
| | | | | | | | | | | I reproduced this bug on Polaris11 and Raven. I can't get this bug on Fiji. The reason might be that Fiji doesn't use 2D tiling for the test due to higher 2D tiling alignment requirements. Fixes piglit: spec@ext_framebuffer_object@fbo-fast-clear Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: don't emit partial flushes at the end of IBs (v2)Marek Olšák2017-06-221-5/+9
| | | | | | | | The kernel sort of does the same thing with fences. v2: do emit partial flushes on SI Reviewed-by: Nicolai Hähnle <[email protected]>
* anv: FORMAT_FEATURE_TRANSFER_SRC/DST_BIT_KHR not used with ↵Andres Gomez2017-06-221-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VkFormatProperties.bufferFeatures VK_FORMAT_FEATURE_TRANSFER_[SRC|DST]_BIT_KHR is a flag value of the VkFormatFeatureFlagBits enum that can only be hold and checked against the linearTilingFeatures or optimalTilingFeatures members of the VkFormatProperties struct but not the bufferFeatures member. >From the Vulkan® 1.0.51, with the VK_KHR_maintenance1 extension, section 32.3.2 docs for VkFormatProperties: "* linearTilingFeatures is a bitmask of VkFormatFeatureFlagBits specifying features supported by images created with a tiling parameter of VK_IMAGE_TILING_LINEAR. * optimalTilingFeatures is a bitmask of VkFormatFeatureFlagBits specifying features supported by images created with a tiling parameter of VK_IMAGE_TILING_OPTIMAL. * bufferFeatures is a bitmask of VkFormatFeatureFlagBits specifying features supported by buffers." ... Bits which can be set in the VkFormatProperties features linearTilingFeatures, optimalTilingFeatures, and bufferFeatures are: typedef enum VkFormatFeatureFlagBits { ... VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = 0x00004000, VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = 0x00008000, ... } VkFormatFeatureFlagBits; ... The following bits may be set in linearTilingFeatures and optimalTilingFeatures, specifying that the features are supported by images or image views created with the queried vkGetPhysicalDeviceFormatProperties::format: ... * VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR specifies that an image can be used as a source image for copy commands. * VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR specifies that an image can be used as a destination image for copy commands and clear commands." Cc: Jason Ekstrand <[email protected]> Cc: Iago Toral Quiroga <[email protected]> Cc: Lionel Landwerlin <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* change va max_entrypointsChandu Babu N2017-06-222-1/+3
| | | | | | | | | | | As encode support is added along with decode, increase max_entrypoints to two. vaMaxNumEntrypoints was returning incorrect value and causing memory corruption before this commit v2: assert when max_entrypoints needs to be bigger CC: [email protected] Reviewed-by: Christian König <[email protected]>
* st/va: Fix leak in VAAPI subpicturesChandu Babu N2017-06-221-0/+1
| | | | | | | sampler view allocated in vaAssociateSubpicture is not cleared in vaiDeassociateSubpicture. Reviewed-by: Christian König <[email protected]>
* glsl: tidy up int declarationTimothy Arceri2017-06-221-2/+1
| | | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* glsl: fix typo in commentTimothy Arceri2017-06-221-1/+1
| | | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: fix using texture id 0 with glTextureSubImage*()Samuel Pitoiset2017-06-221-5/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fix using texture id 0 with gl*TextureParameter*()Samuel Pitoiset2017-06-221-4/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fix using texture id 0 with VDPAURegisterSurfaceNV()Samuel Pitoiset2017-06-221-3/+3
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fix using texture id 0 with glTextureStorage*()Samuel Pitoiset2017-06-221-6/+2
| | | | | | | | This fixes an assertion in debug build, and probably a crash in release build. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: pass the 'caller' function to texturestorage() helperSamuel Pitoiset2017-06-221-10/+13
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: use _mesa_lookup_texture_err() in get_tex_obj_for_clear()Samuel Pitoiset2017-06-221-10/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove unused _mesa_delete_nameless_texture()Samuel Pitoiset2017-06-222-46/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: check for allocation failures in _mesa_new_texture_object()Samuel Pitoiset2017-06-221-2/+5
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* radeonsi: use the correct LLVMTargetMachineRef in si_build_shader_variantNicolai Hähnle2017-06-221-6/+22
| | | | | | | | | | | | si_build_shader_variant can actually be called directly from one of normal-priority compiler threads. In that case, the thread_index is only valid for the normal tm array. v2: - use the correct sel/shader->compiler_ctx_state Fixes: 86cc8097266c ("radeonsi: use a compiler queue with a low priority for optimized shaders") Reviewed-by: Marek Olšák <[email protected]>
* radeonsi/gfx9: keep reusing the same buffer/address for the gfx9 flush fenceMarek Olšák2017-06-223-8/+28
| | | | | | | | instead of using a monotonic suballocator v2: initialize the memory at context creation Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi/gfx9: enable the constant engineMarek Olšák2017-06-221-4/+1
| | | | | | | I think this kernel commit fixes it: drm/amdgpu:use FRAME_CNTL for new GFX ucode Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi/gfx9: indirect buffers and all CP packets use TC L2Marek Olšák2017-06-224-13/+21
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: flush CB after MSAA only when transitioning from CB to texturesMarek Olšák2017-06-222-14/+60
| | | | | | | | | | | | | The main flush before texturing is done after the FMASK decompress pass. CB after MSAA rendering is not flushed in set_framebuffer_state and also not in memory_barrier if the current color buffer is MSAA. We fully rely on the FMASK decompress pass for the flushing. Some CB decompress and resolve passes need an explicit flush before and after. Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: unify CB_RESOLVE blitter invocation codeMarek Olšák2017-06-221-17/+18
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: flush DB caches only when transitioning from DB to texturingMarek Olšák2017-06-225-25/+56
| | | | | | | | | Use the mechanism of si_decompress_textures, but instead of doing the actual decompression, just flag the DB cache flush there. This removes a lot of unnecessary DB cache flushes. Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: add separate HUD counters for CB and DB cache flushesMarek Olšák2017-06-224-10/+20
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't set the border color if it's unusedMarek Olšák2017-06-221-4/+18
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't set 16 scissors and 16 viewports if they're unusedMarek Olšák2017-06-224-6/+34
| | | | | | | Only do so if there is a shader writing gl_ViewportIndex. This removes a lot of CPU overhead for the most common case. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: fix pipe_rasterizer_state::scissor with multiple viewportsMarek Olšák2017-06-221-1/+1
| | | | | Cc: 17.1 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: simplify st_update_viewportMarek Olšák2017-06-221-25/+10
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove redundant sample_mask checkingMarek Olšák2017-06-222-7/+1
| | | | | | cso does that too Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: use precomputed st_fb_orientationMarek Olšák2017-06-224-8/+8
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: don't call _mesa_update_clip_plane in the GL core profileMarek Olšák2017-06-221-1/+2
| | | | | | It uses the projection matrix to transform the clip plane. Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: set st_context::...num_samplers to 0 when there are no samplersMarek Olšák2017-06-221-1/+3
| | | | | | This was missed during my st/mesa series. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: unify fail paths for update_single_textureMarek Olšák2017-06-222-7/+2
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't call u_sampler_view_default_template for sampler viewsMarek Olšák2017-06-221-1/+2
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: always set sampler swizzle according to the texture base formatMarek Olšák2017-06-221-32/+9
| | | | | | | | | Mainly don't (indirectly) call util_format_description here. If the driver supports texture swizzling, this will always do the right thing. If the driver doesn't support it, it doesn't matter. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: samplers only need to track whether GLSL >= 130Marek Olšák2017-06-225-22/+25
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: simplify get_texture_format_swizzleMarek Olšák2017-06-221-23/+20
| | | | | | | - Don't check GL_NONE (that was only for buffers). - Don't use util_format_is_depth_or_stencil. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: add an entirely separate codepath for setting up buffer viewsMarek Olšák2017-06-226-100/+134
| | | | | | | | | | | | Remove handling of buffers from all texture paths. This simplifies things for both buffers and textures. get_sampler_view_format is also cleaned up not to call util_format_is_depth_and_stencil. v2: also update st_NewTextureHandle Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
* st/mesa: don't return an error from update_single_textureMarek Olšák2017-06-223-11/+7
| | | | | | | It can just return a NULL sampler view, which is better than not doing anything at all. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: clean up trivial dereferences in update_texturesMarek Olšák2017-06-221-6/+7
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't check MaxTextureImageUnits in update_texturesMarek Olšák2017-06-221-12/+2
| | | | | | The linker takes care of it. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't call st_shader_stage_to_ptarget in update_texturesMarek Olšák2017-06-221-8/+7
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>