[Piglit] [PATCH 4/4] arb_shader_image_load_store/grid: Iterate over all known shader stages in generate_program_v().

Martin Peres martin.peres at linux.intel.com
Tue May 19 07:20:02 PDT 2015


On 12/05/15 15:39, Francisco Jerez wrote:
> Rather than over all stages that support images.  Implies that the
> stage index has to be calculated differently because the stage pointer
> may no longer be based on the image_stages() array.  Fixes a number of
> tests that were relying on a vertex shader to be present regardless of
> the implementation supporting images on that stage, which is optional
> according to the spec.
> ---
>   tests/spec/arb_shader_image_load_store/grid.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/spec/arb_shader_image_load_store/grid.c b/tests/spec/arb_shader_image_load_store/grid.c
> index 766d968..97e4126 100644
> --- a/tests/spec/arb_shader_image_load_store/grid.c
> +++ b/tests/spec/arb_shader_image_load_store/grid.c
> @@ -243,7 +243,7 @@ generate_stage_source(const struct grid_info grid,
>   static inline unsigned
>   get_stage_idx(const struct image_stage_info *stage)
>   {
> -        return stage - image_stages();
> +        return ffs(stage->bit);
>   }
>   
>   /**
> @@ -270,7 +270,7 @@ generate_program_v(const struct grid_info grid, const char **sources)
>           GLuint prog = glCreateProgram();
>           const struct image_stage_info *stage;
>   
> -        for (stage = image_stages(); stage->stage; ++stage) {
> +        for (stage = known_image_stages(); stage->stage; ++stage) {
>                   if (stages & stage->bit) {
>                           char *source = generate_stage_source(
>                                   grid, stage->stage,

Reviewed-by: Martin Peres <martin.peres at linux.intel.com>


More information about the Piglit mailing list