radeonsi: simplify some shader type conditions
authorMarek Olšák <marek.olsak@amd.com>
Wed, 19 Apr 2017 01:15:52 +0000 (03:15 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 28 Apr 2017 19:47:35 +0000 (21:47 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index 62dc9e2fceebc6c830709f5dfc933d37dd6e70f6..5ce04d67f38ca769692fd9f725e0f05dd266f755 100644 (file)
@@ -6084,7 +6084,7 @@ static void create_function(struct si_shader_context *ctx)
                                                    "ddxy_lds",
                                                    LOCAL_ADDR_SPACE);
 
-       if ((ctx->type == PIPE_SHADER_VERTEX && shader->key.as_ls) ||
+       if (shader->key.as_ls ||
            ctx->type == PIPE_SHADER_TESS_CTRL)
                declare_tess_lds(ctx);
 }
@@ -6101,11 +6101,7 @@ static void preload_ring_buffers(struct si_shader_context *ctx)
        LLVMValueRef buf_ptr = LLVMGetParam(ctx->main_fn,
                                            ctx->param_rw_buffers);
 
-       if ((ctx->type == PIPE_SHADER_VERTEX &&
-            ctx->shader->key.as_es) ||
-           (ctx->type == PIPE_SHADER_TESS_EVAL &&
-            ctx->shader->key.as_es) ||
-           ctx->type == PIPE_SHADER_GEOMETRY) {
+       if (ctx->shader->key.as_es || ctx->type == PIPE_SHADER_GEOMETRY) {
                unsigned ring =
                        ctx->type == PIPE_SHADER_GEOMETRY ? SI_GS_RING_ESGS
                                                             : SI_ES_RING_ESGS;