X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsoftpipe%2Fsp_state_derived.c;h=f34997ab3d0b6114c339dffed7eaf3741a8e61ac;hb=00a56acc235e185bb3c7e2e0a7a731cc8f444044;hp=d4d03f1be500ee8dd604db1a5037242b29c434ff;hpb=83c86e09a8d7610022eae49731ac1ed03ee4f67b;p=mesa.git diff --git a/src/gallium/drivers/softpipe/sp_state_derived.c b/src/gallium/drivers/softpipe/sp_state_derived.c index d4d03f1be50..f34997ab3d0 100644 --- a/src/gallium/drivers/softpipe/sp_state_derived.c +++ b/src/gallium/drivers/softpipe/sp_state_derived.c @@ -176,14 +176,14 @@ softpipe_compute_vertex_info(struct softpipe_context *softpipe) /* * Note that we'd actually want to skip position (as we won't use * the attribute in the fs) but can't. The reason is that we don't - * actually have a input/output map for setup (even though it looks + * actually have an input/output map for setup (even though it looks * like we do...). Could adjust for this though even without a map. */ } else { /* * Note that we'd actually want to skip position (as we won't use * the attribute in the fs) but can't. The reason is that we don't - * actually have a input/output map for setup (even though it looks + * actually have an input/output map for setup (even though it looks * like we do...). Could adjust for this though even without a map. */ draw_emit_vertex_attr(vinfo, EMIT_4F, vs_index); @@ -282,7 +282,7 @@ compute_cliprect(struct softpipe_context *sp) static void set_shader_sampler(struct softpipe_context *softpipe, - unsigned shader, + enum pipe_shader_type shader, int max_sampler) { int i; @@ -292,6 +292,12 @@ set_shader_sampler(struct softpipe_context *softpipe, } } +void +softpipe_update_compute_samplers(struct softpipe_context *softpipe) +{ + set_shader_sampler(softpipe, PIPE_SHADER_COMPUTE, softpipe->cs->max_sampler); +} + static void update_tgsi_samplers( struct softpipe_context *softpipe ) { @@ -307,7 +313,7 @@ update_tgsi_samplers( struct softpipe_context *softpipe ) } /* XXX is this really necessary here??? */ - for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) { + for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) { for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { struct softpipe_tex_tile_cache *tc = softpipe->tex_cache[sh][i]; if (tc && tc->texture) { @@ -343,7 +349,9 @@ update_fragment_shader(struct softpipe_context *softpipe, unsigned prim) softpipe->fs_variant->prepare(softpipe->fs_variant, softpipe->fs_machine, (struct tgsi_sampler *) softpipe-> - tgsi.sampler[PIPE_SHADER_FRAGMENT]); + tgsi.sampler[PIPE_SHADER_FRAGMENT], + (struct tgsi_image *)softpipe->tgsi.image[PIPE_SHADER_FRAGMENT], + (struct tgsi_buffer *)softpipe->tgsi.buffer[PIPE_SHADER_FRAGMENT]); } else { softpipe->fs_variant = NULL;