gallium: Use enum pipe_shader_type in set_sampler_views()

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Kai Wasserbäch 2016-08-27 04:08:00 -06:00 committed by Brian Paul
parent 7413625ad3
commit 532db3b788
34 changed files with 54 additions and 42 deletions

View file

@ -1284,7 +1284,7 @@ cso_restore_fragment_samplers(struct cso_context *ctx)
void
cso_set_sampler_views(struct cso_context *ctx,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
unsigned count,
struct pipe_sampler_view **views)
{

View file

@ -188,7 +188,7 @@ void cso_restore_state(struct cso_context *cso);
void
cso_set_sampler_views(struct cso_context *cso,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
unsigned count,
struct pipe_sampler_view **views);

View file

@ -964,7 +964,7 @@ draw_set_mapped_so_targets(struct draw_context *draw,
void
draw_set_sampler_views(struct draw_context *draw,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
struct pipe_sampler_view **views,
unsigned num)
{
@ -985,7 +985,7 @@ draw_set_sampler_views(struct draw_context *draw,
void
draw_set_samplers(struct draw_context *draw,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
struct pipe_sampler_state **samplers,
unsigned num)
{

View file

@ -167,12 +167,12 @@ draw_buffer(struct draw_context *draw,
void
draw_set_sampler_views(struct draw_context *draw,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
struct pipe_sampler_view **views,
unsigned num);
void
draw_set_samplers(struct draw_context *draw,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
struct pipe_sampler_state **samplers,
unsigned num);

View file

@ -910,7 +910,8 @@ aaline_bind_sampler_states(struct pipe_context *pipe,
static void
aaline_set_sampler_views(struct pipe_context *pipe, unsigned shader,
aaline_set_sampler_views(struct pipe_context *pipe,
enum pipe_shader_type shader,
unsigned start, unsigned num,
struct pipe_sampler_view **views)
{

View file

@ -104,8 +104,8 @@ struct pstip_stage
unsigned, unsigned, void **);
void (*driver_set_sampler_views)(struct pipe_context *,
unsigned shader, unsigned start,
unsigned count,
enum pipe_shader_type shader,
unsigned start, unsigned count,
struct pipe_sampler_view **);
void (*driver_set_polygon_stipple)(struct pipe_context *,
@ -143,7 +143,7 @@ generate_pstip_fs(struct pstip_stage *pstip)
assert(pstip->fs->sampler_unit < PIPE_MAX_SAMPLERS);
pstip->fs->pstip_fs = pstip->driver_create_fs_state(pipe, &pstip_fs);
FREE((void *)pstip_fs.tokens);
if (!pstip->fs->pstip_fs)
@ -399,7 +399,8 @@ pstip_bind_sampler_states(struct pipe_context *pipe,
static void
pstip_set_sampler_views(struct pipe_context *pipe,
unsigned shader, unsigned start, unsigned num,
enum pipe_shader_type shader,
unsigned start, unsigned num,
struct pipe_sampler_view **views)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);

View file

@ -507,7 +507,8 @@ dd_context_stream_output_target_destroy(struct pipe_context *_pipe,
*/
static void
dd_context_set_sampler_views(struct pipe_context *_pipe, unsigned shader,
dd_context_set_sampler_views(struct pipe_context *_pipe,
enum pipe_shader_type shader,
unsigned start, unsigned num,
struct pipe_sampler_view **views)
{

View file

@ -308,7 +308,7 @@ fd4_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
}
static void
fd4_set_sampler_views(struct pipe_context *pctx, unsigned shader,
fd4_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
unsigned start, unsigned nr,
struct pipe_sampler_view **views)
{

View file

@ -102,7 +102,7 @@ fd_sampler_states_bind(struct pipe_context *pctx,
}
void
fd_set_sampler_views(struct pipe_context *pctx, unsigned shader,
fd_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
unsigned start, unsigned nr,
struct pipe_sampler_view **views)
{

View file

@ -35,7 +35,8 @@ void fd_sampler_states_bind(struct pipe_context *pctx,
unsigned shader, unsigned start,
unsigned nr, void **hwcso);
void fd_set_sampler_views(struct pipe_context *pctx, unsigned shader,
void fd_set_sampler_views(struct pipe_context *pctx,
enum pipe_shader_type shader,
unsigned start, unsigned nr,
struct pipe_sampler_view **views);

View file

@ -794,7 +794,7 @@ i915_set_vertex_sampler_views(struct pipe_context *pipe,
static void
i915_set_sampler_views(struct pipe_context *pipe, unsigned shader,
i915_set_sampler_views(struct pipe_context *pipe, enum pipe_shader_type shader,
unsigned start, unsigned num,
struct pipe_sampler_view **views)
{

View file

@ -1802,7 +1802,7 @@ ilo_set_viewport_states(struct pipe_context *pipe,
}
static void
ilo_set_sampler_views(struct pipe_context *pipe, unsigned shader,
ilo_set_sampler_views(struct pipe_context *pipe, enum pipe_shader_type shader,
unsigned start, unsigned count,
struct pipe_sampler_view **views)
{
@ -1846,6 +1846,9 @@ ilo_set_sampler_views(struct pipe_context *pipe, unsigned shader,
case PIPE_SHADER_COMPUTE:
vec->dirty |= ILO_DIRTY_VIEW_CS;
break;
default:
assert(!"unexpected shader type");
break;
}
}

View file

@ -106,7 +106,7 @@ llvmpipe_bind_sampler_states(struct pipe_context *pipe,
static void
llvmpipe_set_sampler_views(struct pipe_context *pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start,
unsigned num,
struct pipe_sampler_view **views)

View file

@ -124,7 +124,8 @@ static struct pipe_surface *noop_create_surface(struct pipe_context *ctx,
return surface;
}
static void noop_set_sampler_views(struct pipe_context *ctx, unsigned shader,
static void noop_set_sampler_views(struct pipe_context *ctx,
enum pipe_shader_type shader,
unsigned start, unsigned count,
struct pipe_sampler_view **views)
{

View file

@ -196,7 +196,7 @@ nv30_fragtex_set_sampler_views(struct pipe_context *pipe, unsigned nr,
static void
nv30_set_sampler_views(struct pipe_context *pipe, unsigned shader,
nv30_set_sampler_views(struct pipe_context *pipe, enum pipe_shader_type shader,
unsigned start, unsigned nr,
struct pipe_sampler_view **views)
{

View file

@ -712,7 +712,7 @@ nv50_stage_set_sampler_views(struct nv50_context *nv50, int s,
}
static void
nv50_set_sampler_views(struct pipe_context *pipe, unsigned shader,
nv50_set_sampler_views(struct pipe_context *pipe, enum pipe_shader_type shader,
unsigned start, unsigned nr,
struct pipe_sampler_view **views)
{

View file

@ -656,7 +656,7 @@ nvc0_stage_set_sampler_views_range(struct nvc0_context *nvc0, const unsigned s,
}
static void
nvc0_set_sampler_views(struct pipe_context *pipe, unsigned shader,
nvc0_set_sampler_views(struct pipe_context *pipe, enum pipe_shader_type shader,
unsigned start, unsigned nr,
struct pipe_sampler_view **views)
{

View file

@ -1522,7 +1522,8 @@ static uint32_t r300_assign_texture_cache_region(unsigned index, unsigned num)
return R300_TX_CACHE(num + index);
}
static void r300_set_sampler_views(struct pipe_context* pipe, unsigned shader,
static void r300_set_sampler_views(struct pipe_context* pipe,
enum pipe_shader_type shader,
unsigned start, unsigned count,
struct pipe_sampler_view** views)
{

View file

@ -597,7 +597,8 @@ void r600_sampler_views_dirty(struct r600_context *rctx,
}
}
static void r600_set_sampler_views(struct pipe_context *pipe, unsigned shader,
static void r600_set_sampler_views(struct pipe_context *pipe,
enum pipe_shader_type shader,
unsigned start, unsigned count,
struct pipe_sampler_view **views)
{

View file

@ -465,7 +465,7 @@ static bool is_compressed_colortex(struct r600_texture *rtex)
}
static void si_set_sampler_views(struct pipe_context *ctx,
unsigned shader, unsigned start,
enum pipe_shader_type shader, unsigned start,
unsigned count,
struct pipe_sampler_view **views)
{

View file

@ -727,7 +727,7 @@ rbug_set_viewport_states(struct pipe_context *_pipe,
static void
rbug_set_sampler_views(struct pipe_context *_pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start,
unsigned num,
struct pipe_sampler_view **_views)

View file

@ -172,7 +172,7 @@ softpipe_update_derived(struct softpipe_context *softpipe, unsigned prim);
void
softpipe_set_sampler_views(struct pipe_context *pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start,
unsigned num,
struct pipe_sampler_view **views);

View file

@ -97,7 +97,7 @@ softpipe_sampler_view_destroy(struct pipe_context *pipe,
void
softpipe_set_sampler_views(struct pipe_context *pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start,
unsigned num,
struct pipe_sampler_view **views)

View file

@ -417,7 +417,7 @@ svga_sampler_view_destroy(struct pipe_context *pipe,
static void
svga_set_sampler_views(struct pipe_context *pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start,
unsigned num,
struct pipe_sampler_view **views)

View file

@ -282,7 +282,7 @@ swr_create_sampler_view(struct pipe_context *pipe,
static void
swr_set_sampler_views(struct pipe_context *pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start,
unsigned num,
struct pipe_sampler_view **views)

View file

@ -1016,7 +1016,7 @@ trace_context_surface_destroy(struct pipe_context *_pipe,
static void
trace_context_set_sampler_views(struct pipe_context *_pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start,
unsigned num,
struct pipe_sampler_view **views)

View file

@ -480,7 +480,7 @@ vc4_set_framebuffer_state(struct pipe_context *pctx,
}
static struct vc4_texture_stateobj *
vc4_get_stage_tex(struct vc4_context *vc4, unsigned shader)
vc4_get_stage_tex(struct vc4_context *vc4, enum pipe_shader_type shader)
{
switch (shader) {
case PIPE_SHADER_FRAGMENT:
@ -660,7 +660,8 @@ vc4_sampler_view_destroy(struct pipe_context *pctx,
}
static void
vc4_set_sampler_views(struct pipe_context *pctx, unsigned shader,
vc4_set_sampler_views(struct pipe_context *pctx,
enum pipe_shader_type shader,
unsigned start, unsigned nr,
struct pipe_sampler_view **views)
{

View file

@ -690,7 +690,7 @@ static struct pipe_sampler_view *virgl_create_sampler_view(struct pipe_context *
}
static void virgl_set_sampler_views(struct pipe_context *ctx,
unsigned shader_type,
enum pipe_shader_type shader_type,
unsigned start_slot,
unsigned num_views,
struct pipe_sampler_view **views)

View file

@ -285,7 +285,8 @@ struct pipe_context {
unsigned num_viewports,
const struct pipe_viewport_state *);
void (*set_sampler_views)(struct pipe_context *, unsigned shader,
void (*set_sampler_views)(struct pipe_context *,
enum pipe_shader_type shader,
unsigned start_slot, unsigned num_views,
struct pipe_sampler_view **);

View file

@ -57,7 +57,7 @@ void st_upload_constants( struct st_context *st,
struct gl_program_parameter_list *params,
gl_shader_stage stage)
{
unsigned shader_type = st_shader_stage_to_ptarget(stage);
enum pipe_shader_type shader_type = st_shader_stage_to_ptarget(stage);
assert(shader_type == PIPE_SHADER_VERTEX ||
shader_type == PIPE_SHADER_FRAGMENT ||

View file

@ -427,7 +427,7 @@ update_textures(struct st_context *st,
struct gl_shader_program *shader =
st->ctx->_Shader->CurrentProgram[mesa_shader];
unsigned glsl_version = shader ? shader->Version : 0;
unsigned shader_stage = st_shader_stage_to_ptarget(mesa_shader);
enum pipe_shader_type shader_stage = st_shader_stage_to_ptarget(mesa_shader);
if (samplers_used == 0x0 && old_max == 0)
return;

View file

@ -317,7 +317,7 @@ st_fb_orientation(const struct gl_framebuffer *fb)
}
static inline unsigned
static inline enum pipe_shader_type
st_shader_stage_to_ptarget(gl_shader_stage stage)
{
switch (stage) {

View file

@ -218,7 +218,7 @@ st_glsl_to_nir(struct st_context *st, struct gl_program *prog,
gl_shader_stage stage)
{
struct pipe_screen *pscreen = st->pipe->screen;
unsigned ptarget = st_shader_stage_to_ptarget(stage);
enum pipe_shader_type ptarget = st_shader_stage_to_ptarget(stage);
const nir_shader_compiler_options *options;
nir_shader *nir;

View file

@ -6465,7 +6465,7 @@ get_mesa_program_tgsi(struct gl_context *ctx,
struct gl_shader_compiler_options *options =
&ctx->Const.ShaderCompilerOptions[shader->Stage];
struct pipe_screen *pscreen = ctx->st->pipe->screen;
unsigned ptarget = st_shader_stage_to_ptarget(shader->Stage);
enum pipe_shader_type ptarget = st_shader_stage_to_ptarget(shader->Stage);
validate_ir_tree(shader->ir);
@ -6701,7 +6701,7 @@ get_mesa_program(struct gl_context *ctx,
struct gl_linked_shader *shader)
{
struct pipe_screen *pscreen = ctx->st->pipe->screen;
unsigned ptarget = st_shader_stage_to_ptarget(shader->Stage);
enum pipe_shader_type ptarget = st_shader_stage_to_ptarget(shader->Stage);
enum pipe_shader_ir preferred_ir = (enum pipe_shader_ir)
pscreen->get_shader_param(pscreen, ptarget, PIPE_SHADER_CAP_PREFERRED_IR);
struct gl_program *prog = NULL;
@ -6855,7 +6855,7 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
gl_shader_stage stage = prog->_LinkedShaders[i]->Stage;
const struct gl_shader_compiler_options *options =
&ctx->Const.ShaderCompilerOptions[stage];
unsigned ptarget = st_shader_stage_to_ptarget(stage);
enum pipe_shader_type ptarget = st_shader_stage_to_ptarget(stage);
bool have_dround = pscreen->get_shader_param(pscreen, ptarget,
PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED);
bool have_dfrexp = pscreen->get_shader_param(pscreen, ptarget,