Compare commits

...

10 Commits

Author SHA1 Message Date
Juan A. Suarez Romero
5d72a334e8 Update version to 19.1.0-rc1
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
2019-05-07 16:10:40 +00:00
Timothy Arceri
825ca9e42e radeonsi: add config entry for Counter-Strike Global Offensive
This fixes rendering issues with gun scopes which is rather
important.

Cc: "19.0" "19.1" <mesa-stable@lists.freedesktop.org>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100239
(cherry picked from commit 49025292fb)
2019-05-07 10:47:39 +00:00
Erik Faye-Lund
67f2be0fbf draw: flush when setting stream-out targets
We need to re-prepare the middle-end state to pick up changes to this
state to react correctly to pausing/resuming stream-out. So let's add a
flush here.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: ec8cbd79ac "draw/softpipe: EXT_transform_feedback support (v2)"
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit d84b85bc28)
2019-05-07 10:46:02 +00:00
John Stultz
05faf6eb56 mesa: Makefile.sources: Add nir_lower_fb_read.c to Makefile.sources list
In commit a99c360a46 (nir: add pass to lower fb reads), a new
file was added that needs to also be added to the
Makefile.sources list used by the Android and SCons build system.

Cc: Rob Clark <robdclark@chromium.org>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Greg Hartman <ghartman@google.com>
Cc: Tapani Pälli <tapani.palli@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Fixes: a99c360a46 ("nir: add pass to lower fb reads")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
(cherry picked from commit c7f2145b4b)
2019-05-06 17:04:24 +02:00
John Stultz
3495bdca13 mesa: Makefile.sources: Add ir3_nir_lower_load_barycentric_at_sample/offset to Makefile.sources
In commit 2f0b9d2249 ("freedreno/ir3: lower
load_barycentric_at_offset") a new file was added that needs to
also be added to the Makefile.sources list used by Android and
SCons build system.

Cc: Rob Clark <robdclark@chromium.org>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Greg Hartman <ghartman@google.com>
Cc: Tapani Pälli <tapani.palli@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Fixes: 2f0b9d2249 ("freedreno/ir3: lower load_barycentric_at_offset")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
(cherry picked from commit d04f44a459)
2019-05-06 17:03:09 +02:00
John Stultz
f93e1f92c4 mesa: android: freedreno: Fix build failure due to path change
The ir3_nir_trig.py file was moved in a previous commit,
aa0fed10d3 (freedreno: move ir3 to common location),
so update the Android.gen.mk file to match.

Cc: Rob Clark <robdclark@chromium.org>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Greg Hartman <ghartman@google.com>
Cc: Tapani Pälli <tapani.palli@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Fixes: aa0fed10d3 ("freedreno: move ir3 to common location")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
(cherry picked from commit c935862127)
2019-05-06 17:02:18 +02:00
Amit Pundir
8c0b80e08a mesa: android: freedreno: build libfreedreno_{drm,ir3} static libs
Add libfreedreno_drm/ir3 to the build

Cc: Rob Clark <robdclark@chromium.org>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Greg Hartman <ghartman@google.com>
Cc: Tapani Pälli <tapani.palli@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Fixes: b4476138d5 ("freedreno: move drm to common location")
Fixes: aa0fed10d3 ("freedreno: move ir3 to common location")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
[jstultz: Tweaked to add extra ir3 files from master]
Signed-off-by: John Stultz <john.stultz@linaro.org>
(cherry picked from commit 88105375c9)
2019-05-06 17:00:59 +02:00
Bas Nieuwenhuizen
070d763d5d radv: Implement cosited_even sampling.
Apparently cosited_even was the required one instead of midpoint.

This adds slight offset of 0.5 pixels to the coordinates (+ we need
the image size to convert to normalized coords)

Fixes: 91702374d5 "radv: Add ycbcr lowering pass."
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 5692351264)
2019-05-06 16:59:58 +02:00
Bas Nieuwenhuizen
ed0d4eaa4c radv: Disable subsampled formats.
Broken on Polaris and since I discovered NV12 is not subsampled, but
a 2-plane format I decided I don't really care.

Work to do to re-enable:

1) Figure out which devices support it natively.
2) Write some software emulation for the others.

Fixes: 52c1adda21 "radv: Add ycbcr format features."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 5cbe12ad1b)
2019-05-06 16:59:00 +02:00
Timothy Arceri
6e52daa18c util/drirc: add workarounds for bugs in Doom 3: BFG
This makes the game playable on radeonsi.

Cc: "19.0" "19.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110143
(cherry picked from commit 1af72fa4d6)
2019-05-06 16:48:57 +02:00
15 changed files with 232 additions and 7 deletions

View File

@@ -110,6 +110,7 @@ endef
# add subdirectories
SUBDIRS := \
src/freedreno \
src/gbm \
src/loader \
src/mapi \

View File

@@ -1 +1 @@
19.1.0-devel
19.1.0-rc1

View File

