Просмотр исходного кода

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>
tags/13.0-branchpoint
Kai Wasserbäch 10 лет назад
Родитель
Сommit
532db3b788
34 измененных файлов: 54 добавлений и 42 удалений
  1. 1
    1
      src/gallium/auxiliary/cso_cache/cso_context.c
  2. 1
    1
      src/gallium/auxiliary/cso_cache/cso_context.h
  3. 2
    2
      src/gallium/auxiliary/draw/draw_context.c
  4. 2
    2
      src/gallium/auxiliary/draw/draw_context.h
  5. 2
    1
      src/gallium/auxiliary/draw/draw_pipe_aaline.c
  6. 5
    4
      src/gallium/auxiliary/draw/draw_pipe_pstipple.c
  7. 2
    1
      src/gallium/drivers/ddebug/dd_context.c
  8. 1
    1
      src/gallium/drivers/freedreno/a4xx/fd4_texture.c
  9. 1
    1
      src/gallium/drivers/freedreno/freedreno_texture.c
  10. 2
    1
      src/gallium/drivers/freedreno/freedreno_texture.h
  11. 1
    1
      src/gallium/drivers/i915/i915_state.c
  12. 4
    1
      src/gallium/drivers/ilo/ilo_state.c
  13. 1
    1
      src/gallium/drivers/llvmpipe/lp_state_sampler.c
  14. 2
    1
      src/gallium/drivers/noop/noop_state.c
  15. 1
    1
      src/gallium/drivers/nouveau/nv30/nv30_fragtex.c
  16. 1
    1
      src/gallium/drivers/nouveau/nv50/nv50_state.c
  17. 1
    1
      src/gallium/drivers/nouveau/nvc0/nvc0_state.c
  18. 2
    1
      src/gallium/drivers/r300/r300_state.c
  19. 2
    1
      src/gallium/drivers/r600/r600_state_common.c
  20. 1
    1
      src/gallium/drivers/radeonsi/si_descriptors.c
  21. 1
    1
      src/gallium/drivers/rbug/rbug_context.c
  22. 1
    1
      src/gallium/drivers/softpipe/sp_state.h
  23. 1
    1
      src/gallium/drivers/softpipe/sp_state_sampler.c
  24. 1
    1
      src/gallium/drivers/svga/svga_pipe_sampler.c
  25. 1
    1
      src/gallium/drivers/swr/swr_state.cpp
  26. 1
    1
      src/gallium/drivers/trace/tr_context.c
  27. 3
    2
      src/gallium/drivers/vc4/vc4_state.c
  28. 1
    1
      src/gallium/drivers/virgl/virgl_context.c
  29. 2
    1
      src/gallium/include/pipe/p_context.h
  30. 1
    1
      src/mesa/state_tracker/st_atom_constbuf.c
  31. 1
    1
      src/mesa/state_tracker/st_atom_texture.c
  32. 1
    1
      src/mesa/state_tracker/st_context.h
  33. 1
    1
      src/mesa/state_tracker/st_glsl_to_nir.cpp
  34. 3
    3
      src/mesa/state_tracker/st_glsl_to_tgsi.cpp

+ 1
- 1
src/gallium/auxiliary/cso_cache/cso_context.c Просмотреть файл



void void
cso_set_sampler_views(struct cso_context *ctx, cso_set_sampler_views(struct cso_context *ctx,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
unsigned count, unsigned count,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 1
- 1
src/gallium/auxiliary/cso_cache/cso_context.h Просмотреть файл



void void
cso_set_sampler_views(struct cso_context *cso, cso_set_sampler_views(struct cso_context *cso,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
unsigned count, unsigned count,
struct pipe_sampler_view **views); struct pipe_sampler_view **views);



+ 2
- 2
src/gallium/auxiliary/draw/draw_context.c Просмотреть файл



void void
draw_set_sampler_views(struct draw_context *draw, draw_set_sampler_views(struct draw_context *draw,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
struct pipe_sampler_view **views, struct pipe_sampler_view **views,
unsigned num) unsigned num)
{ {


void void
draw_set_samplers(struct draw_context *draw, draw_set_samplers(struct draw_context *draw,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
struct pipe_sampler_state **samplers, struct pipe_sampler_state **samplers,
unsigned num) unsigned num)
{ {

+ 2
- 2
src/gallium/auxiliary/draw/draw_context.h Просмотреть файл



void void
draw_set_sampler_views(struct draw_context *draw, draw_set_sampler_views(struct draw_context *draw,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
struct pipe_sampler_view **views, struct pipe_sampler_view **views,
unsigned num); unsigned num);
void void
draw_set_samplers(struct draw_context *draw, draw_set_samplers(struct draw_context *draw,
unsigned shader_stage,
enum pipe_shader_type shader_stage,
struct pipe_sampler_state **samplers, struct pipe_sampler_state **samplers,
unsigned num); unsigned num);



+ 2
- 1
src/gallium/auxiliary/draw/draw_pipe_aaline.c Просмотреть файл





static void 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, unsigned start, unsigned num,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 5
- 4
src/gallium/auxiliary/draw/draw_pipe_pstipple.c Просмотреть файл

unsigned, unsigned, void **); unsigned, unsigned, void **);


void (*driver_set_sampler_views)(struct pipe_context *, 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 **); struct pipe_sampler_view **);


void (*driver_set_polygon_stipple)(struct pipe_context *, void (*driver_set_polygon_stipple)(struct pipe_context *,
assert(pstip->fs->sampler_unit < PIPE_MAX_SAMPLERS); assert(pstip->fs->sampler_unit < PIPE_MAX_SAMPLERS);


pstip->fs->pstip_fs = pstip->driver_create_fs_state(pipe, &pstip_fs); pstip->fs->pstip_fs = pstip->driver_create_fs_state(pipe, &pstip_fs);
FREE((void *)pstip_fs.tokens); FREE((void *)pstip_fs.tokens);


if (!pstip->fs->pstip_fs) if (!pstip->fs->pstip_fs)


static void static void
pstip_set_sampler_views(struct pipe_context *pipe, 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 pipe_sampler_view **views)
{ {
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe); struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);

+ 2
- 1
src/gallium/drivers/ddebug/dd_context.c Просмотреть файл

*/ */


static void 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, unsigned start, unsigned num,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 1
- 1
src/gallium/drivers/freedreno/a4xx/fd4_texture.c Просмотреть файл

} }


static void 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, unsigned start, unsigned nr,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 1
- 1
src/gallium/drivers/freedreno/freedreno_texture.c Просмотреть файл

} }


void 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, unsigned start, unsigned nr,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 2
- 1
src/gallium/drivers/freedreno/freedreno_texture.h Просмотреть файл

unsigned shader, unsigned start, unsigned shader, unsigned start,
unsigned nr, void **hwcso); 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, unsigned start, unsigned nr,
struct pipe_sampler_view **views); struct pipe_sampler_view **views);



