radv: Revert divisor = 0 case for vertex attribute extension.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 15 Aug 2018 14:28:24 +0000 (16:28 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 16 Aug 2018 09:13:19 +0000 (11:13 +0200)
Seems like DXVK depends on that and it might get reverted
upstream. Since apps are not supposed to use 0 in v2 anyway,
we should be safe implementing the old behavior there.

Fixes: 66e12451ac4 "radv: Update to new VK_EXT_vertex_attribute_divisor to version 2."
CC: 18.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_nir_to_llvm.c

index bfd8b562e5c01ca80780b555653d23ca27b11067..8bf3ae0f150083d68867bfbbfcc631a26b53046d 100644 (file)
@@ -2006,7 +2006,7 @@ handle_vs_input_decl(struct radv_shader_context *ctx,
                                                MAX2(1, ctx->shader_info->vs.vgpr_comp_cnt);
                                }
                        } else {
-                               unreachable("Invalid vertex attribute divisor of 0.");
+                               buffer_index = ctx->ac.i32_0;
                        }
 
                        buffer_index = LLVMBuildAdd(ctx->ac.builder, ctx->abi.start_instance, buffer_index, "");