All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Jason Ekstrand <jason@jlekstrand.net>
Subject: [RFCv0 5/8] freedreno/ir3: drop tokens arg
Date: Mon, 19 Oct 2015 15:47:58 -0400	[thread overview]
Message-ID: <1445284081-29532-6-git-send-email-robdclark@gmail.com> (raw)
In-Reply-To: <1445284081-29532-1-git-send-email-robdclark@gmail.com>

We can get the tokens from variant->shader so drop the extra arg.  This
will make things easier to support either getting TGSI or NIR as input.
---
 src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
index 8c9234b..b4e5483 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
@@ -126,8 +126,8 @@ struct ir3_compile {
 static struct ir3_instruction * create_immed(struct ir3_block *block, uint32_t val);
 static struct ir3_block * get_block(struct ir3_compile *ctx, nir_block *nblock);
 
-static struct nir_shader *to_nir(struct ir3_compile *ctx,
-		const struct tgsi_token *tokens, struct ir3_shader_variant *so)
+static struct nir_shader *
+to_nir(struct ir3_compile *ctx, struct ir3_shader_variant *so)
 {
 	static const nir_shader_compiler_options options = {
 			.lower_fpow = true,
@@ -164,7 +164,7 @@ static struct nir_shader *to_nir(struct ir3_compile *ctx,
 		tex_options.lower_txp = (1 << GLSL_SAMPLER_DIM_3D);
 	}
 
-	struct nir_shader *s = tgsi_to_nir(tokens, &options);
+	struct nir_shader *s = tgsi_to_nir(so->shader->tokens, &options);
 
 	if (fd_mesa_debug & FD_DBG_OPTMSGS) {
 		debug_printf("----------------------\n");
@@ -214,9 +214,7 @@ static struct nir_shader *to_nir(struct ir3_compile *ctx,
 }
 
 static struct ir3_compile *
-compile_init(struct ir3_compiler *compiler,
-		struct ir3_shader_variant *so,
-		const struct tgsi_token *tokens)
+compile_init(struct ir3_compiler *compiler, struct ir3_shader_variant *so)
 {
 	struct ir3_compile *ctx = rzalloc(NULL, struct ir3_compile);
 
@@ -245,7 +243,7 @@ compile_init(struct ir3_compiler *compiler,
 	ctx->block_ht = _mesa_hash_table_create(ctx,
 			_mesa_hash_pointer, _mesa_key_pointer_equal);
 
-	ctx->s = to_nir(ctx, tokens, so);
+	ctx->s = to_nir(ctx, so);
 
 	so->first_driver_param = so->first_immediate = ctx->s->num_uniforms;
 
@@ -2432,7 +2430,7 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
 
 	assert(!so->ir);
 
-	ctx = compile_init(compiler, so, so->shader->tokens);
+	ctx = compile_init(compiler, so);
 	if (!ctx) {
 		DBG("INIT failed!");
 		ret = -1;
-- 
2.5.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-10-19 19:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 19:47 [RFCv0 0/8] gallium: add support for NIR as alternate IR Rob Clark
2015-10-19 19:47 ` [PATCH 1/8] nir: add nir_var_all enum Rob Clark
2015-10-19 19:47 ` [RFCv0 2/8] gallium: refactor pipe_shader_state to support multiple IR's Rob Clark
2015-10-19 19:47 ` [RFCv0 3/8] gallium: add NIR as a possible IR Rob Clark
2015-10-19 19:47 ` [RFCv0 4/8] mesa/st: add support for NIR as possible driver IR Rob Clark
2015-10-19 19:47 ` Rob Clark [this message]
2015-10-19 19:47 ` [RFCv0 6/8] freedreno/ir3: add support for NIR as preferred IR Rob Clark
2015-10-19 19:48 ` [RFCv0 7/8] freedreno/ir3: fix const_index handling for uniforms Rob Clark
2015-10-19 19:48 ` [RFCv0 8/8] freedreno/ir3: hack for mismatch on varying slots for glsl->tgsi->nir vs glsl->nir Rob Clark
2015-10-19 19:51 ` [RFCv0 0/8] gallium: add support for NIR as alternate IR Ilia Mirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445284081-29532-6-git-send-email-robdclark@gmail.com \
    --to=robdclark@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jason@jlekstrand.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.