+ 1
- 1
src/gallium/drivers/i915/i915_state.c Просмотреть файл





static void 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, unsigned start, unsigned num,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 4
- 1
src/gallium/drivers/ilo/ilo_state.c Просмотреть файл

} }


static void 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, unsigned start, unsigned count,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {
case PIPE_SHADER_COMPUTE: case PIPE_SHADER_COMPUTE:
vec->dirty |= ILO_DIRTY_VIEW_CS; vec->dirty |= ILO_DIRTY_VIEW_CS;
break; break;
default:
assert(!"unexpected shader type");
break;
} }
} }



+ 1
- 1
src/gallium/drivers/llvmpipe/lp_state_sampler.c Просмотреть файл



static void static void
llvmpipe_set_sampler_views(struct pipe_context *pipe, llvmpipe_set_sampler_views(struct pipe_context *pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start, unsigned start,
unsigned num, unsigned num,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)

+ 2
- 1
src/gallium/drivers/noop/noop_state.c Просмотреть файл

return surface; 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, unsigned start, unsigned count,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 1
- 1
src/gallium/drivers/nouveau/nv30/nv30_fragtex.c Просмотреть файл





static void 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, unsigned start, unsigned nr,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 1
- 1
src/gallium/drivers/nouveau/nv50/nv50_state.c Просмотреть файл

} }


static void 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, unsigned start, unsigned nr,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 1
- 1
src/gallium/drivers/nouveau/nvc0/nvc0_state.c Просмотреть файл

} }


static void 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, unsigned start, unsigned nr,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 2
- 1
src/gallium/drivers/r300/r300_state.c Просмотреть файл

return R300_TX_CACHE(num + index); 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, unsigned start, unsigned count,
struct pipe_sampler_view** views) struct pipe_sampler_view** views)
{ {

+ 2
- 1
src/gallium/drivers/r600/r600_state_common.c Просмотреть файл

} }
} }


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, unsigned start, unsigned count,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 1
- 1
src/gallium/drivers/radeonsi/si_descriptors.c Просмотреть файл

} }


