(nir_lower_io_options)0);
} else {
assert(cso->type == PIPE_SHADER_IR_TGSI);
- so->nir = ir2_tgsi_to_nir(cso->tokens);
+ so->nir = ir2_tgsi_to_nir(cso->tokens, pctx->screen);
}
if (ir2_optimize_nir(so->nir, true))
(nir_lower_io_options)0);
} else {
assert(cso->type == PIPE_SHADER_IR_TGSI);
- so->nir = ir2_tgsi_to_nir(cso->tokens);
+ so->nir = ir2_tgsi_to_nir(cso->tokens, pctx->screen);
}
if (ir2_optimize_nir(so->nir, true))
#define IR2_H_
#include "compiler/nir/nir.h"
+#include "pipe/p_context.h"
struct ir2_fetch_info {
/* dword offset of the fetch instruction */
void ir2_compile(struct fd2_shader_stateobj *so, unsigned variant,
struct fd2_shader_stateobj *fp);
-struct nir_shader *ir2_tgsi_to_nir(const struct tgsi_token *tokens);
+struct nir_shader *ir2_tgsi_to_nir(const struct tgsi_token *tokens,
+ struct pipe_screen *screen);
const nir_shader_compiler_options *ir2_get_compiler_options(void);
};
struct nir_shader *
-ir2_tgsi_to_nir(const struct tgsi_token *tokens)
+ir2_tgsi_to_nir(const struct tgsi_token *tokens,
+ struct pipe_screen *screen)
{
+ /* TODO: pass screen to tgsi_to_nir when it needs that. */
+ (void) screen;
return tgsi_to_nir(tokens, &options);
}
{
struct fd_context *ctx = fd_context(pctx);
struct ir3_compiler *compiler = ctx->screen->compiler;
- return ir3_shader_create(compiler, cso, type, &ctx->debug);
+ return ir3_shader_create(compiler, cso, type, &ctx->debug, pctx->screen);
}
static void *
{
struct fd_context *ctx = fd_context(pctx);
struct ir3_compiler *compiler = ctx->screen->compiler;
- return ir3_shader_create(compiler, cso, type, &ctx->debug);
+ return ir3_shader_create(compiler, cso, type, &ctx->debug, pctx->screen);
}
static void *
struct ir3_compiler *compiler = ctx->screen->compiler;
struct fd5_compute_stateobj *so = CALLOC_STRUCT(fd5_compute_stateobj);
- so->shader = ir3_shader_create_compute(compiler, cso, &ctx->debug);
+ so->shader = ir3_shader_create_compute(compiler, cso, &ctx->debug, pctx->screen);
return so;
}
{
struct fd_context *ctx = fd_context(pctx);
struct ir3_compiler *compiler = ctx->screen->compiler;
- return ir3_shader_create(compiler, cso, type, &ctx->debug);
+ return ir3_shader_create(compiler, cso, type, &ctx->debug, pctx->screen);
}
static void *
struct ir3_compiler *compiler = ctx->screen->compiler;
struct fd6_compute_stateobj *so = CALLOC_STRUCT(fd6_compute_stateobj);
- so->shader = ir3_shader_create_compute(compiler, cso, &ctx->debug);
+ so->shader = ir3_shader_create_compute(compiler, cso, &ctx->debug, pctx->screen);
return so;
}
{
struct fd_context *ctx = fd_context(pctx);
struct ir3_compiler *compiler = ctx->screen->compiler;
- return ir3_shader_create(compiler, cso, type, &ctx->debug);
+ return ir3_shader_create(compiler, cso, type, &ctx->debug, pctx->screen);
}
static void *
#include "compiler/nir_types.h"
#include "compiler/spirv/nir_spirv.h"
+#include "pipe/p_context.h"
+
static void dump_info(struct ir3_shader_variant *so, const char *str)
{
uint32_t *bin;
if (ir3_shader_debug & IR3_DBG_OPTMSGS)
tgsi_dump(toks, 0);
- nir = ir3_tgsi_to_nir(compiler, toks);
+ nir = ir3_tgsi_to_nir(compiler, toks, NULL);
NIR_PASS_V(nir, nir_lower_global_vars_to_local);
} else if (from_spirv) {
nir = load_spirv(filenames[0], entry, stage);
*/
#include "pipe/p_state.h"
+#include "pipe/p_screen.h"
#include "util/u_string.h"
#include "util/u_memory.h"
#include "util/u_inlines.h"
struct ir3_shader *
ir3_shader_create(struct ir3_compiler *compiler,
const struct pipe_shader_state *cso, gl_shader_stage type,
- struct pipe_debug_callback *debug)
+ struct pipe_debug_callback *debug,
+ struct pipe_screen *screen)
{
nir_shader *nir;
if (cso->type == PIPE_SHADER_IR_NIR) {
if (ir3_shader_debug & IR3_DBG_DISASM) {
tgsi_dump(cso->tokens, 0);
}
- nir = ir3_tgsi_to_nir(compiler, cso->tokens);
+ nir = ir3_tgsi_to_nir(compiler, cso->tokens, screen);
}
struct ir3_shader *shader = ir3_shader_from_nir(compiler, nir);
struct ir3_shader *
ir3_shader_create_compute(struct ir3_compiler *compiler,
const struct pipe_compute_state *cso,
- struct pipe_debug_callback *debug)
+ struct pipe_debug_callback *debug,
+ struct pipe_screen *screen)
{
nir_shader *nir;
if (cso->ir_type == PIPE_SHADER_IR_NIR) {
if (ir3_shader_debug & IR3_DBG_DISASM) {
tgsi_dump(cso->prog, 0);
}
- nir = ir3_tgsi_to_nir(compiler, cso->prog);
+ nir = ir3_tgsi_to_nir(compiler, cso->prog, screen);
}
struct ir3_shader *shader = ir3_shader_from_nir(compiler, nir);
}
struct nir_shader *
-ir3_tgsi_to_nir(struct ir3_compiler *compiler, const struct tgsi_token *tokens)
+ir3_tgsi_to_nir(struct ir3_compiler *compiler,
+ const struct tgsi_token *tokens,
+ struct pipe_screen *screen)
{
+ /* TODO: pass screen to tgsi_to_nir when it needs that. */
+ (void) screen;
return tgsi_to_nir(tokens, ir3_get_compiler_options(compiler));
}
#define IR3_GALLIUM_H_
#include "pipe/p_state.h"
+#include "pipe/p_screen.h"
#include "ir3/ir3_shader.h"
struct ir3_shader * ir3_shader_create(struct ir3_compiler *compiler,
const struct pipe_shader_state *cso, gl_shader_stage type,
- struct pipe_debug_callback *debug);
+ struct pipe_debug_callback *debug,
+ struct pipe_screen *screen);
struct ir3_shader *
ir3_shader_create_compute(struct ir3_compiler *compiler,
const struct pipe_compute_state *cso,
- struct pipe_debug_callback *debug);
+ struct pipe_debug_callback *debug,
+ struct pipe_screen *screen);
struct ir3_shader_variant * ir3_shader_variant(struct ir3_shader *shader,
struct ir3_shader_key key, bool binning_pass,
struct pipe_debug_callback *debug);
struct nir_shader * ir3_tgsi_to_nir(struct ir3_compiler *compiler,
- const struct tgsi_token *tokens);
+ const struct tgsi_token *tokens,
+ struct pipe_screen *screen);
struct fd_ringbuffer;
struct fd_context;