diff options
author | Samuel Pitoiset <[email protected]> | 2019-09-17 10:51:46 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-10-02 18:09:30 +0200 |
commit | 3be21b5ab157530d1b56d7db57b80ed8080b89b4 (patch) | |
tree | 5a3b410b9498099cb4ae739f811247540e51104b /src/amd | |
parent | 60f8224171129e4f36b1155d0d30c5dea3f864b3 (diff) |
radv/gfx10: use the component mask when storing/loading NGG stream outputs
It's unnecessary to store/load more components that needed.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_nir_to_llvm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c index 8339bc02326..69a5e0bb9f9 100644 --- a/src/amd/vulkan/radv_nir_to_llvm.c +++ b/src/amd/vulkan/radv_nir_to_llvm.c @@ -3205,6 +3205,9 @@ static void build_streamout_vertex(struct radv_shader_context *ctx, struct radv_shader_output_values out = {}; for (unsigned comp = 0; comp < 4; comp++) { + if (!(output->component_mask & (1 << comp))) + continue; + tmp = ac_build_gep0(&ctx->ac, vertexptr, LLVMConstInt(ctx->ac.i32, 4 * i + comp, false)); out.values[comp] = LLVMBuildLoad(builder, tmp, ""); @@ -3595,6 +3598,9 @@ handle_ngg_outputs_post_1(struct radv_shader_context *ctx) unsigned loc = output->location; for (unsigned comp = 0; comp < 4; comp++) { + if (!(output->component_mask & (1 << comp))) + continue; + tmp = ac_build_gep0(&ctx->ac, vertex_ptr, LLVMConstInt(ctx->ac.i32, 4 * i + comp, false)); tmp2 = LLVMBuildLoad(builder, |