Merge Mesa 20.1.7

This commit is contained in:
jsg 2020-09-03 07:17:20 +00:00
parent 7fa385c847
commit 1c86a17858
48 changed files with 539 additions and 131 deletions

View File

@ -1 +1 @@
20.1.6
20.1.7

View File

@ -228,7 +228,7 @@ void radv_fill_device_extension_table(const struct radv_physical_device *device,
struct radv_device_extension_table* table)
{
const struct radv_instance *instance = device->instance;
table->ANDROID_external_memory_android_hardware_buffer = (!ANDROID || ANDROID_API_LEVEL >= 28) && ((RADV_SUPPORT_ANDROID_HARDWARE_BUFFER && device->rad_info.has_syncobj_wait_for_submit) && (instance->enabled_extensions.KHR_external_memory_capabilities || instance->apiVersion >= VK_API_VERSION_1_1) && (instance->enabled_extensions.KHR_get_physical_device_properties2 || instance->apiVersion >= VK_API_VERSION_1_1));
table->ANDROID_external_memory_android_hardware_buffer = (!ANDROID || ANDROID_API_LEVEL >= 28) && ((RADV_SUPPORT_ANDROID_HARDWARE_BUFFER && device->rad_info.has_syncobj_wait_for_submit) && (instance->enabled_extensions.KHR_get_physical_device_properties2 || instance->apiVersion >= VK_API_VERSION_1_1) && (instance->enabled_extensions.KHR_external_memory_capabilities || instance->apiVersion >= VK_API_VERSION_1_1));
table->ANDROID_native_buffer = (!ANDROID || ANDROID_API_LEVEL >= 26) && ((ANDROID && device->rad_info.has_syncobj_wait_for_submit));
table->KHR_16bit_storage = (!ANDROID || ANDROID_API_LEVEL >= 28) && ((!device->use_aco || device->rad_info.chip_class >= GFX8) && (instance->enabled_extensions.KHR_get_physical_device_properties2 || instance->apiVersion >= VK_API_VERSION_1_1));
table->KHR_bind_memory2 = (!ANDROID || ANDROID_API_LEVEL >= 28) && ((true));
@ -279,7 +279,7 @@ void radv_fill_device_extension_table(const struct radv_physical_device *device,
table->EXT_calibrated_timestamps = (true);
table->EXT_conditional_rendering = (true);
table->EXT_conservative_rasterization = (device->rad_info.chip_class >= GFX9) && (instance->enabled_extensions.KHR_get_physical_device_properties2 || instance->apiVersion >= VK_API_VERSION_1_1);
table->EXT_display_control = (VK_USE_PLATFORM_DISPLAY_KHR) && instance->enabled_extensions.KHR_surface && instance->enabled_extensions.EXT_display_surface_counter;
table->EXT_display_control = (VK_USE_PLATFORM_DISPLAY_KHR) && instance->enabled_extensions.EXT_display_surface_counter && instance->enabled_extensions.KHR_surface;
table->EXT_depth_clip_enable = (true);
table->EXT_depth_range_unrestricted = (true);
table->EXT_descriptor_indexing = (true) && (instance->enabled_extensions.KHR_get_physical_device_properties2 || instance->apiVersion >= VK_API_VERSION_1_1);

View File

@ -4,7 +4,7 @@
#define YY_INT_ALIGNED short int
/* $OpenBSD: glcpp-lex.c,v 1.1 2020/08/26 06:02:33 jsg Exp $ */
/* $OpenBSD: glcpp-lex.c,v 1.2 2020/09/03 07:17:20 jsg Exp $ */
/* A lexical scanner generated by flex */
@ -26,7 +26,7 @@
/* end standard C headers. */
/* $OpenBSD: glcpp-lex.c,v 1.1 2020/08/26 06:02:33 jsg Exp $ */
/* $OpenBSD: glcpp-lex.c,v 1.2 2020/09/03 07:17:20 jsg Exp $ */
/* flex integer type definitions */

View File

@ -4,7 +4,7 @@
#define YY_INT_ALIGNED short int
/* $OpenBSD: glsl_lexer.cpp,v 1.1 2020/08/26 06:02:33 jsg Exp $ */
/* $OpenBSD: glsl_lexer.cpp,v 1.2 2020/09/03 07:17:20 jsg Exp $ */
/* A lexical scanner generated by flex */
@ -26,7 +26,7 @@
/* end standard C headers. */
/* $OpenBSD: glsl_lexer.cpp,v 1.1 2020/08/26 06:02:33 jsg Exp $ */
/* $OpenBSD: glsl_lexer.cpp,v 1.2 2020/09/03 07:17:20 jsg Exp $ */
/* flex integer type definitions */

View File

@ -165,10 +165,10 @@
* ('fge', -1.0, ('fneg', 'a')) => ('fge', 'a', 1.0)
* ('fne', ('fneg', 'a'), -1.0) => ('fne', 1.0, 'a')
* ('feq', -1.0, ('fneg', 'a')) => ('feq', 'a', 1.0)
* ('flt', ('fsat(is_used_once)', 'a'), '#b(is_gt_0_and_lt_1)') => ('flt', 'a', 'b')
* ('~flt', ('fsat(is_used_once)', 'a'), '#b(is_gt_0_and_lt_1)') => ('flt', 'a', 'b')
* ('flt', '#b(is_gt_0_and_lt_1)', ('fsat(is_used_once)', 'a')) => ('flt', 'b', 'a')
* ('fge', ('fsat(is_used_once)', 'a'), '#b(is_gt_0_and_lt_1)') => ('fge', 'a', 'b')
* ('fge', '#b(is_gt_0_and_lt_1)', ('fsat(is_used_once)', 'a')) => ('fge', 'b', 'a')
* ('~fge', '#b(is_gt_0_and_lt_1)', ('fsat(is_used_once)', 'a')) => ('fge', 'b', 'a')
* ('feq', ('fsat(is_used_once)', 'a'), '#b(is_gt_0_and_lt_1)') => ('feq', 'a', 'b')
* ('fne', ('fsat(is_used_once)', 'a'), '#b(is_gt_0_and_lt_1)') => ('fne', 'a', 'b')
* ('fge', ('fsat(is_used_once)', 'a'), 1.0) => ('fge', 'a', 1.0)
@ -7416,7 +7416,7 @@ static const nir_search_variable search159_1 = {
};
static const nir_search_expression search159 = {
{ nir_search_value_expression, 1 },
false, false,
true, false,
-1, 0,
nir_op_flt,
{ &search159_0.value, &search159_1.value },
@ -7505,7 +7505,7 @@ static const nir_search_expression search161 = {
/* search162_1 -> search160_1 in the cache */
static const nir_search_expression search162 = {
{ nir_search_value_expression, 1 },
false, false,
true, false,
-1, 0,
nir_op_fge,
{ &search160_0.value, &search160_1.value },
@ -361651,7 +361651,7 @@ nir_opt_algebraic_before_ffma(nir_shader *shader)
* ('feq', ('fsat(is_used_once)', 'a'), '#b(is_gt_0_and_lt_1)') => ('feq', 'a', 'b')
* ('fne', ('fsat(is_used_once)', 'a'), '#b(is_gt_0_and_lt_1)') => ('fne', 'a', 'b')
* ('fge', ('fsat(is_used_once)', 'a'), 1.0) => ('fge', 'a', 1.0)
* ('flt', ('fsat(is_used_once)', 'a'), 1.0) => ('flt', 'a', 1.0)
* ('~flt', ('fsat(is_used_once)', 'a'), 1.0) => ('flt', 'a', 1.0)
* ('~fge', ('fmin(is_used_once)', ('fadd(is_used_once)', 'a', 'b'), ('fadd', 'c', 'd')), 0.0) => ('iand', ('fge', 'a', ('fneg', 'b')), ('fge', 'c', ('fneg', 'd')))
* ('flt', ('fneg', 'a'), ('fneg', 'b')) => ('flt', 'b', 'a')
* ('fge', ('fneg', 'a'), ('fneg', 'b')) => ('fge', 'b', 'a')
@ -362287,7 +362287,7 @@ static const nir_search_expression replace1277 = {
/* search1278_1 -> search1277_1 in the cache */
static const nir_search_expression search1278 = {
{ nir_search_value_expression, 1 },
false, false,
true, false,
-1, 0,
nir_op_flt,
{ &search1277_0.value, &search1277_1.value },

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
#define YY_INT_ALIGNED short int
/* $OpenBSD: lex.yy.c,v 1.1 2020/08/26 06:02:35 jsg Exp $ */
/* $OpenBSD: lex.yy.c,v 1.2 2020/09/03 07:17:23 jsg Exp $ */
/* A lexical scanner generated by flex */
@ -26,7 +26,7 @@
/* end standard C headers. */
/* $OpenBSD: lex.yy.c,v 1.1 2020/08/26 06:02:35 jsg Exp $ */
/* $OpenBSD: lex.yy.c,v 1.2 2020/09/03 07:17:23 jsg Exp $ */
/* flex integer type definitions */

View File

@ -26,7 +26,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 1.18 $ on $Date: 2020/08/26 06:02:35 $ */
/* $Revision: 1.19 $ on $Date: 2020/09/03 07:17:23 $ */
#ifndef __OPENCL_CL_D3D10_H
#define __OPENCL_CL_D3D10_H

View File

@ -26,7 +26,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 1.18 $ on $Date: 2020/08/26 06:02:35 $ */
/* $Revision: 1.19 $ on $Date: 2020/09/03 07:17:23 $ */
#ifndef __OPENCL_CL_D3D11_H
#define __OPENCL_CL_D3D11_H

View File

@ -26,7 +26,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 1.18 $ on $Date: 2020/08/26 06:02:35 $ */
/* $Revision: 1.19 $ on $Date: 2020/09/03 07:17:23 $ */
#ifndef __OPENCL_CL_DX9_MEDIA_SHARING_H
#define __OPENCL_CL_DX9_MEDIA_SHARING_H

View File

@ -26,7 +26,7 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
******************************************************************************/
/* $Revision: 1.18 $ on $Date: 2020/08/26 06:02:35 $ */
/* $Revision: 1.19 $ on $Date: 2020/09/03 07:17:23 $ */
#ifndef __OPENCL_H
#define __OPENCL_H

View File

@ -25,7 +25,7 @@
*/
/* Platform-specific types and definitions for egl.h
* $Revision: 1.18 $ on $Date: 2020/08/26 06:02:35 $
* $Revision: 1.19 $ on $Date: 2020/09/03 07:17:23 $
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that

View File

@ -1,7 +1,7 @@
#ifndef __gl3ext_h_
#define __gl3ext_h_
/* $Revision: 1.18 $ on $Date: 2020/08/26 06:02:35 $ */
/* $Revision: 1.19 $ on $Date: 2020/09/03 07:17:23 $ */
/*
* This document is licensed under the SGI Free Software B License Version

View File

@ -1161,7 +1161,7 @@ if not ['linux'].contains(host_machine.system())
endif
endif
foreach h : ['xlocale.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'execinfo.h', 'sys/shm.h', 'cet.h']
foreach h : ['xlocale.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'execinfo.h', 'sys/shm.h', 'cet.h', 'pthread_np.h']
if cc.compiles('#include <@0@>'.format(h), name : '@0@'.format(h))
pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
endif
@ -1728,6 +1728,7 @@ if dep_dl.found()
gl_priv_libs += '-ldl'
endif
# FIXME: autotools lists this as incomplete
gbm_priv_libs = []
if dep_dl.found()
gbm_priv_libs += '-ldl'

View File

@ -84,6 +84,7 @@ CPPFLAGS+= \
-DHAVE_MKOSTEMP \
-DHAVE_POSIX_MEMALIGN \
-DHAVE_PTHREAD \
-DHAVE_PTHREAD_NP_H \
-DHAVE_STRTOF \
-DHAVE_STRTOK_R \
-DHAVE_SYS_SHM_H \

View File

@ -404,6 +404,7 @@ def generate(env):
]
if gcc_compat:
cppdefines += [('__MSVCRT_VERSION__', '0x0700')]
cppdefines += ['_USE_MATH_DEFINES']
if msvc:
cppdefines += [
'VC_EXTRALEAN',
@ -496,6 +497,7 @@ def generate(env):
cflags += ['-std=gnu11']
else:
cflags += ['-std=gnu99']
cxxflags += ['-std=c++14']
if icc:
cflags += [
'-std=gnu99',

View File

@ -2721,12 +2721,18 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
Temp src0 = bld.tmp(v1);
Temp src1 = bld.tmp(v1);
bld.pseudo(aco_opcode::p_split_vector, Definition(src0), Definition(src1), src);
if (!ctx->block->fp_mode.care_about_round32 || ctx->block->fp_mode.round32 == fp_round_tz)
if (0 && (!ctx->block->fp_mode.care_about_round32 || ctx->block->fp_mode.round32 == fp_round_tz)) {
bld.vop3(aco_opcode::v_cvt_pkrtz_f16_f32, Definition(dst), src0, src1);
else
bld.vop3(aco_opcode::v_cvt_pk_u16_u32, Definition(dst),
bld.vop1(aco_opcode::v_cvt_f32_f16, bld.def(v1), src0),
bld.vop1(aco_opcode::v_cvt_f32_f16, bld.def(v1), src1));
} else {
src0 = bld.vop1(aco_opcode::v_cvt_f16_f32, bld.def(v1), src0);
src1 = bld.vop1(aco_opcode::v_cvt_f16_f32, bld.def(v1), src1);
if (ctx->program->chip_class >= GFX10) {
/* the high bits of v_cvt_f16_f32 isn't zero'd on GFX10 */
bld.vop3(aco_opcode::v_pack_b32_f16, Definition(dst), src0, src1);
} else {
bld.vop3(aco_opcode::v_cvt_pk_u16_u32, Definition(dst), src0, src1);
}
}
} else {
fprintf(stderr, "Unimplemented NIR instr bit size: ");
nir_print_instr(&instr->instr, stderr);

View File

@ -73,10 +73,6 @@
#include "compiler/glsl_types.h"
#include "util/xmlpool.h"
#ifndef CLOCK_MONOTONIC_RAW
#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
#endif
static struct radv_timeline_point *
radv_timeline_find_point_at_least_locked(struct radv_device *device,
struct radv_timeline *timeline,
@ -7715,7 +7711,9 @@ radv_GetDeviceGroupPeerMemoryFeatures(
static const VkTimeDomainEXT radv_time_domains[] = {
VK_TIME_DOMAIN_DEVICE_EXT,
VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT,
#ifdef CLOCK_MONOTONIC_RAW
VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT,
#endif
};
VkResult radv_GetPhysicalDeviceCalibrateableTimeDomainsEXT(
@ -7742,8 +7740,10 @@ radv_clock_gettime(clockid_t clock_id)
int ret;
ret = clock_gettime(clock_id, &current);
#ifdef CLOCK_MONOTONIC_RAW
if (ret < 0 && clock_id == CLOCK_MONOTONIC_RAW)
ret = clock_gettime(CLOCK_MONOTONIC, &current);
#endif
if (ret < 0)
return 0;
@ -7763,7 +7763,11 @@ VkResult radv_GetCalibratedTimestampsEXT(
uint64_t begin, end;
uint64_t max_clock_period = 0;
#ifdef CLOCK_MONOTONIC_RAW
begin = radv_clock_gettime(CLOCK_MONOTONIC_RAW);
#else
begin = radv_clock_gettime(CLOCK_MONOTONIC);
#endif
for (d = 0; d < timestampCount; d++) {
switch (pTimestampInfos[d].timeDomain) {
@ -7778,16 +7782,22 @@ VkResult radv_GetCalibratedTimestampsEXT(
max_clock_period = MAX2(max_clock_period, 1);
break;
#ifdef CLOCK_MONOTONIC_RAW
case VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT:
pTimestamps[d] = begin;
break;
#endif
default:
pTimestamps[d] = 0;
break;
}
}
#ifdef CLOCK_MONOTONIC_RAW
end = radv_clock_gettime(CLOCK_MONOTONIC_RAW);
#else
end = radv_clock_gettime(CLOCK_MONOTONIC);
#endif
/*
* The maximum deviation is the sum of the interval over which we

View File

@ -299,8 +299,8 @@ meta_emit_blit(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *src_image,
struct radv_image_view *src_iview,
VkImageLayout src_image_layout,
VkOffset3D src_offset_0,
VkOffset3D src_offset_1,
float src_offset_0[3],
float src_offset_1[3],
struct radv_image *dest_image,
struct radv_image_view *dest_iview,
VkImageLayout dest_image_layout,
@ -319,11 +319,11 @@ meta_emit_blit(struct radv_cmd_buffer *cmd_buffer,
assert(src_image->info.samples == dest_image->info.samples);
float vertex_push_constants[5] = {
(float)src_offset_0.x / (float)src_width,
(float)src_offset_0.y / (float)src_height,
(float)src_offset_1.x / (float)src_width,
(float)src_offset_1.y / (float)src_height,
(float)src_offset_0.z / (float)src_depth,
src_offset_0[0] / (float)src_width,
src_offset_0[1] / (float)src_height,
src_offset_1[0] / (float)src_width,
src_offset_1[1] / (float)src_height,
src_offset_0[2] / (float)src_depth,
};
radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
@ -599,12 +599,19 @@ void radv_CmdBlitImage(
}
bool flip_z = flip_coords(&src_start, &src_end, &dst_start, &dst_end);
float src_z_step = (float)(src_end + 1 - src_start) /
(float)(dst_end + 1 - dst_start);
float src_z_step = (float)(src_end - src_start) /
(float)(dst_end - dst_start);
/* There is no interpolation to the pixel center during
* rendering, so add the 0.5 offset ourselves here. */
float depth_center_offset = 0;
if (src_image->type == VK_IMAGE_TYPE_3D)
depth_center_offset = 0.5 / (dst_end - dst_start) * (src_end - src_start);
if (flip_z) {
src_start = src_end;
src_z_step *= -1;
depth_center_offset *= -1;
}
unsigned src_x0 = pRegions[r].srcOffsets[0].x;
@ -635,15 +642,16 @@ void radv_CmdBlitImage(
.x = dst_x1,
.y = dst_y1,
};
VkOffset3D src_offset_0 = {
.x = src_x0,
.y = src_y0,
.z = src_start + i * src_z_step,
float src_offset_0[3] = {
src_x0,
src_y0,
src_start + i * src_z_step + depth_center_offset,
};
VkOffset3D src_offset_1 = {
.x = src_x1,
.y = src_y1,
.z = src_start + i * src_z_step,
float src_offset_1[3] = {
src_x1,
src_y1,
src_start + i * src_z_step + depth_center_offset,
};
const uint32_t dest_array_slice = dst_start + i;

View File

@ -36,9 +36,6 @@
#include "radv_amdgpu_bo.h"
#include "sid.h"
#ifndef ETIME
#define ETIME ETIMEDOUT
#endif
enum {
VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024

View File

@ -799,6 +799,20 @@ ir_constant::ir_constant(const ir_constant *c, unsigned i)
this->const_elements = NULL;
this->type = c->type->get_base_type();
/* Section 5.11 (Out-of-Bounds Accesses) of the GLSL 4.60 spec says:
*
* In the subsections described above for array, vector, matrix and
* structure accesses, any out-of-bounds access produced undefined
* behavior....Out-of-bounds reads return undefined values, which
* include values from other variables of the active program or zero.
*
* GL_KHR_robustness and GL_ARB_robustness encourage us to return zero.
*/
if (i >= c->type->vector_elements) {
this->value = { { 0 } };
return;
}
switch (this->type->base_type) {
case GLSL_TYPE_UINT: this->value.u[0] = c->value.u[i]; break;
case GLSL_TYPE_INT: this->value.i[0] = c->value.i[i]; break;

View File

@ -2574,6 +2574,15 @@ typedef enum {
nir_metadata_live_ssa_defs = 0x4,
nir_metadata_not_properly_reset = 0x8,
nir_metadata_loop_analysis = 0x10,
/** All metadata
*
* This includes all nir_metadata flags except not_properly_reset. Passes
* which do not change the shader in any way should call
*
* nir_metadata_preserve(impl, nir_metadata_all);
*/
nir_metadata_all = ~nir_metadata_not_properly_reset,
} nir_metadata;
typedef struct {

View File

@ -327,10 +327,14 @@ optimizations.extend([
(('fne', ('fneg', a), -1.0), ('fne', 1.0, a)),
(('feq', -1.0, ('fneg', a)), ('feq', a, 1.0)),
(('flt', ('fsat(is_used_once)', a), '#b(is_gt_0_and_lt_1)'), ('flt', a, b)),
# flt(fsat(a), b > 0 && b < 1) is inexact if a is NaN (fsat(NaN) is 0)
# because it returns True while flt(a, b) always returns False.
(('~flt', ('fsat(is_used_once)', a), '#b(is_gt_0_and_lt_1)'), ('flt', a, b)),
(('flt', '#b(is_gt_0_and_lt_1)', ('fsat(is_used_once)', a)), ('flt', b, a)),
(('fge', ('fsat(is_used_once)', a), '#b(is_gt_0_and_lt_1)'), ('fge', a, b)),
(('fge', '#b(is_gt_0_and_lt_1)', ('fsat(is_used_once)', a)), ('fge', b, a)),
# fge(b > 0 && b < 1, fsat(a)) is inexact if a is NaN (fsat(NaN) is 0)
# because it returns True while fge(b, a) always returns False.
(('~fge', '#b(is_gt_0_and_lt_1)', ('fsat(is_used_once)', a)), ('fge', b, a)),
(('feq', ('fsat(is_used_once)', a), '#b(is_gt_0_and_lt_1)'), ('feq', a, b)),
(('fne', ('fsat(is_used_once)', a), '#b(is_gt_0_and_lt_1)'), ('fne', a, b)),
@ -1767,7 +1771,9 @@ late_optimizations = [
(('fne', ('fsat(is_used_once)', a), '#b(is_gt_0_and_lt_1)'), ('fne', a, b)),
(('fge', ('fsat(is_used_once)', a), 1.0), ('fge', a, 1.0)),
(('flt', ('fsat(is_used_once)', a), 1.0), ('flt', a, 1.0)),
# flt(fsat(a), 1.0) is inexact because it returns True if a is NaN
# (fsat(NaN) is 0), while flt(a, 1.0) always returns FALSE.
(('~flt', ('fsat(is_used_once)', a), 1.0), ('flt', a, 1.0)),
(('~fge', ('fmin(is_used_once)', ('fadd(is_used_once)', a, b), ('fadd', c, d)), 0.0), ('iand', ('fge', a, ('fneg', b)), ('fge', c, ('fneg', d)))),

View File

@ -169,7 +169,9 @@ create_pass_manager(struct gallivm_state *gallivm)
*/
LLVMAddReassociatePass(gallivm->passmgr);
LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr);
#if LLVM_VERSION_MAJOR <= 11
LLVMAddConstantPropagationPass(gallivm->passmgr);
#endif
LLVMAddInstructionCombiningPass(gallivm->passmgr);
LLVMAddGVNPass(gallivm->passmgr);
}

View File

@ -581,6 +581,7 @@ The integer capabilities:
* ``PIPE_CAP_SYSTEM_SVM``: True if all application memory can be shared with the GPU without explicit mapping.
* ``PIPE_CAP_VIEWPORT_MASK``: Whether ``TGSI_SEMANTIC_VIEWPORT_MASK`` and ``TGSI_PROPERTY_LAYER_VIEWPORT_RELATIVE`` are supported (see GL_NV_viewport_array2).
* ``PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE``: Whether mapping a buffer as unsynchronized from any thread is safe.
* ``PIPE_CAP_NO_CLIP_ON_COPY_TEX``: Driver doesn't want x/y/width/height clipped based on src size when doing a copy texture operation (eg: may want out-of-bounds reads that produce 0 instead of leaving the texture content undefined)
.. _pipe_capf:

View File

@ -93,6 +93,7 @@ etna_context_destroy(struct pipe_context *pctx)
struct etna_context *ctx = etna_context(pctx);
mtx_lock(&ctx->lock);
if (ctx->used_resources_read) {
/*
@ -103,7 +104,9 @@ etna_context_destroy(struct pipe_context *pctx)
set_foreach(ctx->used_resources_read, entry) {
struct etna_resource *rsc = (struct etna_resource *)entry->key;
mtx_lock(&rsc->lock);
_mesa_set_remove_key(rsc->pending_ctx, ctx);
mtx_unlock(&rsc->lock);
}
_mesa_set_destroy(ctx->used_resources_read, NULL);
@ -118,7 +121,9 @@ etna_context_destroy(struct pipe_context *pctx)
set_foreach(ctx->used_resources_write, entry) {
struct etna_resource *rsc = (struct etna_resource *)entry->key;
mtx_lock(&rsc->lock);
_mesa_set_remove_key(rsc->pending_ctx, ctx);
mtx_unlock(&rsc->lock);
}
_mesa_set_destroy(ctx->used_resources_write, NULL);
@ -487,12 +492,16 @@ etna_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
struct etna_resource *rsc = (struct etna_resource *)entry->key;
struct pipe_resource *referenced = &rsc->base;
mtx_lock(&rsc->lock);
_mesa_set_remove_key(rsc->pending_ctx, ctx);
/* if resource has no pending ctx's reset its status */
if (_mesa_set_next_entry(rsc->pending_ctx, NULL) == NULL)
rsc->status &= ~ETNA_PENDING_READ;
mtx_unlock(&rsc->lock);
pipe_resource_reference(&referenced, NULL);
}
_mesa_set_clear(ctx->used_resources_read, NULL);
@ -501,11 +510,13 @@ etna_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
struct etna_resource *rsc = (struct etna_resource *)entry->key;
struct pipe_resource *referenced = &rsc->base;
mtx_lock(&rsc->lock);
_mesa_set_remove_key(rsc->pending_ctx, ctx);
/* if resource has no pending ctx's reset its status */
if (_mesa_set_next_entry(rsc->pending_ctx, NULL) == NULL)
rsc->status &= ~ETNA_PENDING_WRITE;
mtx_unlock(&rsc->lock);
pipe_resource_reference(&referenced, NULL);
}

View File

@ -321,6 +321,7 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout,
memset(map, 0, size);
}
mtx_init(&rsc->lock, mtx_recursive);
rsc->pending_ctx = _mesa_set_create(NULL, _mesa_hash_pointer,
_mesa_key_pointer_equal);
if (!rsc->pending_ctx)
@ -463,8 +464,10 @@ etna_resource_destroy(struct pipe_screen *pscreen, struct pipe_resource *prsc)
{
struct etna_resource *rsc = etna_resource(prsc);
mtx_lock(&rsc->lock);
assert(!_mesa_set_next_entry(rsc->pending_ctx, NULL));
_mesa_set_destroy(rsc->pending_ctx, NULL);
mtx_unlock(&rsc->lock);
if (rsc->bo)
etna_bo_del(rsc->bo);
@ -483,6 +486,8 @@ etna_resource_destroy(struct pipe_screen *pscreen, struct pipe_resource *prsc)
for (unsigned i = 0; i < ETNA_NUM_LOD; i++)
FREE(rsc->levels[i].patch_offsets);
mtx_destroy(&rsc->lock);
FREE(rsc);
}
@ -559,6 +564,7 @@ etna_resource_from_handle(struct pipe_screen *pscreen,
goto fail;
}
mtx_init(&rsc->lock, mtx_recursive);
rsc->pending_ctx = _mesa_set_create(NULL, _mesa_hash_pointer,
_mesa_key_pointer_equal);
if (!rsc->pending_ctx)
@ -603,34 +609,6 @@ etna_resource_get_handle(struct pipe_screen *pscreen,
}
}
enum etna_resource_status
etna_resource_get_status(struct etna_context *ctx, struct etna_resource *rsc)
{
enum etna_resource_status newstatus = 0;
set_foreach(rsc->pending_ctx, entry) {
struct etna_context *extctx = (struct etna_context *)entry->key;
set_foreach(extctx->used_resources_read, entry2) {
struct etna_resource *rsc2 = (struct etna_resource *)entry2->key;
if (ctx == extctx || rsc2 != rsc)
continue;
newstatus |= ETNA_PENDING_READ;
}
set_foreach(extctx->used_resources_write, entry2) {
struct etna_resource *rsc2 = (struct etna_resource *)entry2->key;
if (ctx == extctx || rsc2 != rsc)
continue;
newstatus |= ETNA_PENDING_WRITE;
}
}
return newstatus;
}
void
etna_resource_used(struct etna_context *ctx, struct pipe_resource *prsc,
enum etna_resource_status status)
@ -644,18 +622,41 @@ etna_resource_used(struct etna_context *ctx, struct pipe_resource *prsc,
mtx_lock(&ctx->lock);
rsc = etna_resource(prsc);
again:
mtx_lock(&rsc->lock);
set_foreach(rsc->pending_ctx, entry) {
struct etna_context *extctx = (struct etna_context *)entry->key;
struct pipe_context *pctx = &extctx->base;
bool need_flush = false;
if (mtx_trylock(&extctx->lock) != thrd_success) {
/*
* The other context could be locked in etna_flush() and
* stuck waiting for the resource lock, so release the
* resource lock here, let etna_flush() finish, and try
* again.
*/
mtx_unlock(&rsc->lock);
thrd_yield();
goto again;
}
set_foreach(extctx->used_resources_read, entry2) {
struct etna_resource *rsc2 = (struct etna_resource *)entry2->key;
if (ctx == extctx || rsc2 != rsc)
continue;
if (status & ETNA_PENDING_WRITE)
pctx->flush(pctx, NULL, 0);
if (status & ETNA_PENDING_WRITE) {
need_flush = true;
break;
}
}
if (need_flush) {
pctx->flush(pctx, NULL, 0);
mtx_unlock(&extctx->lock);
continue;
}
set_foreach(extctx->used_resources_write, entry2) {
@ -663,8 +664,14 @@ etna_resource_used(struct etna_context *ctx, struct pipe_resource *prsc,
if (ctx == extctx || rsc2 != rsc)
continue;
pctx->flush(pctx, NULL, 0);
need_flush = true;
break;
}
if (need_flush)
pctx->flush(pctx, NULL, 0);
mtx_unlock(&extctx->lock);
}
rsc->status = status;
@ -676,6 +683,7 @@ etna_resource_used(struct etna_context *ctx, struct pipe_resource *prsc,
_mesa_set_add(rsc->pending_ctx, ctx);
}
mtx_unlock(&rsc->lock);
mtx_unlock(&ctx->lock);
}

View File

@ -96,6 +96,7 @@ struct etna_resource {
enum etna_resource_status status;
mtx_t lock; /* Lock to protect pending_ctx */
struct set *pending_ctx;
};
@ -150,9 +151,6 @@ etna_resource(struct pipe_resource *p)
return (struct etna_resource *)p;
}
enum etna_resource_status
etna_resource_get_status(struct etna_context *ctx, struct etna_resource *rsc);
void
etna_resource_used(struct etna_context *ctx, struct pipe_resource *prsc,
enum etna_resource_status status);

View File

@ -391,12 +391,14 @@ etna_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc,
(!trans->rsc &&
(((usage & PIPE_TRANSFER_READ) && (rsc->status & ETNA_PENDING_WRITE)) ||
((usage & PIPE_TRANSFER_WRITE) && rsc->status)))) {
mtx_lock(&rsc->lock);
set_foreach(rsc->pending_ctx, entry) {
struct etna_context *pend_ctx = (struct etna_context *)entry->key;
struct pipe_context *pend_pctx = &pend_ctx->base;
pend_pctx->flush(pend_pctx, NULL, 0);
}
mtx_unlock(&rsc->lock);
}
mtx_unlock(&ctx->lock);

View File

@ -216,6 +216,9 @@ do_blit(struct fd_context *ctx, const struct pipe_blit_info *blit, bool fallback
}
}
static void
flush_resource(struct fd_context *ctx, struct fd_resource *rsc, unsigned usage);
/**
* @rsc: the resource to shadow
* @level: the level to discard (if box != NULL, otherwise ignored)
@ -233,6 +236,21 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc,
if (prsc->next)
return false;
/* If you have a sequence where there is a single rsc associated
* with the current render target, and then you end up shadowing
* that same rsc on the 3d pipe (u_blitter), because of how we
* swap the new shadow and rsc before the back-blit, you could end
* up confusing things into thinking that u_blitter's framebuffer
* state is the same as the current framebuffer state, which has
* the result of blitting to rsc rather than shadow.
*
* Normally we wouldn't want to unconditionally trigger a flush,
* since that defeats the purpose of shadowing, but this is a
* case where we'd have to flush anyways.
*/
if (rsc->write_batch == ctx->batch)
flush_resource(ctx, rsc, 0);
/* TODO: somehow munge dimensions and format to copy unsupported
* render target format to something that is supported?
*/

View File

@ -885,7 +885,7 @@ static void si_disk_cache_create(struct si_screen *sscreen)
disk_cache_format_hex_id(cache_id, sha1, 20 * 2);
/* These flags affect shader compilation. */
#define ALL_FLAGS (DBG(GISEL))
#define ALL_FLAGS (DBG(GISEL) | DBG(CLAMP_DIV_BY_ZERO))
uint64_t shader_debug_flags = sscreen->debug_flags & ALL_FLAGS;
/* Add the high bits of 32-bit addresses, which affects
@ -1002,6 +1002,9 @@ static struct pipe_screen *radeonsi_screen_create_impl(struct radeon_winsys *ws,
#include "si_debug_options.h"
}
if (sscreen->options.clamp_div_by_zero)
sscreen->debug_flags |= DBG(CLAMP_DIV_BY_ZERO);
si_disk_cache_create(sscreen);
/* Determine the number of shader compiler threads. */

View File

@ -159,6 +159,7 @@ enum
DBG_W64_GE,
DBG_W64_PS,
DBG_W64_CS,
DBG_CLAMP_DIV_BY_ZERO,
/* Shader compiler options (with no effect on the shader cache): */
DBG_CHECK_IR,

View File

@ -947,6 +947,7 @@ enum pipe_cap
PIPE_CAP_VIEWPORT_MASK,
PIPE_CAP_ALPHA_TO_COVERAGE_DITHER_CONTROL,
PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE,
PIPE_CAP_NO_CLIP_ON_COPY_TEX,
};
/**

View File

@ -439,11 +439,6 @@ clover::llvm::compile_to_spirv(const std::string &source,
debug::log(".ll", print_module_bitcode(*mod));
std::string error_msg;
if (!::llvm::regularizeLlvmForSpirv(mod.get(), error_msg)) {
r_log += "Failed to regularize LLVM IR for SPIR-V: " + error_msg + ".\n";
throw error(CL_INVALID_VALUE);
}
std::ostringstream os;
if (!::llvm::writeSpirv(mod.get(), os, error_msg)) {
r_log += "Translation from LLVM IR to SPIR-V failed: " + error_msg + ".\n";

View File

@ -868,7 +868,7 @@ dri2_get_modifier_num_planes(uint64_t modifier, int fourcc)
case I915_FORMAT_MOD_X_TILED:
case I915_FORMAT_MOD_Y_TILED:
case DRM_FORMAT_MOD_INVALID:
return map->nplanes;
return util_format_get_num_planes(map->pipe_format);
default:
return 0;
}
@ -885,24 +885,14 @@ dri2_create_image_from_fd(__DRIscreen *_screen,
const struct dri2_format_mapping *map = dri2_get_mapping_by_fourcc(fourcc);
__DRIimage *img = NULL;
unsigned err = __DRI_IMAGE_ERROR_SUCCESS;
int i, expected_num_fds;
int num_handles = dri2_get_modifier_num_planes(modifier, fourcc);
int i;
const int expected_num_fds = dri2_get_modifier_num_planes(modifier, fourcc);
if (!map || num_handles == 0) {
if (!map || expected_num_fds == 0) {
err = __DRI_IMAGE_ERROR_BAD_MATCH;
goto exit;
}
switch (fourcc) {
case DRM_FORMAT_YUYV:
case DRM_FORMAT_UYVY:
expected_num_fds = 1;
break;
default:
expected_num_fds = num_handles;
break;
}
if (num_fds != expected_num_fds) {
err = __DRI_IMAGE_ERROR_BAD_MATCH;
goto exit;

View File

@ -63,7 +63,7 @@ pkg.generate(
description : 'Mesa gbm library',
version : meson.project_version(),
libraries : libgbm,
libraries_private : gbm_priv_libs, # FIXME: autotools lists this a incomplete
libraries_private : gbm_priv_libs,
)
if with_symbols_check

View File

@ -1,4 +1,4 @@
/* $OpenBSD: getopt.h,v 1.18 2020/08/26 06:02:58 jsg Exp $ */
/* $OpenBSD: getopt.h,v 1.19 2020/09/03 07:17:26 jsg Exp $ */
/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */
/*-

View File

@ -1,4 +1,4 @@
/* $OpenBSD: getopt_long.c,v 1.18 2020/08/26 06:02:58 jsg Exp $ */
/* $OpenBSD: getopt_long.c,v 1.19 2020/09/03 07:17:26 jsg Exp $ */
/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
/*

View File

@ -3350,9 +3350,18 @@ brw_broadcast(struct brw_codegen *p,
* asserting would be mean.
*/
const unsigned i = idx.file == BRW_IMMEDIATE_VALUE ? idx.ud : 0;
brw_MOV(p, dst,
(align1 ? stride(suboffset(src, i), 0, 1, 0) :
stride(suboffset(src, 4 * i), 0, 4, 1)));
src = align1 ? stride(suboffset(src, i), 0, 1, 0) :
stride(suboffset(src, 4 * i), 0, 4, 1);
if (type_sz(src.type) > 4 && !devinfo->has_64bit_float) {
brw_MOV(p, subscript(dst, BRW_REGISTER_TYPE_D, 0),
subscript(src, BRW_REGISTER_TYPE_D, 0));
brw_set_default_swsb(p, tgl_swsb_null());
brw_MOV(p, subscript(dst, BRW_REGISTER_TYPE_D, 1),
subscript(src, BRW_REGISTER_TYPE_D, 1));
} else {
brw_MOV(p, dst, src);
}
} else {
/* From the Haswell PRM section "Register Region Restrictions":
*
@ -3401,7 +3410,8 @@ brw_broadcast(struct brw_codegen *p,
/* Use indirect addressing to fetch the specified component. */
if (type_sz(src.type) > 4 &&
(devinfo->is_cherryview || gen_device_info_is_9lp(devinfo))) {
(devinfo->is_cherryview || gen_device_info_is_9lp(devinfo) ||
!devinfo->has_64bit_float)) {
/* From the Cherryview PRM Vol 7. "Register Region Restrictions":
*
* "When source or destination datatype is 64b or operation is

View File

@ -410,7 +410,15 @@ fs_generator::generate_mov_indirect(fs_inst *inst,
reg.nr = imm_byte_offset / REG_SIZE;
reg.subnr = imm_byte_offset % REG_SIZE;
brw_MOV(p, dst, reg);
if (type_sz(reg.type) > 4 && !devinfo->has_64bit_float) {
brw_MOV(p, subscript(dst, BRW_REGISTER_TYPE_D, 0),
subscript(reg, BRW_REGISTER_TYPE_D, 0));
brw_set_default_swsb(p, tgl_swsb_null());
brw_MOV(p, subscript(dst, BRW_REGISTER_TYPE_D, 1),
subscript(reg, BRW_REGISTER_TYPE_D, 1));
} else {
brw_MOV(p, dst, reg);
}
} else {
/* Prior to Broadwell, there are only 8 address registers. */
assert(inst->exec_size <= 8 || devinfo->gen >= 8);

View File

@ -101,7 +101,7 @@ brw_nir_link_shaders(const struct brw_compiler *compiler,
bool brw_nir_lower_cs_intrinsics(nir_shader *nir,
unsigned dispatch_width);
void brw_nir_lower_alpha_to_coverage(nir_shader *shader);
bool brw_nir_lower_alpha_to_coverage(nir_shader *shader);
void brw_nir_lower_legacy_clipping(nir_shader *nir,
int nr_userclip_plane_consts,
struct brw_stage_prog_data *prog_data);

View File

@ -4337,7 +4337,9 @@ void anv_DestroyFramebuffer(
static const VkTimeDomainEXT anv_time_domains[] = {
VK_TIME_DOMAIN_DEVICE_EXT,
VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT,
#ifdef CLOCK_MONOTONIC_RAW
VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT,
#endif
};
VkResult anv_GetPhysicalDeviceCalibrateableTimeDomainsEXT(
@ -4364,8 +4366,10 @@ anv_clock_gettime(clockid_t clock_id)
int ret;
ret = clock_gettime(clock_id, &current);
#ifdef CLOCK_MONOTONIC_RAW
if (ret < 0 && clock_id == CLOCK_MONOTONIC_RAW)
ret = clock_gettime(CLOCK_MONOTONIC, &current);
#endif
if (ret < 0)
return 0;
@ -4388,7 +4392,11 @@ VkResult anv_GetCalibratedTimestampsEXT(
uint64_t begin, end;
uint64_t max_clock_period = 0;
#ifdef CLOCK_MONOTONIC_RAW
begin = anv_clock_gettime(CLOCK_MONOTONIC_RAW);
#else
begin = anv_clock_gettime(CLOCK_MONOTONIC);
#endif
for (d = 0; d < timestampCount; d++) {
switch (pTimestampInfos[d].timeDomain) {
@ -4408,16 +4416,22 @@ VkResult anv_GetCalibratedTimestampsEXT(
max_clock_period = MAX2(max_clock_period, 1);
break;
#ifdef CLOCK_MONOTONIC_RAW
case VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT:
pTimestamps[d] = begin;
break;
#endif
default:
pTimestamps[d] = 0;
break;
}
}
#ifdef CLOCK_MONOTONIC_RAW
end = anv_clock_gettime(CLOCK_MONOTONIC_RAW);
#else
end = anv_clock_gettime(CLOCK_MONOTONIC);
#endif
/*
* The maximum deviation is the sum of the interval over which we

View File

@ -32,16 +32,6 @@
#include <stdint.h>
#include "drm-uapi/i915_drm.h"
#include <errno.h>
#ifndef ETIME
#define ETIME ETIMEDOUT
#endif
#include <time.h>
#ifndef CLOCK_MONOTONIC_RAW
#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
#endif
#ifdef HAVE_VALGRIND
#include <valgrind.h>
#include <memcheck.h>

View File

@ -3346,7 +3346,7 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
sob.SurfaceBaseAddress = anv_address_add(xfb->buffer->address,
xfb->offset);
/* Size is in DWords - 1 */
sob.SurfaceSize = xfb->size / 4 - 1;
sob.SurfaceSize = DIV_ROUND_UP(xfb->size, 4) - 1;
}
}
}

View File

@ -4175,6 +4175,12 @@ struct gl_constants
/** Buffer size used to upload vertices from glBegin/glEnd. */
unsigned glBeginEndBufferSize;
/** Whether the driver doesn't want x/y/width/height clipped based on src size
* when doing a copy texture operation (eg: may want out-of-bounds reads that
* produce 0 instead of leaving the texture content undefined).
*/
bool NoClippingOnCopyTex;
};

View File

@ -4210,7 +4210,8 @@ copy_texture_sub_image(struct gl_context *ctx, GLuint dims,
xoffset += texImage->Border;
}
if (_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y,
if (ctx->Const.NoClippingOnCopyTex ||
_mesa_clip_copytexsubimage(ctx, &xoffset, &yoffset, &x, &y,
&width, &height)) {
struct gl_renderbuffer *srcRb =
get_copy_tex_image_source(ctx, texImage->TexFormat);
@ -4416,7 +4417,8 @@ copyteximage(struct gl_context *ctx, GLuint dims, struct gl_texture_object *texO
/* Allocate texture memory (no pixel data yet) */
ctx->Driver.AllocTextureImageBuffer(ctx, texImage);
if (_mesa_clip_copytexsubimage(ctx, &dstX, &dstY, &srcX, &srcY,
if (ctx->Const.NoClippingOnCopyTex ||
_mesa_clip_copytexsubimage(ctx, &dstX, &dstY, &srcX, &srcY,
&width, &height)) {
struct gl_renderbuffer *srcRb =
get_copy_tex_image_source(ctx, texImage->TexFormat);

View File

@ -765,6 +765,10 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
*/
ctx->Point.MaxSize = MAX2(ctx->Const.MaxPointSize,
ctx->Const.MaxPointSizeAA);
ctx->Const.NoClippingOnCopyTex = screen->get_param(screen,
PIPE_CAP_NO_CLIP_ON_COPY_TEX);
/* For vertex shaders, make sure not to emit saturate when SM 3.0
* is not supported
*/

View File

@ -510,7 +510,8 @@ st_translate_vertex_program(struct st_context *st,
stp->affected_states |= ST_NEW_VS_CONSTANTS;
/* Translate to NIR if preferred. */
if (st->pipe->screen->get_shader_param(st->pipe->screen,
if (PIPE_SHADER_IR_NIR ==
st->pipe->screen->get_shader_param(st->pipe->screen,
PIPE_SHADER_VERTEX,
PIPE_SHADER_CAP_PREFERRED_IR)) {
assert(!stp->glsl_to_tgsi);
@ -883,6 +884,7 @@ st_translate_fragment_program(struct st_context *st,
/* Translate to NIR. */
if (!stfp->ati_fs &&
PIPE_SHADER_IR_NIR ==
st->pipe->screen->get_shader_param(st->pipe->screen,
PIPE_SHADER_FRAGMENT,
PIPE_SHADER_CAP_PREFERRED_IR)) {