mesa: Add EXT_frag_depth bits and enable it on all drivers
authorAnuj Phogat <anuj.phogat@gmail.com>
Fri, 10 Feb 2017 21:43:57 +0000 (13:43 -0800)
committerAnuj Phogat <anuj.phogat@gmail.com>
Tue, 14 Feb 2017 00:08:40 +0000 (16:08 -0800)
Passes the newly added piglit test for this extension on i965.

V2: Fix comments by Ilia.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/compiler/glsl/builtin_variables.cpp
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/glsl_parser_extras.h
src/mesa/main/extensions_table.h

index be593e9f4338544c6580430fe70530ebc36aa66c..db8418bbc7fceec3409a50115e4eb8fe046a7cb1 100644 (file)
@@ -1193,6 +1193,9 @@ builtin_variable_generator::generate_fs_special_vars()
    if (state->is_version(110, 300))
       add_output(FRAG_RESULT_DEPTH, float_t, "gl_FragDepth");
 
+   if (state->EXT_frag_depth_enable)
+      add_output(FRAG_RESULT_DEPTH, float_t, "gl_FragDepthEXT");
+
    if (state->ARB_shader_stencil_export_enable) {
       ir_variable *const var =
          add_output(FRAG_RESULT_STENCIL, int_t, "gl_FragStencilRefARB");
index c4da79a32f80aaecdbc22f2b7b5e770332822055..f6a9c9a051dd711d6ca34f44b449e60b0889c1f1 100644 (file)
@@ -684,6 +684,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(AMD_vertex_shader_viewport_index),
    EXT(ANDROID_extension_pack_es31a),
    EXT(EXT_blend_func_extended),
+   EXT(EXT_frag_depth),
    EXT(EXT_draw_buffers),
    EXT(EXT_clip_cull_distance),
    EXT(EXT_geometry_point_size),
index 66a954f880be77a33a1857b2a1230b4bdc16bd70..9f4a309ca2144eabfc2bae9ee1279696124fc46d 100644 (file)
@@ -741,6 +741,8 @@ struct _mesa_glsl_parse_state {
    bool EXT_clip_cull_distance_warn;
    bool EXT_draw_buffers_enable;
    bool EXT_draw_buffers_warn;
+   bool EXT_frag_depth_enable;
+   bool EXT_frag_depth_warn;
    bool EXT_geometry_point_size_enable;
    bool EXT_geometry_point_size_warn;
    bool EXT_geometry_shader_enable;
index 75f432bae96eb77a9789aa3500bd51652588fc73..7ea56c8422d65454a1c07590f047f21f8e08fc42 100644 (file)
@@ -211,6 +211,7 @@ EXT(EXT_draw_elements_base_vertex           , ARB_draw_elements_base_vertex
 EXT(EXT_draw_instanced                      , ARB_draw_instanced                     , GLL, GLC,  x ,  x , 2006)
 EXT(EXT_draw_range_elements                 , dummy_true                             , GLL,  x ,  x ,  x , 1997)
 EXT(EXT_fog_coord                           , dummy_true                             , GLL,  x ,  x ,  x , 1999)
+EXT(EXT_frag_depth                          , dummy_true                             ,  x ,  x ,  x , ES2, 2010)
 EXT(EXT_framebuffer_blit                    , dummy_true                             , GLL, GLC,  x ,  x , 2005)
 EXT(EXT_framebuffer_multisample             , EXT_framebuffer_multisample            , GLL, GLC,  x ,  x , 2005)
 EXT(EXT_framebuffer_multisample_blit_scaled , EXT_framebuffer_multisample_blit_scaled, GLL, GLC,  x ,  x , 2011)