[Mesa-dev] [PATCH 5/7] mesa: enable enums for OES_geometry_shader
Ilia Mirkin
imirkin at alum.mit.edu
Wed Sep 23 08:45:23 PDT 2015
On Wed, Sep 23, 2015 at 4:42 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 | 18 +++++++++++++++
> src/mesa/main/get_hash_params.py | 50 ++++++++++++++++++++++++----------------
> 2 files changed, 48 insertions(+), 20 deletions(-)
>
> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
> index 926caef..37b2a30 100644
> --- a/src/mesa/main/get.c
> +++ b/src/mesa/main/get.c
> @@ -454,6 +454,24 @@ static const int extra_gl32_ARB_geometry_shader4[] = {
> EXTRA_END
> };
>
> +static const int extra_ARB_geometry_shader4_OES_geometry_shader[] = {
> + EXTRA_VERSION_32,
> + EXT(ARB_geometry_shader4),
> + EXT(OES_geometry_shader),
> + EXTRA_END
Fun. This actually works, since it matches GL 3.2+, GLES 3.2+, or if
you have either of those exts. There's the unfortunate situation if
you have OES_geometry_shader4 enabled but not GL 3.2, but I'm
certainly willing to overlook such theoretical possibilities. (Esp
since fixing them leads to a lot more complications.)
> +};
> +
> +static const int extra_version_32_OES_geometry_shader[] = {
> + EXTRA_VERSION_32,
> + EXT(OES_geometry_shader),
> + EXTRA_END
> +};
> +
> +static const int extra_ARB_viewport_array_OES_geometry_shader[] = {
> + EXT(ARB_viewport_array),
> + EXT(OES_geometry_shader),
> + EXTRA_END
> +};
> static const int extra_gl40_ARB_sample_shading[] = {
> EXTRA_VERSION_40,
> EXT(ARB_sample_shading),
> diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
> index e2fb2a1..0637b49 100644
> --- a/src/mesa/main/get_hash_params.py
> +++ b/src/mesa/main/get_hash_params.py
> @@ -468,12 +468,42 @@ descriptor=[
>
> # GL 4.4 / GLES 3.1
> [ "MAX_VERTEX_ATTRIB_STRIDE", "CONTEXT_ENUM(Const.MaxVertexAttribStride), NO_EXTRA" ],
> +
> +# GL_ARB_uniform_buffer_object / GL_OES_geometry_shader
> + [ "MAX_GEOMETRY_UNIFORM_BLOCKS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks), extra_ARB_uniform_buffer_object_and_geometry_shader" ],
> + [ "MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object_and_geometry_shader" ],
> +
> +# GL_ARB_shader_atomic_counters / GL_OES_geometry_shader
> + [ "MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicBuffers), extra_ARB_shader_atomic_counters_and_geometry_shader" ],
> + [ "MAX_GEOMETRY_ATOMIC_COUNTERS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCounters), extra_ARB_shader_atomic_counters_and_geometry_shader" ],
> +
> +# shader_image_load_store / GL_OES_geometry_shader
> + [ "MAX_GEOMETRY_IMAGE_UNIFORMS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxImageUniforms), extra_ARB_shader_image_load_store_and_geometry_shader" ],
> +
> +# GL 3.2 / GL OES_geometry_shader
> + [ "MAX_GEOMETRY_INPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxInputComponents), extra_version_32_OES_geometry_shader" ],
> + [ "MAX_GEOMETRY_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents), extra_version_32_OES_geometry_shader" ],
These 2 should probably be in the below GL_CORE/GLES31 section. As
probably should all or most of these, but ... meh. I guess someone
still has ARB_gs4 aspirations.
> +
> +# GL_ARB_geometry_shader4 / GL_OES_geometry_shader
> + [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits), extra_ARB_geometry_shader4_OES_geometry_shader" ],
> + [ "MAX_GEOMETRY_OUTPUT_VERTICES", "CONTEXT_INT(Const.MaxGeometryOutputVertices), extra_ARB_geometry_shader4_OES_geometry_shader" ],
> + [ "MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.MaxGeometryTotalOutputComponents), extra_ARB_geometry_shader4_OES_geometry_shader" ],
> + [ "MAX_GEOMETRY_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents), extra_ARB_geometry_shader4_OES_geometry_shader" ],
> +
> +# GL_ARB_framebuffer_no_attachments / GL_OES_geometry_shader
> + ["MAX_FRAMEBUFFER_LAYERS", "CONTEXT_INT(Const.MaxFramebufferLayers), extra_ARB_framebuffer_no_attachments"],
> ]},
>
> # Enums in OpenGL Core profile and ES 3.1
> { "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_ARB_viewport_array / GL_OES_geometry_shader
> + [ "LAYER_PROVOKING_VERTEX", "CONTEXT_ENUM(Light.ProvokingVertex), extra_ARB_viewport_array_OES_geometry_shader" ],
Not strictly speaking correct... you'd want OES_geometry_shader in an
ES context or ARB_viewport_array in a core context. Is there a
scenario where you'd have OES_geometry_shader and not
ARB_viewport_array, and tried to query this from a core context? Seems
far-fetched, so this is probably OK.
> +
> +# GL_ARB_gpu_shader5 / GL_OES_geometry_shader
> + [ "MAX_GEOMETRY_SHADER_INVOCATIONS", "CONST(MAX_GEOMETRY_SHADER_INVOCATIONS), extra_ARB_gpu_shader5" ],
> ]},
>
> # Remaining enums are only in OpenGL
> @@ -741,10 +771,6 @@ descriptor=[
> [ "MAX_VERTEX_STREAMS", "CONTEXT_INT(Const.MaxVertexStreams), extra_ARB_transform_feedback3_ARB_gpu_shader5" ],
>
> # GL_ARB_geometry_shader4
> - [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits), extra_gl32_ARB_geometry_shader4" ],
> - [ "MAX_GEOMETRY_OUTPUT_VERTICES_ARB", "CONTEXT_INT(Const.MaxGeometryOutputVertices), extra_gl32_ARB_geometry_shader4" ],
> - [ "MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxGeometryTotalOutputComponents), extra_gl32_ARB_geometry_shader4" ],
> - [ "MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformComponents), extra_gl32_ARB_geometry_shader4" ],
> [ "MAX_GEOMETRY_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents), extra_ARB_geometry_shader4" ],
> [ "MAX_VERTEX_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxOutputComponents), extra_ARB_geometry_shader4" ],
>
> @@ -773,8 +799,6 @@ 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].MaxInputComponents), extra_version_32" ],
> - [ "MAX_GEOMETRY_OUTPUT_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxOutputComponents), extra_version_32" ],
>
> # GL_ARB_robustness
> [ "RESET_NOTIFICATION_STRATEGY_ARB", "CONTEXT_ENUM(Const.ResetStrategy), NO_EXTRA" ],
> @@ -790,10 +814,6 @@ descriptor=[
>
> [ "MAX_DUAL_SOURCE_DRAW_BUFFERS", "CONTEXT_INT(Const.MaxDualSourceDrawBuffers), extra_ARB_blend_func_extended" ],
>
> -# GL_ARB_uniform_buffer_object
> - [ "MAX_GEOMETRY_UNIFORM_BLOCKS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks), extra_ARB_uniform_buffer_object_and_geometry_shader" ],
> - [ "MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxCombinedUniformComponents), extra_ARB_uniform_buffer_object_and_geometry_shader" ],
> -
> # GL_ARB_timer_query
> [ "TIMESTAMP", "LOC_CUSTOM, TYPE_INT64, 0, extra_ARB_timer_query" ],
>
> @@ -806,17 +826,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].MaxAtomicBuffers), extra_ARB_shader_atomic_counters_and_geometry_shader" ],
> - [ "MAX_GEOMETRY_ATOMIC_COUNTERS", "CONTEXT_INT(Const.Program[MESA_SHADER_GEOMETRY].MaxAtomicCounters), 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].MaxImageUniforms), 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"],
>
> # GL_EXT_polygon_offset_clamp
> [ "POLYGON_OFFSET_CLAMP_EXT", "CONTEXT_FLOAT(Polygon.OffsetClamp), extra_EXT_polygon_offset_clamp" ],
> @@ -831,11 +843,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.1.4
>
> _______________________________________________
> 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