[Mesa-dev] [PATCH V2] mesa: Add EXT_frag_depth bits and enable it on all drivers
Anuj Phogat
anuj.phogat at gmail.com
Fri Feb 10 21:52:26 UTC 2017
Passes the newly added piglit test for this extension on i965.
V2: Fix comments by Ilia.
Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
src/compiler/glsl/builtin_variables.cpp | 3 +++
src/compiler/glsl/glsl_parser_extras.cpp | 1 +
src/compiler/glsl/glsl_parser_extras.h | 2 ++
src/mesa/main/extensions_table.h | 1 +
4 files changed, 7 insertions(+)
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index 4eb275e..deab4f3 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -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");
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index e16d543..50b067d 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -677,6 +677,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),
diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
index 424cab5..3f3adec 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -738,6 +738,8 @@ struct _mesa_glsl_parse_state {
bool EXT_blend_func_extended_warn;
bool EXT_clip_cull_distance_enable;
bool EXT_clip_cull_distance_warn;
+ bool EXT_frag_depth_enable;
+ bool EXT_frag_depth_warn;
bool EXT_draw_buffers_enable;
bool EXT_draw_buffers_warn;
bool EXT_geometry_point_size_enable;
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 75f432b..7ea56c8 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -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)
--
2.9.3
More information about the mesa-dev
mailing list