Commits (82)
......@@ -58,24 +58,22 @@ if ! env \
EXIT=1
fi
# gles3-multisample mustpass -- disabled pending https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1859
# if ! env \
# DEQP_RESULTS_DIR=results/gles3-multisample \
# DEQP_VER=gles3 \
# DEQP_CONFIG="rgba8888d24s8ms4" \
# DEQP_VARIANT="multisample" \
# /install/deqp-runner.sh; then
# EXIT=1
# fi
if ! env \
DEQP_RESULTS_DIR=results/gles3-multisample \
DEQP_VER=gles3 \
DEQP_CONFIG="rgba8888d24s8ms4" \
DEQP_VARIANT="multisample" \
/install/deqp-runner.sh; then
EXIT=1
fi
# gles31-multisample mustpass -- disabled pending https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1859
# if ! env \
# DEQP_RESULTS_DIR=results/gles31-multisample \
# DEQP_VER=gles31 \
# DEQP_CONFIG="rgba8888d24s8ms4" \
# DEQP_VARIANT="multisample" \
# /install/deqp-runner.sh; then
# EXIT=1
# fi
if ! env \
DEQP_RESULTS_DIR=results/gles31-multisample \
DEQP_VER=gles31 \
DEQP_CONFIG="rgba8888d24s8ms4" \
DEQP_VARIANT="multisample" \
/install/deqp-runner.sh; then
EXIT=1
fi
exit $EXIT
......@@ -11,3 +11,4 @@ stack.
:maxdepth: 2
alu
tex
NIR Texture Instructions
========================
Even though texture instructions *could* be supported as intrinsics, the vast
number of combinations mean that doing so is practically impossible. Instead,
NIR has a dedicated texture instruction. There are several texture operations:
.. doxygenenum:: nir_texop
As with other instruction types, there is still an array of sources, except
that each source also has a *type* associated with it. There are various
source types, each corresponding to a piece of information that the different
texture operations require.
.. doxygenenum:: nir_tex_src_type
Of particular interest are the texture/sampler deref/index/handle source types.
First, note that textures and samplers are specified separately in NIR. While
not required for OpenGL, this is required for Vulkan and OpenCL. Some
OpenGL [ES] drivers have to deal with hardware that does not have separate
samplers and textures. While not recommended, an OpenGL-only driver may assume
that the texture and sampler derefs will always point to the same resource, if
needed. Note that this pretty well paints your compiler into a corner and
makes any future port to Vulkan or OpenCL harder, so such assumptions should
really only be made if targeting OpenGL ES 2.0 era hardware.
Also, like a lot of other resources, there are multiple ways to represent a
texture in NIR. It can be referenced by a variable dereference, an index, or a
bindless handle. When using an index or a bindless handle, the texture type
information is generally not available. To handle this, various information
from the type is redundantly stored in the :cpp:struct:`nir_tex_instr` itself.
.. doxygenstruct:: nir_tex_instr
:members:
.. doxygenstruct:: nir_tex_src
:members:
Texture instruction helpers
---------------------------
There are a number of helper functions for working with NIR texture
instructions. They are documented here in no particular order.
.. doxygenfunction:: nir_tex_instr_create
.. doxygenfunction:: nir_tex_instr_need_sampler
.. doxygenfunction:: nir_tex_instr_result_size
.. doxygenfunction:: nir_tex_instr_dest_size
.. doxygenfunction:: nir_tex_instr_is_query
.. doxygenfunction:: nir_tex_instr_has_implicit_derivative
.. doxygenfunction:: nir_tex_instr_src_type
.. doxygenfunction:: nir_tex_instr_src_size
.. doxygenfunction:: nir_tex_instr_src_index
.. doxygenfunction:: nir_tex_instr_add_src
.. doxygenfunction:: nir_tex_instr_remove_src
Texture instruction lowering
----------------------------
Because most hardware only supports some subset of all possible GLSL/SPIR-V
texture operations, NIR provides a quite powerful lowering pass which is able
to implement more complex texture operations in terms of simpler ones.
.. doxygenfunction:: nir_lower_tex
.. doxygenstruct:: nir_lower_tex_options
:members:
.. doxygenenum:: nir_lower_tex_packing
......@@ -6,34 +6,15 @@ extern "C" {
#endif
/*
** Copyright (c) 2013-2017 The Khronos Group Inc.
** Copyright 2013-2020 The Khronos Group Inc.
** SPDX-License-Identifier: Apache-2.0
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos EGL XML API Registry.
** The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: b5409265f3 $ on $Git commit date: 2020-02-20 08:24:34 -0800 $
** Khronos $Git commit SHA1: e8baa0bf39 $ on $Git commit date: 2021-04-26 17:56:26 -0600 $
*/
#include <EGL/eglplatform.h>
......@@ -42,7 +23,7 @@ extern "C" {
#define EGL_EGL_PROTOTYPES 1
#endif
/* Generated on date 20200220 */
/* Generated on date 20210604 */
/* Generated C header for:
* API: egl
......
......@@ -6,39 +6,20 @@ extern "C" {
#endif
/*
** Copyright (c) 2013-2017 The Khronos Group Inc.
** Copyright 2013-2020 The Khronos Group Inc.
** SPDX-License-Identifier: Apache-2.0
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos EGL XML API Registry.
** The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: b5409265f3 $ on $Git commit date: 2020-02-20 08:24:34 -0800 $
** Khronos $Git commit SHA1: e8baa0bf39 $ on $Git commit date: 2021-04-26 17:56:26 -0600 $
*/
#include <EGL/eglplatform.h>
#define EGL_EGLEXT_VERSION 20200220
#define EGL_EGLEXT_VERSION 20210604
/* Generated C header for:
* API: egl
......@@ -593,6 +574,14 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu
#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */
#ifndef EGL_ANGLE_sync_control_rate
#define EGL_ANGLE_sync_control_rate 1
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMSCRATEANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *numerator, EGLint *denominator);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglGetMscRateANGLE (EGLDisplay dpy, EGLSurface surface, EGLint *numerator, EGLint *denominator);
#endif
#endif /* EGL_ANGLE_sync_control_rate */
#ifndef EGL_ANGLE_window_fixed_size
#define EGL_ANGLE_window_fixed_size 1
#define EGL_FIXED_SIZE_ANGLE 0x3201
......@@ -694,6 +683,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint a
#define EGL_DRM_MASTER_FD_EXT 0x333C
#endif /* EGL_EXT_device_drm */
#ifndef EGL_EXT_device_drm_render_node
#define EGL_EXT_device_drm_render_node 1
#define EGL_DRM_RENDER_NODE_FILE_EXT 0x3377
#endif /* EGL_EXT_device_drm_render_node */
#ifndef EGL_EXT_device_enumeration
#define EGL_EXT_device_enumeration 1
#endif /* EGL_EXT_device_enumeration */
......@@ -703,10 +697,22 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint a
#define EGL_OPENWF_DEVICE_ID_EXT 0x3237
#endif /* EGL_EXT_device_openwf */
#ifndef EGL_EXT_device_persistent_id
#define EGL_EXT_device_persistent_id 1
#define EGL_DEVICE_UUID_EXT 0x335C
#define EGL_DRIVER_UUID_EXT 0x335D
#define EGL_DRIVER_NAME_EXT 0x335E
#endif /* EGL_EXT_device_persistent_id */
#ifndef EGL_EXT_device_query
#define EGL_EXT_device_query 1
#endif /* EGL_EXT_device_query */
#ifndef EGL_EXT_device_query_name
#define EGL_EXT_device_query_name 1
#define EGL_RENDERER_EXT 0x335F
#endif /* EGL_EXT_device_query_name */
#ifndef EGL_EXT_gl_colorspace_bt2020_linear
#define EGL_EXT_gl_colorspace_bt2020_linear 1
#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
......@@ -883,11 +889,11 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy,
#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6
#endif /* EGL_EXT_platform_x11 */
#ifndef EGL_MESA_platform_xcb
#define EGL_MESA_platform_xcb 1
#ifndef EGL_EXT_platform_xcb
#define EGL_EXT_platform_xcb 1
#define EGL_PLATFORM_XCB_EXT 0x31DC
#define EGL_PLATFORM_XCB_SCREEN_EXT 0x31DE
#endif /* EGL_MESA_platform_xcb */
#endif /* EGL_EXT_platform_xcb */
#ifndef EGL_EXT_protected_content
#define EGL_EXT_protected_content 1
......@@ -1155,6 +1161,24 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur
#define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C
#endif /* EGL_NV_robustness_video_memory_purge */
#ifndef EGL_NV_stream_consumer_eglimage
#define EGL_NV_stream_consumer_eglimage 1
#define EGL_STREAM_CONSUMER_IMAGE_NV 0x3373
#define EGL_STREAM_IMAGE_ADD_NV 0x3374
#define EGL_STREAM_IMAGE_REMOVE_NV 0x3375
#define EGL_STREAM_IMAGE_AVAILABLE_NV 0x3376
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
#endif
#endif /* EGL_NV_stream_consumer_eglimage */
#ifndef EGL_NV_stream_consumer_gltexture_yuv
#define EGL_NV_stream_consumer_gltexture_yuv 1
#define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C
......
......@@ -55,7 +55,7 @@ radv_polaris10_vkcts:
- polaris10
# Run three jobs in parallel each running 1/30th of the test suite
.radv_stoney_vkcts:amd64:
radv_stoney_vkcts:amd64:
extends:
- .lava-test:amd64
- .radv-rules
......
......@@ -6485,24 +6485,9 @@ visit_image_size(isel_context* ctx, nir_intrinsic_instr* instr)
mimg->dmask = (1 << instr->dest.ssa.num_components) - 1;
mimg->da = glsl_sampler_type_is_array(type);
if (glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_CUBE && glsl_sampler_type_is_array(type)) {
assert(instr->dest.ssa.num_components == 3);
Temp tmp = ctx->program->allocateTmp(v3);
mimg->definitions[0] = Definition(tmp);
emit_split_vector(ctx, tmp, 3);
/* divide 3rd value by 6 by multiplying with magic number */
Temp c = bld.copy(bld.def(s1), Operand::c32(0x2AAAAAAB));
Temp by_6 =
bld.vop3(aco_opcode::v_mul_hi_i32, bld.def(v1), emit_extract_vector(ctx, tmp, 2, v1), c);
bld.pseudo(aco_opcode::p_create_vector, Definition(dst), emit_extract_vector(ctx, tmp, 0, v1),
emit_extract_vector(ctx, tmp, 1, v1), by_6);
} else if (ctx->options->chip_class == GFX9 &&
glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_1D &&
glsl_sampler_type_is_array(type)) {
if (ctx->options->chip_class == GFX9 &&
glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_1D &&
glsl_sampler_type_is_array(type)) {
assert(instr->dest.ssa.num_components == 2);
dmask = 0x5;
}
......@@ -9494,11 +9479,6 @@ visit_tex(isel_context* ctx, nir_tex_instr* instr)
if (!has_lod)
lod = bld.copy(bld.def(v1), Operand::zero());
bool div_by_6 = instr->op == nir_texop_txs && instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE &&
instr->is_array && (dmask & (1 << 2));
if (tmp_dst.id() == dst.id() && div_by_6)
tmp_dst = bld.tmp(tmp_dst.regClass());
MIMG_instruction* tex = emit_mimg(bld, aco_opcode::image_get_resinfo, Definition(tmp_dst),
resource, Operand(s4), std::vector<Temp>{lod});
if (ctx->options->chip_class == GFX9 && instr->op == nir_texop_txs &&
......@@ -9512,19 +9492,6 @@ visit_tex(isel_context* ctx, nir_tex_instr* instr)
tex->da = da;
tex->dim = dim;
if (div_by_6) {
/* divide 3rd value by 6 by multiplying with magic number */
emit_split_vector(ctx, tmp_dst, tmp_dst.size());
Temp c = bld.copy(bld.def(s1), Operand::c32(0x2AAAAAAB));
Temp by_6 = bld.vop3(aco_opcode::v_mul_hi_i32, bld.def(v1),
emit_extract_vector(ctx, tmp_dst, 2, v1), c);
assert(instr->dest.ssa.num_components == 3);
Temp tmp = dst.type() == RegType::vgpr ? dst : bld.tmp(v3);
tmp_dst = bld.pseudo(aco_opcode::p_create_vector, Definition(tmp),
emit_extract_vector(ctx, tmp_dst, 0, v1),
emit_extract_vector(ctx, tmp_dst, 1, v1), by_6);
}
expand_vector(ctx, tmp_dst, dst, instr->dest.ssa.num_components, dmask);
return;
}
......
......@@ -3760,6 +3760,11 @@ select_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
if ((instr->opcode == aco_opcode::v_fma_f32 || instr->opcode == aco_opcode::v_fma_f16) &&
ctx.program->chip_class < GFX10)
return;
/* There are no v_fmaak_legacy_f16/v_fmamk_legacy_f16 and on chips where VOP3 can take
* literals (GFX10+), these instructions don't exist.
*/
if (instr->opcode == aco_opcode::v_fma_legacy_f16)
return;
bool sgpr_used = false;
uint32_t literal_idx = 0;
......
......@@ -95,7 +95,7 @@ _libaco = static_library(
],
gnu_symbol_visibility : 'hidden',
build_by_default : true,
cpp_args : cpp_args_aco,
cpp_args : [cpp_args_aco, cpp_msvc_compat_args],
)
# Also link with aco
......
......@@ -2768,16 +2768,8 @@ static LLVMValueRef visit_image_size(struct ac_nir_context *ctx, const nir_intri
res = ac_build_image_opcode(&ctx->ac, &args);
LLVMValueRef two = LLVMConstInt(ctx->ac.i32, 2, false);
if (dim == GLSL_SAMPLER_DIM_CUBE && is_array) {
LLVMValueRef six = LLVMConstInt(ctx->ac.i32, 6, false);
LLVMValueRef z = LLVMBuildExtractElement(ctx->ac.builder, res, two, "");
z = LLVMBuildSDiv(ctx->ac.builder, z, six, "");
res = LLVMBuildInsertElement(ctx->ac.builder, res, z, two, "");
}
if (ctx->ac.chip_class == GFX9 && dim == GLSL_SAMPLER_DIM_1D && is_array) {
LLVMValueRef two = LLVMConstInt(ctx->ac.i32, 2, false);
LLVMValueRef layers = LLVMBuildExtractElement(ctx->ac.builder, res, two, "");
res = LLVMBuildInsertElement(ctx->ac.builder, res, layers, ctx->ac.i32_1, "");
}
......@@ -4339,8 +4331,6 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
case nir_tex_src_ms_index:
sample_index = get_src(ctx, instr->src[i].src);
break;
case nir_tex_src_ms_mcs:
break;
case nir_tex_src_ddx:
ddx = get_src(ctx, instr->src[i].src);
args.g16 = instr->src[i].src.ssa->bit_size == 16;
......@@ -4616,14 +4606,7 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
else if (instr->is_shadow && instr->is_new_style_shadow && instr->op != nir_texop_txs &&
instr->op != nir_texop_lod && instr->op != nir_texop_tg4)
result = LLVMBuildExtractElement(ctx->ac.builder, result, ctx->ac.i32_0, "");
else if (instr->op == nir_texop_txs && instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE &&
instr->is_array) {
LLVMValueRef two = LLVMConstInt(ctx->ac.i32, 2, false);
LLVMValueRef six = LLVMConstInt(ctx->ac.i32, 6, false);
LLVMValueRef z = LLVMBuildExtractElement(ctx->ac.builder, result, two, "");
z = LLVMBuildSDiv(ctx->ac.builder, z, six, "");
result = LLVMBuildInsertElement(ctx->ac.builder, result, z, two, "");
} else if (ctx->ac.chip_class == GFX9 && instr->op == nir_texop_txs &&
else if (ctx->ac.chip_class == GFX9 && instr->op == nir_texop_txs &&
instr->sampler_dim == GLSL_SAMPLER_DIM_1D && instr->is_array) {
LLVMValueRef two = LLVMConstInt(ctx->ac.i32, 2, false);
LLVMValueRef layers = LLVMBuildExtractElement(ctx->ac.builder, result, two, "");
......
......@@ -102,7 +102,7 @@ if not with_platform_windows
endif
radv_deps = []
radv_flags = cc.get_supported_arguments(['-Wimplicit-fallthrough', '-Wshadow', '-Wpointer-arith'])
radv_flags = cc.get_supported_arguments(['-Wimplicit-fallthrough', '-Wshadow'])
if with_platform_x11
radv_deps += dep_xcb_dri3
......@@ -167,8 +167,8 @@ libvulkan_radeon = shared_library(
dep_valgrind, radv_deps, idep_aco,
idep_mesautil, idep_nir, idep_vulkan_util, idep_amdgfxregs_h, idep_xmlconfig,
],
c_args : [no_override_init_args, radv_flags],
cpp_args : [radv_flags],
c_args : [no_override_init_args, radv_flags, c_msvc_compat_args],
cpp_args : [radv_flags, cpp_msvc_compat_args],
link_args : [
ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections, libvulkan_radeon_ld_args,
],
......
......@@ -673,10 +673,17 @@ radv_shader_compile_to_nir(struct radv_device *device, struct vk_shader_module *
static const nir_lower_tex_options tex_options = {
.lower_txp = ~0,
.lower_tg4_offsets = true,
.lower_txs_cube_array = true,
};
nir_lower_tex(nir, &tex_options);
static const nir_lower_image_options image_options = {
.lower_cube_size = true,
};
nir_lower_image(nir, &image_options);
nir_lower_vars_to_ssa(nir);
if (nir->info.stage == MESA_SHADER_VERTEX || nir->info.stage == MESA_SHADER_GEOMETRY ||
......
......@@ -371,18 +371,30 @@ KHR-GLES2.texture_3d.filtering.sizes.63x63x63_nearest_mipmap_linear,Fail
KHR-GLES2.texture_3d.filtering.sizes.63x63x63_nearest_mipmap_nearest,Fail
KHR-GLES2.texture_3d.framebuffer_texture.rgba,Fail
KHR-GLES2.texture_3d.sub_image.rgba8,Fail
dEQP-EGL.functional.color_clears.multi_context.gles2.rgb888_pbuffer,Crash
dEQP-EGL.functional.color_clears.multi_context.gles2.rgb888_window,Crash
dEQP-EGL.functional.color_clears.multi_context.gles2.rgba8888_pbuffer,Crash
dEQP-EGL.functional.color_clears.multi_context.gles2.rgba8888_window,Crash
dEQP-EGL.functional.color_clears.multi_thread.gles2.rgb888_pbuffer,Crash
dEQP-EGL.functional.color_clears.multi_thread.gles2.rgb888_window,Crash
dEQP-EGL.functional.color_clears.multi_thread.gles2.rgba8888_pbuffer,Crash
dEQP-EGL.functional.color_clears.multi_thread.gles2.rgba8888_window,Crash
dEQP-EGL.functional.color_clears.single_context.gles2.rgb888_pbuffer,Crash
dEQP-EGL.functional.color_clears.single_context.gles2.rgb888_window,Crash
dEQP-EGL.functional.color_clears.single_context.gles2.rgba8888_pbuffer,Crash
dEQP-EGL.functional.color_clears.single_context.gles2.rgba8888_window,Crash
dEQP-EGL.functional.create_context.no_config,Fail
dEQP-EGL.functional.render.multi_context.gles2.rgb888_pbuffer,Crash
dEQP-EGL.functional.render.multi_context.gles2.rgb888_window,Crash
dEQP-EGL.functional.render.multi_context.gles2.rgba8888_pbuffer,Crash
dEQP-EGL.functional.render.multi_context.gles2.rgba8888_window,Crash
dEQP-EGL.functional.render.multi_thread.gles2.rgb888_pbuffer,Crash
dEQP-EGL.functional.render.multi_thread.gles2.rgb888_window,Crash
dEQP-EGL.functional.render.multi_thread.gles2.rgba8888_pbuffer,Crash
dEQP-EGL.functional.render.multi_thread.gles2.rgba8888_window,Crash
dEQP-EGL.functional.render.single_context.gles2.rgb888_pbuffer,Crash
dEQP-EGL.functional.render.single_context.gles2.rgb888_window,Crash
dEQP-EGL.functional.render.single_context.gles2.rgba8888_pbuffer,Crash
dEQP-EGL.functional.render.single_context.gles2.rgba8888_window,Crash
dEQP-GLES2.functional.clipping.line.wide_line_clip_viewport_center,Fail
dEQP-GLES2.functional.clipping.line.wide_line_clip_viewport_corner,Fail
......
......@@ -2,4 +2,5 @@ glx@glx_arb_sync_control@swapbuffersmsc-divisor-zero
glx@glx_arb_sync_control@waitformsc
spec@!opengl 1.1@depthstencil-default_fb-drawpixels-24_8 samples=4
spec@!opengl 1.1@depthstencil-default_fb-drawpixels-float-and-ushort samples=4
spec@arb_occlusion_query@occlusion_query_order
spec@egl_chromium_sync_control@conformance
......@@ -34,33 +34,53 @@
#include "common/v3d_debug.h"
#include "util/macros.h"
#include "util/debug.h"
#include "util/u_debug.h"
#include "c11/threads.h"
uint32_t V3D_DEBUG = 0;
static const struct debug_control debug_control[] = {
{ "cl", V3D_DEBUG_CL},
{ "clif", V3D_DEBUG_CLIF},
{ "qpu", V3D_DEBUG_QPU},
{ "vir", V3D_DEBUG_VIR},
{ "nir", V3D_DEBUG_NIR},
{ "tgsi", V3D_DEBUG_TGSI},
{ "shaderdb", V3D_DEBUG_SHADERDB},
{ "surface", V3D_DEBUG_SURFACE},
{ "perf", V3D_DEBUG_PERF},
{ "norast", V3D_DEBUG_NORAST},
{ "fs", V3D_DEBUG_FS},
{ "gs", V3D_DEBUG_GS},
{ "vs", V3D_DEBUG_VS},
{ "cs", V3D_DEBUG_CS},
{ "always_flush", V3D_DEBUG_ALWAYS_FLUSH},
{ "precompile", V3D_DEBUG_PRECOMPILE},
{ "ra", V3D_DEBUG_RA},
{ "dump_spirv", V3D_DEBUG_DUMP_SPIRV},
{ NULL, 0 }
static const struct debug_named_value debug_control[] = {
{ "cl", V3D_DEBUG_CL,
"Dump command list during creation" },
{ "clif", V3D_DEBUG_CLIF,
"Dump command list (CLIF format) during creation", },
{ "qpu", V3D_DEBUG_QPU,
"Dump generated QPU instructions" },
{ "vir", V3D_DEBUG_VIR,
"Dump VIR during program compile" },
{ "nir", V3D_DEBUG_NIR,
"Dump NIR during program compile" },
{ "tgsi", V3D_DEBUG_TGSI,
"Dump TGSI during program compile" },
{ "shaderdb", V3D_DEBUG_SHADERDB,
"Dump program compile information for shader-db analysis" },
{ "surface", V3D_DEBUG_SURFACE,
"Print resource layout information" },
{ "perf", V3D_DEBUG_PERF,
"Print during runtime performance-related events" },
{ "norast", V3D_DEBUG_NORAST,
"Skip actual hardware execution of commands" },
{ "fs", V3D_DEBUG_FS,
"Dump fragment shaders" },
{ "gs", V3D_DEBUG_GS,
"Dump geometry shaders" },
{ "vs", V3D_DEBUG_VS,
"Dump vertex shaders" },
{ "cs", V3D_DEBUG_CS,
"Dump computer shaders" },
{ "always_flush", V3D_DEBUG_ALWAYS_FLUSH,
"Flush after each draw call" },
{ "precompile", V3D_DEBUG_PRECOMPILE,
"Precompiles shader variant at shader state creation time" },
{ "ra", V3D_DEBUG_RA,
"Dump register allocation failures" },
{ "dump_spirv", V3D_DEBUG_DUMP_SPIRV,
"Dump SPIR-V code" },
{ NULL }
};
DEBUG_GET_ONCE_FLAGS_OPTION(v3d_debug, "V3D_DEBUG", debug_control, 0)
uint32_t
v3d_debug_flag_for_shader_stage(gl_shader_stage stage)
{
......@@ -76,20 +96,11 @@ v3d_debug_flag_for_shader_stage(gl_shader_stage stage)
return flags[stage];
}
static void
v3d_process_debug_variable_once(void)
{
V3D_DEBUG = parse_debug_string(getenv("V3D_DEBUG"), debug_control);
if (V3D_DEBUG & V3D_DEBUG_SHADERDB)
V3D_DEBUG |= V3D_DEBUG_NORAST;
}
void
v3d_process_debug_variable(void)
{
static once_flag v3d_process_debug_variable_flag = ONCE_FLAG_INIT;
V3D_DEBUG = debug_get_option_v3d_debug();
call_once(&v3d_process_debug_variable_flag,
v3d_process_debug_variable_once);
if (V3D_DEBUG & V3D_DEBUG_SHADERDB)
V3D_DEBUG |= V3D_DEBUG_NORAST;
}
......@@ -236,7 +236,7 @@ record_textures_used(struct shader_info *info,
if (op == nir_texop_txf ||
op == nir_texop_txf_ms ||
op == nir_texop_txf_ms_mcs)
op == nir_texop_txf_ms_mcs_intel)
BITSET_SET_RANGE(info->textures_used_by_txf, var->data.binding, var->data.binding + (MAX2(size, 1) - 1));
}
......
......@@ -739,6 +739,44 @@ validate_first_and_last_interface_explicit_locations(struct gl_context *ctx,
}
}
/**
* Check if we should force input / output matching between shader
* interfaces.
*
* Section 4.3.4 (Inputs) of the GLSL 4.10 specifications say:
*
* "Only the input variables that are actually read need to be
* written by the previous stage; it is allowed to have
* superfluous declarations of input variables."
*
* However it's not defined anywhere as to how we should handle
* inputs that are not written in the previous stage and it's not
* clear what "actually read" means.
*
* The GLSL 4.20 spec however is much clearer:
*
* "Only the input variables that are statically read need to
* be written by the previous stage; it is allowed to have
* superfluous declarations of input variables."
*
* It also has a table that states it is an error to statically
* read an input that is not defined in the previous stage. While
* it is not an error to not statically write to the output (it
* just needs to be defined to not be an error).
*
* The text in the GLSL 4.20 spec was an attempt to clarify the
* previous spec iterations. However given the difference in spec
* and that some applications seem to depend on not erroring when
* the input is not actually read in control flow we only apply
* this rule to GLSL 4.20 and higher. GLSL 4.10 shaders have been
* seen in the wild that depend on the less strict interpretation.
*/
static bool
static_input_output_matching(struct gl_shader_program *prog)
{
return prog->data->Version >= (prog->IsES ? 0 : 420);
}
/**
* Validate that outputs from one stage match inputs of another
*/
......@@ -847,7 +885,7 @@ cross_validate_outputs_to_inputs(struct gl_context *ctx,
* output declaration and there is Static Use of the
* declared input.
*/
if (input->data.used) {
if (input->data.used && static_input_output_matching(prog)) {
linker_error(prog,
"%s shader input `%s' with explicit location "
"has no matching output\n",
......@@ -882,40 +920,11 @@ cross_validate_outputs_to_inputs(struct gl_context *ctx,
/* Check for input vars with unmatched output vars in prev stage
* taking into account that interface blocks could have a matching
* output but with different name, so we ignore them.
*
* Section 4.3.4 (Inputs) of the GLSL 4.10 specifications say:
*
* "Only the input variables that are actually read need to be
* written by the previous stage; it is allowed to have
* superfluous declarations of input variables."
*
* However it's not defined anywhere as to how we should handle
* inputs that are not written in the previous stage and it's not
* clear what "actually read" means.
*
* The GLSL 4.20 spec however is much clearer:
*
* "Only the input variables that are statically read need to
* be written by the previous stage; it is allowed to have
* superfluous declarations of input variables."
*
* It also has a table that states it is an error to statically
* read an input that is not defined in the previous stage. While
* it is not an error to not statically write to the output (it
* just needs to be defined to not be an error).
*
* The text in the GLSL 4.20 spec was an attempt to clarify the
* previous spec iterations. However given the difference in spec
* and that some applications seem to depend on not erroring when
* the input is not actually read in control flow we only apply
* this rule to GLSL 4.00 and higher. GLSL 4.00 was chosen as
* a 3.30 shader is the highest version of GLSL we have seen in
* the wild dependant on the less strict interpretation.
*/
assert(!input->data.assigned);
if (input->data.used && !input->get_interface_type() &&
!input->data.explicit_location &&
(prog->data->Version >= (prog->IsES ? 0 : 400)))
static_input_output_matching(prog))
linker_error(prog,
"%s shader input `%s' "
"has no matching output in the previous stage\n",
......
......@@ -2010,40 +2010,135 @@ nir_intrinsic_can_reorder(nir_intrinsic_instr *instr)
bool nir_intrinsic_writes_external_memory(const nir_intrinsic_instr *instr);
/**
* \group texture information
*
* This gives semantic information about textures which is useful to the
* frontend, the backend, and lowering passes, but not the optimizer.
*/
/** Texture instruction source type */
typedef enum {
/** Texture coordinate
*
* Must have nir_tex_instr::coord_components components.
*/
nir_tex_src_coord,
/** Projector
*
* The texture coordinate (except for the array component, if any) is
* divided by this value before LOD computation and sampling.
*
* Must be a float scalar.
*/
nir_tex_src_projector,
nir_tex_src_comparator, /* shadow comparator */
/** Shadow comparator
*
* For shadow sampling, the fetched texel values are compared against the
* shadow comparator using the compare op specified by the sampler object
* and converted to 1.0 if the comparison succeeds and 0.0 if it fails.
* Interpolation happens after this conversion so the actual result may be
* anywhere in the range [0.0, 1.0].
*
* Only valid if nir_tex_instr::is_shadow and must be a float scalar.
*/
nir_tex_src_comparator,
/** Coordinate offset
*
* An integer value that is added to the texel address before sampling.
* This is only allowed with operations that take an explicit LOD as it is
* applied in integer texel space after LOD selection and not normalized
* coordinate space.
*/
nir_tex_src_offset,
/** LOD bias
*
* This value is added to the computed LOD before mip-mapping.
*/
nir_tex_src_bias,
/** Explicit LOD */
nir_tex_src_lod,
/** Min LOD
*
* The computed LOD is clamped to be at least as large as min_lod before
* mip-mapping.
*/
nir_tex_src_min_lod,
nir_tex_src_ms_index, /* MSAA sample index */
nir_tex_src_ms_mcs, /* MSAA compression value */
/** MSAA sample index */
nir_tex_src_ms_index,
/** Intel-specific MSAA compression data */
nir_tex_src_ms_mcs_intel,
/** Explicit horizontal (X-major) coordinate derivative */
nir_tex_src_ddx,
/** Explicit vertical (Y-major) coordinate derivative */
nir_tex_src_ddy,
nir_tex_src_texture_deref, /* < deref pointing to the texture */
nir_tex_src_sampler_deref, /* < deref pointing to the sampler */
nir_tex_src_texture_offset, /* < dynamically uniform indirect offset */
nir_tex_src_sampler_offset, /* < dynamically uniform indirect offset */
nir_tex_src_texture_handle, /* < bindless texture handle */
nir_tex_src_sampler_handle, /* < bindless sampler handle */
nir_tex_src_plane, /* < selects plane for planar textures */
/** Texture variable dereference */
nir_tex_src_texture_deref,
/** Sampler variable dereference */
nir_tex_src_sampler_deref,
/** Texture index offset
*
* This is added to nir_tex_instr::texture_index. Unless
* nir_tex_instr::texture_non_uniform is set, this is guaranteed to be
* dynamically uniform.
*/
nir_tex_src_texture_offset,
/** Dynamically uniform sampler index offset
*
* This is added to nir_tex_instr::sampler_index. Unless
* nir_tex_instr::sampler_non_uniform is set, this is guaranteed to be
* dynamically uniform.
*/
nir_tex_src_sampler_offset,
/** Bindless texture handle
*
* This is, unfortunately, a bit overloaded at the moment. There are
* generally two types of bindless handles:
*
* 1. For GL_ARB_bindless bindless handles. These are part of the
* GL/Gallium-level API and are always a 64-bit integer.
*
* 2. HW-specific handles. GL_ARB_bindless handles may be lowered to
* these. Also, these are used by many Vulkan drivers to implement
* descriptor sets, especially for UPDATE_AFTER_BIND descriptors.
* The details of hardware handles (bit size, format, etc.) is
* HW-specific.
*
* Because of this overloading and the resulting ambiguity, we currently
* don't validate anything for these.
*/
nir_tex_src_texture_handle,
/** Bindless sampler handle
*
* See nir_tex_src_texture_handle,
*/
nir_tex_src_sampler_handle,
/** Plane index for multi-plane YCbCr textures */
nir_tex_src_plane,
nir_num_tex_src_types
} nir_tex_src_type;
/** A texture instruction source */
typedef struct {
/** Base source */
nir_src src;
/** Type of this source */
nir_tex_src_type src_type;
} nir_tex_src;
/** Texture instruction opcode */
typedef enum {
nir_texop_tex, /**< Regular texture look-up */
nir_texop_txb, /**< Texture look-up with LOD bias */
......@@ -2052,7 +2147,7 @@ typedef enum {
nir_texop_txf, /**< Texel fetch with explicit LOD */
nir_texop_txf_ms, /**< Multisample texture fetch */
nir_texop_txf_ms_fb, /**< Multisample texture fetch from framebuffer */
nir_texop_txf_ms_mcs, /**< Multisample compression value fetch */
nir_texop_txf_ms_mcs_intel, /**< Multisample compression value fetch */
nir_texop_txs, /**< Texture size */
nir_texop_lod, /**< Texture lod query */
nir_texop_tg4, /**< Texture gather */
......@@ -2066,43 +2161,88 @@ typedef enum {
nir_texop_fragment_mask_fetch,/**< Multisample fragment mask texture fetch */
} nir_texop;
/** Represents a texture instruction */
typedef struct {
/** Base instruction */
nir_instr instr;
/** Dimensionality of the texture operation
*
* This will typically match the dimensionality of the texture deref type
* if a nir_tex_src_texture_deref is present. However, it may not if
* texture lowering has occurred.
*/
enum glsl_sampler_dim sampler_dim;
/** ALU type of the destination
*
* This is the canonical sampled type for this texture operation and may
* not exactly match the sampled type of the deref type when a
* nir_tex_src_texture_deref is present. For OpenCL, the sampled type of
* the texture deref will be GLSL_TYPE_VOID and this is allowed to be
* anything. With SPIR-V, the signedness of integer types is allowed to
* differ. For all APIs, the bit size may differ if the driver has done
* any sort of mediump or similar lowering since texture types always have
* 32-bit sampled types.
*/
nir_alu_type dest_type;
/** Texture opcode */
nir_texop op;
/** Destination */
nir_dest dest;
/** Array of sources
*
* This array has nir_tex_instr::num_srcs elements
*/
nir_tex_src *src;
unsigned num_srcs, coord_components;
bool is_array, is_shadow;
/** Number of sources */
unsigned num_srcs;
/** Number of components in the coordinate, if any */
unsigned coord_components;
/** True if the texture instruction acts on an array texture */
bool is_array;
/** True if the texture instruction performs a shadow comparison
*
* If this is true, the texture instruction must have a
* nir_tex_src_comparator.
*/
bool is_shadow;
/**
* If is_shadow is true, whether this is the old-style shadow that outputs 4
* components or the new-style shadow that outputs 1 component.
* If is_shadow is true, whether this is the old-style shadow that outputs
* 4 components or the new-style shadow that outputs 1 component.
*/