enum shader_t type)
{
struct fd3_shader_stateobj *so = CALLOC_STRUCT(fd3_shader_stateobj);
- so->shader = ir3_shader_create(pctx, cso, type);
+ struct ir3_compiler *compiler = fd_context(pctx)->screen->compiler;
+ so->shader = ir3_shader_create(compiler, cso, type);
return so;
}
enum shader_t type)
{
struct fd4_shader_stateobj *so = CALLOC_STRUCT(fd4_shader_stateobj);
- so->shader = ir3_shader_create(pctx, cso, type);
+ struct ir3_compiler *compiler = fd_context(pctx)->screen->compiler;
+ so->shader = ir3_shader_create(compiler, cso, type);
return so;
}
case PIPE_CAP_DEPTH_BOUNDS_TEST:
case PIPE_CAP_TGSI_TXQS:
case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
- case PIPE_CAP_SHAREABLE_SHADERS:
case PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS:
case PIPE_CAP_CLEAR_TEXTURE:
case PIPE_CAP_DRAW_PARAMETERS:
case PIPE_CAP_MAX_VIEWPORTS:
return 1;
+ case PIPE_CAP_SHAREABLE_SHADERS:
+ if (is_ir3(screen))
+ return 1;
+ return 0;
+
/* Stream output. */
case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
if (is_ir3(screen))
}
struct ir3_shader *
-ir3_shader_create(struct pipe_context *pctx,
+ir3_shader_create(struct ir3_compiler *compiler,
const struct pipe_shader_state *cso,
enum shader_t type)
{
struct ir3_shader *shader = CALLOC_STRUCT(ir3_shader);
- shader->compiler = fd_context(pctx)->screen->compiler;
+ shader->compiler = compiler;
shader->id = ++shader->compiler->shader_count;
- shader->pctx = pctx;
shader->type = type;
if (fd_mesa_debug & FD_DBG_DISASM) {
DBG("dump tgsi: type=%d", shader->type);
struct ir3_compiler *compiler;
- struct pipe_context *pctx; /* TODO replace w/ pipe_screen */
nir_shader *nir;
struct pipe_stream_output_info stream_output;
void * ir3_shader_assemble(struct ir3_shader_variant *v, uint32_t gpu_id);
-struct ir3_shader * ir3_shader_create(struct pipe_context *pctx,
+struct ir3_shader * ir3_shader_create(struct ir3_compiler *compiler,
const struct pipe_shader_state *cso, enum shader_t type);
void ir3_shader_destroy(struct ir3_shader *shader);
struct ir3_shader_variant * ir3_shader_variant(struct ir3_shader *shader,