radv/gfx10: account for the subpass view for the NGG GS storage
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 6 Sep 2019 08:32:13 +0000 (10:32 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 6 Sep 2019 15:25:28 +0000 (17:25 +0200)
If the fragment shader needs the layer index, we have to allocate
one more dword in the NGG GS storage. Found by inspection. This
doesn't fix anything known.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_nir_to_llvm.c

index 92fcec9015ac00aae9f89bb2a44faff3aced7891..10cc82eb8d9ca810c8a34ae83830fe217ace441e 100644 (file)
@@ -2981,6 +2981,9 @@ ngg_gs_get_vertex_storage(struct radv_shader_context *ctx)
 {
        unsigned num_outputs = util_bitcount64(ctx->output_mask);
 
+       if (ctx->options->key.has_multiview_view_index)
+               num_outputs++;
+
        LLVMTypeRef elements[2] = {
                LLVMArrayType(ctx->ac.i32, 4 * num_outputs),
                LLVMArrayType(ctx->ac.i8, 4),