Mesa (master): radv: Really use correct HTILE expanded words.
Module: Mesa Branch: master Commit: afd8fd0656a8eb3a2ce892381387aad3c6b0a78f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=afd8fd0656a8eb3a2ce892381387aad3c6b0a78f Author: James Legg Date: Thu Feb 22 16:57:53 2018 + radv: Really use correct HTILE expanded words. When transitioning to an htile compressed depth format, Set the full depth range, so later rasterization can pass HiZ. Previously, for depth only formats, the depth range was set to 0 to 0. This caused unwanted HiZ rejections with a VK_FORMAT_D16_UNORM depth buffer (VK_FORMAT_D32_SFLOAT was not affected somehow). These values are derived from PAL [0], since I can't find the specification describing the htile values. [0] https://github.com/GPUOpen-Drivers/pal/blob/5cba4ecbda9452773f59692f5915301e7db4a183/src/core/hw/gfxip/gfx9/gfx9MaskRam.cpp#L1500 CC: Dave Airlie CC: Bas Nieuwenhuizen CC: mesa-sta...@lists.freedesktop.org Reviewed-by: Bas Nieuwenhuizen Tested-by: Grazvydas Ignotas Fixes: 5158603182fe7435 "radv: Use correct HTILE expanded words." --- src/amd/vulkan/radv_cmd_buffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 8a384b114c..2b41baea3d 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -3440,8 +3440,8 @@ void radv_CmdEndRenderPass( /* * For HTILE we have the following interesting clear words: - * 0x030f: Uncompressed for depth+stencil HTILE. - * 0x000f: Uncompressed for depth only HTILE. + * 0xf30f: Uncompressed, full depth range, for depth+stencil HTILE + * 0xfffc000f: Uncompressed, full depth range, for depth only HTILE. * 0xfff0: Clear depth to 1.0 * 0x: Clear depth to 0.0 */ @@ -3489,7 +3489,7 @@ static void radv_handle_depth_image_transition(struct radv_cmd_buffer *cmd_buffe radv_initialize_htile(cmd_buffer, image, range, 0); } else if (!radv_layout_is_htile_compressed(image, src_layout, src_queue_mask) && radv_layout_is_htile_compressed(image, dst_layout, dst_queue_mask)) { - uint32_t clear_value = vk_format_is_stencil(image->vk_format) ? 0x30f : 0xf; + uint32_t clear_value = vk_format_is_stencil(image->vk_format) ? 0xf30f : 0xfffc000f; radv_initialize_htile(cmd_buffer, image, range, clear_value); } else if (radv_layout_is_htile_compressed(image, src_layout, src_queue_mask) && !radv_layout_is_htile_compressed(image, dst_layout, dst_queue_mask)) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): radv/extensions: fix c_vk_version for patch == None
Module: Mesa Branch: master Commit: 8eed9421367d3a5576cb4b924d5004a1f976a418 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8eed9421367d3a5576cb4b924d5004a1f976a418 Author: Mauro Rossi Date: Fri Feb 23 23:33:37 2018 +0100 radv/extensions: fix c_vk_version for patch == None Similar to cb0d1ba156 ("anv/extensions: Fix VkVersion::c_vk_version for patch == None") fixes the following building errors: out/target/product/x86_64/obj_x86/STATIC_LIBRARIES/libmesa_radv_common_intermediates/radv_entrypoints.c:1161:48: error: use of undeclared identifier 'None'; did you mean 'long'? return instance && VK_MAKE_VERSION(1, 0, None) <= core_version; ^~~~ long external/mesa/include/vulkan/vulkan.h:34:43: note: expanded from macro 'VK_MAKE_VERSION' (((major) << 22) | ((minor) << 12) | (patch)) ^ ... fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. Fixes: e72ad05c1d ("radv: Return NULL for entrypoints when not supported.") Reviewed-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_extensions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py index ac6ec8744e..92b1ea3e14 100644 --- a/src/amd/vulkan/radv_extensions.py +++ b/src/amd/vulkan/radv_extensions.py @@ -116,7 +116,8 @@ class VkVersion: return '.'.join(ver_list) def c_vk_version(self): -ver_list = [str(self.major), str(self.minor), str(self.patch)] +patch = self.patch if self.patch is not None else 0 +ver_list = [str(self.major), str(self.minor), str(patch)] return 'VK_MAKE_VERSION(' + ', '.join(ver_list) + ')' def __int_ver(self): ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): gbm: Fix the alpha masks in the GBM format table.
Module: Mesa Branch: master Commit: 880573e7370b866c94513f59ad0bb0b10660643f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=880573e7370b866c94513f59ad0bb0b10660643f Author: Eric Anholt Date: Fri Feb 23 14:55:51 2018 -0800 gbm: Fix the alpha masks in the GBM format table. Once GBM started looking at the values of the alpha masks, ARGB/ABGR wouldn't match any more because we had both A and R in the low bits. Fixes: 2ed344645d65 ("gbm/dri: Add RGBA masks to GBM format table") Reviewed-by: Ilia Mirkin Reviewed-by: Daniel Stone --- src/gbm/backends/dri/gbm_dri.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index ed64ad61bf..df20db4021 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -562,7 +562,7 @@ static const struct gbm_dri_visual gbm_dri_visuals_table[] = { }, { GBM_FORMAT_ARGB, __DRI_IMAGE_FORMAT_ARGB, - { 0x00ff, 0xff00, 0x00ff, 0x00ff }, + { 0x00ff, 0xff00, 0x00ff, 0xff00 }, }, { GBM_FORMAT_XBGR, __DRI_IMAGE_FORMAT_XBGR, @@ -570,7 +570,7 @@ static const struct gbm_dri_visual gbm_dri_visuals_table[] = { }, { GBM_FORMAT_ABGR, __DRI_IMAGE_FORMAT_ABGR, - { 0x00ff, 0xff00, 0x00ff, 0x00ff }, + { 0x00ff, 0xff00, 0x00ff, 0xff00 }, }, { GBM_FORMAT_XRGB2101010, __DRI_IMAGE_FORMAT_XRGB2101010, ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): broadcom/vc5: Ignore unused usage flags in is_format_supported.
Module: Mesa Branch: master Commit: 97dc0773032d6284ea5c63758abf704d877f65dc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=97dc0773032d6284ea5c63758abf704d877f65dc Author: Eric Anholt Date: Fri Feb 23 09:10:36 2018 -0800 broadcom/vc5: Ignore unused usage flags in is_format_supported. Like for vc4, the new DISPLAY_TARGET flag ended up causing no formats to match. Just drop the whole retval == usage thing and return early when we hit a known unsupported case. Fixes: f7604d8af521 ("st/dri: only expose config formats that are display targets") --- src/gallium/drivers/vc5/vc5_screen.c | 43 ++-- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/src/gallium/drivers/vc5/vc5_screen.c b/src/gallium/drivers/vc5/vc5_screen.c index 47727d0ada..5d63fb6ec0 100644 --- a/src/gallium/drivers/vc5/vc5_screen.c +++ b/src/gallium/drivers/vc5/vc5_screen.c @@ -426,7 +426,6 @@ vc5_screen_is_format_supported(struct pipe_screen *pscreen, unsigned usage) { struct vc5_screen *screen = vc5_screen(pscreen); -unsigned retval = 0; if (sample_count > 1 && sample_count != VC5_MAX_SAMPLES) return FALSE; @@ -482,49 +481,39 @@ vc5_screen_is_format_supported(struct pipe_screen *pscreen, case PIPE_FORMAT_R8G8B8_SSCALED: case PIPE_FORMAT_R8G8_SSCALED: case PIPE_FORMAT_R8_SSCALED: -retval |= PIPE_BIND_VERTEX_BUFFER; break; default: -break; +return FALSE; } } if ((usage & PIPE_BIND_RENDER_TARGET) && -vc5_rt_format_supported(&screen->devinfo, format)) { -retval |= PIPE_BIND_RENDER_TARGET; +!vc5_rt_format_supported(&screen->devinfo, format)) { +return FALSE; } if ((usage & PIPE_BIND_SAMPLER_VIEW) && -vc5_tex_format_supported(&screen->devinfo, format)) { -retval |= PIPE_BIND_SAMPLER_VIEW; +!vc5_tex_format_supported(&screen->devinfo, format)) { +return FALSE; } if ((usage & PIPE_BIND_DEPTH_STENCIL) && -(format == PIPE_FORMAT_S8_UINT_Z24_UNORM || - format == PIPE_FORMAT_X8Z24_UNORM || - format == PIPE_FORMAT_Z16_UNORM || - format == PIPE_FORMAT_Z32_FLOAT || - format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT)) { -retval |= PIPE_BIND_DEPTH_STENCIL; +!(format == PIPE_FORMAT_S8_UINT_Z24_UNORM || + format == PIPE_FORMAT_X8Z24_UNORM || + format == PIPE_FORMAT_Z16_UNORM || + format == PIPE_FORMAT_Z32_FLOAT || + format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT)) { +return FALSE; } if ((usage & PIPE_BIND_INDEX_BUFFER) && -(format == PIPE_FORMAT_I8_UINT || - format == PIPE_FORMAT_I16_UINT || - format == PIPE_FORMAT_I32_UINT)) { -retval |= PIPE_BIND_INDEX_BUFFER; -} - -#if 0 -if (retval != usage) { -fprintf(stderr, -"not supported: format=%s, target=%d, sample_count=%d, " -"usage=0x%x, retval=0x%x\n", util_format_name(format), -target, sample_count, usage, retval); +!(format == PIPE_FORMAT_I8_UINT || + format == PIPE_FORMAT_I16_UINT || + format == PIPE_FORMAT_I32_UINT)) { +return FALSE; } -#endif -return retval == usage; +return TRUE; } #define PTR_TO_UINT(x) ((unsigned)((intptr_t)(x))) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): broadcom/vc5: Fix layout of 3D textures.
Module: Mesa Branch: master Commit: b4b4ada7616dec49e9386670e43d277e5f85 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b4b4ada7616dec49e9386670e43d277e5f85 Author: Eric Anholt Date: Thu Nov 2 16:59:10 2017 -0700 broadcom/vc5: Fix layout of 3D textures. Cube maps are entire miptrees repeated, while 3D textures have each level have all of its layers next to each other. Fixes tex3d and tex-miplevel-selection GL2:texture() 3D. --- src/gallium/drivers/vc5/vc5_resource.c | 105 +++-- src/gallium/drivers/vc5/vc5_resource.h | 8 +++ 2 files changed, 81 insertions(+), 32 deletions(-) diff --git a/src/gallium/drivers/vc5/vc5_resource.c b/src/gallium/drivers/vc5/vc5_resource.c index 157eb1c101..e1645a4fde 100644 --- a/src/gallium/drivers/vc5/vc5_resource.c +++ b/src/gallium/drivers/vc5/vc5_resource.c @@ -75,18 +75,22 @@ vc5_debug_resource_layout(struct vc5_resource *rsc, const char *caller) int level_width = slice->stride / rsc->cpp; int level_height = slice->padded_height; +int level_depth = +u_minify(util_next_power_of_two(prsc->depth0), i); fprintf(stderr, "rsc %s %p (format %s), %dx%d: " -"level %d (%s) %dx%d -> %dx%d, stride %d@0x%08x\n", +"level %d (%s) %dx%dx%d -> %dx%dx%d, stride %d@0x%08x\n", caller, rsc, util_format_short_name(prsc->format), prsc->width0, prsc->height0, i, tiling_descriptions[slice->tiling], u_minify(prsc->width0, i), u_minify(prsc->height0, i), +u_minify(prsc->depth0, i), level_width, level_height, +level_depth, slice->stride, rsc->bo->offset + slice->offset); } @@ -98,14 +102,8 @@ vc5_resource_bo_alloc(struct vc5_resource *rsc) struct pipe_resource *prsc = &rsc->base; struct pipe_screen *pscreen = prsc->screen; struct vc5_bo *bo; -int layers = (prsc->target == PIPE_TEXTURE_3D ? - prsc->depth0 : prsc->array_size); - -bo = vc5_bo_alloc(vc5_screen(pscreen), - rsc->slices[0].offset + - rsc->slices[0].size + - rsc->cube_map_stride * layers - 1, - "resource"); + +bo = vc5_bo_alloc(vc5_screen(pscreen), rsc->size, "resource"); if (bo) { vc5_bo_unreference(&rsc->bo); rsc->bo = bo; @@ -128,13 +126,21 @@ vc5_resource_transfer_unmap(struct pipe_context *pctx, struct vc5_resource_slice *slice = &rsc->slices[ptrans->level]; if (ptrans->usage & PIPE_TRANSFER_WRITE) { -vc5_store_tiled_image(rsc->bo->map + slice->offset + - ptrans->box.z * rsc->cube_map_stride, - slice->stride, - trans->map, ptrans->stride, - slice->tiling, rsc->cpp, - slice->padded_height, - &ptrans->box); +for (int z = 0; z < ptrans->box.depth; z++) { +void *dst = rsc->bo->map + +vc5_layer_offset(&rsc->base, + ptrans->level, + ptrans->box.z + z); +vc5_store_tiled_image(dst, + slice->stride, + (trans->map + + ptrans->stride * + ptrans->box.height * z), + ptrans->stride, + slice->tiling, rsc->cpp, + slice->padded_height, + &ptrans->box); +} } free(trans->map); } @@ -259,13 +265,21 @@ vc5_resource_transfer_map(struct pipe_context *pctx, trans->map = malloc(ptrans->layer_stride * ptrans->box.depth); if (usage & PIPE_TRANSFER_READ) { -vc5_load_tiled_image(trans->map, ptrans->stride, - buf + slice->offset + - ptra
Mesa (master): mesa: Update vertex processing mode on _mesa_UseProgram.
Module: Mesa Branch: master Commit: b54bf0e3e3378725dec924f8152dcb012dffcd2e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b54bf0e3e3378725dec924f8152dcb012dffcd2e Author: Mathias Fröhlich Date: Fri Feb 23 20:46:20 2018 +0100 mesa: Update vertex processing mode on _mesa_UseProgram. The change is a bug fix for 92d76a169: mesa: Provide an alternative to get_vp_mode() that actually got exposed through 4562a7b0: vbo: Make use of _DrawVAO from the dlist code. Fixes: KHR-GLES31.core.shader_image_load_store.advanced-sso-simple Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105229 Signed-off-by: Mathias Fröhlich Reviewed-by: Brian Paul --- src/mesa/main/shaderapi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 59089a12b0..76bad7f31e 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -2069,6 +2069,8 @@ use_program(GLuint program, bool no_error) _mesa_BindProgramPipeline(ctx->Pipeline.Current->Name); } } + + _mesa_update_vertex_processing_mode(ctx); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: enable OpenGL 3.1 with ARB_compatibility
Module: Mesa Branch: master Commit: a0c8b49284efe736849c0a45920ad0a1bbd8d93d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a0c8b49284efe736849c0a45920ad0a1bbd8d93d Author: Marek Olšák Date: Wed Feb 14 20:13:40 2018 +0100 mesa: enable OpenGL 3.1 with ARB_compatibility Tested-by: Dieter Nützel Reviewed-by: Brian Paul --- docs/features.txt | 8 docs/relnotes/18.1.0.html | 5 +++-- src/mesa/drivers/dri/common/dri_util.c | 8 src/mesa/main/version.c| 16 ++-- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/docs/features.txt b/docs/features.txt index 1672460a2f..5eae34bf0d 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -24,10 +24,10 @@ not started # OpenGL Core and Compatibility context support -OpenGL 3.1 and later versions are only supported with the Core profile. -There are no plans to support GL_ARB_compatibility. The last supported OpenGL -version with all deprecated features is 3.0. Some of the later GL features -are exposed in the 3.0 context as extensions. +Some drivers do not support the Compatibility profile or ARB_compatibility. +Such drivers are limited to OpenGL 3.0 if the Core profile is not requested +by applications. Some of the later GL features are exposed in the 3.0 context +as extensions. Feature Status diff --git a/docs/relnotes/18.1.0.html b/docs/relnotes/18.1.0.html index 0aca0aa1ab..8dd2550ced 100644 --- a/docs/relnotes/18.1.0.html +++ b/docs/relnotes/18.1.0.html @@ -26,8 +26,8 @@ Mesa 18.1.0 implements the OpenGL 4.5 API, but the version reported by glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. Some drivers don't support all the features required in OpenGL 4.5. OpenGL -4.5 is only available if requested at context creation -because compatibility contexts are not supported. +4.5 is only available if requested at context creation. +Compatibility contexts may report a lower version depending on each driver. @@ -44,6 +44,7 @@ Note: some of the new features are only available with certain drivers. +OpenGL 3.1 with ARB_compatibility on nv50, nvc0, r600, radeonsi, softpipe, llvmpipe, svga GL_ARB_bindless_texture on nvc0/maxwell+ GL_EXT_semaphore on radeonsi GL_EXT_semaphore_fd on radeonsi diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index e6a7d2391a..a34f38d611 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -381,14 +381,6 @@ driCreateContextAttribs(__DRIscreen *screen, int api, } } -/* Mesa does not support the GL_ARB_compatibilty extension or the - * compatibility profile. This means that we treat a API_OPENGL_COMPAT 3.1 as - * API_OPENGL_CORE and reject API_OPENGL_COMPAT 3.2+. - */ -if (mesa_api == API_OPENGL_COMPAT && -ctx_config.major_version == 3 && ctx_config.minor_version == 1) - mesa_api = API_OPENGL_CORE; - if (mesa_api == API_OPENGL_COMPAT && ((ctx_config.major_version > 3) || (ctx_config.major_version == 3 && diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index d26baab820..a28069054d 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -580,11 +580,11 @@ _mesa_get_version(const struct gl_extensions *extensions, { switch (api) { case API_OPENGL_COMPAT: - /* Disable GLSL 1.40 and later for legacy contexts. - * This disallows creation of the GL 3.1 compatibility context. */ + /* Disable higher GLSL versions for legacy contexts. + * This disallows creation of higher compatibility contexts. */ if (!consts->AllowHigherCompatVersion) { - if (consts->GLSLVersion > 130) { -consts->GLSLVersion = 130; + if (consts->GLSLVersion > 140) { +consts->GLSLVersion = 140; } } /* fall through */ @@ -607,7 +607,7 @@ void _mesa_compute_version(struct gl_context *ctx) { if (ctx->Version) - return; + goto done; ctx->Version = _mesa_get_version(&ctx->Extensions, &ctx->Const, ctx->API); ctx->Extensions.Version = ctx->Version; @@ -615,7 +615,7 @@ _mesa_compute_version(struct gl_context *ctx) /* Make sure that the GLSL version lines up with the GL version. In some * cases it can be too high, e.g. if an extension is missing. */ - if (ctx->API == API_OPENGL_CORE) { + if (_mesa_is_desktop_gl(ctx) && ctx->Version >= 31) { switch (ctx->Version) { case 31: ctx->Const.GLSLVersion = 140; @@ -651,6 +651,10 @@ _mesa_compute_version(struct gl_context *ctx) create_version_string(ctx, "OpenGL ES "); break; } + +done: + if (ctx->API == API_OPENGL_COMPAT && ctx->Version >= 31) + ctx->Extensions.ARB_compatibility = GL_TRUE; }
Mesa (master): mesa: expose ARB_enhanced_layouts in the compatibility profile
Module: Mesa Branch: master Commit: b8e2e9e1a1a8419f5292b0b2d9d2bdea2ce1b224 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b8e2e9e1a1a8419f5292b0b2d9d2bdea2ce1b224 Author: Marek Olšák Date: Wed Feb 14 23:42:08 2018 +0100 mesa: expose ARB_enhanced_layouts in the compatibility profile GLSL 1.40 is required. Tested-by: Dieter Nützel Reviewed-by: Brian Paul --- src/mesa/drivers/dri/i965/intel_extensions.c | 3 ++- src/mesa/main/extensions_table.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index cc961e051f..5a6b12e52a 100644 --- a/src/mesa/drivers/dri/i965/intel_extensions.c +++ b/src/mesa/drivers/dri/i965/intel_extensions.c @@ -172,7 +172,8 @@ intelInitExtensions(struct gl_context *ctx) ctx->Extensions.ARB_conditional_render_inverted = true; ctx->Extensions.ARB_cull_distance = true; ctx->Extensions.ARB_draw_buffers_blend = true; - ctx->Extensions.ARB_enhanced_layouts = true; + if (ctx->API != API_OPENGL_COMPAT) + ctx->Extensions.ARB_enhanced_layouts = true; ctx->Extensions.ARB_ES3_compatibility = true; ctx->Extensions.ARB_fragment_layer_viewport = true; ctx->Extensions.ARB_pipeline_statistics_query = true; diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 02c97a242a..71c9a57569 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -60,7 +60,7 @@ EXT(ARB_draw_buffers_blend , ARB_draw_buffers_blend EXT(ARB_draw_elements_base_vertex , ARB_draw_elements_base_vertex , GLL, GLC, x , x , 2009) EXT(ARB_draw_indirect , ARB_draw_indirect , x , GLC, x , x , 2010) EXT(ARB_draw_instanced , ARB_draw_instanced , GLL, GLC, x , x , 2008) -EXT(ARB_enhanced_layouts, ARB_enhanced_layouts , x , GLC, x , x , 2013) +EXT(ARB_enhanced_layouts, ARB_enhanced_layouts , GLL, GLC, x , x , 2013) EXT(ARB_explicit_attrib_location, ARB_explicit_attrib_location , GLL, GLC, x , x , 2009) EXT(ARB_explicit_uniform_location , ARB_explicit_uniform_location , GLL, GLC, x , x , 2012) EXT(ARB_fragment_coord_conventions , ARB_fragment_coord_conventions , GLL, GLC, x , x , 2009) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: add some of missing compatibility support for ARB_bindless_texture
Module: Mesa Branch: master Commit: 1defc973db3266a0ae72097951d12f8d851fed9a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1defc973db3266a0ae72097951d12f8d851fed9a Author: Marek Olšák Date: Wed Feb 14 22:32:59 2018 +0100 mesa: add some of missing compatibility support for ARB_bindless_texture The extension is exposed in the compatibility profile. Tested-by: Dieter Nützel Reviewed-by: Brian Paul --- src/mapi/glapi/gen/apiexec.py | 2 +- src/mesa/main/api_loopback.c | 8 src/mesa/main/vtxfmt.c| 9 + 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py index 7da0818f8a..b5e0ad4a17 100644 --- a/src/mapi/glapi/gen/apiexec.py +++ b/src/mapi/glapi/gen/apiexec.py @@ -291,5 +291,5 @@ functions = { "ProgramUniform4ui64vARB": exec_info(core=31), # GL_ARB_bindless_texture -"GetVertexAttribLui64vARB": exec_info(core=31), +"GetVertexAttribLui64vARB": exec_info(compatibility=30, core=31), } diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index b552d17d6a..4eab8118c7 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -1790,6 +1790,10 @@ _mesa_loopback_init_api_table(const struct gl_context *ctx, SET_VertexAttribI4sv(dest, _mesa_VertexAttribI4sv); SET_VertexAttribI4ubv(dest, _mesa_VertexAttribI4ubv); SET_VertexAttribI4usv(dest, _mesa_VertexAttribI4usv); + + /* GL_ARB_bindless_texture */ + SET_VertexAttribL1ui64ARB(dest, _mesa_VertexAttribL1ui64ARB); + SET_VertexAttribL1ui64vARB(dest, _mesa_VertexAttribL1ui64vARB); } if (ctx->API == API_OPENGL_CORE) { @@ -1803,9 +1807,5 @@ _mesa_loopback_init_api_table(const struct gl_context *ctx, SET_VertexAttribL2dv(dest, _mesa_VertexAttribL2dv); SET_VertexAttribL3dv(dest, _mesa_VertexAttribL3dv); SET_VertexAttribL4dv(dest, _mesa_VertexAttribL4dv); - - /* GL_ARB_bindless_texture */ - SET_VertexAttribL1ui64ARB(dest, _mesa_VertexAttribL1ui64ARB); - SET_VertexAttribL1ui64vARB(dest, _mesa_VertexAttribL1ui64vARB); } } diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 293a385363..61629a40fd 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -205,9 +205,14 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_VertexAttribP2uiv(tab, vfmt->VertexAttribP2uiv); SET_VertexAttribP3uiv(tab, vfmt->VertexAttribP3uiv); SET_VertexAttribP4uiv(tab, vfmt->VertexAttribP4uiv); + + /* GL_ARB_bindless_texture */ + SET_VertexAttribL1ui64ARB(tab, vfmt->VertexAttribL1ui64ARB); + SET_VertexAttribL1ui64vARB(tab, vfmt->VertexAttribL1ui64vARB); } if (ctx->API == API_OPENGL_CORE) { + /* GL_ARB_vertex_attrib_64bit */ SET_VertexAttribL1d(tab, vfmt->VertexAttribL1d); SET_VertexAttribL2d(tab, vfmt->VertexAttribL2d); SET_VertexAttribL3d(tab, vfmt->VertexAttribL3d); @@ -217,10 +222,6 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_VertexAttribL2dv(tab, vfmt->VertexAttribL2dv); SET_VertexAttribL3dv(tab, vfmt->VertexAttribL3dv); SET_VertexAttribL4dv(tab, vfmt->VertexAttribL4dv); - - /* GL_ARB_bindless_texture */ - SET_VertexAttribL1ui64ARB(tab, vfmt->VertexAttribL1ui64ARB); - SET_VertexAttribL1ui64vARB(tab, vfmt->VertexAttribL1ui64vARB); } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: implement ARB_compatibility
Module: Mesa Branch: master Commit: 605a7f6db51cb946eed508bc9a7adfa753c75e10 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=605a7f6db51cb946eed508bc9a7adfa753c75e10 Author: Marek Olšák Date: Wed Feb 14 20:12:51 2018 +0100 mesa: implement ARB_compatibility Tested-by: Dieter Nützel Reviewed-by: Brian Paul --- src/compiler/glsl/builtin_functions.cpp | 2 +- src/compiler/glsl/builtin_types.cpp | 2 +- src/compiler/glsl/builtin_variables.cpp | 2 +- src/compiler/glsl/glsl_parser_extras.cpp | 1 + src/compiler/glsl/glsl_parser_extras.h | 2 ++ src/mesa/main/extensions_table.h | 1 + src/mesa/main/mtypes.h | 1 + 7 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp index 293e8bd638..5f772c9eab 100644 --- a/src/compiler/glsl/builtin_functions.cpp +++ b/src/compiler/glsl/builtin_functions.cpp @@ -104,7 +104,7 @@ static bool compatibility_vs_only(const _mesa_glsl_parse_state *state) { return state->stage == MESA_SHADER_VERTEX && - state->language_version <= 130 && + (state->compat_shader || state->ARB_compatibility_enable) && !state->es_shader; } diff --git a/src/compiler/glsl/builtin_types.cpp b/src/compiler/glsl/builtin_types.cpp index b64f75779b..7a01cb48bc 100644 --- a/src/compiler/glsl/builtin_types.cpp +++ b/src/compiler/glsl/builtin_types.cpp @@ -288,7 +288,7 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state) /* Add deprecated structure types. While these were deprecated in 1.30, * they're still present. We've removed them in 1.40+ (OpenGL 3.1+). */ - if (state->compat_shader) { + if (state->compat_shader || state->ARB_compatibility_enable) { for (unsigned i = 0; i < ARRAY_SIZE(deprecated_types); i++) { add_type(symbols, deprecated_types[i]); } diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp index a686cb6a45..f0210b60bc 100644 --- a/src/compiler/glsl/builtin_variables.cpp +++ b/src/compiler/glsl/builtin_variables.cpp @@ -441,7 +441,7 @@ private: builtin_variable_generator::builtin_variable_generator( exec_list *instructions, struct _mesa_glsl_parse_state *state) : instructions(instructions), state(state), symtab(state->symbols), - compatibility(state->compat_shader || !state->is_version(140, 100)), + compatibility(state->compat_shader || state->ARB_compatibility_enable), bool_t(glsl_type::bool_type), int_t(glsl_type::int_type), uint_t(glsl_type::uint_type), uint64_t(glsl_type::uint64_t_type), diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index d99916d8ad..81d74e92ce 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -616,6 +616,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(ARB_ES3_2_compatibility), EXT(ARB_arrays_of_arrays), EXT(ARB_bindless_texture), + EXT(ARB_compatibility), EXT(ARB_compute_shader), EXT(ARB_compute_variable_group_size), EXT(ARB_conservative_depth), diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h index 508befd460..f88cb78347 100644 --- a/src/compiler/glsl/glsl_parser_extras.h +++ b/src/compiler/glsl/glsl_parser_extras.h @@ -609,6 +609,8 @@ struct _mesa_glsl_parse_state { bool ARB_arrays_of_arrays_warn; bool ARB_bindless_texture_enable; bool ARB_bindless_texture_warn; + bool ARB_compatibility_enable; + bool ARB_compatibility_warn; bool ARB_compute_shader_enable; bool ARB_compute_shader_warn; bool ARB_compute_variable_group_size_enable; diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index f4925ed442..02c97a242a 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -40,6 +40,7 @@ EXT(ARB_clear_buffer_object , dummy_true EXT(ARB_clear_texture , ARB_clear_texture , GLL, GLC, x , x , 2013) EXT(ARB_clip_control, ARB_clip_control , GLL, GLC, x , x , 2014) EXT(ARB_color_buffer_float , ARB_color_buffer_float , GLL, GLC, x , x , 2004) +EXT(ARB_compatibility , ARB_compatibility , GLL, x , x , x , 2009) EXT(ARB_compressed_texture_pixel_storage, dummy_true , GLL, GLC, x , x , 2011) EXT(ARB_compute_shader , ARB_compute_shader , GLL, GLC, x , x , 2012) EXT(ARB_compute_variable_group_size , ARB_compute_variable_group_size , GLL, GLC, x , x , 2013) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 15f39cbacc..62b58cea99 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa
Mesa (master): mesa: replace some API_OPENGL_CORE checks with _mesa_is_desktop_gl
Module: Mesa Branch: master Commit: 1881f41b6c3fe6e68b76c561f33942657b135bc8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1881f41b6c3fe6e68b76c561f33942657b135bc8 Author: Marek Olšák Date: Wed Feb 14 21:19:33 2018 +0100 mesa: replace some API_OPENGL_CORE checks with _mesa_is_desktop_gl This is more accurate with respect to the compatibility profile. Tested-by: Dieter Nützel Reviewed-by: Brian Paul --- src/mesa/main/get.c | 2 +- src/mesa/main/varray.c| 6 +++--- src/mesa/vbo/vbo_attrib_tmp.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 13d5e857ab..7c3b9dd22c 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -2555,7 +2555,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v) case GL_SAMPLER_BINDING: { struct gl_sampler_object *samp; - if (ctx->API != API_OPENGL_CORE) + if (!_mesa_is_desktop_gl(ctx) || ctx->Version < 33) goto invalid_enum; if (index >= _mesa_max_tex_unit(ctx)) goto invalid_value; diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index bcd78373f5..c6cacf426c 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -522,7 +522,7 @@ validate_array(struct gl_context *ctx, const char *func, return; } - if (ctx->API == API_OPENGL_CORE && ctx->Version >= 44 && + if (_mesa_is_desktop_gl(ctx) && ctx->Version >= 44 && stride > ctx->Const.MaxVertexAttribStride) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(stride=%d > " "GL_MAX_VERTEX_ATTRIB_STRIDE)", func, stride); @@ -2166,7 +2166,7 @@ vertex_array_vertex_buffer_err(struct gl_context *ctx, return; } - if (((ctx->API == API_OPENGL_CORE && ctx->Version >= 44) || _mesa_is_gles31(ctx)) && + if (((_mesa_is_desktop_gl(ctx) && ctx->Version >= 44) || _mesa_is_gles31(ctx)) && stride > ctx->Const.MaxVertexAttribStride) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(stride=%d > " "GL_MAX_VERTEX_ATTRIB_STRIDE)", func, stride); @@ -2320,7 +2320,7 @@ vertex_array_vertex_buffers(struct gl_context *ctx, continue; } - if (ctx->API == API_OPENGL_CORE && ctx->Version >= 44 && + if (_mesa_is_desktop_gl(ctx) && ctx->Version >= 44 && strides[i] > ctx->Const.MaxVertexAttribStride) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(strides[%u]=%d > " diff --git a/src/mesa/vbo/vbo_attrib_tmp.h b/src/mesa/vbo/vbo_attrib_tmp.h index fd24e571c7..796b388363 100644 --- a/src/mesa/vbo/vbo_attrib_tmp.h +++ b/src/mesa/vbo/vbo_attrib_tmp.h @@ -150,7 +150,7 @@ static inline float conv_i10_to_norm_float(const struct gl_context *ctx, int i10 * is used in every case. They remove equation 2.2 completely. */ if (_mesa_is_gles3(ctx) || - (ctx->API == API_OPENGL_CORE && ctx->Version >= 42)) { + (_mesa_is_desktop_gl(ctx) && ctx->Version >= 42)) { /* Equation 2.3 above. */ float f = ((float) val.x) / 511.0F; return MAX2(f, -1.0f); @@ -166,7 +166,7 @@ static inline float conv_i2_to_norm_float(const struct gl_context *ctx, int i2) val.x = i2; if (_mesa_is_gles3(ctx) || - (ctx->API == API_OPENGL_CORE && ctx->Version >= 42)) { + (_mesa_is_desktop_gl(ctx) && ctx->Version >= 42)) { /* Equation 2.3 above. */ float f = (float) val.x; return MAX2(f, -1.0f); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: rename has_core_gs -> has_gs in get_programiv
Module: Mesa Branch: master Commit: d169438d8ea8cd3a29d739eb284648a7723961cb URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d169438d8ea8cd3a29d739eb284648a7723961cb Author: Marek Olšák Date: Wed Feb 14 23:21:14 2018 +0100 mesa: rename has_core_gs -> has_gs in get_programiv This is also true for GLES. Tested-by: Dieter Nützel Reviewed-by: Brian Paul --- src/mesa/main/shaderapi.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index d8a3031a38..59089a12b0 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -668,7 +668,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, /* True if geometry shaders (of the form that was adopted into GLSL 1.50 * and GL 3.2) are available in this context */ - const bool has_core_gs = _mesa_has_geometry_shaders(ctx); + const bool has_gs = _mesa_has_geometry_shaders(ctx); const bool has_tess = _mesa_has_tessellation(ctx); /* Are uniform buffer objects available in this context? @@ -769,7 +769,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, *params = shProg->TransformFeedback.BufferMode; return; case GL_GEOMETRY_VERTICES_OUT: - if (!has_core_gs) + if (!has_gs) break; if (check_gs_query(ctx, shProg)) { *params = shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]-> @@ -777,7 +777,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, } return; case GL_GEOMETRY_SHADER_INVOCATIONS: - if (!has_core_gs || !ctx->Extensions.ARB_gpu_shader5) + if (!has_gs || !ctx->Extensions.ARB_gpu_shader5) break; if (check_gs_query(ctx, shProg)) { *params = shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]-> @@ -785,7 +785,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, } return; case GL_GEOMETRY_INPUT_TYPE: - if (!has_core_gs) + if (!has_gs) break; if (check_gs_query(ctx, shProg)) { *params = shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]-> @@ -793,7 +793,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, } return; case GL_GEOMETRY_OUTPUT_TYPE: - if (!has_core_gs) + if (!has_gs) break; if (check_gs_query(ctx, shProg)) { *params = shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]-> ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): swr: remove dead LLVM code paths
Module: Mesa Branch: master Commit: 14a2c87c41946794a4ea4870a160b70c01225c4f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=14a2c87c41946794a4ea4870a160b70c01225c4f Author: Emil Velikov Date: Tue Feb 20 18:01:24 2018 + swr: remove dead LLVM code paths LLVM requirement was bumped to 4.0.0 with earlier commit. Hence any code tailored for older versions is now unreachable. Signed-off-by: Emil Velikov Reviewed-By: George Kyriazis Reviewed-by: Andres Gomez --- .../drivers/swr/rasterizer/jitter/JitManager.cpp | 19 --- .../drivers/swr/rasterizer/jitter/builder_mem.cpp | 5 - src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp | 4 3 files changed, 28 deletions(-) diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp index 8092c14402..ab7c6eb15b 100644 --- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp +++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp @@ -71,11 +71,6 @@ JitManager::JitManager(uint32_t simdWidth, const char *arch, const char* core) tOpts.NoInfsFPMath = false; tOpts.NoNaNsFPMath = false; tOpts.UnsafeFPMath = false; -#if defined(_DEBUG) -#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 7 -tOpts.NoFramePointerElim = true; -#endif -#endif //tOpts.PrintMachineCode= true; @@ -249,15 +244,9 @@ DIType* JitManager::GetDebugType(Type* pTy) switch (id) { case Type::VoidTyID: return builder.createUnspecifiedType("void"); break; -#if LLVM_VERSION_MAJOR >= 4 case Type::HalfTyID: return builder.createBasicType("float16", 16, dwarf::DW_ATE_float); break; case Type::FloatTyID: return builder.createBasicType("float", 32, dwarf::DW_ATE_float); break; case Type::DoubleTyID: return builder.createBasicType("double", 64, dwarf::DW_ATE_float); break; -#else -case Type::HalfTyID: return builder.createBasicType("float16", 16, 0, dwarf::DW_ATE_float); break; -case Type::FloatTyID: return builder.createBasicType("float", 32, 0, dwarf::DW_ATE_float); break; -case Type::DoubleTyID: return builder.createBasicType("double", 64, 0, dwarf::DW_ATE_float); break; -#endif case Type::IntegerTyID: return GetDebugIntegerType(pTy); break; case Type::StructTyID: return GetDebugStructType(pTy); break; case Type::ArrayTyID: return GetDebugArrayType(pTy); break; @@ -294,19 +283,11 @@ DIType* JitManager::GetDebugIntegerType(Type* pTy) IntegerType* pIntTy = cast(pTy); switch (pIntTy->getBitWidth()) { -#if LLVM_VERSION_MAJOR >= 4 case 1: return builder.createBasicType("int1", 1, dwarf::DW_ATE_unsigned); break; case 8: return builder.createBasicType("int8", 8, dwarf::DW_ATE_signed); break; case 16: return builder.createBasicType("int16", 16, dwarf::DW_ATE_signed); break; case 32: return builder.createBasicType("int", 32, dwarf::DW_ATE_signed); break; case 64: return builder.createBasicType("int64", 64, dwarf::DW_ATE_signed); break; -#else -case 1: return builder.createBasicType("int1", 1, 0, dwarf::DW_ATE_unsigned); break; -case 8: return builder.createBasicType("int8", 8, 0, dwarf::DW_ATE_signed); break; -case 16: return builder.createBasicType("int16", 16, 0, dwarf::DW_ATE_signed); break; -case 32: return builder.createBasicType("int", 32, 0, dwarf::DW_ATE_signed); break; -case 64: return builder.createBasicType("int64", 64, 0, dwarf::DW_ATE_signed); break; -#endif default: SWR_ASSERT(false, "Unimplemented integer bit width"); } return nullptr; diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp index f7d0402a3d..3bba6ff04f 100644 --- a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp +++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp @@ -117,12 +117,7 @@ namespace SwrJit } else { -// maskload intrinsic expects integer mask operand in llvm >= 3.8 -#if (LLVM_VERSION_MAJOR > 3) || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8) mask = BITCAST(mask, VectorType::get(mInt32Ty, mVWidth)); -#else -mask = BITCAST(mask, VectorType::get(mFP32Ty, mVWidth)); -#endif Function *func = Intrinsic::getDeclaration(JM()->mpCurrentModule, Intrinsic::x86_avx_maskload_ps_256); vResult = BITCAST(CALL(func, { src,mask }), VectorType::get(mInt32Ty, mVWidth)); } diff --git a/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp b/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp index 53c03214aa..031bced8a0 100644 --- a/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp +++ b/src/gallium/drivers/swr/rasterizer/jitter/jit_pch.hpp @@ -105,12 +105,8 @@ using PassManager = llvm::legacy::PassManager; #include "llvm/Support/MemoryBuffer.h" #include "llvm/Config/llvm-config.h" -#if LLVM_VER
Mesa (18.0): i965: Support 0 ARB_get_program_binary formats for compat profiles
Module: Mesa Branch: 18.0 Commit: 719f2c934030f74ce0a4892233f494f168852698 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=719f2c934030f74ce0a4892233f494f168852698 Author: Jordan Justen Date: Wed Feb 14 23:42:50 2018 -0800 i965: Support 0 ARB_get_program_binary formats for compat profiles The QT framework has a bug in their shader program cache, which is built on GL_ARB_get_program_binary. To give QT and distributions time to fix the bug and roll the fix out to users, for the 18.0 release we will advertise support for 0 binary formats for compatibility profiles. This is only being done on the 18.0 release branch. Ref: https://bugreports.qt.io/browse/QTBUG-66420 Ref: https://bugs.freedesktop.org/show_bug.cgi?id=105065 Cc: "18.0" Signed-off-by: Jordan Justen Tested-by: Scott D Phillips Reviewed-by: Scott D Phillips --- docs/relnotes/17.4.0.html | 4 +++- src/mesa/drivers/dri/i965/brw_context.c | 9 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/relnotes/17.4.0.html b/docs/relnotes/17.4.0.html index 412c0fc455..f3ab46ad87 100644 --- a/docs/relnotes/17.4.0.html +++ b/docs/relnotes/17.4.0.html @@ -53,7 +53,9 @@ Note: some of the new features are only available with certain drivers. GL_ARB_enhanced_layouts on r600/evergreen+ GL_ARB_bindless_texture on nvc0/kepler OpenGL 4.3 on r600/evergreen with hw fp64 support -Support 1 binary format for GL_ARB_get_program_binary on i965 +Support 1 binary format for GL_ARB_get_program_binary on i965. +(For the 18.0 release, 0 formats continue to be supported in +compatibility profiles.) Bug fixes diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index e9358b7bc9..58527d7726 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -704,7 +704,14 @@ brw_initialize_context_constants(struct brw_context *brw) ctx->Const.AllowMappedBuffersDuringExecution = true; /* GL_ARB_get_program_binary */ - ctx->Const.NumProgramBinaryFormats = 1; + /* The QT framework has a bug in their shader program cache, which is built +* on GL_ARB_get_program_binary. In an effort to allow them to fix the bug +* we don't enable more than 1 binary format for compatibility profiles. +* This is only being done on the 18.0 release branch. +*/ + if (ctx->API != API_OPENGL_COMPAT) { + ctx->Const.NumProgramBinaryFormats = 1; + } } static void ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): broadcom/vc4: Allow importing linear BOs with arbitrary offset/stride.
Module: Mesa Branch: master Commit: 0c1dd9dee0da6cde3031558a8e24a1fc400e0f99 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0c1dd9dee0da6cde3031558a8e24a1fc400e0f99 Author: Eric Anholt Date: Tue Feb 6 17:42:44 2018 + broadcom/vc4: Allow importing linear BOs with arbitrary offset/stride. This is part of supporting YUV textures -- MMAL will be handing us a single GEM BO with the planes at offsets within it, and MMAL-decided stride. --- src/gallium/drivers/vc4/vc4_resource.c | 33 + 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c index cdcbcc917e..202f62c8f0 100644 --- a/src/gallium/drivers/vc4/vc4_resource.c +++ b/src/gallium/drivers/vc4/vc4_resource.c @@ -708,13 +708,6 @@ vc4_resource_from_handle(struct pipe_screen *pscreen, if (!rsc) return NULL; -if (whandle->offset != 0) { -fprintf(stderr, -"Attempt to import unsupported winsys offset %u\n", -whandle->offset); -return NULL; -} - switch (whandle->type) { case DRM_API_HANDLE_TYPE_SHARED: rsc->bo = vc4_bo_open_name(screen, @@ -766,6 +759,28 @@ vc4_resource_from_handle(struct pipe_screen *pscreen, rsc->vc4_format = get_resource_texture_format(prsc); vc4_setup_slices(rsc, "import"); +if (whandle->offset != 0) { +if (rsc->tiled) { +fprintf(stderr, +"Attempt to import unsupported " +"winsys offset %u\n", +whandle->offset); +goto fail; +} + +rsc->slices[0].offset += whandle->offset; + +if (rsc->slices[0].offset + rsc->slices[0].size > +rsc->bo->size) { +fprintf(stderr, "Attempt to import " +"with overflowing offset (%d + %d > %d)\n", +whandle->offset, +rsc->slices[0].size, +rsc->bo->size); +goto fail; +} +} + if (screen->ro) { /* Make sure that renderonly has a handle to our buffer in the * display's fd, so that a later renderonly_get_handle() @@ -779,7 +794,7 @@ vc4_resource_from_handle(struct pipe_screen *pscreen, goto fail; } -if (whandle->stride != slice->stride) { +if (rsc->tiled && whandle->stride != slice->stride) { static bool warned = false; if (!warned) { warned = true; @@ -792,6 +807,8 @@ vc4_resource_from_handle(struct pipe_screen *pscreen, slice->stride); } goto fail; +} else if (!rsc->tiled) { +slice->stride = whandle->stride; } return prsc; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): broadcom/vc4: Add pipe_reference debugging for vc4_bos.
Module: Mesa Branch: master Commit: 6deb158ec1e03027d855df6a2513c8595ed95924 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6deb158ec1e03027d855df6a2513c8595ed95924 Author: Eric Anholt Date: Tue Feb 20 16:05:29 2018 + broadcom/vc4: Add pipe_reference debugging for vc4_bos. Trying to track down the YUV EGLImage use-after-free, it helps to see what the mystery objects are that are being refcounted. --- src/gallium/drivers/vc4/vc4_bufmgr.c | 10 +- src/gallium/drivers/vc4/vc4_bufmgr.h | 19 +++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.c b/src/gallium/drivers/vc4/vc4_bufmgr.c index 274c4c3120..54f9d9c264 100644 --- a/src/gallium/drivers/vc4/vc4_bufmgr.c +++ b/src/gallium/drivers/vc4/vc4_bufmgr.c @@ -30,6 +30,7 @@ #include "util/u_hash_table.h" #include "util/u_memory.h" +#include "util/u_string.h" #include "util/ralloc.h" #include "vc4_context.h" @@ -49,6 +50,13 @@ static void vc4_bo_cache_free_all(struct vc4_bo_cache *cache); void +vc4_bo_debug_describe(char* buf, const struct vc4_bo *ptr) +{ + util_sprintf(buf, "vc4_bo<%s,%u,%u>", ptr->name ? ptr->name : "?", +ptr->handle, ptr->size); +} + +void vc4_bo_label(struct vc4_screen *screen, struct vc4_bo *bo, const char *fmt, ...) { /* Perform BO labeling by default on debug builds (so that you get @@ -389,7 +397,7 @@ vc4_bo_open_handle(struct vc4_screen *screen, bo = util_hash_table_get(screen->bo_handles, (void*)(uintptr_t)handle); if (bo) { -pipe_reference(NULL, &bo->reference); +vc4_bo_reference(bo); goto done; } diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.h b/src/gallium/drivers/vc4/vc4_bufmgr.h index ecd0daa7c7..9fa4774427 100644 --- a/src/gallium/drivers/vc4/vc4_bufmgr.h +++ b/src/gallium/drivers/vc4/vc4_bufmgr.h @@ -73,10 +73,13 @@ struct vc4_bo *vc4_bo_open_dmabuf(struct vc4_screen *screen, int fd, bool vc4_bo_flink(struct vc4_bo *bo, uint32_t *name); int vc4_bo_get_dmabuf(struct vc4_bo *bo); +void vc4_bo_debug_describe(char* buf, const struct vc4_bo *ptr); static inline struct vc4_bo * vc4_bo_reference(struct vc4_bo *bo) { -pipe_reference(NULL, &bo->reference); +pipe_reference_described(NULL, &bo->reference, + (debug_reference_descriptor) + vc4_bo_debug_describe); return bo; } @@ -89,13 +92,18 @@ vc4_bo_unreference(struct vc4_bo **bo) if ((*bo)->private) { /* Avoid the mutex for private BOs */ -if (pipe_reference(&(*bo)->reference, NULL)) +if (pipe_reference_described(&(*bo)->reference, NULL, + (debug_reference_descriptor) + vc4_bo_debug_describe)) { vc4_bo_last_unreference(*bo); +} } else { screen = (*bo)->screen; mtx_lock(&screen->bo_handles_mutex); -if (pipe_reference(&(*bo)->reference, NULL)) { +if (pipe_reference_described(&(*bo)->reference, NULL, + (debug_reference_descriptor) + vc4_bo_debug_describe)) { util_hash_table_remove(screen->bo_handles, (void *)(uintptr_t)(*bo)->handle); vc4_bo_last_unreference(*bo); @@ -113,8 +121,11 @@ vc4_bo_unreference_locked_timed(struct vc4_bo **bo, time_t time) if (!*bo) return; -if (pipe_reference(&(*bo)->reference, NULL)) +if (pipe_reference_described(&(*bo)->reference, NULL, + (debug_reference_descriptor) + vc4_bo_debug_describe)) { vc4_bo_last_unreference_locked_timed(*bo, time); +} *bo = NULL; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): broadcom/vc4: Add support for YUV textures using unaccelerated blits.
Module: Mesa Branch: master Commit: bc3d16e633fd27b05dfdcda0b7efb000b2c35ed6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bc3d16e633fd27b05dfdcda0b7efb000b2c35ed6 Author: Eric Anholt Date: Thu Feb 22 17:43:21 2018 -0800 broadcom/vc4: Add support for YUV textures using unaccelerated blits. Previously we would assertion fail about having no hardware format. This is enough to get kmscube -M nv12-2img working. --- src/gallium/drivers/vc4/vc4_blit.c | 29 + src/gallium/drivers/vc4/vc4_resource.c | 6 -- src/gallium/drivers/vc4/vc4_state.c| 3 ++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/vc4/vc4_blit.c b/src/gallium/drivers/vc4/vc4_blit.c index 7f4c76968e..f23f74c8f1 100644 --- a/src/gallium/drivers/vc4/vc4_blit.c +++ b/src/gallium/drivers/vc4/vc4_blit.c @@ -184,6 +184,32 @@ vc4_blitter_save(struct vc4_context *vc4) } static bool +vc4_yuv_blit(struct pipe_context *pctx, const struct pipe_blit_info *info) +{ +struct vc4_resource *src = vc4_resource(info->src.resource); +struct vc4_resource *dst = vc4_resource(info->dst.resource); +bool ok; + +if (src->tiled) +return false; +if (src->base.format != PIPE_FORMAT_R8_UNORM && +src->base.format != PIPE_FORMAT_R8G8_UNORM) +return false; + +/* YUV blits always turn raster-order to tiled */ +assert(dst->base.format == src->base.format); +assert(dst->tiled); + +/* Do an immediate SW fallback, since the render blit path + * would just recurse. + */ +ok = util_try_blit_via_copy_region(pctx, info); +assert(ok); (void)ok; + +return true; +} + +static bool vc4_render_blit(struct pipe_context *ctx, struct pipe_blit_info *info) { struct vc4_context *vc4 = vc4_context(ctx); @@ -218,6 +244,9 @@ vc4_blit(struct pipe_context *pctx, const struct pipe_blit_info *blit_info) { struct pipe_blit_info info = *blit_info; +if (vc4_yuv_blit(pctx, blit_info)) +return; + if (vc4_tile_blit(pctx, blit_info)) return; diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c index 202f62c8f0..eee17472fc 100644 --- a/src/gallium/drivers/vc4/vc4_resource.c +++ b/src/gallium/drivers/vc4/vc4_resource.c @@ -564,8 +564,10 @@ get_resource_texture_format(struct pipe_resource *prsc) if (prsc->nr_samples > 1) { return ~0; } else { -assert(format == VC4_TEXTURE_TYPE_RGBA); -return VC4_TEXTURE_TYPE_RGBA32R; +if (format == VC4_TEXTURE_TYPE_RGBA) +return VC4_TEXTURE_TYPE_RGBA32R; +else +return ~0; } } diff --git a/src/gallium/drivers/vc4/vc4_state.c b/src/gallium/drivers/vc4/vc4_state.c index 7bc87b0c4e..c85618789a 100644 --- a/src/gallium/drivers/vc4/vc4_state.c +++ b/src/gallium/drivers/vc4/vc4_state.c @@ -581,7 +581,8 @@ vc4_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc, */ if ((cso->u.tex.first_level && (cso->u.tex.first_level != cso->u.tex.last_level)) || -rsc->vc4_format == VC4_TEXTURE_TYPE_RGBA32R) { +rsc->vc4_format == VC4_TEXTURE_TYPE_RGBA32R || +rsc->vc4_format == ~0) { struct vc4_resource *shadow_parent = rsc; struct pipe_resource tmpl = { .target = prsc->target, ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): broadcom/vc4: Ignore PIPE_BIND_DISPLAY_TARGET in is_format_supported().
Module: Mesa Branch: master Commit: 978b884afc1ab07f3c74e0f11a55cde86baa79b1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=978b884afc1ab07f3c74e0f11a55cde86baa79b1 Author: Eric Anholt Date: Thu Feb 22 17:38:50 2018 -0800 broadcom/vc4: Ignore PIPE_BIND_DISPLAY_TARGET in is_format_supported(). We were failing the retval == usage check at the end. Fixes: f7604d8af521 ("st/dri: only expose config formats that are display targets") --- src/gallium/drivers/vc4/vc4_screen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c index e341211f5b..5339864f7f 100644 --- a/src/gallium/drivers/vc4/vc4_screen.c +++ b/src/gallium/drivers/vc4/vc4_screen.c @@ -550,6 +550,8 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen, retval |= PIPE_BIND_INDEX_BUFFER; } +retval |= usage & PIPE_BIND_DISPLAY_TARGET; + #if 0 if (retval != usage) { fprintf(stderr, ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): broadcom/vc4: Use pipe_resource_reference in sampler views.
Module: Mesa Branch: master Commit: a49738290c01a8e7db6d4053b1ab5c13e685c1bc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a49738290c01a8e7db6d4053b1ab5c13e685c1bc Author: Eric Anholt Date: Wed Feb 7 11:16:12 2018 + broadcom/vc4: Use pipe_resource_reference in sampler views. Improves u_debug_refcount output. --- src/gallium/drivers/vc4/vc4_state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/vc4/vc4_state.c b/src/gallium/drivers/vc4/vc4_state.c index ed8d404a4f..b4696ed798 100644 --- a/src/gallium/drivers/vc4/vc4_state.c +++ b/src/gallium/drivers/vc4/vc4_state.c @@ -567,8 +567,8 @@ vc4_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc, so->base = *cso; -pipe_reference(NULL, &prsc->reference); -so->base.texture = prsc; +so->base.texture = NULL; +pipe_resource_reference(&so->base.texture, prsc); so->base.reference.count = 1; so->base.context = pctx; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): broadcom/vc4: Remove dead vc4_bo_set_reference().
Module: Mesa Branch: master Commit: 34ea1aca92ce20a95e4f5d41325fb965a2b96986 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=34ea1aca92ce20a95e4f5d41325fb965a2b96986 Author: Eric Anholt Date: Tue Feb 20 15:59:10 2018 + broadcom/vc4: Remove dead vc4_bo_set_reference(). It would be broken if NULL was passed to it anyway, since it wouldn't participate in screen->bo_handles management. --- src/gallium/drivers/vc4/vc4_bufmgr.h | 8 1 file changed, 8 deletions(-) diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.h b/src/gallium/drivers/vc4/vc4_bufmgr.h index e0f6bbcfd8..ecd0daa7c7 100644 --- a/src/gallium/drivers/vc4/vc4_bufmgr.h +++ b/src/gallium/drivers/vc4/vc4_bufmgr.h @@ -73,14 +73,6 @@ struct vc4_bo *vc4_bo_open_dmabuf(struct vc4_screen *screen, int fd, bool vc4_bo_flink(struct vc4_bo *bo, uint32_t *name); int vc4_bo_get_dmabuf(struct vc4_bo *bo); -static inline void -vc4_bo_set_reference(struct vc4_bo **old_bo, struct vc4_bo *new_bo) -{ -if (pipe_reference(&(*old_bo)->reference, &new_bo->reference)) -vc4_bo_last_unreference(*old_bo); -*old_bo = new_bo; -} - static inline struct vc4_bo * vc4_bo_reference(struct vc4_bo *bo) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): broadcom/vc4: Fix double-unrefcounting of prsc->next with shadows.
Module: Mesa Branch: master Commit: c824a045ea639b8a93cbc2518b16900402d9150f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c824a045ea639b8a93cbc2518b16900402d9150f Author: Eric Anholt Date: Tue Feb 20 16:28:07 2018 + broadcom/vc4: Fix double-unrefcounting of prsc->next with shadows. When we set up the shadow resource we were copying the original resource as the template, including its prsc->next field. When we shadowed the first YUV plane's resource for linear-to-tiled conversion, we would end up unbalancing the refcount on the shadow resource's destruction. --- src/gallium/drivers/vc4/vc4_state.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/vc4/vc4_state.c b/src/gallium/drivers/vc4/vc4_state.c index b4696ed798..7bc87b0c4e 100644 --- a/src/gallium/drivers/vc4/vc4_state.c +++ b/src/gallium/drivers/vc4/vc4_state.c @@ -583,12 +583,17 @@ vc4_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc, (cso->u.tex.first_level != cso->u.tex.last_level)) || rsc->vc4_format == VC4_TEXTURE_TYPE_RGBA32R) { struct vc4_resource *shadow_parent = rsc; -struct pipe_resource tmpl = *prsc; - -tmpl.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET; -tmpl.width0 = u_minify(tmpl.width0, cso->u.tex.first_level); -tmpl.height0 = u_minify(tmpl.height0, cso->u.tex.first_level); -tmpl.last_level = cso->u.tex.last_level - cso->u.tex.first_level; +struct pipe_resource tmpl = { +.target = prsc->target, +.format = prsc->format, +.width0 = u_minify(prsc->width0, + cso->u.tex.first_level), +.height0 = u_minify(prsc->height0, +cso->u.tex.first_level), +.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET, +.last_level = cso->u.tex.last_level - cso->u.tex.first_level, +.nr_samples = prsc->nr_samples, +}; /* Create the shadow texture. The rest of the texture * parameter setup will use the shadow. ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): broadcom/vc4: Remove the retval==usage check in is_format_supported().
Module: Mesa Branch: master Commit: 5980a41c0f3481aef2a4bc644d8a3a6c8618da46 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5980a41c0f3481aef2a4bc644d8a3a6c8618da46 Author: Eric Anholt Date: Thu Feb 22 17:52:03 2018 -0800 broadcom/vc4: Remove the retval==usage check in is_format_supported(). This got us into trouble recently, so just remove it entirely. --- src/gallium/drivers/vc4/vc4_screen.c | 39 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c index 5339864f7f..5b944bf030 100644 --- a/src/gallium/drivers/vc4/vc4_screen.c +++ b/src/gallium/drivers/vc4/vc4_screen.c @@ -464,7 +464,6 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen, unsigned usage) { struct vc4_screen *screen = vc4_screen(pscreen); -unsigned retval = 0; if (sample_count > 1 && sample_count != VC4_MAX_SAMPLES) return FALSE; @@ -520,48 +519,36 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen, case PIPE_FORMAT_R8G8B8_SSCALED: case PIPE_FORMAT_R8G8_SSCALED: case PIPE_FORMAT_R8_SSCALED: -retval |= PIPE_BIND_VERTEX_BUFFER; break; default: -break; +return FALSE; } } if ((usage & PIPE_BIND_RENDER_TARGET) && -vc4_rt_format_supported(format)) { -retval |= PIPE_BIND_RENDER_TARGET; +!vc4_rt_format_supported(format)) { +return FALSE; } if ((usage & PIPE_BIND_SAMPLER_VIEW) && -vc4_tex_format_supported(format) && -(format != PIPE_FORMAT_ETC1_RGB8 || screen->has_etc1)) { -retval |= PIPE_BIND_SAMPLER_VIEW; +(!vc4_tex_format_supported(format) || + (format == PIPE_FORMAT_ETC1_RGB8 && !screen->has_etc1))) { +return FALSE; } if ((usage & PIPE_BIND_DEPTH_STENCIL) && -(format == PIPE_FORMAT_S8_UINT_Z24_UNORM || - format == PIPE_FORMAT_X8Z24_UNORM)) { -retval |= PIPE_BIND_DEPTH_STENCIL; +format != PIPE_FORMAT_S8_UINT_Z24_UNORM && +format != PIPE_FORMAT_X8Z24_UNORM) { +return FALSE; } if ((usage & PIPE_BIND_INDEX_BUFFER) && -(format == PIPE_FORMAT_I8_UINT || - format == PIPE_FORMAT_I16_UINT)) { -retval |= PIPE_BIND_INDEX_BUFFER; -} - -retval |= usage & PIPE_BIND_DISPLAY_TARGET; - -#if 0 -if (retval != usage) { -fprintf(stderr, -"not supported: format=%s, target=%d, sample_count=%d, " -"usage=0x%x, retval=0x%x\n", util_format_name(format), -target, sample_count, usage, retval); +format != PIPE_FORMAT_I8_UINT && +format != PIPE_FORMAT_I16_UINT) { +return FALSE; } -#endif -return retval == usage; +return TRUE; } static void ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): etnaviv: fix in-place resolve tile count
Module: Mesa Branch: master Commit: 8df11f3fad52507266ca1e97149fd4175ad05471 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8df11f3fad52507266ca1e97149fd4175ad05471 Author: Lucas Stach Date: Mon Feb 5 18:59:48 2018 +0100 etnaviv: fix in-place resolve tile count TS tiles map to a fixed amount of bytes in the color/depth surface, so the blocksize of the format needs to be taken into account when calculating the number of tiles to fill. The simplest fix is to just use the layer stride, which is the surface size in bytes. Signed-off-by: Lucas Stach --- src/gallium/drivers/etnaviv/etnaviv_rs.c | 5 +++-- src/gallium/drivers/etnaviv/etnaviv_rs.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_rs.c b/src/gallium/drivers/etnaviv/etnaviv_rs.c index 7d9e8e0e38..bd40cebb53 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_rs.c +++ b/src/gallium/drivers/etnaviv/etnaviv_rs.c @@ -149,7 +149,7 @@ etna_compile_rs_state(struct etna_context *ctx, struct compiled_rs_state *cs, !rs->swap_rb && !rs->flip && !rs->clear_mode && rs->source_padded_width) { /* Total number of tiles (same as for autodisable) */ - cs->RS_KICKER_INPLACE = rs->source_padded_width * rs->source_padded_height / 16; + cs->RS_KICKER_INPLACE = rs->tile_count; } cs->source_ts_valid = rs->source_ts_valid; } @@ -725,7 +725,8 @@ etna_try_rs_blit(struct pipe_context *pctx, .dither = {0x, 0x}, // XXX dither when going from 24 to 16 bit? .clear_mode = VIVS_RS_CLEAR_CONTROL_MODE_DISABLED, .width = width, - .height = height + .height = height, + .tile_count = src_lev->layer_stride / 64 }); etna_submit_rs_state(ctx, ©_to_screen); diff --git a/src/gallium/drivers/etnaviv/etnaviv_rs.h b/src/gallium/drivers/etnaviv/etnaviv_rs.h index e71dfa0b8a..125a13a9ad 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_rs.h +++ b/src/gallium/drivers/etnaviv/etnaviv_rs.h @@ -56,6 +56,7 @@ struct rs_state { uint32_t clear_bits; uint32_t clear_mode; /* VIVS_RS_CLEAR_CONTROL_MODE_XXX */ uint32_t clear_value[4]; + uint32_t tile_count; uint8_t aa; uint8_t endian_mode; /* ENDIAN_MODE_XXX */ }; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): etnaviv: add debug switch to disable single buffer feature
Module: Mesa Branch: master Commit: 8befc11186275bc33221b94fb4be35b7be7c4efc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8befc11186275bc33221b94fb4be35b7be7c4efc Author: Lucas Stach Date: Mon Feb 5 15:36:34 2018 +0100 etnaviv: add debug switch to disable single buffer feature This feature has caused some trouble already. Add a debug switch to allow users to quickly check if a specific issue is caused by this feature. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner --- src/gallium/drivers/etnaviv/etnaviv_debug.h | 1 + src/gallium/drivers/etnaviv/etnaviv_screen.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/gallium/drivers/etnaviv/etnaviv_debug.h b/src/gallium/drivers/etnaviv/etnaviv_debug.h index f47dffe590..4051e95dd5 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_debug.h +++ b/src/gallium/drivers/etnaviv/etnaviv_debug.h @@ -52,6 +52,7 @@ #define ETNA_DBG_ZERO0x20 /* Zero all resources after allocation */ #define ETNA_DBG_DRAW_STALL 0x40 /* Stall FE/PE after every draw op */ #define ETNA_DBG_SHADERDB0x80 /* dump program compile information */ +#define ETNA_DBG_NO_SINGLEBUF0x100 /* disable single buffer feature */ extern int etna_mesa_debug; /* set in etna_screen.c from ETNA_DEBUG */ diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index 3dd628bd9b..f589bd44ea 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -68,6 +68,7 @@ static const struct debug_named_value debug_options[] = { {"zero", ETNA_DBG_ZERO, "Zero all resources after allocation"}, {"draw_stall", ETNA_DBG_DRAW_STALL, "Stall FE/PE after each rendered primitive"}, {"shaderdb", ETNA_DBG_SHADERDB, "Enable shaderdb output"}, + {"no_singlebuffer",ETNA_DBG_NO_SINGLEBUF, "Disable single buffer feature"}, DEBUG_NAMED_VALUE_END }; @@ -963,6 +964,8 @@ etna_screen_create(struct etna_device *dev, struct etna_gpu *gpu, screen->features[viv_chipMinorFeatures1] &= ~chipMinorFeatures1_AUTO_DISABLE; if (DBG_ENABLED(ETNA_DBG_NO_SUPERTILE)) screen->specs.can_supertile = 0; + if (DBG_ENABLED(ETNA_DBG_NO_SINGLEBUF)) + screen->specs.single_buffer = 0; pscreen->destroy = etna_screen_destroy; pscreen->get_param = etna_screen_get_param; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): etnaviv: switch magic single buffer state to "3"
Module: Mesa Branch: master Commit: add23b59c9c1e7a162e76c885d1f8763807bc157 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=add23b59c9c1e7a162e76c885d1f8763807bc157 Author: Lucas Stach Date: Mon Feb 5 18:56:09 2018 +0100 etnaviv: switch magic single buffer state to "3" Some of the 16bit formats misrender with missing tiles with the current "2" state. As all the previously working formats also work with the "3" state, just always use that one. Signed-off-by: Lucas Stach --- src/gallium/drivers/etnaviv/etnaviv_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c index e4ad0f62f1..87ba10b0dc 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_state.c +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c @@ -323,7 +323,7 @@ etna_set_framebuffer_state(struct pipe_context *pctx, * one per color buffer / depth buffer. To keep the logic simple always use * single buffer when this feature is available. */ - cs->PE_LOGIC_OP = VIVS_PE_LOGIC_OP_SINGLE_BUFFER(ctx->specs.single_buffer ? 2 : 0); + cs->PE_LOGIC_OP = VIVS_PE_LOGIC_OP_SINGLE_BUFFER(ctx->specs.single_buffer ? 3 : 0); ctx->framebuffer_s = *sv; /* keep copy of original structure */ ctx->dirty |= ETNA_DIRTY_FRAMEBUFFER | ETNA_DIRTY_DERIVE_TS; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): meson: Fix GL and EGL pkg-config files with glvnd
Module: Mesa Branch: master Commit: 5c460337fd9c1096dea4bc569bd876a112ed6f16 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5c460337fd9c1096dea4bc569bd876a112ed6f16 Author: Dylan Baker Date: Tue Feb 20 10:36:44 2018 -0800 meson: Fix GL and EGL pkg-config files with glvnd Currently meson will generate a pkg-config that links to EGL_mesa (or GLX_mesa), but this isn't correct, it should always link to EGL or GL. Probably the "right" solution is to have glvnd itself provide the pkg config files for GL and EGL, but that also means that glvnd needs to provide many of the header files, which makes it a more involved job. Fixes: a47c525f3281a27 ("meson: build glx") Fixes: 035ec7a2bb2d5e4 ("meson: Add support for EGL glvnd") Signed-off-by: Dylan Baker Reviewed-by: Daniel Stone --- src/egl/meson.build | 12 +++- src/meson.build | 11 ++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/egl/meson.build b/src/egl/meson.build index cf9320aecb..abf6085573 100644 --- a/src/egl/meson.build +++ b/src/egl/meson.build @@ -174,11 +174,21 @@ libegl = shared_library( version : egl_lib_version, ) +# If using glvnd the pkg-config header should not point to EGL_mesa, it should +# point to EGL. glvnd is only available on unix like platforms so adding -l +# should be safe here +# TODO: in the glvnd case glvnd itself should really be providing this. +if with_glvnd + _egl = '-L${libdir} -lEGL' +else + _egl = libegl +endif + pkg.generate( name : 'egl', description : 'Mesa EGL Library', version : meson.project_version(), - libraries : libegl, + libraries : _egl, libraries_private: gl_priv_libs, requires_private : gl_priv_reqs, extra_cflags : gl_pkgconfig_c_flags, diff --git a/src/meson.build b/src/meson.build index 4d5637f0aa..b2c045fce1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -82,6 +82,15 @@ if with_gallium subdir('gallium') endif +# If using glvnd the pkg-config header should not point to GL_mesa, it should +# point to GL. glvnd is only available on unix like platforms so adding -l +# should be safe here +# TODO: in the glvnd case glvnd itself should really be providing this. +if with_glvnd + _gl = '-L${libdir} -lGL' +else + _gl = libgl +endif # This must be after at least mesa, glx, and gallium, since libgl will be # defined in one of those subdirs depending on the glx provider. if with_glx != 'disabled' @@ -89,7 +98,7 @@ if with_glx != 'disabled' name : 'gl', description : 'Mesa OpenGL Library', version : meson.project_version(), -libraries : libgl, +libraries : _gl, libraries_private : gl_priv_libs, requires_private : gl_priv_reqs, variables : ['glx_tls=yes'], ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): egl/dri2: fix segfault when display initialisation fails
Module: Mesa Branch: master Commit: 6160bf97db8bc493512795b1fa49c072a703df50 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6160bf97db8bc493512795b1fa49c072a703df50 Author: Frank Binns Date: Thu Feb 22 13:37:54 2018 + egl/dri2: fix segfault when display initialisation fails dri2_display_destroy() is called when platform specific display initialisation fails. However, this would typically lead to a segfault due to the dri2_egl_display vbtl not having been set up. Fixes: 2db95482964 ("loader_dri3/glx/egl: Optionally use a blit context for blitting operations") Signed-off-by: Frank Binns Reviewed-by: Eric Engestrom Reviewed-by: Emil Velikov --- src/egl/drivers/dri2/egl_dri2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 17b646e7ed..c06a0ca099 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -973,7 +973,7 @@ dri2_display_destroy(_EGLDisplay *disp) struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); if (dri2_dpy->own_dri_screen) { - if (dri2_dpy->vtbl->close_screen_notify) + if (dri2_dpy->vtbl && dri2_dpy->vtbl->close_screen_notify) dri2_dpy->vtbl->close_screen_notify(disp); dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: add missing RGB9_E5 format in _mesa_base_fbo_format
Module: Mesa Branch: master Commit: e1623b303ccc7a880e34bddef7231dcf230826b3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e1623b303ccc7a880e34bddef7231dcf230826b3 Author: Juan A. Suarez Romero Date: Mon Jan 15 10:58:50 2018 + mesa: add missing RGB9_E5 format in _mesa_base_fbo_format RGB9_E5 should be accepted by RenderbufferStorage if the EXT_texture_shared_exponent is exposed. It is left to the implementations to return GL_FRAMEBUFFER_UNSUPPORTED_EXT when checking the framebuffer completeness if they do not support rendering in this format. Discussed in: https://github.com/KhronosGroup/OpenGL-API/issues/32 This fixes KHR-GL45.internalformat.renderbuffer.rgb9_e5 v2: Added more info to the commit message (Antia) Reviewed-by: Kenneth Graunke Reviewed-by: Antia Puentes --- src/mesa/main/fbobject.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index d23916d1ad..c72204e11a 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1976,6 +1976,9 @@ _mesa_base_fbo_format(const struct gl_context *ctx, GLenum internalFormat) ctx->Extensions.ARB_texture_float) || _mesa_is_gles3(ctx) /* EXT_color_buffer_float */ ) ? GL_RGBA : 0; + case GL_RGB9_E5: + return (_mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_shared_exponent) + ? GL_RGB: 0; case GL_ALPHA16F_ARB: case GL_ALPHA32F_ARB: return ctx->API == API_OPENGL_COMPAT && ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): etnaviv: npot_tex_any_wrap needs one bit only
Module: Mesa Branch: master Commit: e72062b66d9b646c0df269da5982b26237a77fab URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e72062b66d9b646c0df269da5982b26237a77fab Author: Christian Gmeiner Date: Tue Feb 20 20:47:18 2018 +0100 etnaviv: npot_tex_any_wrap needs one bit only Reduces size of struct etna_specs from 100 to 94 bytes. Signed-off-by: Christian Gmeiner Reviewed-by: Lucas Stach --- src/gallium/drivers/etnaviv/etnaviv_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_internal.h b/src/gallium/drivers/etnaviv/etnaviv_internal.h index b8d2186433..3424d8a771 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_internal.h +++ b/src/gallium/drivers/etnaviv/etnaviv_internal.h @@ -87,7 +87,7 @@ struct etna_specs { /* has BLT engine instead of RS */ unsigned use_blt : 1; /* can use any kind of wrapping mode on npot textures */ - unsigned npot_tex_any_wrap; + unsigned npot_tex_any_wrap : 1; /* number of bits per TS tile */ unsigned bits_per_tile; /* clear value for TS (dependent on bits_per_tile) */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit