[Mesa-dev] [PATCH 1/7] nir/info: Add more information about geometry shaders

Jason Ekstrand jason at jlekstrand.net
Tue Oct 20 18:14:23 PDT 2015


I have no idea why, but gmail and git-send-email aren't getting along
for me.  The entire series (including patches 6 and 7) can be found
here:

http://cgit.freedesktop.org/~jekstrand/mesa/log/?h=wip/i965-gs-cleanup

--Jason

On Tue, Oct 20, 2015 at 6:10 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> ---
>  src/glsl/nir/glsl_to_nir.cpp | 3 +++
>  src/glsl/nir/nir.h           | 9 +++++++++
>  2 files changed, 12 insertions(+)
>
> diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
> index c9cdf35..91b766a 100644
> --- a/src/glsl/nir/glsl_to_nir.cpp
> +++ b/src/glsl/nir/glsl_to_nir.cpp
> @@ -170,8 +170,11 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,
>
>     switch (stage) {
>     case MESA_SHADER_GEOMETRY:
> +      shader->info.gs.vertices_in = shader_prog->Geom.VerticesIn;
> +      shader->info.gs.output_primitive = sh->Geom.OutputType;
>        shader->info.gs.vertices_out = sh->Geom.VerticesOut;
>        shader->info.gs.invocations = sh->Geom.Invocations;
> +      shader->info.gs.uses_end_primitive = shader_prog->Geom.UsesEndPrimitive;
>        break;
>
>     case MESA_SHADER_FRAGMENT: {
> diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
> index 2ab48fb..64fa70b 100644
> --- a/src/glsl/nir/nir.h
> +++ b/src/glsl/nir/nir.h
> @@ -1495,11 +1495,20 @@ typedef struct nir_shader_info {
>
>     union {
>        struct {
> +         /** The number of vertices recieves per input primitive */
> +         unsigned vertices_in;
> +
> +         /** The output primitive type (GL enum value) */
> +         unsigned output_primitive;
> +
>           /** The maximum number of vertices the geometry shader might write. */
>           unsigned vertices_out;
>
>           /** 1 .. MAX_GEOMETRY_SHADER_INVOCATIONS */
>           unsigned invocations;
> +
> +         /** Whether or not this shader uses EndPrimitive */
> +         bool uses_end_primitive;
>        } gs;
>
>        struct {
> --
> 2.5.0.400.gff86faf
>


More information about the mesa-dev mailing list