static void si_set_sampler_views(struct pipe_context *ctx, static void si_set_sampler_views(struct pipe_context *ctx,
unsigned shader, unsigned start,
enum pipe_shader_type shader, unsigned start,
unsigned count, unsigned count,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 1
- 1
src/gallium/drivers/rbug/rbug_context.c Просмотреть файл



static void static void
rbug_set_sampler_views(struct pipe_context *_pipe, rbug_set_sampler_views(struct pipe_context *_pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start, unsigned start,
unsigned num, unsigned num,
struct pipe_sampler_view **_views) struct pipe_sampler_view **_views)

+ 1
- 1
src/gallium/drivers/softpipe/sp_state.h Просмотреть файл



void void
softpipe_set_sampler_views(struct pipe_context *pipe, softpipe_set_sampler_views(struct pipe_context *pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start, unsigned start,
unsigned num, unsigned num,
struct pipe_sampler_view **views); struct pipe_sampler_view **views);

+ 1
- 1
src/gallium/drivers/softpipe/sp_state_sampler.c Просмотреть файл



void void
softpipe_set_sampler_views(struct pipe_context *pipe, softpipe_set_sampler_views(struct pipe_context *pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start, unsigned start,
unsigned num, unsigned num,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)

+ 1
- 1
src/gallium/drivers/svga/svga_pipe_sampler.c Просмотреть файл



static void static void
svga_set_sampler_views(struct pipe_context *pipe, svga_set_sampler_views(struct pipe_context *pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start, unsigned start,
unsigned num, unsigned num,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)

+ 1
- 1
src/gallium/drivers/swr/swr_state.cpp Просмотреть файл



static void static void
swr_set_sampler_views(struct pipe_context *pipe, swr_set_sampler_views(struct pipe_context *pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start, unsigned start,
unsigned num, unsigned num,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)

+ 1
- 1
src/gallium/drivers/trace/tr_context.c Просмотреть файл



static void static void
trace_context_set_sampler_views(struct pipe_context *_pipe, trace_context_set_sampler_views(struct pipe_context *_pipe,
unsigned shader,
enum pipe_shader_type shader,
unsigned start, unsigned start,
unsigned num, unsigned num,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)

+ 3
- 2
src/gallium/drivers/vc4/vc4_state.c Просмотреть файл

} }


static struct vc4_texture_stateobj * 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) { switch (shader) {
case PIPE_SHADER_FRAGMENT: case PIPE_SHADER_FRAGMENT:
} }


static void 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, unsigned start, unsigned nr,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)
{ {

+ 1
- 1
src/gallium/drivers/virgl/virgl_context.c Просмотреть файл

} }


static void virgl_set_sampler_views(struct pipe_context *ctx, static void virgl_set_sampler_views(struct pipe_context *ctx,
unsigned shader_type,
enum pipe_shader_type shader_type,
unsigned start_slot, unsigned start_slot,
unsigned num_views, unsigned num_views,
struct pipe_sampler_view **views) struct pipe_sampler_view **views)

+ 2
- 1
src/gallium/include/pipe/p_context.h Просмотреть файл

unsigned num_viewports, unsigned num_viewports,
const struct pipe_viewport_state *); 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, unsigned start_slot, unsigned num_views,
struct pipe_sampler_view **); struct pipe_sampler_view **);



+ 1
- 1
src/mesa/state_tracker/st_atom_constbuf.c Просмотреть файл

struct gl_program_parameter_list *params, struct gl_program_parameter_list *params,
gl_shader_stage stage) 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 || assert(shader_type == PIPE_SHADER_VERTEX ||
shader_type == PIPE_SHADER_FRAGMENT || shader_type == PIPE_SHADER_FRAGMENT ||

+ 1
- 1
src/mesa/state_tracker/st_atom_texture.c Просмотреть файл

struct gl_shader_program *shader = struct gl_shader_program *shader =
st->ctx->_Shader->CurrentProgram[mesa_shader]; st->ctx->_Shader->CurrentProgram[mesa_shader];
unsigned glsl_version = shader ? shader->Version : 0; 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) if (samplers_used == 0x0 && old_max == 0)
return; return;

+ 1
- 1
src/mesa/state_tracker/st_context.h Просмотреть файл

} }




static inline unsigned
static inline enum pipe_shader_type
st_shader_stage_to_ptarget(gl_shader_stage stage) st_shader_stage_to_ptarget(gl_shader_stage stage)
{ {
switch (stage) { switch (stage) {

+ 1
- 1
src/mesa/state_tracker/st_glsl_to_nir.cpp Просмотреть файл

gl_shader_stage stage) gl_shader_stage stage)
{ {
struct pipe_screen *pscreen = st->pipe->screen; 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; const nir_shader_compiler_options *options;
nir_shader *nir; nir_shader *nir;



+ 3
- 3
src/mesa/state_tracker/st_glsl_to_tgsi.cpp Просмотреть файл

struct gl_shader_compiler_options *options = struct gl_shader_compiler_options *options =
&ctx->Const.ShaderCompilerOptions[shader->Stage]; &ctx->Const.ShaderCompilerOptions[shader->Stage];
struct pipe_screen *pscreen = ctx->st->pipe->screen; 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); validate_ir_tree(shader->ir);


struct gl_linked_shader *shader) struct gl_linked_shader *shader)
{ {
struct pipe_screen *pscreen = ctx->st->pipe->screen; 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) enum pipe_shader_ir preferred_ir = (enum pipe_shader_ir)
pscreen->get_shader_param(pscreen, ptarget, PIPE_SHADER_CAP_PREFERRED_IR); pscreen->get_shader_param(pscreen, ptarget, PIPE_SHADER_CAP_PREFERRED_IR);
struct gl_program *prog = NULL; struct gl_program *prog = NULL;
gl_shader_stage stage = prog->_LinkedShaders[i]->Stage; gl_shader_stage stage = prog->_LinkedShaders[i]->Stage;
const struct gl_shader_compiler_options *options = const struct gl_shader_compiler_options *options =
&ctx->Const.ShaderCompilerOptions[stage]; &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, bool have_dround = pscreen->get_shader_param(pscreen, ptarget,
PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED); PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED);
bool have_dfrexp = pscreen->get_shader_param(pscreen, ptarget, bool have_dfrexp = pscreen->get_shader_param(pscreen, ptarget,

Загрузка…
Отмена
Сохранить