@@ -635,7 +635,8 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
const struct vk_format_description *desc = vk_format_description(format);
bool blendable;
bool scaled = false;
if (!desc) {
/* TODO: implement some software emulation of SUBSAMPLED formats. */
if (!desc || desc->layout == VK_FORMAT_LAYOUT_SUBSAMPLED) {
out_properties->linearTilingFeatures = linear;
out_properties->optimalTilingFeatures = tiled;
out_properties->bufferFeatures = buffer;
@@ -655,6 +656,7 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
uint32_t tiling = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT |
VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT;
/* The subsampled formats have no support for linear filters. */

View File

@@ -156,6 +156,73 @@ convert_ycbcr(struct ycbcr_state *state,
converted_channels[2], nir_imm_float(b, 1.0f));
}
static nir_ssa_def *
get_texture_size(struct ycbcr_state *state, nir_deref_instr *texture)
{
nir_builder *b = state->builder;
const struct glsl_type *type = texture->type;
nir_tex_instr *tex = nir_tex_instr_create(b->shader, 1);
tex->op = nir_texop_txs;
tex->sampler_dim = glsl_get_sampler_dim(type);
tex->is_array = glsl_sampler_type_is_array(type);
tex->is_shadow = glsl_sampler_type_is_shadow(type);
tex->dest_type = nir_type_int;
tex->src[0].src_type = nir_tex_src_texture_deref;
tex->src[0].src = nir_src_for_ssa(&texture->dest.ssa);
nir_ssa_dest_init(&tex->instr, &tex->dest,
nir_tex_instr_dest_size(tex), 32, NULL);
nir_builder_instr_insert(b, &tex->instr);
return nir_i2f32(b, &tex->dest.ssa);
}
static nir_ssa_def *
implicit_downsampled_coord(nir_builder *b,
nir_ssa_def *value,
nir_ssa_def *max_value,
int div_scale)
{
return nir_fadd(b,
value,
nir_fdiv(b,
nir_imm_float(b, 1.0f),
nir_fmul(b,
nir_imm_float(b, div_scale),
max_value)));
}
static nir_ssa_def *
implicit_downsampled_coords(struct ycbcr_state *state,
nir_ssa_def *old_coords)
{
nir_builder *b = state->builder;
const struct radv_sampler_ycbcr_conversion *conversion = state->conversion;
nir_ssa_def *image_size = NULL;
nir_ssa_def *comp[4] = { NULL, };
const struct vk_format_description *fmt_desc = vk_format_description(state->conversion->format);
const unsigned divisors[2] = {fmt_desc->width_divisor, fmt_desc->height_divisor};
for (int c = 0; c < old_coords->num_components; c++) {
if (c < ARRAY_SIZE(divisors) && divisors[c] > 1 &&
conversion->chroma_offsets[c] == VK_CHROMA_LOCATION_COSITED_EVEN) {
if (!image_size)
image_size = get_texture_size(state, state->tex_deref);
comp[c] = implicit_downsampled_coord(b,
nir_channel(b, old_coords, c),
nir_channel(b, image_size, c),
divisors[c]);
} else {
comp[c] = nir_channel(b, old_coords, c);
}
}
return nir_vec(b, comp, old_coords->num_components);
}
static nir_ssa_def *
create_plane_tex_instr_implicit(struct ycbcr_state *state,
uint32_t plane)
@@ -163,10 +230,23 @@ create_plane_tex_instr_implicit(struct ycbcr_state *state,
nir_builder *b = state->builder;
nir_tex_instr *old_tex = state->origin_tex;
nir_tex_instr *tex = nir_tex_instr_create(b->shader, old_tex->num_srcs+ 1);
for (uint32_t i = 0; i < old_tex->num_srcs; i++) {
tex->src[i].src_type = old_tex->src[i].src_type;
nir_src_copy(&tex->src[i].src, &old_tex->src[i].src, tex);
switch (old_tex->src[i].src_type) {
case nir_tex_src_coord:
if (plane && true/*state->conversion->chroma_reconstruction*/) {
assert(old_tex->src[i].src.is_ssa);
tex->src[i].src =
nir_src_for_ssa(implicit_downsampled_coords(state,
old_tex->src[i].src.ssa));
break;
}
/* fall through */
default:
nir_src_copy(&tex->src[i].src, &old_tex->src[i].src, tex);
break;
}
}
tex->src[tex->num_srcs - 1].src = nir_src_for_ssa(nir_imm_int(b, plane));

View File

@@ -244,6 +244,7 @@ NIR_FILES = \
nir/nir_lower_constant_initializers.c \
nir/nir_lower_double_ops.c \
nir/nir_lower_drawpixels.c \
nir/nir_lower_fb_read.c \
nir/nir_lower_fragcoord_wtrans.c \
nir/nir_lower_frexp.c \
nir/nir_lower_global_vars_to_local.c \

View File

@@ -0,0 +1,41 @@
# Mesa 3-D graphics library
#
# Copyright (C)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is 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 Software.
#
# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# Android.mk for libfreedreno_drm.a
# ---------------------------------------
# Build libfreedreno_drm
# ---------------------------------------
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(drm_SOURCES)
LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/gallium/include \
$(MESA_TOP)/src/gallium/auxiliary
LOCAL_MODULE := libfreedreno_drm
include $(MESA_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)

View File

@@ -0,0 +1,51 @@
# Mesa 3-D graphics library
#
# Copyright (C)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is 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 Software.
#
# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# Android.mk for libfreedreno_ir3.a
# ---------------------------------------
# Build libfreedreno_ir3
# ---------------------------------------
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(ir3_SOURCES)
LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/compiler/nir \
$(MESA_TOP)/src/gallium/include \
$(MESA_TOP)/src/gallium/auxiliary \
$(MESA_TOP)/prebuilt-intermediates/nir \
# We need libmesa_nir to get NIR's generated include directories.
LOCAL_STATIC_LIBRARIES := \
libmesa_nir
LOCAL_MODULE := libfreedreno_ir3
LOCAL_GENERATED_SOURCES := \
$(MESA_GEN_GLSL_H) \
$(MESA_GEN_NIR_H)
include $(MESA_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)

30
src/freedreno/Android.mk Normal file
View File

@@ -0,0 +1,30 @@
# Mesa 3-D graphics library
#
# Copyright (C)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is 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 Software.
#
# THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# Android.mk for libfreedreno_*
LOCAL_PATH := $(call my-dir)
include $(LOCAL_PATH)/Makefile.sources
include $(MESA_TOP)/src/gallium/drivers/freedreno/Android.gen.mk
include $(LOCAL_PATH)/Android.drm.mk
include $(LOCAL_PATH)/Android.ir3.mk

View File

@@ -36,6 +36,8 @@ ir3_SOURCES := \
ir3/ir3_nir.c \
ir3/ir3_nir.h \
ir3/ir3_nir_analyze_ubo_ranges.c \
ir3/ir3_nir_lower_load_barycentric_at_sample.c \
ir3/ir3_nir_lower_load_barycentric_at_offset.c \
ir3/ir3_nir_lower_io_offsets.c \
ir3/ir3_nir_lower_tg4_to_tex.c \
ir3/ir3_nir_move_varying_inputs.c \

View File

@@ -27,6 +27,9 @@ LOCAL_C_INCLUDES += \
$(GALLIUM_TOP)/include \
$(GALLIUM_TOP)/auxiliary \
$(GALLIUM_TOP)/winsys \
$(GALLIUM_TOP)/drivers
$(GALLIUM_TOP)/drivers \
$(MESA_TOP)/src/freedreno \
$(MESA_TOP)/src/freedreno/ir3 \
$(MESA_TOP)/src/freedreno/registers
include $(MESA_COMMON_MK)

View File

@@ -950,6 +950,8 @@ draw_set_mapped_so_targets(struct draw_context *draw,
{
int i;
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
for (i = 0; i < num_targets; i++)
draw->so.targets[i] = targets[i];
for (i = num_targets; i < PIPE_MAX_SO_BUFFERS; i++)

View File

@@ -25,7 +25,7 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
endif
ir3_nir_trig_deps := \
$(LOCAL_PATH)/ir3/ir3_nir_trig.py \
$(MESA_TOP)/src/freedreno/ir3/ir3_nir_trig.py \
$(MESA_TOP)/src/compiler/nir/nir_algebraic.py
intermediates := $(call local-generated-sources-dir)

View File

@@ -44,7 +44,7 @@ LOCAL_C_INCLUDES := \
LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H)
LOCAL_SHARED_LIBRARIES := libdrm
LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_nir
LOCAL_STATIC_LIBRARIES := libmesa_glsl libmesa_nir libfreedreno_drm libfreedreno_ir3
LOCAL_MODULE := libmesa_pipe_freedreno
include $(LOCAL_PATH)/Android.gen.mk

View File

@@ -53,6 +53,10 @@ LOCAL_SHARED_LIBRARIES += \
libexpat
endif
LOCAL_STATIC_LIBRARIES += \
libfreedreno_drm \
libfreedreno_ir3
ifeq ($(USE_LIBBACKTRACE),true)
LOCAL_SHARED_LIBRARIES += libbacktrace
endif

View File

@@ -111,6 +111,11 @@ TODO: document the other workarounds.
<option name="allow_glsl_builtin_variable_redeclaration" value="true" />
</application>
<application name="Doom 3: BFG" executable="Doom3BFG.exe">
<option name="allow_glsl_builtin_variable_redeclaration" value="true" />
<option name="force_glsl_extensions_warn" value="true" />
</application>
<application name="Dying Light" executable="DyingLightGame">
<option name="allow_glsl_builtin_variable_redeclaration" value="true" />
</application>
@@ -463,6 +468,9 @@ TODO: document the other workarounds.
<application name="ARK: Survival Evolved (and unintentionally the UE4 demo template)" executable="ShooterGame">
<option name="radeonsi_clear_db_cache_before_clear" value="true" />
</application>
<application name="Counter-Strike Global Offensive" executable="csgo_linux64">
<option name="radeonsi_zerovram" value="true" />
</application>
<application name="No Mans Sky" executable="NMS.exe">
<option name="radeonsi_zerovram" value="true" />
</application>