mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
iris: remove stage_from_pipe and pipe_from_stage helpers
Both simply take mesa_shader_stage and return it, pipe_shader_type was
renamed to mesa_shader_stage by f972e76148 .
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36918>
This commit is contained in:
parent
ecf8aa2700
commit
e09b4ff65e
3 changed files with 9 additions and 29 deletions
|
|
@ -24,19 +24,6 @@
|
||||||
#define IRIS_PIPE_H
|
#define IRIS_PIPE_H
|
||||||
|
|
||||||
#include "pipe/p_defines.h"
|
#include "pipe/p_defines.h"
|
||||||
#include "compiler/shader_enums.h"
|
|
||||||
|
|
||||||
static inline mesa_shader_stage
|
|
||||||
stage_from_pipe(mesa_shader_stage pstage)
|
|
||||||
{
|
|
||||||
return (mesa_shader_stage)pstage;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline mesa_shader_stage
|
|
||||||
stage_to_pipe(mesa_shader_stage stage)
|
|
||||||
{
|
|
||||||
return (mesa_shader_stage)stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert an swizzle enumeration (i.e. PIPE_SWIZZLE_X) to one of the HW's
|
* Convert an swizzle enumeration (i.e. PIPE_SWIZZLE_X) to one of the HW's
|
||||||
|
|
|
||||||
|
|
@ -4001,10 +4001,9 @@ iris_shader_perf_log(void *data, unsigned *id, const char *fmt, ...)
|
||||||
|
|
||||||
const struct nir_shader_compiler_options *
|
const struct nir_shader_compiler_options *
|
||||||
iris_get_compiler_options(struct pipe_screen *pscreen,
|
iris_get_compiler_options(struct pipe_screen *pscreen,
|
||||||
mesa_shader_stage pstage)
|
mesa_shader_stage stage)
|
||||||
{
|
{
|
||||||
struct iris_screen *screen = (struct iris_screen *) pscreen;
|
struct iris_screen *screen = (struct iris_screen *) pscreen;
|
||||||
mesa_shader_stage stage = stage_from_pipe(pstage);
|
|
||||||
|
|
||||||
#ifdef INTEL_USE_ELK
|
#ifdef INTEL_USE_ELK
|
||||||
return screen->brw ? screen->brw->nir_options[stage]
|
return screen->brw ? screen->brw->nir_options[stage]
|
||||||
|
|
|
||||||
|
|
@ -2623,12 +2623,11 @@ iris_create_sampler_state(struct pipe_context *ctx,
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
iris_bind_sampler_states(struct pipe_context *ctx,
|
iris_bind_sampler_states(struct pipe_context *ctx,
|
||||||
mesa_shader_stage p_stage,
|
mesa_shader_stage stage,
|
||||||
unsigned start, unsigned count,
|
unsigned start, unsigned count,
|
||||||
void **states)
|
void **states)
|
||||||
{
|
{
|
||||||
struct iris_context *ice = (struct iris_context *) ctx;
|
struct iris_context *ice = (struct iris_context *) ctx;
|
||||||
mesa_shader_stage stage = stage_from_pipe(p_stage);
|
|
||||||
struct iris_shader_state *shs = &ice->state.shaders[stage];
|
struct iris_shader_state *shs = &ice->state.shaders[stage];
|
||||||
|
|
||||||
assert(start + count <= IRIS_MAX_SAMPLERS);
|
assert(start + count <= IRIS_MAX_SAMPLERS);
|
||||||
|
|
@ -3357,14 +3356,13 @@ fill_buffer_image_param(struct isl_image_param *param,
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
iris_set_shader_images(struct pipe_context *ctx,
|
iris_set_shader_images(struct pipe_context *ctx,
|
||||||
mesa_shader_stage p_stage,
|
mesa_shader_stage stage,
|
||||||
unsigned start_slot, unsigned count,
|
unsigned start_slot, unsigned count,
|
||||||
unsigned unbind_num_trailing_slots,
|
unsigned unbind_num_trailing_slots,
|
||||||
const struct pipe_image_view *p_images)
|
const struct pipe_image_view *p_images)
|
||||||
{
|
{
|
||||||
struct iris_context *ice = (struct iris_context *) ctx;
|
struct iris_context *ice = (struct iris_context *) ctx;
|
||||||
struct iris_screen *screen = (struct iris_screen *)ctx->screen;
|
struct iris_screen *screen = (struct iris_screen *)ctx->screen;
|
||||||
mesa_shader_stage stage = stage_from_pipe(p_stage);
|
|
||||||
struct iris_shader_state *shs = &ice->state.shaders[stage];
|
struct iris_shader_state *shs = &ice->state.shaders[stage];
|
||||||
#if GFX_VER == 8
|
#if GFX_VER == 8
|
||||||
struct iris_genx_state *genx = ice->state.genx;
|
struct iris_genx_state *genx = ice->state.genx;
|
||||||
|
|
@ -3489,7 +3487,7 @@ iris_set_shader_images(struct pipe_context *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unbind_num_trailing_slots) {
|
if (unbind_num_trailing_slots) {
|
||||||
iris_set_shader_images(ctx, p_stage, start_slot + count,
|
iris_set_shader_images(ctx, stage, start_slot + count,
|
||||||
unbind_num_trailing_slots, 0, NULL);
|
unbind_num_trailing_slots, 0, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3505,7 +3503,7 @@ is_sampler_view_3d(const struct iris_sampler_view *view)
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
iris_set_sampler_views(struct pipe_context *ctx,
|
iris_set_sampler_views(struct pipe_context *ctx,
|
||||||
mesa_shader_stage p_stage,
|
mesa_shader_stage stage,
|
||||||
unsigned start, unsigned count,
|
unsigned start, unsigned count,
|
||||||
unsigned unbind_num_trailing_slots,
|
unsigned unbind_num_trailing_slots,
|
||||||
struct pipe_sampler_view **views)
|
struct pipe_sampler_view **views)
|
||||||
|
|
@ -3513,7 +3511,6 @@ iris_set_sampler_views(struct pipe_context *ctx,
|
||||||
struct iris_context *ice = (struct iris_context *) ctx;
|
struct iris_context *ice = (struct iris_context *) ctx;
|
||||||
UNUSED struct iris_screen *screen = (void *) ctx->screen;
|
UNUSED struct iris_screen *screen = (void *) ctx->screen;
|
||||||
UNUSED const struct intel_device_info *devinfo = screen->devinfo;
|
UNUSED const struct intel_device_info *devinfo = screen->devinfo;
|
||||||
mesa_shader_stage stage = stage_from_pipe(p_stage);
|
|
||||||
struct iris_shader_state *shs = &ice->state.shaders[stage];
|
struct iris_shader_state *shs = &ice->state.shaders[stage];
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
|
|
@ -3949,12 +3946,11 @@ iris_set_framebuffer_state(struct pipe_context *ctx,
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
iris_set_constant_buffer(struct pipe_context *ctx,
|
iris_set_constant_buffer(struct pipe_context *ctx,
|
||||||
mesa_shader_stage p_stage, unsigned index,
|
mesa_shader_stage stage, unsigned index,
|
||||||
bool take_ownership,
|
bool take_ownership,
|
||||||
const struct pipe_constant_buffer *input)
|
const struct pipe_constant_buffer *input)
|
||||||
{
|
{
|
||||||
struct iris_context *ice = (struct iris_context *) ctx;
|
struct iris_context *ice = (struct iris_context *) ctx;
|
||||||
mesa_shader_stage stage = stage_from_pipe(p_stage);
|
|
||||||
struct iris_shader_state *shs = &ice->state.shaders[stage];
|
struct iris_shader_state *shs = &ice->state.shaders[stage];
|
||||||
struct pipe_shader_buffer *cbuf = &shs->constbuf[index];
|
struct pipe_shader_buffer *cbuf = &shs->constbuf[index];
|
||||||
|
|
||||||
|
|
@ -3972,7 +3968,7 @@ iris_set_constant_buffer(struct pipe_context *ctx,
|
||||||
|
|
||||||
if (!cbuf->buffer) {
|
if (!cbuf->buffer) {
|
||||||
/* Allocation was unsuccessful - just unbind */
|
/* Allocation was unsuccessful - just unbind */
|
||||||
iris_set_constant_buffer(ctx, p_stage, index, false, NULL);
|
iris_set_constant_buffer(ctx, stage, index, false, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4109,13 +4105,12 @@ upload_sysvals(struct iris_context *ice,
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
iris_set_shader_buffers(struct pipe_context *ctx,
|
iris_set_shader_buffers(struct pipe_context *ctx,
|
||||||
mesa_shader_stage p_stage,
|
mesa_shader_stage stage,
|
||||||
unsigned start_slot, unsigned count,
|
unsigned start_slot, unsigned count,
|
||||||
const struct pipe_shader_buffer *buffers,
|
const struct pipe_shader_buffer *buffers,
|
||||||
unsigned writable_bitmask)
|
unsigned writable_bitmask)
|
||||||
{
|
{
|
||||||
struct iris_context *ice = (struct iris_context *) ctx;
|
struct iris_context *ice = (struct iris_context *) ctx;
|
||||||
mesa_shader_stage stage = stage_from_pipe(p_stage);
|
|
||||||
struct iris_shader_state *shs = &ice->state.shaders[stage];
|
struct iris_shader_state *shs = &ice->state.shaders[stage];
|
||||||
|
|
||||||
unsigned modified_bits = u_bit_consecutive(start_slot, count);
|
unsigned modified_bits = u_bit_consecutive(start_slot, count);
|
||||||
|
|
@ -9616,7 +9611,6 @@ iris_rebind_buffer(struct iris_context *ice,
|
||||||
|
|
||||||
for (int s = MESA_SHADER_VERTEX; s < MESA_SHADER_STAGES; s++) {
|
for (int s = MESA_SHADER_VERTEX; s < MESA_SHADER_STAGES; s++) {
|
||||||
struct iris_shader_state *shs = &ice->state.shaders[s];
|
struct iris_shader_state *shs = &ice->state.shaders[s];
|
||||||
mesa_shader_stage p_stage = stage_to_pipe(s);
|
|
||||||
|
|
||||||
if (!(res->bind_stages & (1 << s)))
|
if (!(res->bind_stages & (1 << s)))
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -9651,7 +9645,7 @@ iris_rebind_buffer(struct iris_context *ice,
|
||||||
.buffer_offset = ssbo->buffer_offset,
|
.buffer_offset = ssbo->buffer_offset,
|
||||||
.buffer_size = ssbo->buffer_size,
|
.buffer_size = ssbo->buffer_size,
|
||||||
};
|
};
|
||||||
iris_set_shader_buffers(ctx, p_stage, i, 1, &buf,
|
iris_set_shader_buffers(ctx, s, i, 1, &buf,
|
||||||
(shs->writable_ssbos >> i) & 1);
|
(shs->writable_ssbos >> i) & 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue