[Mesa-dev] [PATCH v2 4/6] mesa: enable enums for OES_geometry_shader
Lofstedt, Marta
marta.lofstedt at intel.com
Tue Dec 1 07:36:38 PST 2015
> -----Original Message-----
> From: mesa-dev [mailto:mesa-dev-bounces at lists.freedesktop.org] On
> Behalf Of Ilia Mirkin
> Sent: Friday, November 27, 2015 7:08 PM
> To: Marta Lofstedt
> Cc: mesa-dev at lists.freedesktop.org
> Subject: Re: [Mesa-dev] [PATCH v2 4/6] mesa: enable enums for
> OES_geometry_shader
>
> On Fri, Nov 27, 2015 at 9:31 AM, Marta Lofstedt
> <marta.lofstedt at linux.intel.com> wrote:
> > From: Marta Lofstedt <marta.lofstedt at intel.com>
> >
> > Enable GL_OES_geometry_shader enums for OpenGL ES 3.1.
> >
> > Signed-off-by: Marta Lofstedt <marta.lofstedt at linux.intel.com>
> > ---
> > src/mesa/main/get.c | 58
> +++++++++++++++++++++++++++++++++-------
> > src/mesa/main/get_hash_params.py | 50
> > +++++++++++++++++++++-------------
> > 2 files changed, 80 insertions(+), 28 deletions(-)
> >
> > diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index
> > c6a2e5b..3770fba 100644
> > --- a/src/mesa/main/get.c
> > +++ b/src/mesa/main/get.c
> > @@ -147,11 +147,14 @@ enum value_extra {
> > EXTRA_VALID_CLIP_DISTANCE,
> > EXTRA_FLUSH_CURRENT,
> > EXTRA_GLSL_130,
> > - EXTRA_EXT_UBO_GS4,
> > - EXTRA_EXT_ATOMICS_GS4,
> > - EXTRA_EXT_SHADER_IMAGE_GS4,
> > + EXTRA_EXT_UBO_GS,
> > + EXTRA_EXT_ATOMICS_GS,
> > + EXTRA_EXT_SHADER_IMAGE_GS,
> > EXTRA_EXT_ATOMICS_TESS,
> > EXTRA_EXT_SHADER_IMAGE_TESS,
> > + EXTRA_EXT_SSBO_GS,
> > + EXTRA_EXT_GPU5_GS,
> > + EXTRA_EXT_VIEWPORT_GS,
> > };
> >
> > #define NO_EXTRA NULL
> > @@ -308,7 +311,7 @@ static const int
> > extra_ARB_transform_feedback2_api_es3[] = { };
> >
> > static const int
> extra_ARB_uniform_buffer_object_and_geometry_shader[] = {
> > - EXTRA_EXT_UBO_GS4,
> > + EXTRA_EXT_UBO_GS,
> > EXTRA_END
> > };
> >
> > @@ -343,12 +346,12 @@ static const int extra_EXT_texture_array_es3[] =
> > { };
> >
> > static const int
> extra_ARB_shader_atomic_counters_and_geometry_shader[] = {
> > - EXTRA_EXT_ATOMICS_GS4,
> > + EXTRA_EXT_ATOMICS_GS,
> > EXTRA_END
> > };
> >
> > static const int
> extra_ARB_shader_image_load_store_and_geometry_shader[] = {
> > - EXTRA_EXT_SHADER_IMAGE_GS4,
> > + EXTRA_EXT_SHADER_IMAGE_GS,
> > EXTRA_END
> > };
> >
> > @@ -375,6 +378,21 @@ static const int
> extra_ARB_shader_storage_buffer_object_es31[] = {
> > EXTRA_END
> > };
> >
> > +static const int extra_ARB_gpu_shader5_and_geometry_shader[] = {
> > + EXTRA_EXT_GPU5_GS,
> > + EXTRA_END
> > +};
> > +
> > +static const int
> extra_ARB_shader_storage_buffer_object_and_geometry_shader[] = {
> > + EXTRA_EXT_SSBO_GS,
> > + EXTRA_END
> > +};
> > +
> > +static const int extra_ARB_viewport_array_and_geometry_shader[] = {
> > + EXTRA_EXT_VIEWPORT_GS,
> > + EXTRA_END
> > +};
> > +
> > EXTRA_EXT(ARB_texture_cube_map);
> > EXTRA_EXT(EXT_texture_array);
> > EXTRA_EXT(NV_fog_distance);
> > @@ -423,6 +441,7 @@ EXTRA_EXT(ARB_framebuffer_no_attachments);
> > EXTRA_EXT(ARB_tessellation_shader);
> > EXTRA_EXT(ARB_shader_subroutine);
> > EXTRA_EXT(ARB_shader_storage_buffer_object);
> > +EXTRA_EXT(OES_geometry_shader);
> >
> > static const int
> > extra_ARB_color_buffer_float_or_glcore[] = { @@ -454,6 +473,12 @@
> > static const int extra_gl32_es3[] = {
> > EXTRA_END,
> > };
> >
> > +static const int extra_version_32_OES_geometry_shader[] = {
> > + EXTRA_VERSION_32,
> > + EXT(OES_geometry_shader),
> > + EXTRA_END
> > +};
> > +
> > static const int extra_gl40_ARB_sample_shading[] = {
> > EXTRA_VERSION_40,
> > EXT(ARB_sample_shading),
> > @@ -1149,17 +1174,17 @@ check_extra(struct gl_context *ctx, const char
> *func, const struct value_desc *d
> > if (ctx->Const.GLSLVersion >= 130)
> > api_found = GL_TRUE;
> > break;
> > - case EXTRA_EXT_UBO_GS4:
> > + case EXTRA_EXT_UBO_GS:
> > api_check = GL_TRUE;
> > api_found = (ctx->Extensions.ARB_uniform_buffer_object &&
> > _mesa_has_geometry_shaders(ctx));
> > break;
> > - case EXTRA_EXT_ATOMICS_GS4:
> > + case EXTRA_EXT_ATOMICS_GS:
> > api_check = GL_TRUE;
> > api_found = (ctx->Extensions.ARB_shader_atomic_counters &&
> > _mesa_has_geometry_shaders(ctx));
> > break;
> > - case EXTRA_EXT_SHADER_IMAGE_GS4:
> > + case EXTRA_EXT_SHADER_IMAGE_GS:
> > api_check = GL_TRUE;
> > api_found = (ctx->Extensions.ARB_shader_image_load_store &&
> > _mesa_has_geometry_shaders(ctx)); @@ -1174,6
> > +1199,21 @@ check_extra(struct gl_context *ctx, const char *func, const
> struct value_desc *d
> > api_found = ctx->Extensions.ARB_shader_image_load_store &&
> > _mesa_has_tessellation(ctx);
> > break;
> > + case EXTRA_EXT_GPU5_GS:
> > + api_check = GL_TRUE;
> > + api_found = (ctx->Extensions.ARB_framebuffer_no_attachments &&
> > + _mesa_has_geometry_shaders(ctx));
>
> What does this have to do with ARB_gpu_shader5?
>
My bad, thanks for spotting this!
>
> > + break;
> > + case EXTRA_EXT_SSBO_GS:
> > + api_check = GL_TRUE;
> > + api_found = (ctx->Extensions.ARB_shader_storage_buffer_object
> &&
> > + _mesa_has_geometry_shaders(ctx));
> > + break;
> > + case EXTRA_EXT_VIEWPORT_GS:
> > + api_check = GL_TRUE;
> > + api_found = (ctx->Extensions.ARB_viewport_array &&
> > + _mesa_has_geometry_shaders(ctx));
>
> Not sure this makes sense without geometry shaders tbh...
I agree, the viewport_array extension requires geometry shader. However the oes_geometry_shader extension only use part of the viewport_array. I will go back to my initial viewport_array or oes_geometry_shader for this one. But, I was thinking that you found that one silly.
>
> > + break;
> > case EXTRA_END:
> > break;
> > default: /* *e is a offset into the extension struct */ diff
> > --git a/src/mesa/main/get_hash_params.py
> > b/src/mesa/main/get_hash_params.py
> > index 0c58b30..2b90fa1 100644
> > --- a/src/mesa/main/get_hash_params.py
> > +++ b/src/mesa/main/get_hash_params.py
> > @@ -499,6 +499,37 @@ descriptor=[
> > { "apis": ["GL_CORE", "GLES31"], "params": [ # GL_ARB_draw_indirect
> > / GLES 3.1
> > [ "DRAW_INDIRECT_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0,
> > extra_ARB_draw_indirect" ],
> > +
> > +# GL 3.2 / GL OES_geometry_shader
> > + [ "MAX_GEOMETRY_INPUT_COMPONENTS",
> >
> +"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxInputCom
> ponents),
> > +extra_version_32_OES_geometry_shader" ],
> > + [ "MAX_GEOMETRY_OUTPUT_COMPONENTS",
> >
> +"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxOutputCo
> mponents)
> > +, extra_version_32_OES_geometry_shader" ],
> > + [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS",
> >
> +"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxTextureI
> mageUnits
> > +), extra_version_32_OES_geometry_shader" ],
> > + [ "MAX_GEOMETRY_OUTPUT_VERTICES",
> > +"CONTEXT_INT(Const.MaxGeometryOutputVertices),
> > +extra_version_32_OES_geometry_shader" ],
> > + [ "MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS",
> > +"CONTEXT_INT(Const.MaxGeometryTotalOutputComponents),
> > +extra_version_32_OES_geometry_shader" ],
> > + [ "MAX_GEOMETRY_UNIFORM_COMPONENTS",
> >
> +"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformC
> omponents
> > +), extra_version_32_OES_geometry_shader" ],
> > +
> > +# shader_image_load_store / GL_OES_geometry_shader
> > + [ "MAX_GEOMETRY_IMAGE_UNIFORMS",
> >
> +"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxImageUni
> forms),
> > +extra_ARB_shader_image_load_store_and_geometry_shader" ],
> > +
> > +# GL_ARB_shader_atomic_counters / GL_OES_geometry_shader
> > + [ "MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS",
> >
> +"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicBu
> ffers),
> > +extra_ARB_shader_atomic_counters_and_geometry_shader " ],
> > + [ "MAX_GEOMETRY_ATOMIC_COUNTERS",
> >
> +"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCo
> unters),
> > +extra_ARB_shader_atomic_counters_and_geometry_shader" ],
> > +
> > +# GL_ARB_shader_storage_buffer_object / GL_OES_geometry_shader
> > + [ "MAX_GEOMETRY_SHADER_STORAGE_BLOCKS",
> >
> +"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxShaderSt
> orageBloc
> > +ks), extra_ARB_shader_storage_buffer_object_and_geometry_shader"
> ],
> > +
> > +# GL_ARB_uniform_buffer_object / GL_OES_geometry_shader
> > + [ "MAX_GEOMETRY_UNIFORM_BLOCKS",
> >
> +"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBl
> ocks),
> > +extra_ARB_uniform_buffer_object_and_geometry_shader" ],
> > + [ "MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS",
> >
> +"CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxCombined
> UniformCo
> > +mponents), extra_ARB_uniform_buffer_object_and_geometry_shader"
> ],
> > +
> > +# GL_ARB_gpu_shader5 / GL_OES_geometry_shader
> > + [ "MAX_GEOMETRY_SHADER_INVOCATIONS",
> > +"CONST(MAX_GEOMETRY_SHADER_INVOCATIONS),
> > +extra_ARB_gpu_shader5_and_geometry_shader" ],
> > +
> > +# GL_ARB_viewport_array / GL_OES_geometry_shader
> > + [ "LAYER_PROVOKING_VERTEX",
> "CONTEXT_ENUM(Light.ProvokingVertex),
> > +extra_ARB_viewport_array_and_geometry_shader" ],
> > +
> > +# GL_ARB_framebuffer_no_attachments / GL_OES_geometry_shader
> > + ["MAX_FRAMEBUFFER_LAYERS",
> > +"CONTEXT_INT(Const.MaxFramebufferLayers),
> > +extra_ARB_framebuffer_no_attachments"],
>
> Does this need a _and_geometry_shader thing too?
>
Yes, gles 3.1 requires fb_no_attachments, but does not have geometry shader. Also, some GL core drivers does not have fb_no_attachments.
> > ]},
> >
> > # Remaining enums are only in OpenGL
> > @@ -790,21 +821,10 @@ descriptor=[
> >
> > # GL 3.2
> > [ "CONTEXT_PROFILE_MASK", "CONTEXT_INT(Const.ProfileMask),
> > extra_version_32" ],
> > - [ "MAX_GEOMETRY_INPUT_COMPONENTS",
> >
> "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxInputComp
> onents),
> > extra_version_32" ],
> > - [ "MAX_GEOMETRY_OUTPUT_COMPONENTS",
> >
> "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxOutputCo
> mponents),
> > extra_version_32" ],
> > - [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS",
> >
> "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxTextureIma
> geUnits)
> > , extra_version_32" ],
> > - [ "MAX_GEOMETRY_OUTPUT_VERTICES",
> > "CONTEXT_INT(Const.MaxGeometryOutputVertices), extra_version_32" ],
> > - [ "MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS",
> > "CONTEXT_INT(Const.MaxGeometryTotalOutputComponents),
> > extra_version_32" ],
> > - [ "MAX_GEOMETRY_UNIFORM_COMPONENTS",
> >
> "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformCo
> mponents)
> > , extra_version_32" ],
> >
> > # GL_ARB_robustness
> > [ "RESET_NOTIFICATION_STRATEGY_ARB",
> > "CONTEXT_ENUM(Const.ResetStrategy), NO_EXTRA" ],
> >
> > -
> > -# GL_ARB_uniform_buffer_object
> > - [ "MAX_GEOMETRY_UNIFORM_BLOCKS",
> >
> "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlo
> cks),
> > extra_ARB_uniform_buffer_object_and_geometry_shader" ],
> > - [ "MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS",
> >
> "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxCombined
> UniformCom
> > ponents), extra_ARB_uniform_buffer_object_and_geometry_shader" ],
> > -
> > # GL_ARB_timer_query
> > [ "TIMESTAMP", "LOC_CUSTOM, TYPE_INT64, 0,
> extra_ARB_timer_query"
> > ],
> >
> > @@ -817,14 +837,9 @@ descriptor=[
> > # GL_ARB_texture_gather
> > [ "MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB",
> > "CONTEXT_INT(Const.MaxProgramTextureGatherComponents),
> > extra_ARB_texture_gather"],
> >
> > -# GL_ARB_shader_atomic_counters
> > - [ "MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS",
> >
> "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicBuff
> ers),
> > extra_ARB_shader_atomic_counters_and_geometry_shader" ],
> > - [ "MAX_GEOMETRY_ATOMIC_COUNTERS",
> >
> "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCou
> nters),
> > extra_ARB_shader_atomic_counters_and_geometry_shader" ],
> > -
> > # GL_ARB_shader_image_load_store
> > [ "MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS",
> "CONTEXT_INT(Const.MaxCombinedShaderOutputResources),
> extra_ARB_shader_image_load_store" ],
> > [ "MAX_IMAGE_SAMPLES", "CONTEXT_INT(Const.MaxImageSamples),
> > extra_ARB_shader_image_load_store" ],
> > - [ "MAX_GEOMETRY_IMAGE_UNIFORMS",
> >
> "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxImageUnif
> orms),
> > extra_ARB_shader_image_load_store_and_geometry_shader"],
> >
> > # GL_ARB_framebuffer_no_attachments
> > ["MAX_FRAMEBUFFER_LAYERS",
> > "CONTEXT_INT(Const.MaxFramebufferLayers),
> > extra_ARB_framebuffer_no_attachments"],
>
> Forgot to remove this one?
Yes I did, thanks.
>
> > @@ -833,7 +848,6 @@ descriptor=[
> > [ "POLYGON_OFFSET_CLAMP_EXT",
> "CONTEXT_FLOAT(Polygon.OffsetClamp),
> > extra_EXT_polygon_offset_clamp" ],
> >
> > # GL_ARB_shader_storage_buffer_object
> > - [ "MAX_GEOMETRY_SHADER_STORAGE_BLOCKS",
> "CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxShaderStor
> ageBlocks), extra_ARB_shader_storage_buffer_object" ],
> > [ "MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS",
> "CONTEXT_INT(Const.Program[MESA_SHADER_TESS_CTRL].MaxShaderStora
> geBlocks), extra_ARB_shader_storage_buffer_object" ],
> > [ "MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS",
> >
> "CONTEXT_INT(Const.Program[MESA_SHADER_TESS_EVAL].MaxShaderStor
> ageBloc
> > ks), extra_ARB_shader_storage_buffer_object" ], ]}, @@ -847,11 +861,9
> @@ descriptor=[
> > [ "MAX_VIEWPORTS", "CONTEXT_INT(Const.MaxViewports),
> extra_ARB_viewport_array" ],
> > [ "VIEWPORT_SUBPIXEL_BITS",
> "CONTEXT_INT(Const.ViewportSubpixelBits), extra_ARB_viewport_array" ],
> > [ "VIEWPORT_BOUNDS_RANGE",
> "CONTEXT_FLOAT2(Const.ViewportBounds),
> > extra_ARB_viewport_array" ],
> > - [ "LAYER_PROVOKING_VERTEX",
> "CONTEXT_ENUM(Light.ProvokingVertex), extra_ARB_viewport_array" ],
> > [ "VIEWPORT_INDEX_PROVOKING_VERTEX",
> > "CONTEXT_ENUM(Light.ProvokingVertex), extra_ARB_viewport_array" ],
> >
> > # GL_ARB_gpu_shader5
> > - [ "MAX_GEOMETRY_SHADER_INVOCATIONS",
> "CONST(MAX_GEOMETRY_SHADER_INVOCATIONS),
> extra_ARB_gpu_shader5" ],
> > [ "MIN_FRAGMENT_INTERPOLATION_OFFSET",
> "CONTEXT_FLOAT(Const.MinFragmentInterpolationOffset),
> extra_ARB_gpu_shader5" ],
> > [ "MAX_FRAGMENT_INTERPOLATION_OFFSET",
> "CONTEXT_FLOAT(Const.MaxFragmentInterpolationOffset),
> extra_ARB_gpu_shader5" ],
> > [ "FRAGMENT_INTERPOLATION_OFFSET_BITS",
> > "CONST(FRAGMENT_INTERPOLATION_OFFSET_BITS),
> extra_ARB_gpu_shader5" ],
> > --
> > 2.5.0
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list