diff options
author | Karol Herbst <[email protected]> | 2018-11-29 15:21:12 +0100 |
---|---|---|
committer | Karol Herbst <[email protected]> | 2019-01-21 20:36:41 +0100 |
commit | 8bb46de08b310b902f49795be45608293e21255e (patch) | |
tree | 228268450a023d42a4418222e77502a31dd83a67 /src/gallium | |
parent | 2aa78e46e9746174e24a192eefd4e3fee703a357 (diff) |
mesa: add MESA_SHADER_KERNEL
used for CL kernels
Signed-off-by: Karol Herbst <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_emit.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_emit.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_program.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_util.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_cmdline.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_gallium.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_nir.c | 4 |
7 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c index 711ff4ac66c..befb025930e 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c @@ -56,6 +56,7 @@ shader_t_to_opcode(gl_shader_stage type) return CP_LOAD_STATE6_GEOM; case MESA_SHADER_FRAGMENT: case MESA_SHADER_COMPUTE: + case MESA_SHADER_KERNEL: return CP_LOAD_STATE6_FRAG; default: unreachable("bad shader type"); diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.h b/src/gallium/drivers/freedreno/a6xx/fd6_emit.h index 289e4877418..9e578844741 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.h +++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.h @@ -163,6 +163,7 @@ fd6_stage2shadersb(gl_shader_stage type) case MESA_SHADER_FRAGMENT: return SB6_FS_SHADER; case MESA_SHADER_COMPUTE: + case MESA_SHADER_KERNEL: return SB6_CS_SHADER; default: unreachable("bad shader type"); diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_program.c b/src/gallium/drivers/freedreno/a6xx/fd6_program.c index 53d4a1d3e5b..9fde74201dd 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_program.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_program.c @@ -105,6 +105,7 @@ fd6_emit_shader(struct fd_ringbuffer *ring, const struct ir3_shader_variant *so) break; case MESA_SHADER_FRAGMENT: case MESA_SHADER_COMPUTE: + case MESA_SHADER_KERNEL: opcode = CP_LOAD_STATE6_FRAG; break; default: diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h index 17e64b03f38..3e7ea638a6e 100644 --- a/src/gallium/drivers/freedreno/freedreno_util.h +++ b/src/gallium/drivers/freedreno/freedreno_util.h @@ -480,6 +480,7 @@ fd4_stage2shadersb(gl_shader_stage type) case MESA_SHADER_FRAGMENT: return SB4_FS_SHADER; case MESA_SHADER_COMPUTE: + case MESA_SHADER_KERNEL: return SB4_CS_SHADER; default: unreachable("bad shader type"); diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c index 94838416ece..364e62b308c 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c @@ -165,6 +165,7 @@ load_glsl(unsigned num_files, char* const* files, gl_shader_stage stage) ir3_glsl_type_size); break; case MESA_SHADER_COMPUTE: + case MESA_SHADER_KERNEL: break; default: errx(1, "unhandled shader stage: %d", stage); diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c index cc6efa1ca17..7e7b699678f 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c @@ -588,7 +588,7 @@ void ir3_emit_cs_consts(const struct ir3_shader_variant *v, struct fd_ringbuffer *ring, struct fd_context *ctx, const struct pipe_grid_info *info) { - debug_assert(v->type == MESA_SHADER_COMPUTE); + debug_assert(gl_shader_stage_is_compute(v->type)); emit_common_consts(v, ring, ctx, PIPE_SHADER_COMPUTE); diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 65da6384c7d..037376a22ef 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -362,7 +362,7 @@ void si_nir_scan_shader(const struct nir_shader *nir, } } - if (nir->info.stage == MESA_SHADER_COMPUTE) { + if (gl_shader_stage_is_compute(nir->info.stage)) { info->properties[TGSI_PROPERTY_CS_FIXED_BLOCK_WIDTH] = nir->info.cs.local_size[0]; info->properties[TGSI_PROPERTY_CS_FIXED_BLOCK_HEIGHT] = nir->info.cs.local_size[1]; info->properties[TGSI_PROPERTY_CS_FIXED_BLOCK_DEPTH] = nir->info.cs.local_size[2]; @@ -1051,7 +1051,7 @@ bool si_nir_build_llvm(struct si_shader_context *ctx, struct nir_shader *nir) ctx->num_images = util_last_bit(info->images_declared); if (ctx->shader->selector->info.properties[TGSI_PROPERTY_CS_LOCAL_SIZE]) { - assert(nir->info.stage == MESA_SHADER_COMPUTE); + assert(gl_shader_stage_is_compute(nir->info.stage)); si_declare_compute_memory(ctx); } ac_nir_translate(&ctx->ac, &ctx->abi, nir); |