From d39f5519a11ca865506637a8b69cf6f2b7f5699a Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 13 Dec 2019 13:23:11 +0000 Subject: [PATCH] aco: handle unaligned vertex fetch on GFX10 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit pipeline-db (Vega): Totals from affected shaders: SGPRS: 0 -> 0 (0.00 %) VGPRS: 0 -> 0 (0.00 %) Spilled SGPRs: 0 -> 0 (0.00 %) Spilled VGPRs: 0 -> 0 (0.00 %) Private memory VGPRs: 0 -> 0 (0.00 %) Scratch size: 0 -> 0 (0.00 %) dwords per thread Code Size: 0 -> 0 (0.00 %) bytes LDS: 0 -> 0 (0.00 %) blocks Max Waves: 0 -> 0 (0.00 %) pipeline-db (Navi): Totals from affected shaders: SGPRS: 795000 -> 802368 (0.93 %) VGPRS: 579632 -> 581280 (0.28 %) Spilled SGPRs: 0 -> 0 (0.00 %) Spilled VGPRs: 0 -> 0 (0.00 %) Private memory VGPRs: 0 -> 0 (0.00 %) Scratch size: 0 -> 0 (0.00 %) dwords per thread Code Size: 17208408 -> 17583652 (2.18 %) bytes LDS: 0 -> 0 (0.00 %) blocks Max Waves: 145731 -> 145279 (-0.31 %) Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 0847d5b6ca8..16a93ce4c16 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -3072,7 +3072,8 @@ bool check_vertex_fetch_size(isel_context *ctx, const ac_data_format_info *vtx_i unsigned vertex_byte_size = vtx_info->chan_byte_size * channels; if (vtx_info->chan_byte_size != 4 && channels == 3) return false; - return true; + return (ctx->options->chip_class != GFX6 && ctx->options->chip_class != GFX10) || + (offset % vertex_byte_size == 0 && stride % vertex_byte_size == 0); } uint8_t get_fetch_data_format(isel_context *ctx, const ac_data_format_info *vtx_info, -- 2.30.2