Compare commits
10 Commits
explicit-s
...
mesa-19.1.
Author | SHA1 | Date | |
---|---|---|---|
|
5d72a334e8 | ||
|
825ca9e42e | ||
|
67f2be0fbf | ||
|
05faf6eb56 | ||
|
3495bdca13 | ||
|
f93e1f92c4 | ||
|
8c0b80e08a | ||
|
070d763d5d | ||
|
ed0d4eaa4c | ||
|
6e52daa18c |
@@ -110,6 +110,7 @@ endef
|
||||
|
||||
# add subdirectories
|
||||
SUBDIRS := \
|
||||
src/freedreno \
|
||||
src/gbm \
|
||||
src/loader \
|
||||
src/mapi \
|
||||
|
@@ -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. */
|
||||
|
@@ -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));
|
||||
|
@@ -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 \
|
||||
|
41
src/freedreno/Android.drm.mk
Normal file
41
src/freedreno/Android.drm.mk
Normal 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)
|
51
src/freedreno/Android.ir3.mk
Normal file
51
src/freedreno/Android.ir3.mk
Normal 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
30
src/freedreno/Android.mk
Normal 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
|
@@ -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 \
|
||||
|
@@ -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)
|
||||
|
@@ -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++)
|
||||
|
@@ -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)
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user