No need to add a third set of enums to the mix.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
enum pipe_shader_ir ir_type,
const void *ir,
const char *src,
- int type,
+ gl_shader_stage stage,
struct panfrost_shader_state *state)
{
uint8_t *dst;
s = tgsi_to_nir(ir, ctx->base.screen);
}
- s->info.stage = type == JOB_TYPE_VERTEX ? MESA_SHADER_VERTEX : MESA_SHADER_FRAGMENT;
+ s->info.stage = stage;
- if (s->info.stage == MESA_SHADER_FRAGMENT) {
+ if (stage == MESA_SHADER_FRAGMENT) {
/* Inject the alpha test now if we need to */
if (state->alpha_state.enabled) {
meta->midgard1.uniform_count = MIN2(program.uniform_count, program.uniform_cutoff);
meta->midgard1.work_count = program.work_register_count;
- switch (s->info.stage) {
+ switch (stage) {
case MESA_SHADER_VERTEX:
meta->attribute_count = util_bitcount64(s->info.inputs_read);
meta->varying_count = util_bitcount64(s->info.outputs_written);
panfrost_shader_compile(ctx, v->tripipe,
cso->ir_type, cso->prog, NULL,
- JOB_TYPE_COMPUTE, v);
+ MESA_SHADER_COMPUTE, v);
#include "util/u_prim_restart.h"
#include "indices/u_primconvert.h"
#include "tgsi/tgsi_parse.h"
+#include "tgsi/tgsi_from_mesa.h"
#include "util/u_math.h"
#include "pan_screen.h"
/* Do not actually send anything to the GPU; merely generate the cmdstream as fast as possible. Disables framebuffer writes */
//#define DRY_RUN
-static enum mali_job_type
-panfrost_job_type_for_pipe(enum pipe_shader_type type) {
- switch (type)
- {
- case PIPE_SHADER_VERTEX:
- return JOB_TYPE_VERTEX;
-
- case PIPE_SHADER_FRAGMENT:
- /* Note: JOB_TYPE_FRAGMENT is different.
- * JOB_TYPE_FRAGMENT actually executes the
- * fragment shader, but JOB_TYPE_TILER is how you
- * specify it*/
- return JOB_TYPE_TILER;
-
- case PIPE_SHADER_GEOMETRY:
- return JOB_TYPE_GEOMETRY;
-
- case PIPE_SHADER_COMPUTE:
- return JOB_TYPE_COMPUTE;
-
- default:
- unreachable("Unsupported shader stage");
- }
-}
-
/* Framebuffer descriptor */
static struct midgard_tiler_descriptor
variants->base.ir.nir :
variants->base.tokens,
NULL,
- panfrost_job_type_for_pipe(type), shader_state);
+ tgsi_processor_to_shader_stage(type), shader_state);
shader_state->compiled = true;
}
#include "util/hash_table.h"
#include "midgard/midgard_compile.h"
+#include "compiler/shader_enums.h"
/* Forward declare to avoid extra header dep */
struct prim_convert_context;
enum pipe_shader_ir ir_type,
const void *ir,
const char *src,
- int type,
+ gl_shader_stage stage,
struct panfrost_shader_state *state);
void