[Mesa-dev] [PATCH v5] mesa: enable enums for OES_geometry_shader

2016-01-26 Thread Marta Lofstedt
From: Marta Lofstedt 

Enable GL_OES_geometry_shader enums for OpenGL ES 3.1.

V4: EXTRA tokens updated according to comments from Ilia Mirkin.

V5: Account for check_extra does not evaluate "or" lazy. Fix issues
with EXTRA_EXT_FB_NO_ATTACH_CS.

Signed-off-by: Marta Lofstedt 
Reviewed-by: Tapani Pälli 
Reviewed-by: Ilia Mirkin 
---
 src/mesa/main/get.c  | 82 
 src/mesa/main/get_hash_params.py | 52 +++--
 2 files changed, 98 insertions(+), 36 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 95cb18c..0434836 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_FB_NO_ATTACH_GS,
+   EXTRA_EXT_ES_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,28 @@ static const int 
extra_ARB_shader_storage_buffer_object_es31[] = {
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_framebuffer_no_attachments_and_geometry_shader[] = {
+   EXTRA_EXT_FB_NO_ATTACH_GS,
+   EXTRA_END
+};
+
+static const int extra_ARB_viewport_array_or_oes_geometry_shader[] = {
+   EXT(ARB_viewport_array),
+   EXTRA_EXT_ES_GS,
+   EXTRA_END
+};
+
+static const int extra_ARB_gpu_shader5_or_oes_geometry_shader[] = {
+   EXT(ARB_gpu_shader5),
+   EXTRA_EXT_ES_GS,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
@@ -455,6 +480,12 @@ static const int extra_gl32_es3[] = {
 EXTRA_END,
 };
 
+static const int extra_version_32_OES_geometry_shader[] = {
+EXTRA_VERSION_32,
+EXTRA_EXT_ES_GS,
+EXTRA_END
+};
+
 static const int extra_gl40_ARB_sample_shading[] = {
EXTRA_VERSION_40,
EXT(ARB_sample_shading),
@@ -1154,20 +1185,23 @@ 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));
+ if (ctx->Extensions.ARB_uniform_buffer_object &&
+_mesa_has_geometry_shaders(ctx))
+api_found = GL_TRUE;
  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));
+ if (ctx->Extensions.ARB_shader_atomic_counters &&
+_mesa_has_geometry_shaders(ctx))
+api_found = GL_TRUE;
  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));
+ if (ctx->Extensions.ARB_shader_image_load_store &&
+_mesa_has_geometry_shaders(ctx))
+api_found = GL_TRUE;
  break;
   case EXTRA_EXT_ATOMICS_TESS:
  api_check = GL_TRUE;
@@ -1179,6 +1213,24 @@ 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_SSBO_GS:
+ api_check = GL_TRUE;
+ if (ctx->Extensions.ARB_shader_storage_buffer_object &&
+_mesa_has_geometry_shaders(ctx))
+api_found = GL_TRUE;
+ break;
+  case EXTRA_EXT_FB_NO_ATTACH_GS:
+ api_check = GL_TRUE;
+ if (ctx->Extensions.ARB_framebuffer_no_attachments &&
+(_mesa_is_desktop_gl(ctx) ||
+_mesa_has_OES_geometr

[Mesa-dev] [PATCH 4/4] mesa: Update _mesa_has_geometry_shaders

2016-01-21 Thread Marta Lofstedt
From: Marta Lofstedt 

Updates the _mesa_has_geometry_shaders function to also look
for OpenGL ES 3.1 contexts that has OES_geometry_shader enabled.
Reviewed-by: Matt Turner 
---
 src/mesa/main/context.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 8b64f45..46444d2 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -330,7 +330,8 @@ _mesa_is_gles31(const struct gl_context *ctx)
 static inline bool
 _mesa_has_geometry_shaders(const struct gl_context *ctx)
 {
-   return _mesa_is_desktop_gl(ctx) && ctx->Version >= 32;
+   return _mesa_has_OES_geometry_shader(ctx) ||
+  (_mesa_is_desktop_gl(ctx) && ctx->Version >= 32);
 }
 
 
-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/4] mesa: enable enums for OES_geometry_shader

2016-01-21 Thread Marta Lofstedt
From: Marta Lofstedt 

Enable GL_OES_geometry_shader enums for OpenGL ES 3.1.

V4: EXTRA tokens updated according to comments from Ilia Mirkin.

Signed-off-by: Marta Lofstedt 
Reviewed-by: Tapani Pälli 
---
 src/mesa/main/get.c  | 65 ++--
 src/mesa/main/get_hash_params.py | 52 +++-
 2 files changed, 87 insertions(+), 30 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 95cb18c..d8f9e25a 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_FB_NO_ATTACH_GS,
+   EXTRA_EXT_ES_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,29 @@ static const int 
extra_ARB_shader_storage_buffer_object_es31[] = {
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_framebuffer_no_attachments_and_geometry_shader[] = {
+   EXTRA_EXT_FB_NO_ATTACH_GS,
+   EXTRA_END
+};
+
+static const int extra_ARB_viewport_array_or_oes_geometry_shader[] = {
+   EXT(ARB_viewport_array),
+   EXTRA_EXT_ES_GS,
+   EXTRA_END
+};
+
+static const int extra_ARB_gpu_shader5_or_oes_geometry_shader[] = {
+   EXT(ARB_gpu_shader5),
+   EXTRA_EXT_ES_GS,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
@@ -424,6 +450,7 @@ EXTRA_EXT(ARB_tessellation_shader);
 EXTRA_EXT(ARB_shader_subroutine);
 EXTRA_EXT(ARB_shader_storage_buffer_object);
 EXTRA_EXT(ARB_indirect_parameters);
+EXTRA_EXT(OES_geometry_shader);
 
 static const int
 extra_ARB_color_buffer_float_or_glcore[] = {
@@ -455,6 +482,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),
@@ -1154,17 +1187,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));
@@ -1179,6 +1212,20 @@ 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_SSBO_GS:
+ api_check = GL_TRUE;
+ api_found = (ctx->Extensions.ARB_shader_storage_buffer_object &&
+  _mesa_has_geometry_shaders(ctx));
+ break;
+  case EXTRA_EXT_FB_NO_ATTACH_GS:
+ api_check = GL_TRUE;
+ api_found = (ctx->Extensions.ARB_framebuffer_no_attachments &&
+  _mesa_has_geometry_shaders(ctx));
+ break;
+  case EXTRA_EXT_ES_GS:
+ api_check = GL_TRUE;
+ api_found = _mesa_has_OES_geometry_shader(ctx);
+ 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 af7a8f4..6da0f84 100644
--- a/src/mesa/main/get_hash_params.p

[Mesa-dev] [PATCH 3/4] glsl: add support for GL_OES_geometry_shader

2016-01-21 Thread Marta Lofstedt
From: Marta Lofstedt 

This adds glsl support of GL_OES_geometry_shader for
OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
Reviewed-by: Ian Romanick 
---
 src/glsl/builtin_variables.cpp  | 25 +
 src/glsl/glsl_parser.yy |  4 ++--
 src/glsl/glsl_parser_extras.cpp |  1 +
 src/glsl/glsl_parser_extras.h   |  7 +++
 4 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index 221aab0..ccc04c0 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -667,7 +667,7 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxVaryingComponents", state->ctx->Const.MaxVarying * 4);
}
 
-   if (state->is_version(150, 0)) {
+   if (state->has_geometry_shader()) {
   add_const("gl_MaxVertexOutputComponents",
 state->Const.MaxVertexOutputComponents);
   add_const("gl_MaxGeometryInputComponents",
@@ -730,12 +730,11 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxAtomicCounterBindings",
 state->Const.MaxAtomicBufferBindings);
 
-  /* When Mesa adds support for GL_OES_geometry_shader and
-   * GL_OES_tessellation_shader, this will need to change.
-   */
-  if (!state->es_shader) {
+  if (state->has_geometry_shader()) {
  add_const("gl_MaxGeometryAtomicCounters",
state->Const.MaxGeometryAtomicCounters);
+  }
+  if (!state->es_shader) {
  add_const("gl_MaxTessControlAtomicCounters",
state->Const.MaxTessControlAtomicCounters);
  add_const("gl_MaxTessEvaluationAtomicCounters",
@@ -753,12 +752,11 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxAtomicCounterBufferSize",
 state->Const.MaxAtomicCounterBufferSize);
 
-  /* When Mesa adds support for GL_OES_geometry_shader and
-   * GL_OES_tessellation_shader, this will need to change.
-   */
-  if (!state->es_shader) {
+  if (state->has_geometry_shader()) {
  add_const("gl_MaxGeometryAtomicCounterBuffers",
state->Const.MaxGeometryAtomicCounterBuffers);
+  }
+  if (!state->es_shader) {
  add_const("gl_MaxTessControlAtomicCounterBuffers",
state->Const.MaxTessControlAtomicCounterBuffers);
  add_const("gl_MaxTessEvaluationAtomicCounterBuffers",
@@ -814,13 +812,16 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxCombinedImageUniforms",
 state->Const.MaxCombinedImageUniforms);
 
+  if (state->has_geometry_shader()) {
+ add_const("gl_MaxGeometryImageUniforms",
+   state->Const.MaxGeometryImageUniforms);
+  }
+
   if (!state->es_shader) {
  add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs",
state->Const.MaxCombinedShaderOutputResources);
  add_const("gl_MaxImageSamples",
state->Const.MaxImageSamples);
- add_const("gl_MaxGeometryImageUniforms",
-   state->Const.MaxGeometryImageUniforms);
   }
 
   if (state->is_version(450, 310)) {
@@ -1070,7 +1071,7 @@ builtin_variable_generator::generate_fs_special_vars()
if (state->is_version(120, 100))
   add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord");
 
-   if (state->is_version(150, 0)) {
+   if (state->has_geometry_shader()) {
   var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID");
   var->data.interpolation = INTERP_QUALIFIER_FLAT;
}
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 1019875..2109fb2 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1270,7 +1270,7 @@ layout_qualifier_id:
 }
  }
 
- if ($$.flags.i && !state->is_version(150, 0)) {
+ if ($$.flags.i && !state->has_geometry_shader()) {
 _mesa_glsl_error(& @1, state, "#version 150 layout "
  "qualifier `%s' used", $1);
  }
@@ -1507,7 +1507,7 @@ layout_qualifier_id:
   if (match_layout_qualifier("max_vertices", $1, state) == 0) {
  $$.flags.q.max_vertices = 1;
  $$.max_vertices = new(ctx) ast_layout_expression(@1, $3);
- if (!state->is_version(150, 0)) {
+ if (!state->has_geometry_shader()) {
 _mesa_glsl_error(& @3, state,
  "#version 150 max_vertices qualifier "
  "specified", $3);
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extra

[Mesa-dev] [PATCH 1/4] glapi: add GL_OES_geometry_shader extension

2016-01-21 Thread Marta Lofstedt
From: Marta Lofstedt 

Add xml definitions for the GL_OES_geometry_shader extension
and expose the extension for OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
Reviewed-by: Ilia Mirkin 
---
 src/mapi/glapi/gen/apiexec.py   |  5 ++--
 src/mapi/glapi/gen/es_EXT.xml   | 43 +
 src/mesa/main/extensions_table.h|  1 +
 src/mesa/main/mtypes.h  |  1 +
 src/mesa/main/tests/dispatch_sanity.cpp |  3 +++
 5 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py
index 58ec08b..2a80432 100644
--- a/src/mapi/glapi/gen/apiexec.py
+++ b/src/mapi/glapi/gen/apiexec.py
@@ -70,9 +70,8 @@ functions = {
 # extension with core profile.
 "TexBuffer": exec_info(core=31),
 
-# OpenGL 3.2 / GL_ARB_geometry_shader4.  Mesa does not support
-# GL_ARB_geometry_shader4, so OpenGL 3.2 is required.
-"FramebufferTexture": exec_info(core=32),
+# OpenGL 3.2 / GL_OES_geometry_shader.
+"FramebufferTexture": exec_info(core=32, es2=31),
 
 # OpenGL 4.0 / GL_ARB_shader_subroutines. Mesa only exposes this
 # extension with core profile.
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 577d825..86df980 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -940,4 +940,47 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
 
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index aeccb01..ebcd0e6 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -309,6 +309,7 @@ EXT(OES_element_index_uint  , dummy_true
 EXT(OES_fbo_render_mipmap   , dummy_true   
  ,  x ,  x , ES1, ES2, 2005)
 EXT(OES_fixed_point , dummy_true   
  ,  x ,  x , ES1,  x , 2002)
 EXT(OES_framebuffer_object  , dummy_true   
  ,  x ,  x , ES1,  x , 2005)
+EXT(OES_geometry_shader , OES_geometry_shader  
  ,  x ,  x ,  x ,  31, 2015)
 EXT(OES_get_program_binary  , dummy_true   
  ,  x ,  x ,  x , ES2, 2008)
 EXT(OES_mapbuffer   , dummy_true   
  ,  x ,  x , ES1, ES2, 2005)
 EXT(OES_packed_depth_stencil, dummy_true   
  ,  x ,  x , ES1, ES2, 2007)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 0992d4d..40cc2a5 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3904,6 +3904,7 @@ struct gl_extensions
GLboolean OES_texture_half_float;
GLboolean OES_texture_half_float_linear;
GLboolean OES_compressed_ETC1_RGB8_texture;
+   GLboolean OES_geometry_shader;
GLboolean extension_sentinel;
/** The extension string */
const GLubyte *String;
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index 7610bcb..f652da1 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2524,5 +2524,8 @@ const struct function gles31_functions_possible[] = {
/* GL_EXT_blend_func_extended */
{ "glGetProgramResourceLocationIndexEXT", 31, -1 },
 
+   /* GL_OES_geometry_shader */
+   { "glFramebufferTextureOES", 31, -1},
+
{ NULL, 0, -1 },
  };
-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 0/4] Resend of initial OES_geometry_shader patches

2016-01-21 Thread Marta Lofstedt
These patches have been previously reviewed, but after updating
according to review comments, I want to
give people some time to provide more feedback. I will push in 24 hours
unless I hear otherwise.

Marta Lofstedt (4):
  glapi: add GL_OES_geometry_shader extension
  mesa: enable enums for OES_geometry_shader
  glsl: add support for GL_OES_geometry_shader
  mesa: Update _mesa_has_geometry_shaders

 src/glsl/builtin_variables.cpp  | 25 +++--
 src/glsl/glsl_parser.yy |  4 +-
 src/glsl/glsl_parser_extras.cpp |  1 +
 src/glsl/glsl_parser_extras.h   |  7 
 src/mapi/glapi/gen/apiexec.py   |  5 +--
 src/mapi/glapi/gen/es_EXT.xml   | 43 ++
 src/mesa/main/context.h |  3 +-
 src/mesa/main/extensions_table.h|  1 +
 src/mesa/main/get.c | 65 -
 src/mesa/main/get_hash_params.py| 52 +++---
 src/mesa/main/mtypes.h  |  1 +
 src/mesa/main/tests/dispatch_sanity.cpp |  3 ++
 12 files changed, 162 insertions(+), 48 deletions(-)

-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH V3] glapi: add GL_OES_geometry_shader extension

2016-01-12 Thread Marta Lofstedt
From: Marta Lofstedt 

Add xml definitions for the GL_OES_geometry_shader extension
and expose the extension for OpenGL ES 3.1.

V3: Added dependency to OES_shader_io_blocks and updated to
correct Khronos extension number.

Signed-off-by: Marta Lofstedt 
---
 src/mapi/glapi/gen/apiexec.py   |  2 +-
 src/mapi/glapi/gen/es_EXT.xml   | 43 +
 src/mesa/main/extensions_table.h|  1 +
 src/mesa/main/mtypes.h  |  2 ++
 src/mesa/main/tests/dispatch_sanity.cpp |  3 +++
 5 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py
index 58ec08b..fa046fa 100644
--- a/src/mapi/glapi/gen/apiexec.py
+++ b/src/mapi/glapi/gen/apiexec.py
@@ -72,7 +72,7 @@ functions = {
 
 # OpenGL 3.2 / GL_ARB_geometry_shader4.  Mesa does not support
 # GL_ARB_geometry_shader4, so OpenGL 3.2 is required.
-"FramebufferTexture": exec_info(core=32),
+"FramebufferTexture": exec_info(core=32, es2=31),
 
 # OpenGL 4.0 / GL_ARB_shader_subroutines. Mesa only exposes this
 # extension with core profile.
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 577d825..8ecce34 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -940,4 +940,47 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
 
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index aeccb01..11ca22e 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -309,6 +309,7 @@ EXT(OES_element_index_uint  , dummy_true
 EXT(OES_fbo_render_mipmap   , dummy_true   
  ,  x ,  x , ES1, ES2, 2005)
 EXT(OES_fixed_point , dummy_true   
  ,  x ,  x , ES1,  x , 2002)
 EXT(OES_framebuffer_object  , dummy_true   
  ,  x ,  x , ES1,  x , 2005)
+EXT(OES_geometry_shader , OES_shader_io_blocks 
  ,  x ,  x ,  x ,  31, 2015)
 EXT(OES_get_program_binary  , dummy_true   
  ,  x ,  x ,  x , ES2, 2008)
 EXT(OES_mapbuffer   , dummy_true   
  ,  x ,  x , ES1, ES2, 2005)
 EXT(OES_packed_depth_stencil, dummy_true   
  ,  x ,  x , ES1, ES2, 2007)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 0992d4d..24208b0 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3904,6 +3904,8 @@ struct gl_extensions
GLboolean OES_texture_half_float;
GLboolean OES_texture_half_float_linear;
GLboolean OES_compressed_ETC1_RGB8_texture;
+   GLboolean OES_geometry_shader;
+   GLboolean OES_shader_io_blocks;
GLboolean extension_sentinel;
/** The extension string */
const GLubyte *String;
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index 7610bcb..f652da1 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2524,5 +2524,8 @@ const struct function gles31_functions_possible[] = {
/* GL_EXT_blend_func_extended */
{ "glGetProgramResourceLocationIndexEXT", 31, -1 },
 
+   /* GL_OES_geometry_shader */
+   { "glFramebufferTextureOES", 31, -1},
+
{ NULL, 0, -1 },
  };
-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa: Move sanity check of BindVertexBuffer for OpenGL ES 3.1

2016-01-08 Thread Marta Lofstedt
From: Marta Lofstedt 

Sanity check of BindVertexBuffer for OpenGL ES in
_mesa_handle_bind_buffer_gen breaks OpenGL ES 2 conformance.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93426
Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/bufferobj.c | 2 +-
 src/mesa/main/varray.c| 8 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index d7c5680..3ca1b3a 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -953,7 +953,7 @@ _mesa_handle_bind_buffer_gen(struct gl_context *ctx,
 {
struct gl_buffer_object *buf = *buf_handle;
 
-   if (!buf && (ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx))) {
+   if (!buf && (ctx->API == API_OPENGL_CORE)) {
   _mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", caller);
   return false;
}
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index c71e16a..a8d757b 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1754,8 +1754,14 @@ vertex_array_vertex_buffer(struct gl_context *ctx,
* Otherwise, we fall back to the same compat profile behavior as other
* object references (automatically gen it).
*/
-  if (!_mesa_handle_bind_buffer_gen(ctx, buffer, &vbo, func))
+  if (!_mesa_handle_bind_buffer_gen(ctx, buffer, &vbo, func)) {
+  return;
+  }
+
+  if (!vbo && _mesa_is_gles31(ctx)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", func);
  return;
+  }
} else {
   /* The ARB_vertex_attrib_binding spec says:
*
-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] i965/gen8: Always use BRW_REGISTER_TYPE_UW for MUL on GEN8+

2015-12-29 Thread Marta Lofstedt
From: Marta Lofstedt 

The imulExtended test of the shader bitfield tests of the
OpenGL ES 3.1 CTS, fail on gen8+, when BRW_REGISTER_TYPE_W
is used for SHADER_OPECODE_MULH.

See:
https://bugs.freedesktop.org/show_bug.cgi?id=92595

Signed-off-by: Marta Lofstedt 
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 6ac2f85..511979d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -3436,8 +3436,7 @@ fs_visitor::lower_integer_multiplication()
  */
 assert(mul->src[1].type == BRW_REGISTER_TYPE_D ||
mul->src[1].type == BRW_REGISTER_TYPE_UD);
-mul->src[1].type = (type_is_signed(mul->src[1].type) ?
-BRW_REGISTER_TYPE_W : BRW_REGISTER_TYPE_UW);
+mul->src[1].type = BRW_REGISTER_TYPE_UW;
 mul->src[1].stride *= 2;
 
  } else if (devinfo->gen == 7 && !devinfo->is_haswell &&
-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4] mesa: Update _mesa_has_geometry_shaders

2015-12-10 Thread Marta Lofstedt
From: Marta Lofstedt 

Updates the _mesa_has_geometry_shaders function to also look
for OpenGL ES 3.1 contexts that has OES_geometry_shader enabled.
---
 src/mesa/main/context.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 8b64f45..46444d2 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -330,7 +330,8 @@ _mesa_is_gles31(const struct gl_context *ctx)
 static inline bool
 _mesa_has_geometry_shaders(const struct gl_context *ctx)
 {
-   return _mesa_is_desktop_gl(ctx) && ctx->Version >= 32;
+   return _mesa_has_OES_geometry_shader(ctx) ||
+  (_mesa_is_desktop_gl(ctx) && ctx->Version >= 32);
 }
 
 
-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4] mesa: enable enums for OES_geometry_shader

2015-12-10 Thread Marta Lofstedt
From: Marta Lofstedt 

Enable GL_OES_geometry_shader enums for OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  | 70 ++--
 src/mesa/main/get_hash_params.py | 53 +-
 2 files changed, 92 insertions(+), 31 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index c6a2e5b..6279d81 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -147,11 +147,15 @@ 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_FB_NO_ATTACH_GS,
+   EXTRA_EXT_VIEWPORT_GS,
+   EXTRA_EXT_GPU5_GS,
 };
 
 #define NO_EXTRA NULL
@@ -308,7 +312,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 +347,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 +379,27 @@ static const int 
extra_ARB_shader_storage_buffer_object_es31[] = {
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_framebuffer_no_attachments_and_geometry_shader[] = {
+   EXTRA_EXT_FB_NO_ATTACH_GS,
+   EXTRA_END
+};
+
+static const int extra_ARB_viewport_array_or_oes_geometry_shader[] = {
+   EXTRA_EXT_VIEWPORT_GS,
+   EXTRA_END
+};
+
+static const int extra_ARB_gpu_shader5_or_oes_geometry_shader[] = {
+   EXTRA_EXT_GPU5_GS,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
@@ -423,6 +448,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 +480,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 +1181,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 +1206,26 @@ 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_SSBO_GS:
+ api_check = GL_TRUE;
+ api_found = (ctx->Extensions.ARB_shader_storage_buffer_object &&
+  _mesa_has_geometry_shaders(ctx));
+ break;
+  case EXTRA_EXT_FB_NO_ATTACH_GS:
+ api_check = GL_TRUE;
+ api_found = (ctx->Extensions.ARB_framebuffer_no_attachments &&
+  _mesa_has_geometry_shaders(ctx));
+ break;
+  case EXTRA_EXT_GPU5_GS:
+ api_check = GL_TRUE;
+ api_found = (ctx->Extensions.ARB_gpu_shader5 ||
+  _mesa_has_OES_geometry_shader(ctx));
+ break;
+  case EXTRA_EXT_VIEWPORT_GS:
+ api_check = GL_TRUE;
+ api_found = (ctx->Extensions.ARB_viewport_array ||
+  _mesa_has_OES_geometry_shader(ctx));
+ break;
   case EXTRA_END:
 break;
   default: /* *e is a offset into the ext

[Mesa-dev] [PATCH v3] mesa: Update _mesa_has_geometry_shaders

2015-12-01 Thread Marta Lofstedt
From: Marta Lofstedt 

Updates the _mesa_has_geometry_shaders function to also look
for OpenGL ES 3.1 contexts that has OES_geometry_shader enabled.
---
 src/mesa/main/context.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 8b64f45..25ef686 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -330,7 +330,8 @@ _mesa_is_gles31(const struct gl_context *ctx)
 static inline bool
 _mesa_has_geometry_shaders(const struct gl_context *ctx)
 {
-   return _mesa_is_desktop_gl(ctx) && ctx->Version >= 32;
+   return (_mesa_has_OES_geometry_shader(ctx)) ||
+  (_mesa_is_desktop_gl(ctx) && ctx->Version >= 32);
 }
 
 
-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3] mesa: enable enums for OES_geometry_shader

2015-12-01 Thread Marta Lofstedt
From: Marta Lofstedt 

Enable GL_OES_geometry_shader enums for OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  | 64 ++--
 src/mesa/main/get_hash_params.py | 53 +++--
 2 files changed, 86 insertions(+), 31 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index c6a2e5b..7be7971 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_FB_NO_ATTACH_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,27 @@ 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_or_geometry_shader[] = {
+   EXT(ARB_viewport_array),
+   EXT(OES_geometry_shader),
+   EXTRA_END
+};
+
+static const int extra_ARB_framebuffer_no_attachments_and_geometry_shader[] = {
+   EXTRA_EXT_FB_NO_ATTACH_GS,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
@@ -423,6 +447,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 +479,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 +1180,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 +1205,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_gpu_shader5 &&
+  _mesa_has_geometry_shaders(ctx));
+ 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_FB_NO_ATTACH_GS:
+ api_check = GL_TRUE;
+ api_found = (ctx->Extensions.ARB_framebuffer_no_attachments &&
+  _mesa_has_geometry_shaders(ctx));
+ 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..151f7f8 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_pa

[Mesa-dev] [PATCH v3] glsl: add support for GL_OES_geometry_shader

2015-12-01 Thread Marta Lofstedt
From: Marta Lofstedt 

This adds glsl support of GL_OES_geometry_shader for
OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
---
 src/glsl/builtin_variables.cpp  | 25 +
 src/glsl/glsl_parser.yy |  4 ++--
 src/glsl/glsl_parser_extras.cpp |  1 +
 src/glsl/glsl_parser_extras.h   |  7 +++
 4 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index e8eab80..6f87600 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -667,7 +667,7 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxVaryingComponents", state->ctx->Const.MaxVarying * 4);
}
 
-   if (state->is_version(150, 0)) {
+   if (state->has_geometry_shader()) {
   add_const("gl_MaxVertexOutputComponents",
 state->Const.MaxVertexOutputComponents);
   add_const("gl_MaxGeometryInputComponents",
@@ -730,12 +730,11 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxAtomicCounterBindings",
 state->Const.MaxAtomicBufferBindings);
 
-  /* When Mesa adds support for GL_OES_geometry_shader and
-   * GL_OES_tessellation_shader, this will need to change.
-   */
-  if (!state->es_shader) {
+  if (state->has_geometry_shader()) {
  add_const("gl_MaxGeometryAtomicCounters",
state->Const.MaxGeometryAtomicCounters);
+  }
+  if (!state->es_shader) {
  add_const("gl_MaxTessControlAtomicCounters",
state->Const.MaxTessControlAtomicCounters);
  add_const("gl_MaxTessEvaluationAtomicCounters",
@@ -753,12 +752,11 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxAtomicCounterBufferSize",
 state->Const.MaxAtomicCounterBufferSize);
 
-  /* When Mesa adds support for GL_OES_geometry_shader and
-   * GL_OES_tessellation_shader, this will need to change.
-   */
-  if (!state->es_shader) {
+  if (state->has_geometry_shader()) {
  add_const("gl_MaxGeometryAtomicCounterBuffers",
state->Const.MaxGeometryAtomicCounterBuffers);
+  }
+  if(!state->es_shader) {
  add_const("gl_MaxTessControlAtomicCounterBuffers",
state->Const.MaxTessControlAtomicCounterBuffers);
  add_const("gl_MaxTessEvaluationAtomicCounterBuffers",
@@ -814,13 +812,16 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxCombinedImageUniforms",
 state->Const.MaxCombinedImageUniforms);
 
+  if (state->has_geometry_shader()) {
+ add_const("gl_MaxGeometryImageUniforms",
+   state->Const.MaxGeometryImageUniforms);
+  }
+
   if (!state->es_shader) {
  add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs",
state->Const.MaxCombinedShaderOutputResources);
  add_const("gl_MaxImageSamples",
state->Const.MaxImageSamples);
- add_const("gl_MaxGeometryImageUniforms",
-   state->Const.MaxGeometryImageUniforms);
   }
 
   if (state->is_version(450, 310)) {
@@ -1057,7 +1058,7 @@ builtin_variable_generator::generate_fs_special_vars()
if (state->is_version(120, 100))
   add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord");
 
-   if (state->is_version(150, 0)) {
+   if (state->has_geometry_shader()) {
   var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID");
   var->data.interpolation = INTERP_QUALIFIER_FLAT;
}
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 5a8f980..7a875fa 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1262,7 +1262,7 @@ layout_qualifier_id:
 }
  }
 
- if ($$.flags.i && !state->is_version(150, 0)) {
+ if ($$.flags.i && !state->has_geometry_shader()) {
 _mesa_glsl_error(& @1, state, "#version 150 layout "
  "qualifier `%s' used", $1);
  }
@@ -1499,7 +1499,7 @@ layout_qualifier_id:
   if (match_layout_qualifier("max_vertices", $1, state) == 0) {
  $$.flags.q.max_vertices = 1;
  $$.max_vertices = new(ctx) ast_layout_expression(@1, $3);
- if (!state->is_version(150, 0)) {
+ if (!state->has_geometry_shader()) {
 _mesa_glsl_error(& @3, state,
  "#version 150 max_vertices qualifier "
  "specified", $3);
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 29cf0c6.

[Mesa-dev] [PATCH v2 6/6] doc: Set GL_OES_geometry_shader as started

2015-11-27 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
Reviewed-by: Eduardo Lima Mitev 
---
 docs/GL3.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/GL3.txt b/docs/GL3.txt
index acf1166..45da51a 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -244,7 +244,7 @@ GLES3.2, GLSL ES 3.2
   GL_OES_copy_imagenot started (based on 
GL_ARB_copy_image, which is done for some drivers)
   GL_OES_draw_buffers_indexed  not started
   GL_OES_draw_elements_base_vertex DONE (all drivers)
-  GL_OES_geometry_shader   not started (based on 
GL_ARB_geometry_shader4, which is done for all drivers)
+  GL_OES_geometry_shader   started (Marta)
   GL_OES_gpu_shader5   not started (based on 
parts of GL_ARB_gpu_shader5, which is done for some drivers)
   GL_OES_primitive_bounding boxnot started
   GL_OES_sample_shadingnot started (based on 
parts of GL_ARB_sample_shading, which is done for some drivers)
-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2 2/6] glapi: add GL_OES_geometry_shader extension

2015-11-27 Thread Marta Lofstedt
From: Marta Lofstedt 

Add xml definitions for the GL_OES_geometry_shader extension
and expose the extension for OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
---
 src/mapi/glapi/gen/apiexec.py   |  2 +-
 src/mapi/glapi/gen/es_EXT.xml   | 43 +
 src/mesa/main/extensions_table.h|  1 +
 src/mesa/main/mtypes.h  |  1 +
 src/mesa/main/tests/dispatch_sanity.cpp |  3 +++
 5 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py
index 58ec08b..fa046fa 100644
--- a/src/mapi/glapi/gen/apiexec.py
+++ b/src/mapi/glapi/gen/apiexec.py
@@ -72,7 +72,7 @@ functions = {
 
 # OpenGL 3.2 / GL_ARB_geometry_shader4.  Mesa does not support
 # GL_ARB_geometry_shader4, so OpenGL 3.2 is required.
-"FramebufferTexture": exec_info(core=32),
+"FramebufferTexture": exec_info(core=32, es2=31),
 
 # OpenGL 4.0 / GL_ARB_shader_subroutines. Mesa only exposes this
 # extension with core profile.
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 577d825..f6c49c2 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -940,4 +940,47 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
 
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 051d69a..d3cbb25 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -307,6 +307,7 @@ EXT(OES_element_index_uint  , dummy_true
 EXT(OES_fbo_render_mipmap   , dummy_true   
  ,  x ,  x , ES1, ES2, 2005)
 EXT(OES_fixed_point , dummy_true   
  ,  x ,  x , ES1,  x , 2002)
 EXT(OES_framebuffer_object  , dummy_true   
  ,  x ,  x , ES1,  x , 2005)
+EXT(OES_geometry_shader , dummy_true   
  ,  x ,  x ,  x ,  31, 2015)
 EXT(OES_get_program_binary  , dummy_true   
  ,  x ,  x ,  x , ES2, 2008)
 EXT(OES_mapbuffer   , dummy_true   
  ,  x ,  x , ES1, ES2, 2005)
 EXT(OES_packed_depth_stencil, dummy_true   
  ,  x ,  x , ES1, ES2, 2007)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index c1b18a4..bff355e 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3818,6 +3818,7 @@ struct gl_extensions
GLboolean OES_texture_half_float;
GLboolean OES_texture_half_float_linear;
GLboolean OES_compressed_ETC1_RGB8_texture;
+   GLboolean OES_geometry_shader;
GLboolean extension_sentinel;
/** The extension string */
const GLubyte *String;
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index 97f81f9..b5b8c8b 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2517,5 +2517,8 @@ const struct function gles31_functions_possible[] = {
/* GL_EXT_blend_func_extended */
{ "glGetProgramResourceLocationIndexEXT", 31, -1 },
 
+   /*GL_OES_geometry_shader*/
+   { "glFramebufferTextureOES", 31, -1},
+
{ NULL, 0, -1 },
  };
-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2 4/6] mesa: enable enums for OES_geometry_shader

2015-11-27 Thread Marta Lofstedt
From: Marta Lofstedt 

Enable GL_OES_geometry_shader enums for OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
---
 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));
+ 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));
+ 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
   [ 

[Mesa-dev] [PATCH v2 3/6] glsl: add support for GL_OES_geometry_shader

2015-11-27 Thread Marta Lofstedt
From: Marta Lofstedt 

This adds glsl support of GL_OES_geometry_shader for
OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
---
 src/glsl/builtin_variables.cpp  | 17 +
 src/glsl/glsl_parser.yy |  4 ++--
 src/glsl/glsl_parser_extras.cpp |  1 +
 src/glsl/glsl_parser_extras.h   |  2 ++
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index e8eab80..6a53789 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -667,7 +667,7 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxVaryingComponents", state->ctx->Const.MaxVarying * 4);
}
 
-   if (state->is_version(150, 0)) {
+   if (state->is_version(150, 320) || state->OES_geometry_shader_enable) {
   add_const("gl_MaxVertexOutputComponents",
 state->Const.MaxVertexOutputComponents);
   add_const("gl_MaxGeometryInputComponents",
@@ -729,11 +729,7 @@ builtin_variable_generator::generate_constants()
 state->Const.MaxCombinedAtomicCounters);
   add_const("gl_MaxAtomicCounterBindings",
 state->Const.MaxAtomicBufferBindings);
-
-  /* When Mesa adds support for GL_OES_geometry_shader and
-   * GL_OES_tessellation_shader, this will need to change.
-   */
-  if (!state->es_shader) {
+  if (!state->es_shader || state->OES_geometry_shader_enable) {
  add_const("gl_MaxGeometryAtomicCounters",
state->Const.MaxGeometryAtomicCounters);
  add_const("gl_MaxTessControlAtomicCounters",
@@ -753,10 +749,7 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxAtomicCounterBufferSize",
 state->Const.MaxAtomicCounterBufferSize);
 
-  /* When Mesa adds support for GL_OES_geometry_shader and
-   * GL_OES_tessellation_shader, this will need to change.
-   */
-  if (!state->es_shader) {
+  if (!state->es_shader || state->OES_geometry_shader_enable) {
  add_const("gl_MaxGeometryAtomicCounterBuffers",
state->Const.MaxGeometryAtomicCounterBuffers);
  add_const("gl_MaxTessControlAtomicCounterBuffers",
@@ -814,7 +807,7 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxCombinedImageUniforms",
 state->Const.MaxCombinedImageUniforms);
 
-  if (!state->es_shader) {
+  if (!state->es_shader || state->OES_geometry_shader_enable) {
  add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs",
state->Const.MaxCombinedShaderOutputResources);
  add_const("gl_MaxImageSamples",
@@ -1057,7 +1050,7 @@ builtin_variable_generator::generate_fs_special_vars()
if (state->is_version(120, 100))
   add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord");
 
-   if (state->is_version(150, 0)) {
+   if (state->is_version(150, 320) || state->OES_geometry_shader_enable) {
   var = add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID");
   var->data.interpolation = INTERP_QUALIFIER_FLAT;
}
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 5a8f980..fae6d0b 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1262,7 +1262,7 @@ layout_qualifier_id:
 }
  }
 
- if ($$.flags.i && !state->is_version(150, 0)) {
+ if ($$.flags.i && !state->is_version(150, 320) && 
!state->OES_geometry_shader_enable) {
 _mesa_glsl_error(& @1, state, "#version 150 layout "
  "qualifier `%s' used", $1);
  }
@@ -1499,7 +1499,7 @@ layout_qualifier_id:
   if (match_layout_qualifier("max_vertices", $1, state) == 0) {
  $$.flags.q.max_vertices = 1;
  $$.max_vertices = new(ctx) ast_layout_expression(@1, $3);
- if (!state->is_version(150, 0)) {
+ if (!state->is_version(150, 310)) {
 _mesa_glsl_error(& @3, state,
  "#version 150 max_vertices qualifier "
  "specified", $3);
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 7138925..193cc2a 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -635,6 +635,7 @@ static const _mesa_glsl_extension 
_mesa_glsl_supported_extensions[] = {
/* OES extensions go here, sorted alphabetically.
 */
EXT(OES_EGL_image_external, false, true,  
OES_EGL_image_external),
+   EXT(OES_geometry_shader,false, true,  OES_geometry_shader),
EXT(OES_standard_derivatives,   false, true,  
OES_standard_derivat

[Mesa-dev] [PATCH v2 1/6] gles2: Update gl2ext.h to revision: 32120

2015-11-27 Thread Marta Lofstedt
From: Marta Lofstedt 

This is needed to be able to implement the accepted OES
extensions.

Signed-off-by: Marta Lofstedt 
---
 include/GLES2/gl2ext.h | 940 -
 1 file changed, 934 insertions(+), 6 deletions(-)

diff --git a/include/GLES2/gl2ext.h b/include/GLES2/gl2ext.h
index 2b67c6e..2d05596 100644
--- a/include/GLES2/gl2ext.h
+++ b/include/GLES2/gl2ext.h
@@ -6,7 +6,7 @@ extern "C" {
 #endif
 
 /*
-** Copyright (c) 2013-2014 The Khronos Group Inc.
+** Copyright (c) 2013-2015 The Khronos Group Inc.
 **
 ** Permission is hereby granted, free of charge, to any person obtaining a
 ** copy of this software and/or associated documentation files (the
@@ -33,14 +33,14 @@ extern "C" {
 ** used to make the header, and the header can be found at
 **   http://www.opengl.org/registry/
 **
-** Khronos $Revision: 28335 $ on $Date: 2014-09-26 18:55:45 -0700 (Fri, 26 Sep 
2014) $
+** Khronos $Revision: 32120 $ on $Date: 2015-10-15 04:27:13 -0700 (Thu, 15 Oct 
2015) $
 */
 
 #ifndef GL_APIENTRYP
 #define GL_APIENTRYP GL_APIENTRY*
 #endif
 
-/* Generated on date 20140926 */
+/* Generated on date 20151015 */
 
 /* Generated C header for:
  * API: gles2
@@ -117,6 +117,7 @@ typedef void (GL_APIENTRY  *GLDEBUGPROCKHR)(GLenum 
source,GLenum type,GLuint id,
 #define GL_PROGRAM_KHR0x82E2
 #define GL_VERTEX_ARRAY_KHR   0x8074
 #define GL_QUERY_KHR  0x82E3
+#define GL_PROGRAM_PIPELINE_KHR   0x82E4
 #define GL_SAMPLER_KHR0x82E6
 #define GL_MAX_LABEL_LENGTH_KHR   0x82E8
 #define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR   0x9143
@@ -155,6 +156,11 @@ GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum 
pname, void **params);
 #endif
 #endif /* GL_KHR_debug */
 
+#ifndef GL_KHR_no_error
+#define GL_KHR_no_error 1
+#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR  0x0008
+#endif /* GL_KHR_no_error */
+
 #ifndef GL_KHR_robust_buffer_access_behavior
 #define GL_KHR_robust_buffer_access_behavior 1
 #endif /* GL_KHR_robust_buffer_access_behavior */
@@ -219,6 +225,10 @@ GL_APICALL void GL_APIENTRY glGetnUniformuivKHR (GLuint 
program, GLint location,
 #define GL_KHR_texture_compression_astc_ldr 1
 #endif /* GL_KHR_texture_compression_astc_ldr */
 
+#ifndef GL_KHR_texture_compression_astc_sliced_3d
+#define GL_KHR_texture_compression_astc_sliced_3d 1
+#endif /* GL_KHR_texture_compression_astc_sliced_3d */
+
 #ifndef GL_OES_EGL_image
 #define GL_OES_EGL_image 1
 typedef void *GLeglImageOES;
@@ -238,6 +248,10 @@ GL_APICALL void GL_APIENTRY 
glEGLImageTargetRenderbufferStorageOES (GLenum targe
 #define GL_SAMPLER_EXTERNAL_OES   0x8D66
 #endif /* GL_OES_EGL_image_external */
 
+#ifndef GL_OES_EGL_image_external_essl3
+#define GL_OES_EGL_image_external_essl3 1
+#endif /* GL_OES_EGL_image_external_essl3 */
+
 #ifndef GL_OES_compressed_ETC1_RGB8_sub_texture
 #define GL_OES_compressed_ETC1_RGB8_sub_texture 1
 #endif /* GL_OES_compressed_ETC1_RGB8_sub_texture */
@@ -261,6 +275,14 @@ GL_APICALL void GL_APIENTRY 
glEGLImageTargetRenderbufferStorageOES (GLenum targe
 #define GL_PALETTE8_RGB5_A1_OES   0x8B99
 #endif /* GL_OES_compressed_paletted_texture */
 
+#ifndef GL_OES_copy_image
+#define GL_OES_copy_image 1
+typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAOESPROC) (GLuint srcName, 
GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint 
dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, 
GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCopyImageSubDataOES (GLuint srcName, GLenum 
srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, 
GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei 
srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+#endif
+#endif /* GL_OES_copy_image */
+
 #ifndef GL_OES_depth24
 #define GL_OES_depth24 1
 #define GL_DEPTH_COMPONENT24_OES  0x81A6
@@ -275,6 +297,44 @@ GL_APICALL void GL_APIENTRY 
glEGLImageTargetRenderbufferStorageOES (GLenum targe
 #define GL_OES_depth_texture 1
 #endif /* GL_OES_depth_texture */
 
+#ifndef GL_OES_draw_buffers_indexed
+#define GL_OES_draw_buffers_indexed 1
+#define GL_MIN0x8007
+#define GL_MAX0x8008
+typedef void (GL_APIENTRYP PFNGLENABLEIOESPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLDISABLEIOESPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIOESPROC) (GLuint buf, GLenum 
mode);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIOESPROC) (GLuint buf, 
GLenum modeRGB, GLenum modeAlpha);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCIOESPROC) (GLuint buf, GLenum src, 
GLenum dst);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIOESPROC) (GLuint buf, GLenum 
srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+typedef void (GL_APIENTRYP PFNGLCOLORM

[Mesa-dev] [PATCH v2 5/6] mesa: Update _mesa_has_geometry_shaders

2015-11-27 Thread Marta Lofstedt
From: Marta Lofstedt 

Updates the _mesa_has_geometry_shaders function to also look
for OpenGL ES 3.1 contexts that has OES_geometry_shader enabled.
---
 src/mesa/main/context.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 8b64f45..23b2718 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -330,7 +330,8 @@ _mesa_is_gles31(const struct gl_context *ctx)
 static inline bool
 _mesa_has_geometry_shaders(const struct gl_context *ctx)
 {
-   return _mesa_is_desktop_gl(ctx) && ctx->Version >= 32;
+   return (_mesa_is_gles31(ctx) && ctx->Extensions.OES_geometry_shader) ||
+  (_mesa_is_desktop_gl(ctx) && ctx->Version >= 32);
 }
 
 
-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2 0/6] Enable GL_OES_geometry_shader for OpenGL ES 3.1

2015-11-27 Thread Marta Lofstedt
After I was able to remove the ARB_geometry_shader4
extension I have now rebased my OES_geometry_shader patches.

In order to avoid confusion I send V2 for all patches,
i.e. all of my old OES_geometry_shader patches are now obsolete.

The patches are available here:
https://github.com/MartaLo/mesa/tree/gl_oes_geometry_shader_v2

Changes for V2:
gles2: Update gl2ext.h to revision: 32902:
Updated to the latest gl2ext.h

glapi: add GL_OES_geometry_shader extension:
After comments from Ilia I squashed my previous,
http://patchwork.freedesktop.org/patch/60228/
and
http://patchwork.freedesktop.org/patch/60225/
patches.

glsl: add support for GL_OES_geometry_shader:
After comments from Ilia, added support for glsl version 3.2

mesa: enable enums for OES_geometry_shader:
This needed some work after the ARB_geometry_shader4 was removed.
After a comment from Ilia, I moved all OES_geometry_shader enums
to GL_CORE and GLES31.
I created new EXTRA_EXT for enums that OES_geometry_shader has in
common with ARB_shader_storage_buffer_object, ARB_gpu_shader5 and
ARB_viewport_array.
In my previous patch for the ARB_viewport_array enum
LAYER_PROVOKING_VERTEX, I added an extra that checked
ARB_viewport_array or OES_geometry_shader. But since
ARB_viewport array requires EXT_geometry_shader4, I believe it is
better to check if some version of geometry shader is available.
The dependency for ARB_viewport_array on geometry shader should
be fixed in a another patch.
Also, we may need to discuss if the full ARB_viewport_array
should be exposed under GLES 3.1.

I also renamed the GS4 EXTRA_EXT stuff to only GS.
I should have done that when I removed the ARB_geometry_shader4

the rest of the changes are simple rebases.


Marta Lofstedt (6):
  gles2: Update gl2ext.h to revision: 32120
  glapi: add GL_OES_geometry_shader extension
  glsl: add support for GL_OES_geometry_shader
  mesa: enable enums for OES_geometry_shader
  mesa: Update _mesa_has_geometry_shaders
  doc: Set GL_OES_geometry_shader as started

 docs/GL3.txt|   2 +-
 include/GLES2/gl2ext.h  | 940 +++-
 src/glsl/builtin_variables.cpp  |  17 +-
 src/glsl/glsl_parser.yy |   4 +-
 src/glsl/glsl_parser_extras.cpp |   1 +
 src/glsl/glsl_parser_extras.h   |   2 +
 src/mapi/glapi/gen/apiexec.py   |   2 +-
 src/mapi/glapi/gen/es_EXT.xml   |  43 ++
 src/mesa/main/context.h |   3 +-
 src/mesa/main/extensions_table.h|   1 +
 src/mesa/main/get.c |  58 +-
 src/mesa/main/get_hash_params.py|  50 +-
 src/mesa/main/mtypes.h  |   1 +
 src/mesa/main/tests/dispatch_sanity.cpp |   3 +
 14 files changed, 1076 insertions(+), 51 deletions(-)

-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] mesa: remove ARB_geometry_shader4

2015-11-25 Thread Marta Lofstedt
From: Marta Lofstedt 

No drivers currently implement ARB_geometry_shader4, nor are there
any plans to implement it.  We only support the version of geometry
shaders that was incorporated into OpenGL 3.2 / GLSL 1.50.

Signed-off-by: Marta Lofstedt 
---
 src/mapi/glapi/gen/ARB_geometry_shader4.xml | 57 -
 src/mapi/glapi/gen/Makefile.am  |  1 -
 src/mapi/glapi/gen/gl_API.xml   |  2 +-
 src/mesa/main/api_validate.c|  2 +-
 src/mesa/main/config.h  |  2 +-
 src/mesa/main/context.h |  3 +-
 src/mesa/main/dlist.c   | 55 
 src/mesa/main/get.c |  7 
 src/mesa/main/get_hash_params.py| 12 ++
 src/mesa/main/mtypes.h  |  3 +-
 src/mesa/main/tests/enum_strings.cpp|  6 ---
 11 files changed, 9 insertions(+), 141 deletions(-)
 delete mode 100644 src/mapi/glapi/gen/ARB_geometry_shader4.xml

diff --git a/src/mapi/glapi/gen/ARB_geometry_shader4.xml 
b/src/mapi/glapi/gen/ARB_geometry_shader4.xml
deleted file mode 100644
index 280e7a0..000
--- a/src/mapi/glapi/gen/ARB_geometry_shader4.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
index a5a26a6..40b0e65 100644
--- a/src/mapi/glapi/gen/Makefile.am
+++ b/src/mapi/glapi/gen/Makefile.am
@@ -133,7 +133,6 @@ API_XML = \
ARB_ES3_compatibility.xml \
ARB_framebuffer_no_attachments.xml \
ARB_framebuffer_object.xml \
-   ARB_geometry_shader4.xml \
ARB_get_program_binary.xml \
ARB_get_texture_sub_image.xml \
ARB_gpu_shader_fp64.xml \
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index ec83cd4..6243bdd 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -7975,7 +7975,7 @@
 
 
 
-http://www.w3.org/2001/XInclude"/>
+
 
 
 
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index a490189..cbfb6b5 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -170,7 +170,7 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, 
const char *name)
   return GL_FALSE;
}
 
-   /* From the ARB_geometry_shader4 spec:
+   /* From the OpenGL 4.5 specification, section 11.3.1:
 *
 * The error INVALID_OPERATION is generated if Begin, or any command that
 * implicitly calls Begin, is called when a geometry shader is active and:
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index f29de5f..2d53e2f 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -246,7 +246,7 @@
 #define MAX_FEEDBACK_BUFFERS 4
 #define MAX_FEEDBACK_ATTRIBS 32
 
-/** For GL_ARB_geometry_shader4 */
+/** For geometry shader */
 /*@{*/
 #define MAX_GEOMETRY_UNIFORM_COMPONENTS  512
 #define MAX_GEOMETRY_OUTPUT_VERTICES 256
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 4798b1f..8b64f45 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -330,8 +330,7 @@ _mesa_is_gles31(const struct gl_context *ctx)
 static inline bool
 _mesa_has_geometry_shaders(const struct gl_context *ctx)
 {
-   return _mesa_is_desktop_gl(ctx) &&
-  (ctx->Version >= 32 || ctx->Extensions.ARB_geometry_shader4);
+   return _mesa_is_desktop_gl(ctx) && ctx->Version >= 32;
 }
 
 
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 2b65b2e..ba2e670 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -457,11 +457,6 @@ typedef enum
OPCODE_SAMPLER_PARAMETERIIV,
OPCODE_SAMPLER_PARAMETERUIV,
 
-   /* GL_ARB_geometry_shader4 */
-   OPCODE_PROGRAM_PARAMETERI,
-   OPCODE_FRAMEBUFFER_TEXTURE,
-   OPCODE_FRAMEBUFFER_TEXTURE_FACE,
-
/* GL_ARB_sync */
OPCODE_WAIT_SYNC,
 
@@ -7554,44 +7549,6 @@ save_SamplerParameterIuiv(GLuint sampler, GLenum pname, 
const GLuint *params)
}
 }
 
-/* GL_ARB_geometry_shader4 */
-static void GLAPIENTRY
-save_ProgramParameteri(GLuint program, GLenum pname, GLint value)
-{
-   Node *n;
-   GET_CURRENT_CONTEXT(ctx);
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
-   n = alloc_instruction(ctx, OPCODE_PROGRAM_PARAMETERI, 3);
-   if (n) {
-  n[1].ui = program;
-  n[2].e = pname;
-  n[3].i = value;
-   }
-   if (ctx->ExecuteFlag) {
-  CALL_ProgramParameteri(ctx->Exec, (program, pname, value));
-   }
-}
-
-static void GLAPIENTRY
-save_FramebufferTexture(GLenum target, GLenum attachment,
-GLuint texture, GLint l

[Mesa-dev] [PATCH] mesa: remove ARB_geometry_shader4

2015-11-24 Thread Marta Lofstedt
From: Marta Lofstedt 

Since all drivers support OpenGL 3.2 geometry shaders,
there is no reason to keep the ARB_geometry_shader4.

Signed-off-by: Marta Lofstedt 
---
 src/mapi/glapi/gen/ARB_geometry_shader4.xml | 57 -
 src/mapi/glapi/gen/Makefile.am  |  1 -
 src/mapi/glapi/gen/gl_API.xml   |  2 -
 src/mesa/main/api_validate.c|  2 +-
 src/mesa/main/config.h  |  2 +-
 src/mesa/main/context.h |  3 +-
 src/mesa/main/dlist.c   |  6 +--
 src/mesa/main/get.c |  7 
 src/mesa/main/get_hash_params.py| 12 ++
 src/mesa/main/mtypes.h  |  3 +-
 10 files changed, 11 insertions(+), 84 deletions(-)
 delete mode 100644 src/mapi/glapi/gen/ARB_geometry_shader4.xml

diff --git a/src/mapi/glapi/gen/ARB_geometry_shader4.xml 
b/src/mapi/glapi/gen/ARB_geometry_shader4.xml
deleted file mode 100644
index 280e7a0..000
--- a/src/mapi/glapi/gen/ARB_geometry_shader4.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
index a5a26a6..40b0e65 100644
--- a/src/mapi/glapi/gen/Makefile.am
+++ b/src/mapi/glapi/gen/Makefile.am
@@ -133,7 +133,6 @@ API_XML = \
ARB_ES3_compatibility.xml \
ARB_framebuffer_no_attachments.xml \
ARB_framebuffer_object.xml \
-   ARB_geometry_shader4.xml \
ARB_get_program_binary.xml \
ARB_get_texture_sub_image.xml \
ARB_gpu_shader_fp64.xml \
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index ec83cd4..8ff110c 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -7975,8 +7975,6 @@
 
 
 
-http://www.w3.org/2001/XInclude"/>
-
 
 
 http://www.w3.org/2001/XInclude"/>
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index a490189..cbfb6b5 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -170,7 +170,7 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, 
const char *name)
   return GL_FALSE;
}
 
-   /* From the ARB_geometry_shader4 spec:
+   /* From the OpenGL 4.5 specification, section 11.3.1:
 *
 * The error INVALID_OPERATION is generated if Begin, or any command that
 * implicitly calls Begin, is called when a geometry shader is active and:
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index f29de5f..2d53e2f 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -246,7 +246,7 @@
 #define MAX_FEEDBACK_BUFFERS 4
 #define MAX_FEEDBACK_ATTRIBS 32
 
-/** For GL_ARB_geometry_shader4 */
+/** For geometry shader */
 /*@{*/
 #define MAX_GEOMETRY_UNIFORM_COMPONENTS  512
 #define MAX_GEOMETRY_OUTPUT_VERTICES 256
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 4798b1f..8b64f45 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -330,8 +330,7 @@ _mesa_is_gles31(const struct gl_context *ctx)
 static inline bool
 _mesa_has_geometry_shaders(const struct gl_context *ctx)
 {
-   return _mesa_is_desktop_gl(ctx) &&
-  (ctx->Version >= 32 || ctx->Extensions.ARB_geometry_shader4);
+   return _mesa_is_desktop_gl(ctx) && ctx->Version >= 32;
 }
 
 
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 2b65b2e..dc3b632 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -457,7 +457,7 @@ typedef enum
OPCODE_SAMPLER_PARAMETERIIV,
OPCODE_SAMPLER_PARAMETERUIV,
 
-   /* GL_ARB_geometry_shader4 */
+   /* For geometry shader */
OPCODE_PROGRAM_PARAMETERI,
OPCODE_FRAMEBUFFER_TEXTURE,
OPCODE_FRAMEBUFFER_TEXTURE_FACE,
@@ -7554,7 +7554,7 @@ save_SamplerParameterIuiv(GLuint sampler, GLenum pname, 
const GLuint *params)
}
 }
 
-/* GL_ARB_geometry_shader4 */
+/* OpenGL 3.2 */
 static void GLAPIENTRY
 save_ProgramParameteri(GLuint program, GLenum pname, GLint value)
 {
@@ -8841,7 +8841,7 @@ execute_list(struct gl_context *ctx, GLuint list)
 }
 break;
 
- /* GL_ARB_geometry_shader4 */
+ /* OpenGL 3.2 geometry shader */
  case OPCODE_PROGRAM_PARAMETERI:
 CALL_ProgramParameteri(ctx->Exec, (n[1].ui, n[2].e, n[3].i));
 break;
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 539c411..c6a2e5b 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -398,7 +398,6 @@ EXTRA_EXT(EXT_pixel_buffer_object);
 EXTRA_EXT(ARB_vertex_program);
 EXTRA_EXT2(NV_point_sprite, ARB_point_sprite);
 E

[Mesa-dev] [PATCH] glsl: Relax requirement on Centroid matching between shader stages

2015-11-04 Thread Marta Lofstedt
From: Marta Lofstedt 

In OpenGL 4.4, section 4.5, the requirement for interpolation
qualifiers to match over shader stages was removed.
In OpenGL ES 3.1, section 9.2.1 there is a table showing that
centroid does not have to match between shader stages.

Also see bug 92743 for more discussions.

Signed-off-by: Marta Lofstedt 
---
 src/glsl/link_varyings.cpp | 14 --
 1 file changed, 14 deletions(-)

diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 7e77a67..d0edc71 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -96,20 +96,6 @@ cross_validate_types_and_qualifiers(struct gl_shader_program 
*prog,
   }
}
 
-   /* Check that all of the qualifiers match between stages.
-*/
-   if (input->data.centroid != output->data.centroid) {
-  linker_error(prog,
-   "%s shader output `%s' %s centroid qualifier, "
-   "but %s shader input %s centroid qualifier\n",
-   _mesa_shader_stage_to_string(producer_stage),
-   output->name,
-   (output->data.centroid) ? "has" : "lacks",
-   _mesa_shader_stage_to_string(consumer_stage),
-   (input->data.centroid) ? "has" : "lacks");
-  return;
-   }
-
if (input->data.sample != output->data.sample) {
   linker_error(prog,
"%s shader output `%s' %s sample qualifier, "
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa: DispatchComputeIndirect should return INVALID_VALUE on unaligned

2015-10-29 Thread Marta Lofstedt
From: Marta Lofstedt 

From the ARB_compute_shader specification:

"An INVALID_OPERATION error is generated [...] if  is
less than zero or not a multiple of the size, in basic machine
units, of uint."

However, OpenGL ES 3.1 specification, section 17 and OpenGL 4.5
specification, section 19, has the updated definition:

"An INVALID_VALUE error is generated if indirect is negative or
is not a multiple of the size, in basic machine units, of uint."

Mesa should use the updated version.
---
 src/mesa/main/api_validate.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 06efe02..9ee8252 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -960,14 +960,15 @@ valid_dispatch_indirect(struct gl_context *ctx,
if (!check_valid_to_compute(ctx, name))
   return GL_FALSE;
 
-   /* From the ARB_compute_shader specification:
+   /* From the OpenGL ES 3.1 specification, section 17 and the
+* OpenGL 4.5 specification, section 19:
 *
-* "An INVALID_OPERATION error is generated [...] if  is less
-*  than zero or not a multiple of the size, in basic machine units, of
-*  uint."
+*   "An INVALID_VALUE error is generated if indirect is negative
+*or is not a multiple of the size, in basic machine units,
+*of uint."
 */
if ((GLintptr)indirect & (sizeof(GLuint) - 1)) {
-  _mesa_error(ctx, GL_INVALID_OPERATION,
+  _mesa_error(ctx, GL_INVALID_VALUE,
   "%s(indirect is not aligned)", name);
   return GL_FALSE;
}
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] mesa: Draw indirect is not allowed when xfb is active and unpaused

2015-10-26 Thread Marta Lofstedt
From: Marta Lofstedt 

OpenGL ES 3.1 specification, section 10.5:
"An INVALID_OPERATION error is generated if
transform feedback is active and not paused."

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/api_validate.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index fa6c1b5..303d5e8 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -710,6 +710,16 @@ valid_draw_indirect(struct gl_context *ctx,
   return GL_FALSE;
}
 
+   /* OpenGL ES 3.1 specification, section 10.5:
+*
+*  "An INVALID_OPERATION error is generated if
+*  transform feedback is active and not paused."
+*/
+   if (_mesa_is_gles31(ctx) && _mesa_is_xfb_active_and_unpaused(ctx)) {
+  _mesa_error(ctx, GL_INVALID_OPERATION,
+  "%s(TransformFeedback is active but not paused)", name);
+   }
+
/*
 * OpenGL ES 3.1 spec. section 10.5:
 * "An INVALID_OPERATION error is generated if zero is bound to
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] mesa: Draw Indirect return wrong error code on unalinged

2015-10-26 Thread Marta Lofstedt
From: Marta Lofstedt 

From OpenGL 4.4 specification, section 10.4 and
Open GL Es 3.1 section 10.5:
"An INVALID_VALUE error is generated if indirect is not a multiple
of the size, in basic machine units, of uint."

However, the current code follow the ARB_draw_indirect:
https://www.opengl.org/registry/specs/ARB/draw_indirect.txt
"INVALID_OPERATION is generated by DrawArraysIndirect and
DrawElementsIndirect if commands source data beyond the end
of a buffer object or if  is not word aligned."

V2: After discussions on the list, it was suggested to
only keep the INVALID_VALUE error.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/api_validate.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 40a2f43..19b6a73 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -714,12 +714,14 @@ valid_draw_indirect(struct gl_context *ctx,
   return GL_FALSE;
 
 
-   /* From the ARB_draw_indirect specification:
-* "An INVALID_OPERATION error is generated [...] if  is no
-*  word aligned."
+   /* From OpenGL version 4.4. section 10.5
+* and OpenGL ES 3.1, section 10.6:
+*
+*  "An INVALID_VALUE error is generated if indirect is not a
+*   multiple of the size, in basic machine units, of uint."
 */
if ((GLsizeiptr)indirect & (sizeof(GLuint) - 1)) {
-  _mesa_error(ctx, GL_INVALID_OPERATION,
+  _mesa_error(ctx, GL_INVALID_VALUE,
   "%s(indirect is not aligned)", name);
   return GL_FALSE;
}
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] mesa: Draw indirect is not allowed if the default VAO is bound.

2015-10-26 Thread Marta Lofstedt
From: Marta Lofstedt 

From OpenGL ES 3.1 specification, section 10.5:
"DrawArraysIndirect requires that all data sourced for the
command, including the DrawArraysIndirectCommand
structure,  be in buffer objects,  and may not be called when
the default vertex array object is bound."

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/api_validate.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index a46c194..40a2f43 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -698,6 +698,18 @@ valid_draw_indirect(struct gl_context *ctx,
 {
const GLsizeiptr end = (GLsizeiptr)indirect + size;
 
+   /* OpenGL ES 3.1 spec. section 10.5:
+*
+*  "DrawArraysIndirect requires that all data sourced for the
+*  command, including the DrawArraysIndirectCommand
+*  structure,  be in buffer objects,  and may not be called when
+*  the default vertex array object is bound."
+*/
+   if (ctx->Array.VAO == ctx->Array.DefaultVAO) {
+  _mesa_error(ctx, GL_INVALID_OPERATION, "(no VAO bound)");
+  return GL_FALSE;
+   }
+
if (!_mesa_valid_prim_mode(ctx, mode, name))
   return GL_FALSE;
 
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/4] mesa: Draw indirect is not allowed if the default VAO is bound.

2015-10-20 Thread Marta Lofstedt
From: Marta Lofstedt 

From OpenGL ES 3.1 specification, section 10.5:
"DrawArraysIndirect requires that all data sourced for the
command, including the DrawArraysIndirectCommand
structure,  be in buffer objects,  and may not be called when
the default vertex array object is bound."

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/api_validate.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index a46c194..c5628f5 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -698,6 +698,19 @@ valid_draw_indirect(struct gl_context *ctx,
 {
const GLsizeiptr end = (GLsizeiptr)indirect + size;
 
+   /*
+* OpenGL ES 3.1 spec. section 10.5:
+* "DrawArraysIndirect requires that all data sourced for the
+* command, including the DrawArraysIndirectCommand
+* structure,  be in buffer objects,  and may not be called when
+* the default vertex array object is bound."
+*/
+   if (_mesa_is_gles31(ctx) && (ctx->Array.VAO == ctx->Array.DefaultVAO)) {
+  _mesa_error(ctx, GL_INVALID_OPERATION,
+  "%s(The default VAO is bound)", name);
+  return GL_FALSE;
+   }
+
if (!_mesa_valid_prim_mode(ctx, mode, name))
   return GL_FALSE;
 
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/4] mesa: Draw Indirect is not allowed when no vertex array binding exists.

2015-10-20 Thread Marta Lofstedt
From: Marta Lofstedt 

OpenGL ES 3.1 spec. section 10.5:
"An INVALID_OPERATION error is generated if zero is bound
to VERTEX_ARRAY_BINDING, DRAW_INDIRECT_BUFFER or to
any enabled vertex array."

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/api_validate.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index c5628f5..7062cbd 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -711,6 +711,20 @@ valid_draw_indirect(struct gl_context *ctx,
   return GL_FALSE;
}
 
+   /*
+* OpenGL ES 3.1 spec. section 10.5:
+* "An INVALID_OPERATION error is generated if zero is bound to
+* VERTEX_ARRAY_BINDING, DRAW_INDIRECT_BUFFER or to any enabled
+* vertex array."
+* OpenGL 4.5 spec. section 10.4:
+* "An INVALID_OPERATION error is generated if  zero is bound to
+* DRAW_INDIRECT_BUFFER, or if  no element array buffer is bound"
+*/
+   if (!_mesa_is_bufferobj(ctx->Array.ArrayBufferObj)) {
+  _mesa_error(ctx, GL_INVALID_OPERATION,
+  "%s(No VBO is bound)", name);
+   }
+
if (!_mesa_valid_prim_mode(ctx, mode, name))
   return GL_FALSE;
 
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 0/4] Updates to Draw Indirect for OpenGL ES 3.1

2015-10-20 Thread Marta Lofstedt
This patchset fixes 7 API related tests of the OpenGL ES 3.1 CTS.

I would consider squashing these into one patch, but to avoid
confusion when we discuss my solution I preferr to keep the discussions
separated for each patch for now.

Marta Lofstedt (4):
  mesa: Draw indirect is not allowed if the default VAO is bound.
  mesa: Draw Indirect is not allowed when no vertex array binding
exists.
  mesa: Draw Indirect return wrong error code on unalinged
  mesa: Draw indirect is not allowed when xfb is active and unpaused

 src/mesa/main/api_validate.c | 49 ++--
 1 file changed, 47 insertions(+), 2 deletions(-)

-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/4] mesa: Draw Indirect return wrong error code on unalinged

2015-10-20 Thread Marta Lofstedt
From: Marta Lofstedt 

From OpenGL 4.4 specification, section 10.4 and
Open GL Es 3.1 section 10.5:
"An INVALID_VALUE error is generated if indirect is not a multiple
of the size, in basic machine units, of uint."

However, the current code follow the ARB_draw_indirect:
https://www.opengl.org/registry/specs/ARB/draw_indirect.txt
"INVALID_OPERATION is generated by DrawArraysIndirect and
DrawElementsIndirect if commands source data beyond the end
of a buffer object or if  is not word aligned."

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/api_validate.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 7062cbd..a084362 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -732,10 +732,19 @@ valid_draw_indirect(struct gl_context *ctx,
/* From the ARB_draw_indirect specification:
 * "An INVALID_OPERATION error is generated [...] if  is no
 *  word aligned."
+* However, from OpenGL version 4.4. section 10.5
+* and OpenGL ES 3.1, section 10.6:
+* "An INVALID_VALUE error is generated if indirect is not a multiple
+* of the size, in basic machine units, of uint."
 */
if ((GLsizeiptr)indirect & (sizeof(GLuint) - 1)) {
-  _mesa_error(ctx, GL_INVALID_OPERATION,
-  "%s(indirect is not aligned)", name);
+  if ((_mesa_is_desktop_gl(ctx) && ctx->Version >= 44) ||
+  _mesa_is_gles31(ctx))
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "%s(indirect is not aligned)", name);
+  else
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(indirect is not aligned)", name);
   return GL_FALSE;
}
 
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/4] mesa: Draw indirect is not allowed when xfb is active and unpaused

2015-10-20 Thread Marta Lofstedt
From: Marta Lofstedt 

OpenGL ES 3.1 specification, section 10.5:
"An INVALID_OPERATION error is generated if
transform feedback is active and not paused."

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/api_validate.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index a084362..cb6112f 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -711,6 +711,15 @@ valid_draw_indirect(struct gl_context *ctx,
   return GL_FALSE;
}
 
+   /* OpenGL ES 3.1 specification, section 10.5:
+* "An INVALID_OPERATION error is generated if
+* transform feedback is active and not paused."
+*/
+   if (_mesa_is_gles31(ctx) && _mesa_is_xfb_active_and_unpaused(ctx)) {
+  _mesa_error(ctx, GL_INVALID_OPERATION,
+  "%s(TransformFeedback is active but not paused)", name);
+   }
+
/*
 * OpenGL ES 3.1 spec. section 10.5:
 * "An INVALID_OPERATION error is generated if zero is bound to
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] glsl: Enable split of lower UBOs and SSBO also for compute shaders

2015-10-14 Thread Marta Lofstedt
From: Marta Lofstedt 

The split of Uniform blocks and shader storage block only loops
up to MESA_SHADER_FRAGMENT and igonres compute shaders.
This cause segfault when running the OpenGL ES 3.1 CTS tests
with GL_ARB_compute_shader enabled.

V2: Changed to use MESA_SHADER_STAGES instead of
MESA_SHADER_COMPUTE

Signed-off-by: Marta Lofstedt 
---
 src/glsl/linker.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index c61c76e..c15034b 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -4392,7 +4392,7 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
 * for gl_shader_program and gl_shader, so that drivers that need separate
 * index spaces for each set can have that.
 */
-   for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_FRAGMENT; i++) {
+   for (unsigned i = MESA_SHADER_VERTEX; i < MESA_SHADER_STAGES; i++) {
   if (prog->_LinkedShaders[i] != NULL) {
  gl_shader *sh = prog->_LinkedShaders[i];
  split_ubos_and_ssbos(sh,
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] glsl: Enable split of lower UBOs and SSBO also for compute shaders

2015-10-14 Thread Marta Lofstedt
From: Marta Lofstedt 

The split of Uniform blocks and shader storage block only loops
up to MESA_SHADER_FRAGMENT and igonres compute shaders.
This cause segfault when running the OpenGL ES 3.1 CTS tests
with GL_ARB_compute_shader enabled.

Signed-off-by: Marta Lofstedt 
---
 src/glsl/linker.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index c61c76e..5b5d6e6 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -4392,7 +4392,7 @@ link_shaders(struct gl_context *ctx, struct 
gl_shader_program *prog)
 * for gl_shader_program and gl_shader, so that drivers that need separate
 * index spaces for each set can have that.
 */
-   for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_FRAGMENT; i++) {
+   for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_COMPUTE; i++) {
   if (prog->_LinkedShaders[i] != NULL) {
  gl_shader *sh = prog->_LinkedShaders[i];
  split_ubos_and_ssbos(sh,
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 5/7] mesa: enable enums for OES_geometry_shader

2015-09-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Enable GL_OES_geometry_shader enums for OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
---
 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
+};
+
+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" ],
+
+# 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" ],
+
+# 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_geometr

[Mesa-dev] [PATCH 7/7] doc: Set GL_OES_geometry_shader as started

2015-09-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 docs/GL3.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/GL3.txt b/docs/GL3.txt
index 92941cf..e1c6049 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -238,7 +238,7 @@ GLES3.2, GLSL ES 3.2
   GL_OES_copy_imagenot started (based on 
GL_ARB_copy_image, which is done for some drivers)
   GL_OES_draw_buffers_indexed  not started
   GL_OES_draw_elements_base_vertex not started (based on 
GL_ARB_draw_elements_base_verte, which is done for all drivers)
-  GL_OES_geometry_shader   not started (based on 
GL_ARB_geometry_shader4, which is done for all drivers)
+  GL_OES_geometry_shader   started (Marta)
   GL_OES_gpu_shader5   not started (based on 
parts of GL_ARB_gpu_shader5, which is done for some drivers)
   GL_OES_primitive_bounding boxnot started
   GL_OES_sample_shadingnot started (based on 
parts of GL_ARB_sample_shading, which is done for some drivers)
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 6/7] mesa: Update _mesa_has_geometry_shaders

2015-09-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Updates the _mesa_has_geometry_shaders function to also look
for OpenGL ES 3.1 contexts that has OES_geometry_shader enabled.
---
 src/mesa/main/context.h | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 0f7529a..6ce048a 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -328,8 +328,11 @@ _mesa_is_gles31(const struct gl_context *ctx)
 static inline bool
 _mesa_has_geometry_shaders(const struct gl_context *ctx)
 {
-   return _mesa_is_desktop_gl(ctx) &&
-  (ctx->Version >= 32 || ctx->Extensions.ARB_geometry_shader4);
+   return (_mesa_is_gles31(ctx) &&
+   ctx->Extensions.OES_geometry_shader) ||
+   (_mesa_is_desktop_gl(ctx) &&
+   (ctx->Version >= 32 ||
+   ctx->Extensions.ARB_geometry_shader4));
 }
 
 
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/7] glsl: add support for GL_OES_geometry_shader

2015-09-23 Thread Marta Lofstedt
From: Marta Lofstedt 

This adds glsl support of GL_OES_geometry_shader for
OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
---
 src/glsl/builtin_variables.cpp  | 16 +---
 src/glsl/glsl_parser.yy |  4 ++--
 src/glsl/glsl_parser_extras.cpp |  1 +
 src/glsl/glsl_parser_extras.h   |  2 ++
 4 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index b5e2908..cd8d61c 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -611,7 +611,7 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxVaryingComponents", state->ctx->Const.MaxVarying * 4);
}
 
-   if (state->is_version(150, 0)) {
+   if (state->is_version(150, 0) || state->OES_geometry_shader_enable) {
   add_const("gl_MaxVertexOutputComponents",
 state->Const.MaxVertexOutputComponents);
   add_const("gl_MaxGeometryInputComponents",
@@ -674,10 +674,7 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxAtomicCounterBindings",
 state->Const.MaxAtomicBufferBindings);
 
-  /* When Mesa adds support for GL_OES_geometry_shader and
-   * GL_OES_tessellation_shader, this will need to change.
-   */
-  if (!state->es_shader) {
+  if (!state->es_shader || state->OES_geometry_shader_enable) {
  add_const("gl_MaxGeometryAtomicCounters",
state->Const.MaxGeometryAtomicCounters);
 
@@ -701,10 +698,7 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxAtomicCounterBufferSize",
 state->Const.MaxAtomicCounterBufferSize);
 
-  /* When Mesa adds support for GL_OES_geometry_shader and
-   * GL_OES_tessellation_shader, this will need to change.
-   */
-  if (!state->es_shader) {
+  if (!state->es_shader || state->OES_geometry_shader_enable) {
  add_const("gl_MaxGeometryAtomicCounterBuffers",
state->Const.MaxGeometryAtomicCounterBuffers);
  add_const("gl_MaxTessControlAtomicCounterBuffers",
@@ -762,7 +756,7 @@ builtin_variable_generator::generate_constants()
   add_const("gl_MaxCombinedImageUniforms",
 state->Const.MaxCombinedImageUniforms);
 
-  if (!state->es_shader) {
+  if (!state->es_shader || state->OES_geometry_shader_enable) {
  add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs",
state->Const.MaxCombinedShaderOutputResources);
  add_const("gl_MaxImageSamples",
@@ -993,7 +987,7 @@ builtin_variable_generator::generate_fs_special_vars()
if (state->is_version(120, 100))
   add_input(VARYING_SLOT_PNTC, vec2_t, "gl_PointCoord");
 
-   if (state->is_version(150, 0)) {
+   if (state->is_version(150, 0) || state->OES_geometry_shader_enable) {
   ir_variable *var =
  add_input(VARYING_SLOT_PRIMITIVE_ID, int_t, "gl_PrimitiveID");
   var->data.interpolation = INTERP_QUALIFIER_FLAT;
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 59e4527..ab50c4b 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1250,7 +1250,7 @@ layout_qualifier_id:
 }
  }
 
- if ($$.flags.i && !state->is_version(150, 0)) {
+ if ($$.flags.i && !state->is_version(150, 310)) {
 _mesa_glsl_error(& @1, state, "#version 150 layout "
  "qualifier `%s' used", $1);
  }
@@ -1491,7 +1491,7 @@ layout_qualifier_id:
 YYERROR;
  } else {
 $$.max_vertices = $3;
-if (!state->is_version(150, 0)) {
+if (!state->is_version(150, 310)) {
_mesa_glsl_error(& @3, state,
 "#version 150 max_vertices qualifier "
 "specified", $3);
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index dae5261..1cb34df 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -625,6 +625,7 @@ static const _mesa_glsl_extension 
_mesa_glsl_supported_extensions[] = {
/* OES extensions go here, sorted alphabetically.
 */
EXT(OES_EGL_image_external, false, true,  
OES_EGL_image_external),
+   EXT(OES_geometry_shader,false, true,  dummy_true),
EXT(OES_standard_derivatives,   false, true,  
OES_standard_derivatives),
EXT(OES_texture_3D, false, true,  EXT_texture3D),
EXT(OES_texture_storage_multisample_2d_array, false, true, 
ARB_texture_multisample),
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index d3b091d..f271d37 1

[Mesa-dev] [PATCH 2/7] glapi: add GL_OES_geometry_shader extension

2015-09-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Adds xml definitions for the GL_OES_geometry_shader extension
and exposes the glFrameBufferTexture function as an alias of
glFramebufferTextureOES.

Signed-off-by: Marta Lofstedt 
---
 src/mapi/glapi/gen/apiexec.py |  2 +-
 src/mapi/glapi/gen/es_EXT.xml | 43 +++
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py
index 58ec08b..fa046fa 100644
--- a/src/mapi/glapi/gen/apiexec.py
+++ b/src/mapi/glapi/gen/apiexec.py
@@ -72,7 +72,7 @@ functions = {
 
 # OpenGL 3.2 / GL_ARB_geometry_shader4.  Mesa does not support
 # GL_ARB_geometry_shader4, so OpenGL 3.2 is required.
-"FramebufferTexture": exec_info(core=32),
+"FramebufferTexture": exec_info(core=32, es2=31),
 
 # OpenGL 4.0 / GL_ARB_shader_subroutines. Mesa only exposes this
 # extension with core profile.
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index cfca5a9..76d23ad 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -817,4 +817,47 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
 
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/7] mesa: Add extension enable for GL_OES_geometry_shader

2015-09-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Exposes the GL_OES_geometry_shader extension for OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/extensions.c  | 1 +
 src/mesa/main/mtypes.h  | 1 +
 src/mesa/main/tests/dispatch_sanity.cpp | 3 +++
 3 files changed, 5 insertions(+)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index b2c88c3..5cfcd43 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -314,6 +314,7 @@ static const struct extension extension_table[] = {
{ "GL_OES_fbo_render_mipmap",   o(dummy_true),  
 ES1 | ES2, 2005 },
{ "GL_OES_fixed_point", o(dummy_true),  
 ES1,   2002 },
{ "GL_OES_framebuffer_object",  o(dummy_true),  
 ES1,   2005 },
+   { "GL_OES_geometry_shader", o(OES_geometry_shader), 
  ES31, 2015 },
{ "GL_OES_get_program_binary",  o(dummy_true),  
   ES2, 2008 },
{ "GL_OES_mapbuffer",   o(dummy_true),  
 ES1 | ES2, 2005 },
{ "GL_OES_packed_depth_stencil",o(dummy_true),  
 ES1 | ES2, 2007 },
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index fac45aa..2886f19 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3770,6 +3770,7 @@ struct gl_extensions
GLboolean OES_texture_half_float;
GLboolean OES_texture_half_float_linear;
GLboolean OES_compressed_ETC1_RGB8_texture;
+   GLboolean OES_geometry_shader;
GLboolean extension_sentinel;
/** The extension string */
const GLubyte *String;
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index 0ddda59..cce05d9 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2481,5 +2481,8 @@ const struct function gles31_functions_possible[] = {
/* GL_OES_texture_storage_multisample_2d_array */
{ "glTexStorage3DMultisampleOES", 31, -1 },
 
+   /*GL_OES_geometry_shader*/
+   { "glFramebufferTextureOES", 31, -1},
+
{ NULL, 0, -1 },
  };
-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/7] gles2: Update gl2ext.h to revision: 31902

2015-09-23 Thread Marta Lofstedt
From: Marta Lofstedt 

This is needed to be able to implement the accepted OES
extensions.

Signed-off-by: Marta Lofstedt 
---
 include/GLES2/gl2ext.h | 921 -
 1 file changed, 915 insertions(+), 6 deletions(-)

diff --git a/include/GLES2/gl2ext.h b/include/GLES2/gl2ext.h
index 2b67c6e..a878bcf 100644
--- a/include/GLES2/gl2ext.h
+++ b/include/GLES2/gl2ext.h
@@ -6,7 +6,7 @@ extern "C" {
 #endif
 
 /*
-** Copyright (c) 2013-2014 The Khronos Group Inc.
+** Copyright (c) 2013-2015 The Khronos Group Inc.
 **
 ** Permission is hereby granted, free of charge, to any person obtaining a
 ** copy of this software and/or associated documentation files (the
@@ -33,14 +33,14 @@ extern "C" {
 ** used to make the header, and the header can be found at
 **   http://www.opengl.org/registry/
 **
-** Khronos $Revision: 28335 $ on $Date: 2014-09-26 18:55:45 -0700 (Fri, 26 Sep 
2014) $
+** Khronos $Revision: 31902 $ on $Date: 2015-09-03 15:44:53 -0700 (Thu, 03 Sep 
2015) $
 */
 
 #ifndef GL_APIENTRYP
 #define GL_APIENTRYP GL_APIENTRY*
 #endif
 
-/* Generated on date 20140926 */
+/* Generated on date 20150903 */
 
 /* Generated C header for:
  * API: gles2
@@ -117,6 +117,7 @@ typedef void (GL_APIENTRY  *GLDEBUGPROCKHR)(GLenum 
source,GLenum type,GLuint id,
 #define GL_PROGRAM_KHR0x82E2
 #define GL_VERTEX_ARRAY_KHR   0x8074
 #define GL_QUERY_KHR  0x82E3
+#define GL_PROGRAM_PIPELINE_KHR   0x82E4
 #define GL_SAMPLER_KHR0x82E6
 #define GL_MAX_LABEL_LENGTH_KHR   0x82E8
 #define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR   0x9143
@@ -155,6 +156,11 @@ GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum 
pname, void **params);
 #endif
 #endif /* GL_KHR_debug */
 
+#ifndef GL_KHR_no_error
+#define GL_KHR_no_error 1
+#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR  0x0008
+#endif /* GL_KHR_no_error */
+
 #ifndef GL_KHR_robust_buffer_access_behavior
 #define GL_KHR_robust_buffer_access_behavior 1
 #endif /* GL_KHR_robust_buffer_access_behavior */
@@ -238,6 +244,10 @@ GL_APICALL void GL_APIENTRY 
glEGLImageTargetRenderbufferStorageOES (GLenum targe
 #define GL_SAMPLER_EXTERNAL_OES   0x8D66
 #endif /* GL_OES_EGL_image_external */
 
+#ifndef GL_OES_EGL_image_external_essl3
+#define GL_OES_EGL_image_external_essl3 1
+#endif /* GL_OES_EGL_image_external_essl3 */
+
 #ifndef GL_OES_compressed_ETC1_RGB8_sub_texture
 #define GL_OES_compressed_ETC1_RGB8_sub_texture 1
 #endif /* GL_OES_compressed_ETC1_RGB8_sub_texture */
@@ -261,6 +271,14 @@ GL_APICALL void GL_APIENTRY 
glEGLImageTargetRenderbufferStorageOES (GLenum targe
 #define GL_PALETTE8_RGB5_A1_OES   0x8B99
 #endif /* GL_OES_compressed_paletted_texture */
 
+#ifndef GL_OES_copy_image
+#define GL_OES_copy_image 1
+typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAOESPROC) (GLuint srcName, 
GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint 
dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, 
GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCopyImageSubDataOES (GLuint srcName, GLenum 
srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, 
GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei 
srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+#endif
+#endif /* GL_OES_copy_image */
+
 #ifndef GL_OES_depth24
 #define GL_OES_depth24 1
 #define GL_DEPTH_COMPONENT24_OES  0x81A6
@@ -275,6 +293,44 @@ GL_APICALL void GL_APIENTRY 
glEGLImageTargetRenderbufferStorageOES (GLenum targe
 #define GL_OES_depth_texture 1
 #endif /* GL_OES_depth_texture */
 
+#ifndef GL_OES_draw_buffers_indexed
+#define GL_OES_draw_buffers_indexed 1
+#define GL_MIN0x8007
+#define GL_MAX0x8008
+typedef void (GL_APIENTRYP PFNGLENABLEIOESPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLDISABLEIOESPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIOESPROC) (GLuint buf, GLenum 
mode);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIOESPROC) (GLuint buf, 
GLenum modeRGB, GLenum modeAlpha);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCIOESPROC) (GLuint buf, GLenum src, 
GLenum dst);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIOESPROC) (GLuint buf, GLenum 
srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+typedef void (GL_APIENTRYP PFNGLCOLORMASKIOESPROC) (GLuint index, GLboolean r, 
GLboolean g, GLboolean b, GLboolean a);
+typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIOESPROC) (GLenum target, GLuint 
index);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glEnableiOES (GLenum target, GLuint index);
+GL_APICALL void GL_APIENTRY glDisableiOES (GLenum target, GLuint index);
+GL_APICALL void GL_APIENTRY glBlendEquationiOES (GLuint buf, GLenum mode);
+GL_APIC

[Mesa-dev] [PATCH 0/7] Enable GL_OES_geometry_shader for OpenGL ES 3.1

2015-09-23 Thread Marta Lofstedt
This is an initial patch set for enabling
GL_OES_geometry_shader for OpenGL ES 3.1.

For verification I am using the GL_EXT_geometry_shader tests
that are part of the OpenGL ES 3.1 CTS suit.

I keep the patches here:
https://github.com/MartaLo/mesa/tree/gl_oes_geometry_shaders

About the patches:

gles2: Update gl2ext.h to revision: 31902:
Since the GL_OES_geometry_shader has been accepted,
there is no reason to implement the old
GL_EXT_geometry_shader. Therefore, I need the latest gl2ext.h

glapi: add GL_OES_geometry_shader extension:
I wanted to use the already implemented FramebufferTexture
function as an alias for FramebufferTextureOES, but I
could only get this to work by allowing the function for
GLES 3.1 in apiexec.py

mesa: Add extension enable for GL_OES_geometry_shader:
Straight forward addition to the extension_table,
the gl_extensions struct and addition to dispatch.
I have found no consensus if this should be squashed
with previous patch or not.

glsl: add support for GL_OES_geometry_shader:
This enables the Gl_OES_geometry_shader for GLSL ES 310.
However, I am not sure if the solution for enabling layout
in glsl_parser.yy is acceptable. Let's discuss this...

mesa: enable enums for OES_geometry_shader:
This is just a suggestion. I have no strong opinions
as to how this is supposed to be done. Let's discuss...

mesa: Update _mesa_has_geometry_shaders
Just add gles 31 and OES-geometry_shaders to
the _mesa_has_geometry_shaders function.

doc: Set GL_OES_geometry_shader as started
Just added my name to this.


Marta Lofstedt (7):
  gles2: Update gl2ext.h to revision: 31902
  glapi: add GL_OES_geometry_shader extension
  mesa: Add extension enable for GL_OES_geometry_shader
  glsl: add support for GL_OES_geometry_shader
  mesa: enable enums for OES_geometry_shader
  mesa: Update _mesa_has_geometry_shaders
  doc: Set GL_OES_geometry_shader as started

 docs/GL3.txt|   2 +-
 include/GLES2/gl2ext.h  | 921 +++-
 src/glsl/builtin_variables.cpp  |  16 +-
 src/glsl/glsl_parser.yy |   4 +-
 src/glsl/glsl_parser_extras.cpp |   1 +
 src/glsl/glsl_parser_extras.h   |   2 +
 src/mapi/glapi/gen/apiexec.py   |   2 +-
 src/mapi/glapi/gen/es_EXT.xml   |  43 ++
 src/mesa/main/context.h |   7 +-
 src/mesa/main/extensions.c  |   1 +
 src/mesa/main/get.c |  18 +
 src/mesa/main/get_hash_params.py|  50 +-
 src/mesa/main/mtypes.h  |   1 +
 src/mesa/main/tests/dispatch_sanity.cpp |   3 +
 14 files changed, 1028 insertions(+), 43 deletions(-)

-- 
2.1.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3] mesa: Allow query of GL_VERTEX_BINDING_BUFFER

2015-08-31 Thread Marta Lofstedt
From: Marta Lofstedt 

According to OpenGL ES 3.1 specification table : 20.2 and
OpenGL specification 4.4 table 23.4. The glGetIntegeri_v
functions should report the name  of the buffer bound
when called with GL_VERTEX_BINDING_BUFFER.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 4855187..d5df530 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1992,6 +1992,14 @@ find_value_indexed(const char *func, GLenum pname, 
GLuint index, union value *v)
   v->value_int = 
ctx->Array.VAO->VertexBinding[VERT_ATTRIB_GENERIC(index)].Stride;
   return TYPE_INT;
 
+   case GL_VERTEX_BINDING_BUFFER:
+  if (ctx->API == API_OPENGLES2 && ctx->Version < 31)
+ goto invalid_enum;
+  if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
+ goto invalid_value;
+  v->value_int = 
ctx->Array.VAO->VertexBinding[VERT_ATTRIB_GENERIC(index)].BufferObj->Name;
+  return TYPE_INT;
+
/* ARB_shader_image_load_store */
case GL_IMAGE_BINDING_NAME: {
   struct gl_texture_object *t;
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] mesa: Allow query of GL_VERTEX_BINDING_BUFFER

2015-08-31 Thread Marta Lofstedt
From: Marta Lofstedt 

According to OpenGL ES 3.1 specification table : 20.2 and
OpenGL specification 4.4 table 23.4. The glGetIntegeri_v
functions should report the name  of the buffer bound
when called with GL_VERTEX_BINDING_BUFFER.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 4855187..13860dd 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1992,6 +1992,14 @@ find_value_indexed(const char *func, GLenum pname, 
GLuint index, union value *v)
   v->value_int = 
ctx->Array.VAO->VertexBinding[VERT_ATTRIB_GENERIC(index)].Stride;
   return TYPE_INT;
 
+   case GL_VERTEX_BINDING_BUFFER:
+  if (ctx->API == GLES2 && ctx->Version < 31)
+ goto invalid_enum;
+  if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
+ goto invalid_value;
+  v->value_int = 
ctx->Array.VAO->VertexBinding[VERT_ATTRIB_GENERIC(index)].BufferObj->Name;
+  return TYPE_INT;
+
/* ARB_shader_image_load_store */
case GL_IMAGE_BINDING_NAME: {
   struct gl_texture_object *t;
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] i965/fs: Do not set the size for zero-size uniforms

2015-08-28 Thread Marta Lofstedt
From: Marta Lofstedt 

Zero sized uniforms can exist in the list, but they
don't get get any space allocated in
prog_data->params or in the param_size array, so
the size should not be set for them.
This was previously fixed in:
commit: 781dc7c0e1f41502f18e07c0940af949a78d2792.
However,
commit: 259f7291de2387aa3ac5f856b39b7b934a1d8e7d
removed the fix.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index 430efb3..9d14d1f 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -190,8 +190,8 @@ fs_visitor::nir_setup_uniforms(nir_shader *shader)
 nir_setup_builtin_uniform(var);
  else
 nir_setup_uniform(var);
-
- param_size[var->data.driver_location] = type_size_scalar(var->type);
+ if(type_size_scalar(var->type) > 0)
+param_size[var->data.driver_location] = 
type_size_scalar(var->type);
   }
} else {
   /* prog_to_nir only creates a single giant uniform variable so we can
@@ -202,7 +202,8 @@ fs_visitor::nir_setup_uniforms(nir_shader *shader)
&prog->Parameters->ParameterValues[p][i];
  }
   }
-  param_size[0] = prog->Parameters->NumParameters * 4;
+  if(prog->Parameters->NumParameters > 0)
+ param_size[0] = prog->Parameters->NumParameters * 4;
}
 }
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] mesa/es3.1: Expose GL_ARB_framebuffer_no_attachments to GLES 3.1

2015-08-27 Thread Marta Lofstedt
From: Marta Lofstedt 

V2: Conform to new standard for exposing enums for OpenGL ES 3.1.

Signed-off-by: Marta Lofstedt 
---
 src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml | 4 ++--
 src/mapi/glapi/gen/apiexec.py | 4 ++--
 src/mesa/main/get_hash_params.py  | 8 +---
 src/mesa/main/tests/dispatch_sanity.cpp   | 6 ++
 src/mesa/main/version.c   | 2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml 
b/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml
index 59839a0..55ad764 100644
--- a/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml
+++ b/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml
@@ -15,13 +15,13 @@


 
-
+



 
 
-
+



diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py
index 3a0eb18..58ec08b 100644
--- a/src/mapi/glapi/gen/apiexec.py
+++ b/src/mapi/glapi/gen/apiexec.py
@@ -151,8 +151,8 @@ functions = {
 
 # OpenGL 4.3 / GL_ARB_framebuffer_no_attachments.  Mesa can expose the
 # extension with OpenGL 3.0.
-"FramebufferParameteri": exec_info(compatibility=30, core=31),
-"GetFramebufferParameteri": exec_info(compatibility=30, core=31),
+"FramebufferParameteri": exec_info(compatibility=30, core=31, es2=31),
+"GetFramebufferParameteri": exec_info(compatibility=30, core=31, es2=31),
 
 # OpenGL 4.5 / GL_ARB_direct_state_access.   Mesa can expose the extension
 # with core profile.
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 517c391..ddebade 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -450,6 +450,11 @@ descriptor=[
 
 # GL_ARB_explicit_uniform_location / GLES 3.1
   [ "MAX_UNIFORM_LOCATIONS", 
"CONTEXT_INT(Const.MaxUserAssignableUniformLocations), 
extra_ARB_explicit_uniform_location_es31" ],
+
+# GL_ARB_framebuffer_no_attachments / GLES 3.1
+  ["MAX_FRAMEBUFFER_WIDTH", "CONTEXT_INT(Const.MaxFramebufferWidth), 
extra_ARB_framebuffer_no_attachments"],
+  ["MAX_FRAMEBUFFER_HEIGHT", "CONTEXT_INT(Const.MaxFramebufferHeight), 
extra_ARB_framebuffer_no_attachments"],
+  ["MAX_FRAMEBUFFER_SAMPLES", "CONTEXT_INT(Const.MaxFramebufferSamples), 
extra_ARB_framebuffer_no_attachments"],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -811,10 +816,7 @@ descriptor=[
   [ "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_WIDTH", "CONTEXT_INT(Const.MaxFramebufferWidth), 
extra_ARB_framebuffer_no_attachments"],
-  ["MAX_FRAMEBUFFER_HEIGHT", "CONTEXT_INT(Const.MaxFramebufferHeight), 
extra_ARB_framebuffer_no_attachments"],
   ["MAX_FRAMEBUFFER_LAYERS", "CONTEXT_INT(Const.MaxFramebufferLayers), 
extra_ARB_framebuffer_no_attachments"],
-  ["MAX_FRAMEBUFFER_SAMPLES", "CONTEXT_INT(Const.MaxFramebufferSamples), 
extra_ARB_framebuffer_no_attachments"],
 
 # GL_EXT_polygon_offset_clamp
   [ "POLYGON_OFFSET_CLAMP_EXT", "CONTEXT_FLOAT(Polygon.OffsetClamp), 
extra_EXT_polygon_offset_clamp" ],
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index 59107eb..b9a760f 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2405,10 +2405,8 @@ const struct function gles31_functions_possible[] = {
{ "glDrawArraysIndirect", 31, -1 },
{ "glDrawElementsIndirect", 31, -1 },
 
-   // FINISHME: These two functions have not been implemented yet.  They come
-   // FINISHME: from the ARB_framebuffer_no_attachments extension.
-   // { "glFramebufferParameteri", 31, -1 },
-   // { "glGetFramebufferParameteriv", 31, -1 },
+   { "glFramebufferParameteri", 31, -1 },
+   { "glGetFramebufferParameteriv", 31, -1 },
 
{ "glGetProgramInterfaceiv", 31, -1 },
{ "glGetProgramResourceIndex", 31, -1 },
diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
index fd7ae53..d3e902e 100644
--- a/src/mesa/main/version.c
+++ b/src/mesa/main/version.c
@@ -450,7 +450,7 @@ compute_version_es2(const struct gl_extensions *extensions)
  extensions->ARB_arrays_of_arrays &&
  extensions->ARB_compute_shader &&
  extensions->ARB_draw_indirect &&
- false /*extensions->ARB_framebuffer_no_attachments*/ 
&&
+ extensio

[Mesa-dev] [PATCH v2 1/2] mesa/es3.1: Expose GL_ARB_framebuffer_no_attachments to GLES 3.1

2015-08-24 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml | 4 ++--
 src/mapi/glapi/gen/apiexec.py | 4 ++--
 src/mesa/main/get.c   | 6 ++
 src/mesa/main/get_hash_params.py  | 8 +---
 src/mesa/main/tests/dispatch_sanity.cpp   | 6 ++
 src/mesa/main/version.c   | 2 +-
 6 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml 
b/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml
index 59839a0..55ad764 100644
--- a/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml
+++ b/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml
@@ -15,13 +15,13 @@


 
-
+



 
 
-
+



diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py
index 3a0eb18..58ec08b 100644
--- a/src/mapi/glapi/gen/apiexec.py
+++ b/src/mapi/glapi/gen/apiexec.py
@@ -151,8 +151,8 @@ functions = {
 
 # OpenGL 4.3 / GL_ARB_framebuffer_no_attachments.  Mesa can expose the
 # extension with OpenGL 3.0.
-"FramebufferParameteri": exec_info(compatibility=30, core=31),
-"GetFramebufferParameteri": exec_info(compatibility=30, core=31),
+"FramebufferParameteri": exec_info(compatibility=30, core=31, es2=31),
+"GetFramebufferParameteri": exec_info(compatibility=30, core=31, es2=31),
 
 # OpenGL 4.5 / GL_ARB_direct_state_access.   Mesa can expose the extension
 # with core profile.
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 307a5ff..8542ddb 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -403,6 +403,12 @@ static const int 
extra_ARB_explicit_uniform_location_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_framebuffer_no_attachments_es31[] = {
+   EXT(ARB_framebuffer_no_attachments),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 517c391..3d6ed64 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -450,6 +450,11 @@ descriptor=[
 
 # GL_ARB_explicit_uniform_location / GLES 3.1
   [ "MAX_UNIFORM_LOCATIONS", 
"CONTEXT_INT(Const.MaxUserAssignableUniformLocations), 
extra_ARB_explicit_uniform_location_es31" ],
+
+# GL_ARB_framebuffer_no_attachments / GLES 3.1
+  ["MAX_FRAMEBUFFER_WIDTH", "CONTEXT_INT(Const.MaxFramebufferWidth), 
extra_ARB_framebuffer_no_attachments_es31"],
+  ["MAX_FRAMEBUFFER_HEIGHT", "CONTEXT_INT(Const.MaxFramebufferHeight), 
extra_ARB_framebuffer_no_attachments_es31"],
+  ["MAX_FRAMEBUFFER_SAMPLES", "CONTEXT_INT(Const.MaxFramebufferSamples), 
extra_ARB_framebuffer_no_attachments_es31"],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -811,10 +816,7 @@ descriptor=[
   [ "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_WIDTH", "CONTEXT_INT(Const.MaxFramebufferWidth), 
extra_ARB_framebuffer_no_attachments"],
-  ["MAX_FRAMEBUFFER_HEIGHT", "CONTEXT_INT(Const.MaxFramebufferHeight), 
extra_ARB_framebuffer_no_attachments"],
   ["MAX_FRAMEBUFFER_LAYERS", "CONTEXT_INT(Const.MaxFramebufferLayers), 
extra_ARB_framebuffer_no_attachments"],
-  ["MAX_FRAMEBUFFER_SAMPLES", "CONTEXT_INT(Const.MaxFramebufferSamples), 
extra_ARB_framebuffer_no_attachments"],
 
 # GL_EXT_polygon_offset_clamp
   [ "POLYGON_OFFSET_CLAMP_EXT", "CONTEXT_FLOAT(Polygon.OffsetClamp), 
extra_EXT_polygon_offset_clamp" ],
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index 59107eb..b9a760f 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2405,10 +2405,8 @@ const struct function gles31_functions_possible[] = {
{ "glDrawArraysIndirect", 31, -1 },
{ "glDrawElementsIndirect", 31, -1 },
 
-   // FINISHME: These two functions have not been implemented yet.  They come
-   // FINISHME: from the ARB_framebuffer_no_attachments extension.
-   // { "glFramebufferParameteri", 31, -1 },
-   // { "glGetFramebufferParameteriv", 31, -1 },
+   { "glFramebufferParameteri", 31, -1 },
+   { "glGetFramebufferParameteriv", 31, -1 },
 
{ "glGetProgramInterfaceiv", 31, -1 },
{ "glGetProgramResourceIndex", 31, -1 },
diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
index fd

[Mesa-dev] [PATCH v2 2/2] mesa/es3.1: Limit Framebuffer Parameter OpenGL ES 3.1 usage

2015-08-24 Thread Marta Lofstedt
From: Marta Lofstedt 

According to OpenGL ES 3.1 specification,
section 9.2.1 for glFramebufferParameter
and section 9.2.3 for glGetFramebufferParameteriv:

"An INVALID_ENUM error is generated if pname is not
FRAMEBUFFER_DEFAULT_WIDTH, FRAMEBUFFER_DEFAULT_HEIGHT,
FRAMEBUFFER_DEFAULT_SAMPLES, or
FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS."

Therefore exclude OpenGL ES 3.1 from using the
GL_FRAMEBUFFER_DEFAULT_LAYERS parameter.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/fbobject.c | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 07db195..a8f39b9 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1389,8 +1389,18 @@ framebuffer_parameteri(struct gl_context *ctx, struct 
gl_framebuffer *fb,
  fb->DefaultGeometry.Height = param;
   break;
case GL_FRAMEBUFFER_DEFAULT_LAYERS:
+ /*
+  * According to the OpenGL ES 3.1 specification,
+  * section 9.2.1, the GL_FRAMEBUFFER_DEFAULT_LAYERS
+  * parameter name is not supported.
+  */
+  if (_mesa_is_gles31(ctx)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "%s(pname=0x%x)", func, pname);
+ break;
+  }
   if (param < 0 || param > ctx->Const.MaxFramebufferLayers)
-_mesa_error(ctx, GL_INVALID_VALUE, "%s", func);
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s", func);
   else
  fb->DefaultGeometry.Layers = param;
   break;
@@ -1451,6 +1461,16 @@ get_framebuffer_parameteriv(struct gl_context *ctx, 
struct gl_framebuffer *fb,
   *params = fb->DefaultGeometry.Height;
   break;
case GL_FRAMEBUFFER_DEFAULT_LAYERS:
+  /*
+   * According to the OpenGL ES 3.1 specification,
+   * section 9.2.3, the GL_FRAMEBUFFER_LAYERS
+   * parameter name is not supported.
+   */
+  if (_mesa_is_gles31(ctx)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "%s(pname=0x%x)", func, pname);
+ break;
+  }
   *params = fb->DefaultGeometry.Layers;
   break;
case GL_FRAMEBUFFER_DEFAULT_SAMPLES:
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/2] mesa/es3.1: Limit Framebuffer Parameter OpenGL ES 3.1 usage

2015-08-24 Thread Marta Lofstedt
From: Marta Lofstedt 

According to OpenGL ES 3.1 specification,
section 9.2.1 for glFramebufferParameter
and section 9.2.3 for glGetFramebufferParameteriv:

"An INVALID_ENUM error is generated if pname is not
FRAMEBUFFER_DEFAULT_WIDTH, FRAMEBUFFER_DEFAULT_HEIGHT,
FRAMEBUFFER_DEFAULT_SAMPLES, or
FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS."

Therefore exclude OpenGL ES 3.1 from using the
GL_FRAMEBUFFER_DEFAULT_LAYERS parameter.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/fbobject.c | 34 --
 1 file changed, 28 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 07db195..1bbdd30 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1389,11 +1389,22 @@ framebuffer_parameteri(struct gl_context *ctx, struct 
gl_framebuffer *fb,
  fb->DefaultGeometry.Height = param;
   break;
case GL_FRAMEBUFFER_DEFAULT_LAYERS:
-  if (param < 0 || param > ctx->Const.MaxFramebufferLayers)
-_mesa_error(ctx, GL_INVALID_VALUE, "%s", func);
-  else
- fb->DefaultGeometry.Layers = param;
-  break;
+ /*
+  * According to the OpenGL ES 3.1 specification,
+  * section 9.2.1, the GL_FRAMEBUFFER_DEFAULT_LAYERS
+  * parameter name is not supported.
+  */
+  if (_mesa_is_gles31(ctx)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "%s(pname=0x%x)", func, pname);
+  }
+  else {
+ if (param < 0 || param > ctx->Const.MaxFramebufferLayers)
+_mesa_error(ctx, GL_INVALID_VALUE, "%s", func);
+ else
+fb->DefaultGeometry.Layers = param;
+ break;
+  }
case GL_FRAMEBUFFER_DEFAULT_SAMPLES:
   if (param < 0 || param > ctx->Const.MaxFramebufferSamples)
 _mesa_error(ctx, GL_INVALID_VALUE, "%s", func);
@@ -1451,7 +1462,18 @@ get_framebuffer_parameteriv(struct gl_context *ctx, 
struct gl_framebuffer *fb,
   *params = fb->DefaultGeometry.Height;
   break;
case GL_FRAMEBUFFER_DEFAULT_LAYERS:
-  *params = fb->DefaultGeometry.Layers;
+  /*
+   * According to the OpenGL ES 3.1 specification,
+   * section 9.2.3, the GL_FRAMEBUFFER_LAYERS
+   * parameter name is not supported.
+   */
+  if (_mesa_is_gles31(ctx)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "%s(pname=0x%x)", func, pname);
+  }
+  else {
+ *params = fb->DefaultGeometry.Layers;
+  }
   break;
case GL_FRAMEBUFFER_DEFAULT_SAMPLES:
   *params = fb->DefaultGeometry.NumSamples;
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/2] mesa/es3.1: Expose GL_ARB_framebuffer_no_attachments to GLES 3.1

2015-08-24 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml | 4 ++--
 src/mapi/glapi/gen/apiexec.py | 4 ++--
 src/mesa/main/get.c   | 6 ++
 src/mesa/main/get_hash_params.py  | 8 +---
 src/mesa/main/tests/dispatch_sanity.cpp   | 6 ++
 5 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml 
b/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml
index 59839a0..55ad764 100644
--- a/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml
+++ b/src/mapi/glapi/gen/ARB_framebuffer_no_attachments.xml
@@ -15,13 +15,13 @@


 
-
+



 
 
-
+



diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py
index 3a0eb18..58ec08b 100644
--- a/src/mapi/glapi/gen/apiexec.py
+++ b/src/mapi/glapi/gen/apiexec.py
@@ -151,8 +151,8 @@ functions = {
 
 # OpenGL 4.3 / GL_ARB_framebuffer_no_attachments.  Mesa can expose the
 # extension with OpenGL 3.0.
-"FramebufferParameteri": exec_info(compatibility=30, core=31),
-"GetFramebufferParameteri": exec_info(compatibility=30, core=31),
+"FramebufferParameteri": exec_info(compatibility=30, core=31, es2=31),
+"GetFramebufferParameteri": exec_info(compatibility=30, core=31, es2=31),
 
 # OpenGL 4.5 / GL_ARB_direct_state_access.   Mesa can expose the extension
 # with core profile.
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 307a5ff..8542ddb 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -403,6 +403,12 @@ static const int 
extra_ARB_explicit_uniform_location_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_framebuffer_no_attachments_es31[] = {
+   EXT(ARB_framebuffer_no_attachments),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 517c391..3d6ed64 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -450,6 +450,11 @@ descriptor=[
 
 # GL_ARB_explicit_uniform_location / GLES 3.1
   [ "MAX_UNIFORM_LOCATIONS", 
"CONTEXT_INT(Const.MaxUserAssignableUniformLocations), 
extra_ARB_explicit_uniform_location_es31" ],
+
+# GL_ARB_framebuffer_no_attachments / GLES 3.1
+  ["MAX_FRAMEBUFFER_WIDTH", "CONTEXT_INT(Const.MaxFramebufferWidth), 
extra_ARB_framebuffer_no_attachments_es31"],
+  ["MAX_FRAMEBUFFER_HEIGHT", "CONTEXT_INT(Const.MaxFramebufferHeight), 
extra_ARB_framebuffer_no_attachments_es31"],
+  ["MAX_FRAMEBUFFER_SAMPLES", "CONTEXT_INT(Const.MaxFramebufferSamples), 
extra_ARB_framebuffer_no_attachments_es31"],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -811,10 +816,7 @@ descriptor=[
   [ "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_WIDTH", "CONTEXT_INT(Const.MaxFramebufferWidth), 
extra_ARB_framebuffer_no_attachments"],
-  ["MAX_FRAMEBUFFER_HEIGHT", "CONTEXT_INT(Const.MaxFramebufferHeight), 
extra_ARB_framebuffer_no_attachments"],
   ["MAX_FRAMEBUFFER_LAYERS", "CONTEXT_INT(Const.MaxFramebufferLayers), 
extra_ARB_framebuffer_no_attachments"],
-  ["MAX_FRAMEBUFFER_SAMPLES", "CONTEXT_INT(Const.MaxFramebufferSamples), 
extra_ARB_framebuffer_no_attachments"],
 
 # GL_EXT_polygon_offset_clamp
   [ "POLYGON_OFFSET_CLAMP_EXT", "CONTEXT_FLOAT(Polygon.OffsetClamp), 
extra_EXT_polygon_offset_clamp" ],
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index 59107eb..b9a760f 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2405,10 +2405,8 @@ const struct function gles31_functions_possible[] = {
{ "glDrawArraysIndirect", 31, -1 },
{ "glDrawElementsIndirect", 31, -1 },
 
-   // FINISHME: These two functions have not been implemented yet.  They come
-   // FINISHME: from the ARB_framebuffer_no_attachments extension.
-   // { "glFramebufferParameteri", 31, -1 },
-   // { "glGetFramebufferParameteriv", 31, -1 },
+   { "glFramebufferParameteri", 31, -1 },
+   { "glGetFramebufferParameteriv", 31, -1 },
 
{ "glGetProgramInterfaceiv", 31, -1 },
{ "glGetProgramResourceIndex", 31, -1 },
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/3] mesa/es3.1 : Align OpenGL ES 3.1 glBindVertexBuffer error handling with OpenGL Core

2015-08-19 Thread Marta Lofstedt
From: Marta Lofstedt 

According to OpenGL ES 3.1 specification 10.3.1:
"An INVALID_OPERATION error is generated if buffer is not zero
or a name returned from a previous call to GenBuffers,
or if such a name has since been deleted with DeleteBuffers."
This error check was previously limited to OpenGL Core.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/bufferobj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index e17b41c..2ca0064 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -919,7 +919,7 @@ _mesa_handle_bind_buffer_gen(struct gl_context *ctx,
 {
struct gl_buffer_object *buf = *buf_handle;
 
-   if (!buf && ctx->API == API_OPENGL_CORE) {
+   if (!buf && (ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx))) {
   _mesa_error(ctx, GL_INVALID_OPERATION, "%s(non-gen name)", caller);
   return false;
}
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/3] mesa/es3.1: Enable GL_ARB_vertex_attrib_binding functionality for GLES 3.1

2015-08-19 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/varray.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 3bab985..3ddf795 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -899,12 +899,12 @@ get_vertex_array_attrib(struct gl_context *ctx,
   }
   goto error;
case GL_VERTEX_ATTRIB_BINDING:
-  if (_mesa_is_desktop_gl(ctx)) {
+  if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles31(ctx)) {
  return array->VertexBinding - VERT_ATTRIB_GENERIC0;
   }
   goto error;
case GL_VERTEX_ATTRIB_RELATIVE_OFFSET:
-  if (_mesa_is_desktop_gl(ctx)) {
+  if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles31(ctx)) {
  return array->RelativeOffset;
   }
   goto error;
@@ -1676,7 +1676,7 @@ vertex_array_vertex_buffer(struct gl_context *ctx, struct 
gl_vertex_array_object
   return;
}
 
-   if (ctx->API == API_OPENGL_CORE && ctx->Version >= 44 &&
+   if (((ctx->API == API_OPENGL_CORE && ctx->Version >= 44) || 
_mesa_is_gles31(ctx)) &&
stride > ctx->Const.MaxVertexAttribStride) {
   _mesa_error(ctx, GL_INVALID_VALUE, "%s(stride=%d > "
   "GL_MAX_VERTEX_ATTRIB_STRIDE)", func, stride);
@@ -1726,7 +1726,7 @@ _mesa_BindVertexBuffer(GLuint bindingIndex, GLuint 
buffer, GLintptr offset,
 *"An INVALID_OPERATION error is generated if no vertex array object
 * is bound."
 */
-   if (ctx->API == API_OPENGL_CORE &&
+   if ((ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx)) &&
ctx->Array.VAO == ctx->Array.DefaultVAO) {
   _mesa_error(ctx, GL_INVALID_OPERATION,
   "glBindVertexBuffer(No array object bound)");
@@ -1948,7 +1948,7 @@ vertex_attrib_format(GLuint attribIndex, GLint size, 
GLenum type,
 * is an oversight.  In the OpenGL 4.3 (Core Profile) spec, it applies
 * to all three functions.
 */
-   if (ctx->API == API_OPENGL_CORE &&
+   if ((ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx)) &&
ctx->Array.VAO == ctx->Array.DefaultVAO) {
   _mesa_error(ctx, GL_INVALID_OPERATION,
   "%s(No array object bound)", func);
@@ -2136,7 +2136,7 @@ _mesa_VertexAttribBinding(GLuint attribIndex, GLuint 
bindingIndex)
 *"An INVALID_OPERATION error is generated if no vertex array object
 * is bound."
 */
-   if (ctx->API == API_OPENGL_CORE &&
+   if ((ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx)) &&
ctx->Array.VAO == ctx->Array.DefaultVAO) {
   _mesa_error(ctx, GL_INVALID_OPERATION,
   "glVertexAttribBinding(No array object bound)");
@@ -2210,7 +2210,7 @@ _mesa_VertexBindingDivisor(GLuint bindingIndex, GLuint 
divisor)
 *"An INVALID_OPERATION error is generated if no vertex array object
 * is bound."
 */
-   if (ctx->API == API_OPENGL_CORE &&
+   if ((ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx)) &&
ctx->Array.VAO == ctx->Array.DefaultVAO) {
   _mesa_error(ctx, GL_INVALID_OPERATION,
   "glVertexBindingDivisor(No array object bound)");
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/3] mesa/es3.1: Allow query of Vertex bindings for GLES 3.1

2015-08-19 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index ae2d0b7..b6b7d6c 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1966,7 +1966,8 @@ find_value_indexed(const char *func, GLenum pname, GLuint 
index, union value *v)
   return TYPE_INT64;
 
case GL_VERTEX_BINDING_DIVISOR:
-  if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_instanced_arrays)
+  if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_instanced_arrays) 
&&
+  !_mesa_is_gles31(ctx))
   goto invalid_enum;
   if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
   goto invalid_value;
@@ -1974,7 +1975,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint 
index, union value *v)
   return TYPE_INT;
 
case GL_VERTEX_BINDING_OFFSET:
-  if (!_mesa_is_desktop_gl(ctx))
+  if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles31(ctx))
   goto invalid_enum;
   if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
   goto invalid_value;
@@ -1982,7 +1983,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint 
index, union value *v)
   return TYPE_INT;
 
case GL_VERTEX_BINDING_STRIDE:
-  if (!_mesa_is_desktop_gl(ctx))
+  if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles31(ctx))
   goto invalid_enum;
   if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
   goto invalid_value;
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 0/3] Enable misc. Vertex bindings for OpenGL ES 3.1

2015-08-19 Thread Marta Lofstedt
These patches enable some Vertex Binding functionality for OpenGL ES 3.1,
that is currently limited to desktop GL.

Marta Lofstedt (3):
  mesa/es3.1 : Align OpenGL ES 3.1 glBindVertexBuffer error handling
with OpenGL Core
  mesa/es3.1: Allow query of Vertex bindings for GLES 3.1
  mesa/es3.1: Enable GL_ARB_vertex_attrib_binding functionality for GLES
3.1

 src/mesa/main/bufferobj.c |  2 +-
 src/mesa/main/get.c   |  7 ---
 src/mesa/main/varray.c| 14 +++---
 3 files changed, 12 insertions(+), 11 deletions(-)

-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa: Allow query of GL_VERTEX_BINDING_BUFFER

2015-08-19 Thread Marta Lofstedt
From: Marta Lofstedt 

According to OpenGL ES 3.1 specification table : 20.2 and
OpenGL specification 4.4 table 23.4. The glGetIntegeri_v
functions should report the name  of the buffer bound
when called with GL_VERTEX_BINDING_BUFFER.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 307a5ff..ae2d0b7 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1989,6 +1989,14 @@ find_value_indexed(const char *func, GLenum pname, 
GLuint index, union value *v)
   v->value_int = 
ctx->Array.VAO->VertexBinding[VERT_ATTRIB_GENERIC(index)].Stride;
   return TYPE_INT;
 
+   case GL_VERTEX_BINDING_BUFFER:
+  if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles31(ctx))
+  goto invalid_enum;
+  if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
+  goto invalid_value;
+  v->value_int = 
ctx->Array.VAO->VertexBinding[VERT_ATTRIB_GENERIC(index)].BufferObj->Name;
+  return TYPE_INT;
+
/* ARB_shader_image_load_store */
case GL_IMAGE_BINDING_NAME: {
   struct gl_texture_object *t;
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa/es3.1: Enable getting MAX_COMPUTE_WORK_GROUP_ values for OpenGL ES 3.1

2015-08-19 Thread Marta Lofstedt
From: Marta Lofstedt 

According to the OpenGL ES 3.1 specification chapter 17, the
MAX_COMPUTE_WORK_GROUP_COUNT and MAX_COMPUTE_WORK_GROUP_SIZE
is available for glGetIntegeri_v.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 307a5ff..c691997 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -2049,7 +2049,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint 
index, union value *v)
   return TYPE_INT;
 
case GL_MAX_COMPUTE_WORK_GROUP_COUNT:
-  if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_compute_shader)
+  if (!_mesa_has_compute_shaders(ctx))
  goto invalid_enum;
   if (index >= 3)
  goto invalid_value;
@@ -2057,7 +2057,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint 
index, union value *v)
   return TYPE_INT;
 
case GL_MAX_COMPUTE_WORK_GROUP_SIZE:
-  if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_compute_shader)
+  if (!_mesa_has_compute_shaders(ctx))
  goto invalid_enum;
   if (index >= 3)
  goto invalid_value;
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa/es3.1: Allow GL_COMPUTE_WORK_GROUP_SIZE for OpenGL ES 3.1

2015-08-19 Thread Marta Lofstedt
From: Marta Lofstedt 

According to OpenGL ES specification section 7.12,
GL_COMPUTE_WORK_GROUP_SIZE, is supported by the
glGetProgramiv function.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/shaderapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index b227c17..0e0e0d6 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -756,7 +756,7 @@ get_programiv(struct gl_context *ctx, GLuint program, 
GLenum pname,
   return;
case GL_COMPUTE_WORK_GROUP_SIZE: {
   int i;
-  if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_compute_shader)
+  if (!_mesa_has_compute_shaders(ctx))
  break;
   if (!shProg->LinkStatus) {
  _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramiv(program not "
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3] mesa: Implement glMemoryBarrierByRegion

2015-08-14 Thread Marta Lofstedt
From: Marta Lofstedt 

The function glMemoryBarrierByRegion is part of
OpenGL ES 3.1 and OpenGL 4.5 core and compatibility
profiles.

Signed-off-by: Marta Lofstedt 
---
 src/mapi/glapi/gen/GL4x.xml |  6 +
 src/mesa/main/shaderimage.c | 40 +
 src/mesa/main/shaderimage.h |  3 +++
 src/mesa/main/tests/dispatch_sanity.cpp |  9 ++--
 4 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/GL4x.xml b/src/mapi/glapi/gen/GL4x.xml
index 94ddfb7..dee5027 100644
--- a/src/mapi/glapi/gen/GL4x.xml
+++ b/src/mapi/glapi/gen/GL4x.xml
@@ -44,4 +44,10 @@
   
 
 
+
+  
+
+  
+
+
 
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index a348cdb..7337f22 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -653,3 +653,43 @@ _mesa_MemoryBarrier(GLbitfield barriers)
if (ctx->Driver.MemoryBarrier)
   ctx->Driver.MemoryBarrier(ctx, barriers);
 }
+
+void GLAPIENTRY
+_mesa_MemoryBarrierByRegion(GLbitfield barriers)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   GLbitfield all_allowed_bits = GL_ATOMIC_COUNTER_BARRIER_BIT |
+ GL_FRAMEBUFFER_BARRIER_BIT |
+ GL_SHADER_IMAGE_ACCESS_BARRIER_BIT |
+ GL_SHADER_STORAGE_BARRIER_BIT |
+ GL_TEXTURE_FETCH_BARRIER_BIT |
+ GL_UNIFORM_BARRIER_BIT;
+
+   if (ctx->Driver.MemoryBarrier) {
+  /* From section 7.11.2 of the OpenGL ES 3.1 specification:
+   *
+   *"When barriers is ALL_BARRIER_BITS, shader memory accesses will be
+   * synchronized relative to all these barrier bits, but not to other
+   * barrier bits specific to MemoryBarrier."
+   *
+   * That is, if barriers is the special value GL_ALL_BARRIER_BITS, then 
all
+   * barriers allowed by glMemoryBarrierByRegion should be activated."
+   */
+  if (barriers == GL_ALL_BARRIER_BITS)
+ return ctx->Driver.MemoryBarrier(ctx, all_allowed_bits);
+
+  /* From section 7.11.2 of the OpenGL ES 3.1 specification:
+   *
+   *"An INVALID_VALUE error is generated if barriers is not the special
+   * value ALL_BARRIER_BITS, and has any bits set other than those
+   * described above."
+   */
+  if ((barriers & ~all_allowed_bits) != 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glMemoryBarrierByRegion(unsupported barrier bit");
+  }
+
+  ctx->Driver.MemoryBarrier(ctx, barriers);
+   }
+}
diff --git a/src/mesa/main/shaderimage.h b/src/mesa/main/shaderimage.h
index 33d8a1e..d08ece8 100644
--- a/src/mesa/main/shaderimage.h
+++ b/src/mesa/main/shaderimage.h
@@ -68,6 +68,9 @@ _mesa_BindImageTextures(GLuint first, GLsizei count, const 
GLuint *textures);
 void GLAPIENTRY
 _mesa_MemoryBarrier(GLbitfield barriers);
 
+void GLAPIENTRY
+_mesa_MemoryBarrierByRegion(GLbitfield barriers);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index af89d2c..59107eb 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -851,6 +851,9 @@ const struct function common_desktop_functions_possible[] = 
{
 // { "glTextureStorage2DMultisampleEXT", 43, -1 },  // XXX: Add to xml
 // { "glTextureStorage3DMultisampleEXT", 43, -1 },  // XXX: Add to xml
 
+/* GL 4.5 */
+   { "glMemoryBarrierByRegion", 45, -1 },
+
/* GL_ARB_internalformat_query */
{ "glGetInternalformativ", 30, -1 },
 
@@ -1739,6 +1742,9 @@ const struct function gl_core_functions_possible[] = {
 // { "glTextureStorage2DMultisampleEXT", 43, -1 },  // XXX: Add to xml
 // { "glTextureStorage3DMultisampleEXT", 43, -1 },  // XXX: Add to xml
 
+/* GL 4.5 */
+   { "glMemoryBarrierByRegion", 45, -1 },
+
/* GL_ARB_direct_state_access */
{ "glCreateTransformFeedbacks", 45, -1 },
{ "glTransformFeedbackBufferBase", 45, -1 },
@@ -2461,8 +2467,7 @@ const struct function gles31_functions_possible[] = {
{ "glGetBooleani_v", 31, -1 },
{ "glMemoryBarrier", 31, -1 },
 
-   // FINISHME: This function has not been implemented yet.
-   // { "glMemoryBarrierByRegion", 31, -1 },
+   { "glMemoryBarrierByRegion", 31, -1 },
 
{ "glTexStorage2DMultisample", 31, -1 },
{ "glGetMultisamplefv", 31, -1 },
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] mesa: Raise INVALID_VALUE from glCreateShaderProgramv if count < 0

2015-08-13 Thread Marta Lofstedt
From: Marta Lofstedt 

According to OpenGL version 4.5 and OpenGL ES 3.1 standards,
section 7.3:
GL_INVALID_VALUE should be generated, if count is less than 0.

V2: Changed title, eased Open GL ES 3.1 restriction
and added comments.
---
 src/mesa/main/shaderapi.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index f9a7d13..1622274 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -2003,6 +2003,15 @@ _mesa_create_shader_program(struct gl_context* ctx, 
GLboolean separate,
const GLuint shader = create_shader(ctx, type);
GLuint program = 0;
 
+   /*
+* According to OpenGL 4.5 and OpenGL ES 3.1 standards, section 7.3:
+* GL_INVALID_VALUE should be generated if count < 0
+*/
+   if (count < 0) {
+  _mesa_error(ctx, GL_INVALID_VALUE, "glCreateShaderProgram (count < 0)");
+  return program;
+   }
+
if (shader) {
   _mesa_ShaderSource(shader, count, strings, NULL);
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] mesa: AtomicBufferBindings should be initialized to zero.

2015-08-13 Thread Marta Lofstedt
From: Marta Lofstedt 

According to OpenGL specification version 4.5 table 23.46
and OpenGL ES specification version 3.1 table 20.31:
ATOMIC_COUNTER_BUFFER_START and ATOMIC_COUNTER_BUFFER_SIZE
should have the initial value of zero.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/bufferobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 1cdea93..e17b41c 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -866,8 +866,8 @@ _mesa_init_buffer_objects( struct gl_context *ctx )
   _mesa_reference_buffer_object(ctx,
&ctx->AtomicBufferBindings[i].BufferObject,
ctx->Shared->NullBufferObj);
-  ctx->AtomicBufferBindings[i].Offset = -1;
-  ctx->AtomicBufferBindings[i].Size = -1;
+  ctx->AtomicBufferBindings[i].Offset = 0;
+  ctx->AtomicBufferBindings[i].Size = 0;
}
 }
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa/main: Add GL_IMAGE_FORMAT_COMPATIBILITY_TYPE to glGetTexParameterfv

2015-08-12 Thread Marta Lofstedt
From: Marta Lofstedt 

According to Open GL ES 3.1 specification, section 8.10.2.
GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should be supported by
glGetTexParameterfv.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/texparam.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index c0611c3..c05f45b 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -1890,6 +1890,12 @@ get_tex_parameterfv(struct gl_context *ctx,
  *params = (GLfloat) obj->Sampler.sRGBDecode;
  break;
 
+  case GL_IMAGE_FORMAT_COMPATIBILITY_TYPE:
+ if (!ctx->Extensions.ARB_shader_image_load_store)
+goto invalid_pname;
+ *params = (GLfloat) obj->ImageFormatCompatibilityType;
+ break;
+
   default:
  goto invalid_pname;
}
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa/es3.1: Enable GL_MAX_VERTEX_ATTRIB enums for GLES 3.1

2015-08-10 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get_hash_params.py | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 7dc92f1..66c47de 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -450,6 +450,13 @@ descriptor=[
 
 # GL_ARB_explicit_uniform_location / GLES 3.1
   [ "MAX_UNIFORM_LOCATIONS", 
"CONTEXT_INT(Const.MaxUserAssignableUniformLocations), 
extra_ARB_explicit_uniform_location_es31" ],
+
+# GL_ARB_vertex_attrib_binding / GLES 3.1
+  [ "MAX_VERTEX_ATTRIB_RELATIVE_OFFSET", 
"CONTEXT_ENUM(Const.MaxVertexAttribRelativeOffset), NO_EXTRA" ],
+  [ "MAX_VERTEX_ATTRIB_BINDINGS", 
"CONTEXT_ENUM(Const.MaxVertexAttribBindings), NO_EXTRA" ],
+
+# GL 4.4 / GLES 3.1
+  [ "MAX_VERTEX_ATTRIB_STRIDE", "CONTEXT_ENUM(Const.MaxVertexAttribStride), 
NO_EXTRA" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -761,9 +768,6 @@ descriptor=[
   [ "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 4.4
-  [ "MAX_VERTEX_ATTRIB_STRIDE", "CONTEXT_ENUM(Const.MaxVertexAttribStride), 
NO_EXTRA" ],
-
 # GL_ARB_robustness
   [ "RESET_NOTIFICATION_STRATEGY_ARB", "CONTEXT_ENUM(Const.ResetStrategy), 
NO_EXTRA" ],
 
@@ -801,10 +805,6 @@ descriptor=[
   [ "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_vertex_attrib_binding
-  [ "MAX_VERTEX_ATTRIB_RELATIVE_OFFSET", 
"CONTEXT_ENUM(Const.MaxVertexAttribRelativeOffset), NO_EXTRA" ],
-  [ "MAX_VERTEX_ATTRIB_BINDINGS", 
"CONTEXT_ENUM(Const.MaxVertexAttribBindings), NO_EXTRA" ],
-
 # GL_ARB_shader_image_load_store
   [ "MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS", 
"CONTEXT_INT(Const.MaxCombinedImageUnitsAndFragmentOutputs), 
extra_ARB_shader_image_load_store" ],
   [ "MAX_IMAGE_SAMPLES", "CONTEXT_INT(Const.MaxImageSamples), 
extra_ARB_shader_image_load_store" ],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] glsl/es3.1: Fix up GL_ARB_compute_shader for GLSL ES 3.1

2015-08-10 Thread Marta Lofstedt
From: Marta Lofstedt 

GL_ARB_compute_shader is limited for GLSL version 430.
This enables for GLSL ES version 310.

V2: Updated error string to also include GLSL 3.10

Signed-off-by: Marta Lofstedt 
---
 src/glsl/glsl_parser.yy   | 5 ++---
 src/glsl/glsl_parser_extras.h | 5 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 2b0c8bd..2abdab4 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1519,11 +1519,10 @@ layout_qualifier_id:
 "invalid %s of %d specified",
 local_size_qualifiers[i], $3);
YYERROR;
-} else if (!state->is_version(430, 0) &&
-   !state->ARB_compute_shader_enable) {
+} else if (!state->has_compute_shader_()) {
_mesa_glsl_error(& @3, state,
 "%s qualifier requires GLSL 4.30 or "
-"ARB_compute_shader",
+   "GLSL ES 3.10 or ARB_compute_shader",
 local_size_qualifiers[i]);
YYERROR;
 } else {
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index eb325f0..57a7555 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -236,6 +236,11 @@ struct _mesa_glsl_parse_state {
   return ARB_shading_language_420pack_enable || is_version(420, 0);
}
 
+   bool has_compute_shader() const
+   {
+  return ARB_compute_shader_enable || is_version(430, 310);
+   }
+
void process_version_directive(YYLTYPE *locp, int version,
   const char *ident);
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/4] Implementation of glMemoryBarrierByRegion

2015-08-04 Thread marta . lofstedt
> This provides an i965 implementation of the
> OpenGL ES 3.1 needed function, glMemoryBarrierByRegion.
>
> Marta Lofstedt (4):
>   gles/es3.1: Enable dispatch of glMemoryBarrierByRegion
>   mesa/es3.1: Add driver interface for glMemoryBarrierByRegion
>   mesa/es3.1: Implement the entry point of MemoryBarrierByRegion
>   i965/es3.1: Implement glMemoryBarrierByRegion
>
>  src/mapi/glapi/gen/gl_API.xml   |  4 
>  src/mesa/drivers/dri/i965/brw_program.c | 34
> +
>  src/mesa/main/dd.h  |  7 +++
>  src/mesa/main/shaderimage.c |  9 +
>  src/mesa/main/shaderimage.h |  3 +++
>  src/mesa/main/tests/dispatch_sanity.cpp |  3 +--
>  6 files changed, 58 insertions(+), 2 deletions(-)
>
> --
> 1.9.1
>
>

After discussion with Ilia and Matt, it has been decided to squash above
patches and remove the driver interface. The V2 for this is in:
http://patchwork.freedesktop.org/patch/56180/

/Marta
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] gles/es3.1: Implement glMemoryBarrierByRegion

2015-08-04 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mapi/glapi/gen/gl_API.xml   |  4 
 src/mesa/main/shaderimage.c | 40 +
 src/mesa/main/shaderimage.h |  3 +++
 src/mesa/main/tests/dispatch_sanity.cpp |  3 +--
 4 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 658efa4..3db4349 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -2966,6 +2966,10 @@
 
 
 
+
+
+
+
 
 
 
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index a348cdb..7337f22 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -653,3 +653,43 @@ _mesa_MemoryBarrier(GLbitfield barriers)
if (ctx->Driver.MemoryBarrier)
   ctx->Driver.MemoryBarrier(ctx, barriers);
 }
+
+void GLAPIENTRY
+_mesa_MemoryBarrierByRegion(GLbitfield barriers)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   GLbitfield all_allowed_bits = GL_ATOMIC_COUNTER_BARRIER_BIT |
+ GL_FRAMEBUFFER_BARRIER_BIT |
+ GL_SHADER_IMAGE_ACCESS_BARRIER_BIT |
+ GL_SHADER_STORAGE_BARRIER_BIT |
+ GL_TEXTURE_FETCH_BARRIER_BIT |
+ GL_UNIFORM_BARRIER_BIT;
+
+   if (ctx->Driver.MemoryBarrier) {
+  /* From section 7.11.2 of the OpenGL ES 3.1 specification:
+   *
+   *"When barriers is ALL_BARRIER_BITS, shader memory accesses will be
+   * synchronized relative to all these barrier bits, but not to other
+   * barrier bits specific to MemoryBarrier."
+   *
+   * That is, if barriers is the special value GL_ALL_BARRIER_BITS, then 
all
+   * barriers allowed by glMemoryBarrierByRegion should be activated."
+   */
+  if (barriers == GL_ALL_BARRIER_BITS)
+ return ctx->Driver.MemoryBarrier(ctx, all_allowed_bits);
+
+  /* From section 7.11.2 of the OpenGL ES 3.1 specification:
+   *
+   *"An INVALID_VALUE error is generated if barriers is not the special
+   * value ALL_BARRIER_BITS, and has any bits set other than those
+   * described above."
+   */
+  if ((barriers & ~all_allowed_bits) != 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glMemoryBarrierByRegion(unsupported barrier bit");
+  }
+
+  ctx->Driver.MemoryBarrier(ctx, barriers);
+   }
+}
diff --git a/src/mesa/main/shaderimage.h b/src/mesa/main/shaderimage.h
index 33d8a1e..d08ece8 100644
--- a/src/mesa/main/shaderimage.h
+++ b/src/mesa/main/shaderimage.h
@@ -68,6 +68,9 @@ _mesa_BindImageTextures(GLuint first, GLsizei count, const 
GLuint *textures);
 void GLAPIENTRY
 _mesa_MemoryBarrier(GLbitfield barriers);
 
+void GLAPIENTRY
+_mesa_MemoryBarrierByRegion(GLbitfield barriers);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index af89d2c..14c9eda 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2461,8 +2461,7 @@ const struct function gles31_functions_possible[] = {
{ "glGetBooleani_v", 31, -1 },
{ "glMemoryBarrier", 31, -1 },
 
-   // FINISHME: This function has not been implemented yet.
-   // { "glMemoryBarrierByRegion", 31, -1 },
+   { "glMemoryBarrierByRegion", 31, -1 },
 
{ "glTexStorage2DMultisample", 31, -1 },
{ "glGetMultisamplefv", 31, -1 },
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 0/4] Implementation of glMemoryBarrierByRegion

2015-07-31 Thread Marta Lofstedt
This provides an i965 implementation of the
OpenGL ES 3.1 needed function, glMemoryBarrierByRegion.

Marta Lofstedt (4):
  gles/es3.1: Enable dispatch of glMemoryBarrierByRegion
  mesa/es3.1: Add driver interface for glMemoryBarrierByRegion
  mesa/es3.1: Implement the entry point of MemoryBarrierByRegion
  i965/es3.1: Implement glMemoryBarrierByRegion

 src/mapi/glapi/gen/gl_API.xml   |  4 
 src/mesa/drivers/dri/i965/brw_program.c | 34 +
 src/mesa/main/dd.h  |  7 +++
 src/mesa/main/shaderimage.c |  9 +
 src/mesa/main/shaderimage.h |  3 +++
 src/mesa/main/tests/dispatch_sanity.cpp |  3 +--
 6 files changed, 58 insertions(+), 2 deletions(-)

-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/4] mesa/es3.1: Implement the entry point of MemoryBarrierByRegion

2015-07-31 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/shaderimage.c | 9 +
 src/mesa/main/shaderimage.h | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index a348cdb..be66a6c 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -653,3 +653,12 @@ _mesa_MemoryBarrier(GLbitfield barriers)
if (ctx->Driver.MemoryBarrier)
   ctx->Driver.MemoryBarrier(ctx, barriers);
 }
+
+void GLAPIENTRY
+_mesa_MemoryBarrierByRegion(GLbitfield barriers)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   if (ctx->Driver.MemoryBarrierByRegion)
+  ctx->Driver.MemoryBarrierByRegion(ctx, barriers);
+}
diff --git a/src/mesa/main/shaderimage.h b/src/mesa/main/shaderimage.h
index 33d8a1e..d08ece8 100644
--- a/src/mesa/main/shaderimage.h
+++ b/src/mesa/main/shaderimage.h
@@ -68,6 +68,9 @@ _mesa_BindImageTextures(GLuint first, GLsizei count, const 
GLuint *textures);
 void GLAPIENTRY
 _mesa_MemoryBarrier(GLbitfield barriers);
 
+void GLAPIENTRY
+_mesa_MemoryBarrierByRegion(GLbitfield barriers);
+
 #ifdef __cplusplus
 }
 #endif
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/4] i965/es3.1: Implement glMemoryBarrierByRegion

2015-07-31 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/drivers/dri/i965/brw_program.c | 34 +
 1 file changed, 34 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_program.c 
b/src/mesa/drivers/dri/i965/brw_program.c
index 85e271d..332d84e 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -226,6 +226,39 @@ brw_memory_barrier(struct gl_context *ctx, GLbitfield 
barriers)
brw_emit_pipe_control_flush(brw, bits);
 }
 
+static void
+brw_memory_barrier_by_region(struct gl_context *ctx, GLbitfield barriers)
+{
+   GLbitfield all_allowed_bits = GL_ATOMIC_COUNTER_BARRIER_BIT |
+  GL_FRAMEBUFFER_BARRIER_BIT |
+  GL_SHADER_IMAGE_ACCESS_BARRIER_BIT |
+  GL_SHADER_STORAGE_BARRIER_BIT |
+  GL_TEXTURE_FETCH_BARRIER_BIT |
+  GL_UNIFORM_BARRIER_BIT;
+   /*
+* According to OpenGL ES 3.1 spec. April 29, 2015, 7.11.2:
+* "When barriers are ALL_BARRIERS_BIT, shader memory access
+* will be synchronized realtive to all theese barrier bits,
+* but not to other barrier bits specific to MemoryBarrier."
+* I.e if bariiers is the special value GL_ALL_BARRIER_BITS,
+* then all barriers allowed by glMemoryBarrierByRegion
+* should be activated.
+   */
+   if (barriers == GL_ALL_BARRIER_BITS)
+  return brw_memory_barrier(ctx, all_allowed_bits);
+
+   /*
+* If barriers contain a value that is not allowed
+* for glMemoryBarrierByRegion an GL_INVALID_VALUE
+* should be generated.
+   */
+   if ((all_allowed_bits | barriers) ^ all_allowed_bits)
+   _mesa_error(ctx, GL_INVALID_VALUE,
+"glMemoryBarrierByRegion(unsupported barrier bit");
+
+   return brw_memory_barrier(ctx, barriers);
+}
+
 void
 brw_add_texrect_params(struct gl_program *prog)
 {
@@ -285,6 +318,7 @@ void brwInitFragProgFuncs( struct dd_function_table 
*functions )
functions->LinkShader = brw_link_shader;
 
functions->MemoryBarrier = brw_memory_barrier;
+   functions->MemoryBarrierByRegion = brw_memory_barrier_by_region;
 }
 
 struct shader_times {
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/4] mesa/es3.1: Add driver interface for glMemoryBarrierByRegion

2015-07-31 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/dd.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 87eb63e..4b41141 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -1017,6 +1017,13 @@ struct dd_function_table {
/*@{*/
void (*DispatchCompute)(struct gl_context *ctx, const GLuint *num_groups);
/*@}*/
+
+   /**
+* \name MemoryBarrierByRegion
+*/
+   /*@{*/
+   void (*MemoryBarrierByRegion)(struct gl_context *ctx, GLbitfield barriers);
+   /*@}*/
 };
 
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/4] gles/es3.1: Enable dispatch of glMemoryBarrierByRegion

2015-07-31 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mapi/glapi/gen/gl_API.xml   | 4 
 src/mesa/main/tests/dispatch_sanity.cpp | 3 +--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 658efa4..3db4349 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -2966,6 +2966,10 @@
 
 
 
+
+
+
+
 
 
 
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index af89d2c..14c9eda 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2461,8 +2461,7 @@ const struct function gles31_functions_possible[] = {
{ "glGetBooleani_v", 31, -1 },
{ "glMemoryBarrier", 31, -1 },
 
-   // FINISHME: This function has not been implemented yet.
-   // { "glMemoryBarrierByRegion", 31, -1 },
+   { "glMemoryBarrierByRegion", 31, -1 },
 
{ "glTexStorage2DMultisample", 31, -1 },
{ "glGetMultisamplefv", 31, -1 },
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v6 1/4] mesa/es3.1: enable GL_ARB_shader_image_load_store for GLES 3.1

2015-07-27 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 17 +++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index ec7eb71..dc04930 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -367,6 +367,12 @@ static const int extra_ARB_draw_indirect_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_shader_image_load_store_es31[] = {
+   EXT(ARB_shader_image_load_store),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 4137e7f..34f95d6 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -407,6 +407,15 @@ descriptor=[
   [ "TEXTURE_EXTERNAL_OES", "LOC_CUSTOM, TYPE_BOOLEAN, 0, 
extra_OES_EGL_image_external" ],
 ]},
 
+# Enums in OpenGL and ES 3.1
+{ "apis": ["GL", "GL_CORE", "GLES31"], "params": [
+# GL_ARB_shader_image_load_store / GLES 3.1
+  [ "MAX_IMAGE_UNITS", "CONTEXT_INT(Const.MaxImageUnits), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_VERTEX_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_FRAGMENT_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_COMBINED_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.MaxCombinedImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
+]},
+
 # Enums in OpenGL Core profile and ES 3.1
 { "apis": ["GL_CORE", "GLES3"], "params": [
 # GL_ARB_draw_indirect / GLES 3.1
@@ -779,13 +788,9 @@ descriptor=[
   [ "MAX_VERTEX_ATTRIB_BINDINGS", 
"CONTEXT_ENUM(Const.MaxVertexAttribBindings), NO_EXTRA" ],
 
 # GL_ARB_shader_image_load_store
-  [ "MAX_IMAGE_UNITS", "CONTEXT_INT(Const.MaxImageUnits), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS", 
"CONTEXT_INT(Const.MaxCombinedImageUnitsAndFragmentOutputs), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_IMAGE_SAMPLES", "CONTEXT_INT(Const.MaxImageSamples), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_VERTEX_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxImageUniforms), 
extra_ARB_shader_image_load_store"],
+  [ "MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS", 
"CONTEXT_INT(Const.MaxCombinedImageUnitsAndFragmentOutputs), 
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"],
-  [ "MAX_FRAGMENT_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_COMBINED_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.MaxCombinedImageUniforms), 
extra_ARB_shader_image_load_store"],
 
 # GL_ARB_compute_shader
   [ "MAX_COMPUTE_WORK_GROUP_INVOCATIONS", 
"CONTEXT_INT(Const.MaxComputeWorkGroupInvocations), extra_ARB_compute_shader" ],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v6 4/4] mesa/es3.1: enable GL_ARB_texture_gather for GLES 3.1

2015-07-27 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  | 6 ++
 src/mesa/main/get_hash_params.py | 6 --
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 60c1b1b..a443493 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -385,6 +385,12 @@ static const int extra_ARB_texture_multisample_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_texture_gather_es31[] = {
+   EXT(ARB_texture_gather),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 2040a01..94d856a 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -433,6 +433,10 @@ descriptor=[
   [ "MAX_INTEGER_SAMPLES", "CONTEXT_INT(Const.MaxIntegerSamples), 
extra_ARB_texture_multisample_es31" ],
   [ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask), 
extra_ARB_texture_multisample_es31" ],
   [ "MAX_SAMPLE_MASK_WORDS", "CONST(1), extra_ARB_texture_multisample_es31" ],
+
+# GL_ARB_texture_gather / GLES 3.1
+  [ "MIN_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MinProgramTextureGatherOffset), 
extra_ARB_texture_gather_es31"],
+  [ "MAX_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MaxProgramTextureGatherOffset), 
extra_ARB_texture_gather_es31"],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -776,8 +780,6 @@ descriptor=[
   [ "TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_CUBE_ARRAY_INDEX, extra_ARB_texture_cube_map_array" ],
 
 # GL_ARB_texture_gather
-  [ "MIN_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MinProgramTextureGatherOffset), extra_ARB_texture_gather"],
-  [ "MAX_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MaxProgramTextureGatherOffset), extra_ARB_texture_gather"],
   [ "MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB", 
"CONTEXT_INT(Const.MaxProgramTextureGatherComponents), 
extra_ARB_texture_gather"],
 
 # GL_ARB_separate_shader_objects
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v6 3/4] mesa/es3.1: enable GL_ARB_texture_multisample for GLES 3.1

2015-07-27 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 14 --
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 39fe725..60c1b1b 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -379,6 +379,12 @@ static const int extra_ARB_shader_atomic_counters_es31[] = 
{
EXTRA_END
 };
 
+static const int extra_ARB_texture_multisample_es31[] = {
+   EXT(ARB_texture_multisample),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 1bafc32..2040a01 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -425,6 +425,14 @@ descriptor=[
   [ "MAX_FRAGMENT_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
   [ "MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicBuffers), 
extra_ARB_shader_atomic_counters_es31" ],
   [ "MAX_COMBINED_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
+
+# GL_ARB_texture_multisample / GLES 3.1
+  [ "TEXTURE_BINDING_2D_MULTISAMPLE", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_2D_MULTISAMPLE_INDEX, extra_ARB_texture_multisample_es31" ],
+  [ "MAX_COLOR_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxColorTextureSamples), 
extra_ARB_texture_multisample_es31" ],
+  [ "MAX_DEPTH_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxDepthTextureSamples), 
extra_ARB_texture_multisample_es31" ],
+  [ "MAX_INTEGER_SAMPLES", "CONTEXT_INT(Const.MaxIntegerSamples), 
extra_ARB_texture_multisample_es31" ],
+  [ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask), 
extra_ARB_texture_multisample_es31" ],
+  [ "MAX_SAMPLE_MASK_WORDS", "CONST(1), extra_ARB_texture_multisample_es31" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -717,13 +725,7 @@ descriptor=[
   [ "TEXTURE_BUFFER_ARB", "LOC_CUSTOM, TYPE_INT, 0, 
extra_texture_buffer_object" ],
 
 # GL_ARB_texture_multisample / GL 3.2
-  [ "TEXTURE_BINDING_2D_MULTISAMPLE", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_2D_MULTISAMPLE_INDEX, extra_ARB_texture_multisample" ],
   [ "TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX, extra_ARB_texture_multisample" ],
-  [ "MAX_COLOR_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxColorTextureSamples), 
extra_ARB_texture_multisample" ],
-  [ "MAX_DEPTH_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxDepthTextureSamples), 
extra_ARB_texture_multisample" ],
-  [ "MAX_INTEGER_SAMPLES", "CONTEXT_INT(Const.MaxIntegerSamples), 
extra_ARB_texture_multisample" ],
-  [ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask), 
extra_ARB_texture_multisample" ],
-  [ "MAX_SAMPLE_MASK_WORDS", "CONST(1), extra_ARB_texture_multisample" ],
 
 # GL 3.0
   [ "CONTEXT_FLAGS", "CONTEXT_INT(Const.ContextFlags), extra_version_30" ],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH V5 7/7] mesa/es3.1: enable GL_ARB_explicit_uniform_location for GLES 3.1

2015-07-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  | 6 ++
 src/mesa/main/get_hash_params.py | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 072c1a5..5b308e8 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -397,6 +397,12 @@ static const int extra_ARB_compute_shader_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_explicit_uniform_location_es31[] = {
+   EXT(ARB_explicit_uniform_location),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 944f2bc..8863d17 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -451,6 +451,9 @@ descriptor=[
   [ "MAX_COMPUTE_SHARED_MEMORY_SIZE", "CONST(MAX_COMPUTE_SHARED_MEMORY_SIZE), 
extra_ARB_compute_shader_es31" ],
   [ "MAX_COMPUTE_UNIFORM_COMPONENTS", "CONST(MAX_COMPUTE_UNIFORM_COMPONENTS), 
extra_ARB_compute_shader_es31" ],
   [ "MAX_COMPUTE_IMAGE_UNIFORMS", "CONST(MAX_COMPUTE_IMAGE_UNIFORMS), 
extra_ARB_compute_shader_es31" ],
+
+# GL_ARB_explicit_uniform_location / GLES 3.1
+  [ "MAX_UNIFORM_LOCATIONS", 
"CONTEXT_INT(Const.MaxUserAssignableUniformLocations), 
extra_ARB_explicit_uniform_location_es31" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -542,7 +545,6 @@ descriptor=[
   [ "MAX_LIST_NESTING", "CONST(MAX_LIST_NESTING), NO_EXTRA" ],
   [ "MAX_NAME_STACK_DEPTH", "CONST(MAX_NAME_STACK_DEPTH), NO_EXTRA" ],
   [ "MAX_PIXEL_MAP_TABLE", "CONST(MAX_PIXEL_MAP_TABLE), NO_EXTRA" ],
-  [ "MAX_UNIFORM_LOCATIONS", 
"CONTEXT_INT(Const.MaxUserAssignableUniformLocations), 
extra_ARB_explicit_uniform_location" ],
   [ "NAME_STACK_DEPTH", "CONTEXT_INT(Select.NameStackDepth), NO_EXTRA" ],
   [ "PACK_LSB_FIRST", "CONTEXT_BOOL(Pack.LsbFirst), NO_EXTRA" ],
   [ "PACK_SWAP_BYTES", "CONTEXT_BOOL(Pack.SwapBytes), NO_EXTRA" ],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH V5 4/7] mesa/es3.1: enable GL_ARB_texture_multisample for GLES 3.1

2015-07-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 18 +-
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 39fe725..60c1b1b 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -379,6 +379,12 @@ static const int extra_ARB_shader_atomic_counters_es31[] = 
{
EXTRA_END
 };
 
+static const int extra_ARB_texture_multisample_es31[] = {
+   EXT(ARB_texture_multisample),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index b1a5dd5..fbf2abf 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -427,6 +427,15 @@ descriptor=[
   [ "MAX_FRAGMENT_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
   [ "MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicBuffers), 
extra_ARB_shader_atomic_counters_es31" ],
   [ "MAX_COMBINED_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
+
+# GL_ARB_texture_multisample / GLES 3.1
+  [ "TEXTURE_BINDING_2D_MULTISAMPLE", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_2D_MULTISAMPLE_INDEX, extra_ARB_texture_multisample_es31" ],
+  [ "TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX, extra_ARB_texture_multisample_es31" ],
+  [ "MAX_COLOR_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxColorTextureSamples), 
extra_ARB_texture_multisample_es31" ],
+  [ "MAX_DEPTH_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxDepthTextureSamples), 
extra_ARB_texture_multisample_es31" ],
+  [ "MAX_INTEGER_SAMPLES", "CONTEXT_INT(Const.MaxIntegerSamples), 
extra_ARB_texture_multisample_es31" ],
+  [ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask), 
extra_ARB_texture_multisample_es31" ],
+  [ "MAX_SAMPLE_MASK_WORDS", "CONST(1), extra_ARB_texture_multisample_es31" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -718,15 +727,6 @@ descriptor=[
   [ "TEXTURE_BUFFER_FORMAT_ARB", "LOC_CUSTOM, TYPE_INT, 0, 
extra_texture_buffer_object" ],
   [ "TEXTURE_BUFFER_ARB", "LOC_CUSTOM, TYPE_INT, 0, 
extra_texture_buffer_object" ],
 
-# GL_ARB_texture_multisample / GL 3.2
-  [ "TEXTURE_BINDING_2D_MULTISAMPLE", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_2D_MULTISAMPLE_INDEX, extra_ARB_texture_multisample" ],
-  [ "TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX, extra_ARB_texture_multisample" ],
-  [ "MAX_COLOR_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxColorTextureSamples), 
extra_ARB_texture_multisample" ],
-  [ "MAX_DEPTH_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxDepthTextureSamples), 
extra_ARB_texture_multisample" ],
-  [ "MAX_INTEGER_SAMPLES", "CONTEXT_INT(Const.MaxIntegerSamples), 
extra_ARB_texture_multisample" ],
-  [ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask), 
extra_ARB_texture_multisample" ],
-  [ "MAX_SAMPLE_MASK_WORDS", "CONST(1), extra_ARB_texture_multisample" ],
-
 # GL 3.0
   [ "CONTEXT_FLAGS", "CONTEXT_INT(Const.ContextFlags), extra_version_30" ],
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH V5 6/7] mesa/es3.1: enable GL_ARB_compute_shader for GLES 3.1

2015-07-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 20 ++--
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index a443493..072c1a5 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -391,6 +391,12 @@ static const int extra_ARB_texture_gather_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_compute_shader_es31[] = {
+   EXT(ARB_compute_shader),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index d7e7a7a..944f2bc 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -441,6 +441,16 @@ descriptor=[
   [ "MIN_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MinProgramTextureGatherOffset), 
extra_ARB_texture_gather_es31"],
   [ "MAX_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MaxProgramTextureGatherOffset), 
extra_ARB_texture_gather_es31"],
   [ "MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB", 
"CONTEXT_INT(Const.MaxProgramTextureGatherComponents), 
extra_ARB_texture_gather_es31"],
+
+# GL_ARB_compute_shader / GLES 3.1
+  [ "MAX_COMPUTE_WORK_GROUP_INVOCATIONS", 
"CONTEXT_INT(Const.MaxComputeWorkGroupInvocations), 
extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_UNIFORM_BLOCKS", "CONST(MAX_COMPUTE_UNIFORM_BLOCKS), 
extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_TEXTURE_IMAGE_UNITS", 
"CONST(MAX_COMPUTE_TEXTURE_IMAGE_UNITS), extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS", 
"CONST(MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS), extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_ATOMIC_COUNTERS", "CONST(MAX_COMPUTE_ATOMIC_COUNTERS), 
extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_SHARED_MEMORY_SIZE", "CONST(MAX_COMPUTE_SHARED_MEMORY_SIZE), 
extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_UNIFORM_COMPONENTS", "CONST(MAX_COMPUTE_UNIFORM_COMPONENTS), 
extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_IMAGE_UNIFORMS", "CONST(MAX_COMPUTE_IMAGE_UNIFORMS), 
extra_ARB_compute_shader_es31" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -794,16 +804,6 @@ descriptor=[
 # GL_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_compute_shader
-  [ "MAX_COMPUTE_WORK_GROUP_INVOCATIONS", 
"CONTEXT_INT(Const.MaxComputeWorkGroupInvocations), extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_UNIFORM_BLOCKS", "CONST(MAX_COMPUTE_UNIFORM_BLOCKS), 
extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_TEXTURE_IMAGE_UNITS", 
"CONST(MAX_COMPUTE_TEXTURE_IMAGE_UNITS), extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS", 
"CONST(MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS), extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_ATOMIC_COUNTERS", "CONST(MAX_COMPUTE_ATOMIC_COUNTERS), 
extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_SHARED_MEMORY_SIZE", "CONST(MAX_COMPUTE_SHARED_MEMORY_SIZE), 
extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_UNIFORM_COMPONENTS", "CONST(MAX_COMPUTE_UNIFORM_COMPONENTS), 
extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_IMAGE_UNIFORMS", "CONST(MAX_COMPUTE_IMAGE_UNIFORMS), 
extra_ARB_compute_shader" ],
-
 # GL_ARB_framebuffer_no_attachments
   ["MAX_FRAMEBUFFER_WIDTH", "CONTEXT_INT(Const.MaxFramebufferWidth), 
extra_ARB_framebuffer_no_attachments"],
   ["MAX_FRAMEBUFFER_HEIGHT", "CONTEXT_INT(Const.MaxFramebufferHeight), 
extra_ARB_framebuffer_no_attachments"],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH V5 2/7] mesa/es3.1: enable GL_ARB_shader_image_load_store for GLES 3.1

2015-07-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 17 +++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index ec7eb71..dc04930 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -367,6 +367,12 @@ static const int extra_ARB_draw_indirect_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_shader_image_load_store_es31[] = {
+   EXT(ARB_shader_image_load_store),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 4137e7f..85df077 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -407,6 +407,17 @@ descriptor=[
   [ "TEXTURE_EXTERNAL_OES", "LOC_CUSTOM, TYPE_BOOLEAN, 0, 
extra_OES_EGL_image_external" ],
 ]},
 
+# Enums in OpenGL and ES 3.1
+{ "apis": ["GL", "GL_CORE", "GLES31"], "params": [
+# GL_ARB_shader_image_load_store / GLES 3.1
+  [ "MAX_IMAGE_UNITS", "CONTEXT_INT(Const.MaxImageUnits), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS", 
"CONTEXT_INT(Const.MaxCombinedImageUnitsAndFragmentOutputs), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_IMAGE_SAMPLES", "CONTEXT_INT(Const.MaxImageSamples), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_VERTEX_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_FRAGMENT_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_COMBINED_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.MaxCombinedImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
+]},
+
 # Enums in OpenGL Core profile and ES 3.1
 { "apis": ["GL_CORE", "GLES3"], "params": [
 # GL_ARB_draw_indirect / GLES 3.1
@@ -779,13 +790,7 @@ descriptor=[
   [ "MAX_VERTEX_ATTRIB_BINDINGS", 
"CONTEXT_ENUM(Const.MaxVertexAttribBindings), NO_EXTRA" ],
 
 # GL_ARB_shader_image_load_store
-  [ "MAX_IMAGE_UNITS", "CONTEXT_INT(Const.MaxImageUnits), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS", 
"CONTEXT_INT(Const.MaxCombinedImageUnitsAndFragmentOutputs), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_IMAGE_SAMPLES", "CONTEXT_INT(Const.MaxImageSamples), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_VERTEX_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxImageUniforms), 
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"],
-  [ "MAX_FRAGMENT_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_COMBINED_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.MaxCombinedImageUniforms), 
extra_ARB_shader_image_load_store"],
 
 # GL_ARB_compute_shader
   [ "MAX_COMPUTE_WORK_GROUP_INVOCATIONS", 
"CONTEXT_INT(Const.MaxComputeWorkGroupInvocations), extra_ARB_compute_shader" ],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH V5 3/7] mesa/es3.1: enable GL_ARB_shader_atomic_counters for GLES 3.1

2015-07-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 20 +++-
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index dc04930..39fe725 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -373,6 +373,12 @@ static const int extra_ARB_shader_image_load_store_es31[] 
= {
EXTRA_END
 };
 
+static const int extra_ARB_shader_atomic_counters_es31[] = {
+   EXT(ARB_shader_atomic_counters),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 85df077..b1a5dd5 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -416,6 +416,17 @@ descriptor=[
   [ "MAX_VERTEX_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
   [ "MAX_FRAGMENT_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
   [ "MAX_COMBINED_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.MaxCombinedImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
+
+# GL_ARB_shader_atomic_counters / GLES 3.1
+  [ "ATOMIC_COUNTER_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_ATOMIC_COUNTER_BUFFER_BINDINGS", 
"CONTEXT_INT(Const.MaxAtomicBufferBindings), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_ATOMIC_COUNTER_BUFFER_SIZE", "CONTEXT_INT(Const.MaxAtomicBufferSize), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_VERTEX_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicBuffers), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_VERTEX_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicBuffers), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_FRAGMENT_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicBuffers), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_COMBINED_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -773,17 +784,8 @@ descriptor=[
   [ "PROGRAM_PIPELINE_BINDING", "LOC_CUSTOM, TYPE_INT, 
GL_PROGRAM_PIPELINE_BINDING, NO_EXTRA" ],
 
 # GL_ARB_shader_atomic_counters
-  [ "ATOMIC_COUNTER_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, 
extra_ARB_shader_atomic_counters" ],
-  [ "MAX_ATOMIC_COUNTER_BUFFER_BINDINGS", 
"CONTEXT_INT(Const.MaxAtomicBufferBindings), extra_ARB_shader_atomic_counters" 
],
-  [ "MAX_ATOMIC_COUNTER_BUFFER_SIZE", "CONTEXT_INT(Const.MaxAtomicBufferSize), 
extra_ARB_shader_atomic_counters" ],
-  [ "MAX_VERTEX_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicBuffers), 
extra_ARB_shader_atomic_counters" ],
-  [ "MAX_VERTEX_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters), 
extra_ARB_shader_atomic_counters" ],
-  [ "MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicBuffers), 
extra_ARB_shader_atomic_counters" ],
-  [ "MAX_FRAGMENT_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters), 
extra_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" ],
-  [ "MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicBuffers), extra_ARB_shader_atomic_counters" 
],
-  [ "MAX_COMBINED_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicCounters), 
extra_ARB_shader_atomic_counters" ],
 
 # GL_ARB_vertex_attrib_binding
   [ "MAX_VERTEX_ATTRIB_RELATIVE_OFFSET", 
"CONTEXT_ENUM(Const.MaxVertexAttribRelativeOffset), NO_EXTRA" ],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH V5 1/7] mesa/es3.1: Add ES 3.1 handling to get.c and get_hash_generator.py

2015-07-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c |  5 -
 src/mesa/main/get_hash_generator.py | 12 
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index ce78691..ec7eb71 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1232,10 +1232,13 @@ find_value(const char *func, GLenum pname, void **p, 
union value *v)
 * value since it's compatible with GLES2 its entry in table_set[] is at the
 * end.
 */
-   STATIC_ASSERT(ARRAY_SIZE(table_set) == API_OPENGL_LAST + 2);
+   STATIC_ASSERT(ARRAY_SIZE(table_set) == API_OPENGL_LAST + 3);
if (_mesa_is_gles3(ctx)) {
   api = API_OPENGL_LAST + 1;
}
+   if (_mesa_is_gles31(ctx)) {
+  api = API_OPENGL_LAST + 2;
+   }
mask = ARRAY_SIZE(table(api)) - 1;
hash = (pname * prime_factor);
while (1) {
diff --git a/src/mesa/main/get_hash_generator.py 
b/src/mesa/main/get_hash_generator.py
index b200d19..c777b78 100644
--- a/src/mesa/main/get_hash_generator.py
+++ b/src/mesa/main/get_hash_generator.py
@@ -44,7 +44,7 @@ prime_factor = 89
 prime_step = 281
 hash_table_size = 1024
 
-gl_apis=set(["GL", "GL_CORE", "GLES", "GLES2", "GLES3"])
+gl_apis=set(["GL", "GL_CORE", "GLES", "GLES2", "GLES3", "GLES31"])
 
 def print_header():
print "typedef const unsigned short table_t[%d];\n" % (hash_table_size)
@@ -68,6 +68,7 @@ api_enum = [
'GLES2',
'GL_CORE',
'GLES3', # Not in gl_api enum in mtypes.h
+   'GLES31', # Not in gl_api enum in mtypes.h
 ]
 
 def api_index(api):
@@ -167,10 +168,13 @@ def generate_hash_tables(enum_list, enabled_apis, 
param_descriptors):
 
  for api in valid_apis:
 add_to_hash_table(tables[api], hash_val, len(params))
-# Also add GLES2 items to the GLES3 hash table
+# Also add GLES2 items to the GLES3 and GLES31 hash table
 if api == "GLES2":
add_to_hash_table(tables["GLES3"], hash_val, len(params))
-
+   add_to_hash_table(tables["GLES31"], hash_val, len(params))
+# Also add GLES3 items to the GLES31 hash table
+if api == "GLES3":
+   add_to_hash_table(tables["GLES31"], hash_val, len(params))
  params.append(["GL_" + enum_name, param[1]])
 
sorted_tables={}
@@ -206,7 +210,7 @@ if __name__ == '__main__':
   die("missing descriptor file (-f)\n")
 
# generate the code for all APIs
-   enabled_apis = set(["GLES", "GLES2", "GLES3", "GL", "GL_CORE"])
+   enabled_apis = set(["GLES", "GLES2", "GLES3", "GLES31", "GL", "GL_CORE"])
 
try:
   api_desc = gl_XML.parse_GL_API(api_desc_file)
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH V5 5/7] mesa/es3.1: enable GL_ARB_texture_gather for GLES 3.1

2015-07-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 10 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 60c1b1b..a443493 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -385,6 +385,12 @@ static const int extra_ARB_texture_multisample_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_texture_gather_es31[] = {
+   EXT(ARB_texture_gather),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index fbf2abf..d7e7a7a 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -436,6 +436,11 @@ descriptor=[
   [ "MAX_INTEGER_SAMPLES", "CONTEXT_INT(Const.MaxIntegerSamples), 
extra_ARB_texture_multisample_es31" ],
   [ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask), 
extra_ARB_texture_multisample_es31" ],
   [ "MAX_SAMPLE_MASK_WORDS", "CONST(1), extra_ARB_texture_multisample_es31" ],
+
+# GL_ARB_texture_gather / GLES 3.1
+  [ "MIN_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MinProgramTextureGatherOffset), 
extra_ARB_texture_gather_es31"],
+  [ "MAX_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MaxProgramTextureGatherOffset), 
extra_ARB_texture_gather_es31"],
+  [ "MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB", 
"CONTEXT_INT(Const.MaxProgramTextureGatherComponents), 
extra_ARB_texture_gather_es31"],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -775,11 +780,6 @@ descriptor=[
 # GL_ARB_texture_cube_map_array
   [ "TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_CUBE_ARRAY_INDEX, extra_ARB_texture_cube_map_array" ],
 
-# GL_ARB_texture_gather
-  [ "MIN_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MinProgramTextureGatherOffset), extra_ARB_texture_gather"],
-  [ "MAX_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MaxProgramTextureGatherOffset), extra_ARB_texture_gather"],
-  [ "MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB", 
"CONTEXT_INT(Const.MaxProgramTextureGatherComponents), 
extra_ARB_texture_gather"],
-
 # GL_ARB_separate_shader_objects
   [ "PROGRAM_PIPELINE_BINDING", "LOC_CUSTOM, TYPE_INT, 
GL_PROGRAM_PIPELINE_BINDING, NO_EXTRA" ],
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH V5 0/7] Enabling extension enums for OpenGL ES 3.1

2015-07-23 Thread Marta Lofstedt
This is V5 of my patch-set for enabling extension enums for
OpenGL ES 3.1. 

This update address comments from Ilia Mirkin and adds a new
GLES31 label.

I have my current GLES 3.1 work on github:
https://github.com/MartaLo/mesa
For theese patches see the gles31_resent_patches, branch

Marta Lofstedt (7):
  mesa/es3.1: Add ES 3.1 handling to get.c and get_hash_generator.py
  mesa/es3.1: enable GL_ARB_shader_image_load_store for GLES 3.1
  mesa/es3.1: enable GL_ARB_shader_atomic_counters for GLES 3.1
  mesa/es3.1: enable GL_ARB_texture_multisample for GLES 3.1
  mesa/es3.1: enable GL_ARB_texture_gather for GLES 3.1
  mesa/es3.1: enable GL_ARB_compute_shader for GLES 3.1
  mesa/es3.1: enable GL_ARB_explicit_uniform_location for GLES 3.1

 src/mesa/main/get.c | 41 -
 src/mesa/main/get_hash_generator.py | 12 +++--
 src/mesa/main/get_hash_params.py| 89 -
 3 files changed, 97 insertions(+), 45 deletions(-)

-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v3] mesa: Do not give ralloc_strcat a NULL

2015-06-26 Thread Marta Lofstedt
From: Marta Lofstedt 

When a program is compiled, but linking failed the
sh->InfoLog could be NULL. This is exploited
by OpenGL ES 3.1 conformance tests.

V3: Chnaged title.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/shaderapi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index a4296ad..7ea27ed 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1921,7 +1921,8 @@ _mesa_create_shader_program(struct gl_context* ctx, 
GLboolean separate,
 #endif
 }
 
-ralloc_strcat(&shProg->InfoLog, sh->InfoLog);
+ if (sh->InfoLog)
+ralloc_strcat(&shProg->InfoLog, sh->InfoLog);
   }
 
   delete_shader(ctx, shader);
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] mesa : NULL check InfoLog

2015-06-25 Thread Marta Lofstedt
From: Marta Lofstedt 

When a program is compiled, but linking failed the
sh->InfoLog could be NULL. This is expoloited
by OpenGL ES 3.1 conformance tests.

V2: ralloc_strdup shProg->InfoLog

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/shaderapi.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index a4296ad..bc6625a 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1921,7 +1921,10 @@ _mesa_create_shader_program(struct gl_context* ctx, 
GLboolean separate,
 #endif
 }
 
-ralloc_strcat(&shProg->InfoLog, sh->InfoLog);
+ if (sh->InfoLog)
+ralloc_strcat(&shProg->InfoLog, sh->InfoLog);
+ else
+ralloc_strdup(ctx, shProg->InfoLog);
   }
 
   delete_shader(ctx, shader);
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4 5/6] mesa/es3.1: enable GL_ARB_compute_shader for GLES 3.1

2015-06-25 Thread Marta Lofstedt
From: Marta Lofstedt 

v4 : only expose GL_ARB_compute_shader enums for
gles 3.1 and desktop GL.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 20 ++--
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 7f8da6a..d085583 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -379,6 +379,12 @@ static const int extra_ARB_texture_gather_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_compute_shader_es31[] = {
+   EXT(ARB_compute_shader),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 0804755..b402340 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -440,6 +440,16 @@ descriptor=[
   [ "MIN_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MinProgramTextureGatherOffset), 
extra_ARB_texture_gather_es31"],
   [ "MAX_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MaxProgramTextureGatherOffset), 
extra_ARB_texture_gather_es31"],
   [ "MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB", 
"CONTEXT_INT(Const.MaxProgramTextureGatherComponents), 
extra_ARB_texture_gather_es31"],
+
+# GL_ARB_compute_shader / GLES 3.1
+  [ "MAX_COMPUTE_WORK_GROUP_INVOCATIONS", 
"CONTEXT_INT(Const.MaxComputeWorkGroupInvocations), 
extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_UNIFORM_BLOCKS", "CONST(MAX_COMPUTE_UNIFORM_BLOCKS), 
extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_TEXTURE_IMAGE_UNITS", 
"CONST(MAX_COMPUTE_TEXTURE_IMAGE_UNITS), extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS", 
"CONST(MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS), extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_ATOMIC_COUNTERS", "CONST(MAX_COMPUTE_ATOMIC_COUNTERS), 
extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_SHARED_MEMORY_SIZE", "CONST(MAX_COMPUTE_SHARED_MEMORY_SIZE), 
extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_UNIFORM_COMPONENTS", "CONST(MAX_COMPUTE_UNIFORM_COMPONENTS), 
extra_ARB_compute_shader_es31" ],
+  [ "MAX_COMPUTE_IMAGE_UNIFORMS", "CONST(MAX_COMPUTE_IMAGE_UNIFORMS), 
extra_ARB_compute_shader_es31" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -793,16 +803,6 @@ descriptor=[
 # GL_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_compute_shader
-  [ "MAX_COMPUTE_WORK_GROUP_INVOCATIONS", 
"CONTEXT_INT(Const.MaxComputeWorkGroupInvocations), extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_UNIFORM_BLOCKS", "CONST(MAX_COMPUTE_UNIFORM_BLOCKS), 
extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_TEXTURE_IMAGE_UNITS", 
"CONST(MAX_COMPUTE_TEXTURE_IMAGE_UNITS), extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS", 
"CONST(MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS), extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_ATOMIC_COUNTERS", "CONST(MAX_COMPUTE_ATOMIC_COUNTERS), 
extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_SHARED_MEMORY_SIZE", "CONST(MAX_COMPUTE_SHARED_MEMORY_SIZE), 
extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_UNIFORM_COMPONENTS", "CONST(MAX_COMPUTE_UNIFORM_COMPONENTS), 
extra_ARB_compute_shader" ],
-  [ "MAX_COMPUTE_IMAGE_UNIFORMS", "CONST(MAX_COMPUTE_IMAGE_UNIFORMS), 
extra_ARB_compute_shader" ],
-
 # 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" ],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4 2/6] mesa/es3.1: enable GL_ARB_shader_atomic_counters for GLES 3.1

2015-06-25 Thread Marta Lofstedt
From: Marta Lofstedt 

v4 :  only expose ARB_shader_atomic_counters enums
for gles 3.1 and desktop GL.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 20 +++-
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 0ab6837..4a0537d 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -361,6 +361,12 @@ static const int extra_ARB_shader_image_load_store_es31[] 
= {
EXTRA_END
 };
 
+static const int extra_ARB_shader_atomic_counters_es31[] = {
+   EXT(ARB_shader_atomic_counters),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 3eecc28..e25dbe1 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -415,6 +415,17 @@ descriptor=[
   [ "MAX_VERTEX_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
   [ "MAX_FRAGMENT_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
   [ "MAX_COMBINED_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.MaxCombinedImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
+
+# GL_ARB_shader_atomic_counters / GLES 3.1
+  [ "ATOMIC_COUNTER_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_ATOMIC_COUNTER_BUFFER_BINDINGS", 
"CONTEXT_INT(Const.MaxAtomicBufferBindings), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_ATOMIC_COUNTER_BUFFER_SIZE", "CONTEXT_INT(Const.MaxAtomicBufferSize), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_VERTEX_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicBuffers), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_VERTEX_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicBuffers), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_FRAGMENT_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicBuffers), 
extra_ARB_shader_atomic_counters_es31" ],
+  [ "MAX_COMBINED_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -772,17 +783,8 @@ descriptor=[
   [ "PROGRAM_PIPELINE_BINDING", "LOC_CUSTOM, TYPE_INT, 
GL_PROGRAM_PIPELINE_BINDING, NO_EXTRA" ],
 
 # GL_ARB_shader_atomic_counters
-  [ "ATOMIC_COUNTER_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, 
extra_ARB_shader_atomic_counters" ],
-  [ "MAX_ATOMIC_COUNTER_BUFFER_BINDINGS", 
"CONTEXT_INT(Const.MaxAtomicBufferBindings), extra_ARB_shader_atomic_counters" 
],
-  [ "MAX_ATOMIC_COUNTER_BUFFER_SIZE", "CONTEXT_INT(Const.MaxAtomicBufferSize), 
extra_ARB_shader_atomic_counters" ],
-  [ "MAX_VERTEX_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicBuffers), 
extra_ARB_shader_atomic_counters" ],
-  [ "MAX_VERTEX_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxAtomicCounters), 
extra_ARB_shader_atomic_counters" ],
-  [ "MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicBuffers), 
extra_ARB_shader_atomic_counters" ],
-  [ "MAX_FRAGMENT_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters), 
extra_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" ],
-  [ "MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicBuffers), extra_ARB_shader_atomic_counters" 
],
-  [ "MAX_COMBINED_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicCounters), 
extra_ARB_shader_atomic_counters" ],
 
 # GL_ARB_vertex_attrib_binding
   [ "MAX_VERTEX_ATTRIB_RELATIVE_OFFSET", 
"CONTEXT_ENUM(Const.MaxVertexAttribRelativeOffset), NO_EXTRA" ],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4 4/6] mesa/es3.1: enable GL_ARB_texture_gather for GLES 3.1

2015-06-25 Thread Marta Lofstedt
From: Marta Lofstedt 

v4 : only expose GL_ARB_texture_gather enums for
gles 3.1 and desktop GL.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 10 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 6148349..7f8da6a 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -373,6 +373,12 @@ static const int extra_ARB_texture_multisample_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_texture_gather_es31[] = {
+   EXT(ARB_texture_gather),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 0026000..0804755 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -435,6 +435,11 @@ descriptor=[
   [ "MAX_INTEGER_SAMPLES", "CONTEXT_INT(Const.MaxIntegerSamples), 
extra_ARB_texture_multisample_es31" ],
   [ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask), 
extra_ARB_texture_multisample_es31" ],
   [ "MAX_SAMPLE_MASK_WORDS", "CONST(1), extra_ARB_texture_multisample_es31" ],
+
+# GL_ARB_texture_gather / GLES 3.1
+  [ "MIN_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MinProgramTextureGatherOffset), 
extra_ARB_texture_gather_es31"],
+  [ "MAX_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MaxProgramTextureGatherOffset), 
extra_ARB_texture_gather_es31"],
+  [ "MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB", 
"CONTEXT_INT(Const.MaxProgramTextureGatherComponents), 
extra_ARB_texture_gather_es31"],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -774,11 +779,6 @@ descriptor=[
 # GL_ARB_texture_cube_map_array
   [ "TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_CUBE_ARRAY_INDEX, extra_ARB_texture_cube_map_array" ],
 
-# GL_ARB_texture_gather
-  [ "MIN_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MinProgramTextureGatherOffset), extra_ARB_texture_gather"],
-  [ "MAX_PROGRAM_TEXTURE_GATHER_OFFSET", 
"CONTEXT_INT(Const.MaxProgramTextureGatherOffset), extra_ARB_texture_gather"],
-  [ "MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB", 
"CONTEXT_INT(Const.MaxProgramTextureGatherComponents), 
extra_ARB_texture_gather"],
-
 # GL_ARB_separate_shader_objects
   [ "PROGRAM_PIPELINE_BINDING", "LOC_CUSTOM, TYPE_INT, 
GL_PROGRAM_PIPELINE_BINDING, NO_EXTRA" ],
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4 6/6] mesa/es3.1: enable GL_ARB_explicit_uniform_location for GLES 3.1

2015-06-25 Thread Marta Lofstedt
From: Marta Lofstedt 

v4 : only expose GL_ARB_explicit_uniform_location enums
for gles 3.1 and desktop GL.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  | 6 ++
 src/mesa/main/get_hash_params.py | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index d085583..107ef51 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -385,6 +385,12 @@ static const int extra_ARB_compute_shader_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_explicit_uniform_location_es31[] = {
+   EXT(ARB_explicit_uniform_location),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index b402340..94eb5ac 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -450,6 +450,9 @@ descriptor=[
   [ "MAX_COMPUTE_SHARED_MEMORY_SIZE", "CONST(MAX_COMPUTE_SHARED_MEMORY_SIZE), 
extra_ARB_compute_shader_es31" ],
   [ "MAX_COMPUTE_UNIFORM_COMPONENTS", "CONST(MAX_COMPUTE_UNIFORM_COMPONENTS), 
extra_ARB_compute_shader_es31" ],
   [ "MAX_COMPUTE_IMAGE_UNIFORMS", "CONST(MAX_COMPUTE_IMAGE_UNIFORMS), 
extra_ARB_compute_shader_es31" ],
+
+# GL_ARB_explicit_uniform_location / GLES 3.1
+  [ "MAX_UNIFORM_LOCATIONS", 
"CONTEXT_INT(Const.MaxUserAssignableUniformLocations), 
extra_ARB_explicit_uniform_location_es31" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -541,7 +544,6 @@ descriptor=[
   [ "MAX_LIST_NESTING", "CONST(MAX_LIST_NESTING), NO_EXTRA" ],
   [ "MAX_NAME_STACK_DEPTH", "CONST(MAX_NAME_STACK_DEPTH), NO_EXTRA" ],
   [ "MAX_PIXEL_MAP_TABLE", "CONST(MAX_PIXEL_MAP_TABLE), NO_EXTRA" ],
-  [ "MAX_UNIFORM_LOCATIONS", 
"CONTEXT_INT(Const.MaxUserAssignableUniformLocations), 
extra_ARB_explicit_uniform_location" ],
   [ "NAME_STACK_DEPTH", "CONTEXT_INT(Select.NameStackDepth), NO_EXTRA" ],
   [ "PACK_LSB_FIRST", "CONTEXT_BOOL(Pack.LsbFirst), NO_EXTRA" ],
   [ "PACK_SWAP_BYTES", "CONTEXT_BOOL(Pack.SwapBytes), NO_EXTRA" ],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4 3/6] mesa/es3.1: enable GL_ARB_texture_multisample for GLES 3.1

2015-06-25 Thread Marta Lofstedt
From: Marta Lofstedt 

v4 : only expose GL_ARB_texture_multisample enums
for gles 3.1 and desktop GL.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 18 +-
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 4a0537d..6148349 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -367,6 +367,12 @@ static const int extra_ARB_shader_atomic_counters_es31[] = 
{
EXTRA_END
 };
 
+static const int extra_ARB_texture_multisample_es31[] = {
+   EXT(ARB_texture_multisample),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index e25dbe1..0026000 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -426,6 +426,15 @@ descriptor=[
   [ "MAX_FRAGMENT_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
   [ "MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicBuffers), 
extra_ARB_shader_atomic_counters_es31" ],
   [ "MAX_COMBINED_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicCounters), 
extra_ARB_shader_atomic_counters_es31" ],
+
+# GL_ARB_texture_multisample / GLES 3.1
+  [ "TEXTURE_BINDING_2D_MULTISAMPLE", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_2D_MULTISAMPLE_INDEX, extra_ARB_texture_multisample_es31" ],
+  [ "TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX, extra_ARB_texture_multisample_es31" ],
+  [ "MAX_COLOR_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxColorTextureSamples), 
extra_ARB_texture_multisample_es31" ],
+  [ "MAX_DEPTH_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxDepthTextureSamples), 
extra_ARB_texture_multisample_es31" ],
+  [ "MAX_INTEGER_SAMPLES", "CONTEXT_INT(Const.MaxIntegerSamples), 
extra_ARB_texture_multisample_es31" ],
+  [ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask), 
extra_ARB_texture_multisample_es31" ],
+  [ "MAX_SAMPLE_MASK_WORDS", "CONST(1), extra_ARB_texture_multisample_es31" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -717,15 +726,6 @@ descriptor=[
   [ "TEXTURE_BUFFER_FORMAT_ARB", "LOC_CUSTOM, TYPE_INT, 0, 
extra_texture_buffer_object" ],
   [ "TEXTURE_BUFFER_ARB", "LOC_CUSTOM, TYPE_INT, 0, 
extra_texture_buffer_object" ],
 
-# GL_ARB_texture_multisample / GL 3.2
-  [ "TEXTURE_BINDING_2D_MULTISAMPLE", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_2D_MULTISAMPLE_INDEX, extra_ARB_texture_multisample" ],
-  [ "TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY", "LOC_CUSTOM, TYPE_INT, 
TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX, extra_ARB_texture_multisample" ],
-  [ "MAX_COLOR_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxColorTextureSamples), 
extra_ARB_texture_multisample" ],
-  [ "MAX_DEPTH_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxDepthTextureSamples), 
extra_ARB_texture_multisample" ],
-  [ "MAX_INTEGER_SAMPLES", "CONTEXT_INT(Const.MaxIntegerSamples), 
extra_ARB_texture_multisample" ],
-  [ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask), 
extra_ARB_texture_multisample" ],
-  [ "MAX_SAMPLE_MASK_WORDS", "CONST(1), extra_ARB_texture_multisample" ],
-
 # GL 3.0
   [ "CONTEXT_FLAGS", "CONTEXT_INT(Const.ContextFlags), extra_version_30" ],
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4 1/6] mesa/es3.1: enable GL_ARB_shader_image_load_store for gles3.1

2015-06-25 Thread Marta Lofstedt
From: Marta Lofstedt 

v4: only expose enums from GL_ARB_shader_image_load_store
for gles 3.1 and desktop GL.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get.c  |  6 ++
 src/mesa/main/get_hash_params.py | 14 --
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 1bc9b5d..0ab6837 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -355,6 +355,12 @@ static const int extra_ARB_draw_indirect_es31[] = {
EXTRA_END
 };
 
+static const int extra_ARB_shader_image_load_store_es31[] = {
+   EXT(ARB_shader_image_load_store),
+   EXTRA_API_ES31,
+   EXTRA_END
+};
+
 EXTRA_EXT(ARB_texture_cube_map);
 EXTRA_EXT(EXT_texture_array);
 EXTRA_EXT(NV_fog_distance);
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 513d5d2..3eecc28 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -407,6 +407,14 @@ descriptor=[
 { "apis": ["GL", "GL_CORE", "GLES3"], "params": [
 # GL_ARB_sampler_objects / GL 3.3 / GLES 3.0
   [ "SAMPLER_BINDING", "LOC_CUSTOM, TYPE_INT, GL_SAMPLER_BINDING, NO_EXTRA" ],
+
+# GL_ARB_shader_image_load_store / GLES 3.1
+  [ "MAX_IMAGE_UNITS", "CONTEXT_INT(Const.MaxImageUnits), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS", 
"CONTEXT_INT(Const.MaxCombinedImageUnitsAndFragmentOutputs), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_IMAGE_SAMPLES", "CONTEXT_INT(Const.MaxImageSamples), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_VERTEX_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_FRAGMENT_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
+  [ "MAX_COMBINED_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.MaxCombinedImageUniforms), 
extra_ARB_shader_image_load_store_es31" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -781,13 +789,7 @@ descriptor=[
   [ "MAX_VERTEX_ATTRIB_BINDINGS", 
"CONTEXT_ENUM(Const.MaxVertexAttribBindings), NO_EXTRA" ],
 
 # GL_ARB_shader_image_load_store
-  [ "MAX_IMAGE_UNITS", "CONTEXT_INT(Const.MaxImageUnits), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS", 
"CONTEXT_INT(Const.MaxCombinedImageUnitsAndFragmentOutputs), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_IMAGE_SAMPLES", "CONTEXT_INT(Const.MaxImageSamples), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_VERTEX_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_VERTEX].MaxImageUniforms), 
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"],
-  [ "MAX_FRAGMENT_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.Program[MESA_SHADER_FRAGMENT].MaxImageUniforms), 
extra_ARB_shader_image_load_store"],
-  [ "MAX_COMBINED_IMAGE_UNIFORMS", 
"CONTEXT_INT(Const.MaxCombinedImageUniforms), 
extra_ARB_shader_image_load_store"],
 
 # GL_ARB_compute_shader
   [ "MAX_COMPUTE_WORK_GROUP_INVOCATIONS", 
"CONTEXT_INT(Const.MaxComputeWorkGroupInvocations), extra_ARB_compute_shader" ],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4 0/6] Continue enabling Open GL ES 3.1

2015-06-25 Thread Marta Lofstedt
This are for the V4s.

Marta Lofstedt (6):
  mesa/es3.1: enable GL_ARB_shader_image_load_store for gles3.1
  mesa/es3.1: enable GL_ARB_shader_atomic_counters for GLES 3.1
  mesa/es3.1: enable GL_ARB_texture_multisample for GLES 3.1
  mesa/es3.1: enable GL_ARB_texture_gather for GLES 3.1
  mesa/es3.1: enable GL_ARB_compute_shader for GLES 3.1
  mesa/es3.1: enable GL_ARB_explicit_uniform_location for GLES 3.1

 src/mesa/main/get.c  | 36 +
 src/mesa/main/get_hash_params.py | 86 +---
 2 files changed, 82 insertions(+), 40 deletions(-)

-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] mesa/es3.1: Fix error code for glCreateShaderProgram

2015-06-23 Thread Marta Lofstedt
From: Marta Lofstedt 

According to the OpenGL ES standard, 7.3.
For a call to glCreateShaderProgram with count < 0,
a GL_INVALID_VALUE error should be generated.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/shaderapi.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index c783c69..266064d 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1890,6 +1890,15 @@ _mesa_create_shader_program(struct gl_context* ctx, 
GLboolean separate,
const GLuint shader = create_shader(ctx, type);
GLuint program = 0;
 
+   /*
+* According to OpenGL ES 3.1 standard 7.3: GL_INVALID_VALUE
+* should be generated, if count < 0.
+*/
+   if (_mesa_is_gles31(ctx) && count < 0) {
+  _mesa_error(ctx, GL_INVALID_VALUE, "glCreateShaderProgram (count < 0)");
+  return program;
+   }
+
if (shader) {
   _mesa_ShaderSource(shader, count, strings, NULL);
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 6/6] mesa/es3.1: Fix error code for glCreateShaderProgram

2015-06-23 Thread Marta Lofstedt
From: Marta Lofstedt 

According to the OpenGL ES standard, 7.3.
For a call to glCreateShaderProgram with count < 0,
a GL_INVALID_VALUE error should be generated.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/shaderapi.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index c783c69..266064d 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1890,6 +1890,15 @@ _mesa_create_shader_program(struct gl_context* ctx, 
GLboolean separate,
const GLuint shader = create_shader(ctx, type);
GLuint program = 0;
 
+   /*
+* According to OpenGL ES 3.1 standard 7.3: GL_INVALID_VALUE
+* should be generated, if count < 0.
+*/
+   if (_mesa_is_gles31(ctx) && count < 0) {
+  _mesa_error(ctx, GL_INVALID_VALUE, "glCreateShaderProgram (count < 0)");
+  return program;
+   }
+
if (shader) {
   _mesa_ShaderSource(shader, count, strings, NULL);
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/6] mesa/es3.1 : Correct error code for defect texture target

2015-06-23 Thread Marta Lofstedt
From: Marta Lofstedt 

According to GLES 3.1 CTS test:
ES31-CTS.texture_storage_multisample.
APIGLGetTexLevelParameterifv.
invalid_texture_target_rejected:

GL_INVALID_ENUM should be generated when
glGetTexLevelParameteriv is called with a defect
texture target.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/texobj.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index c563f1e..c239deb 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -222,6 +222,17 @@ _mesa_get_current_tex_object(struct gl_context *ctx, 
GLenum target)
  return ctx->Extensions.ARB_texture_multisample
 ? ctx->Texture.ProxyTex[TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX] : NULL;
   default:
+ if(_mesa_is_gles31(ctx))
+ {
+/*
+ * According to OpenGL ES 3.1 CTS:
+ * 
ES31-CTS.texture_storage_multisample.APIGLGetTexLevelParameterifv.
+ * invalid_value_argument_rejected
+ * 
es31cTextureStorageMultisampleGetTexLevelParameterifvTests.cpp:1277
+ * INVALID_ENUM should be reported for bad targets.
+ */
+_mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", __func__);
+ }
  _mesa_problem(NULL, "bad target in _mesa_get_current_tex_object()");
  return NULL;
}
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 5/6] mesa/es31: AtomicBufferBindings should be initialized to zero.

2015-06-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Accoring to GLES 3.1 CTS:
GLES 3.1 CTS: ES31-CTS.shader_atomic_counters.
basic-buffer-bind.

AtomicBufferBindings size and start should be initialized
to zero.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/bufferobj.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 66dee68..94629b3 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -849,9 +849,14 @@ _mesa_init_buffer_objects( struct gl_context *ctx )
   _mesa_reference_buffer_object(ctx,
&ctx->AtomicBufferBindings[i].BufferObject,
ctx->Shared->NullBufferObj);
-  ctx->AtomicBufferBindings[i].Offset = -1;
-  ctx->AtomicBufferBindings[i].Size = -1;
-   }
+  if (_mesa_is_gles31(ctx)) {
+ ctx->AtomicBufferBindings[i].Offset = 0;
+ ctx->AtomicBufferBindings[i].Size = 0;
+  }
+  else {
+ ctx->AtomicBufferBindings[i].Offset = -1;
+ ctx->AtomicBufferBindings[i].Size = -1;
+  }
 }
 
 
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/6] mesa/es3.1: Correct error code for illegal internal formats

2015-06-23 Thread Marta Lofstedt
From: Marta Lofstedt 

According to GLES 3.1 CTS test:
ES31-CTS.texture_storage_multisample.
APIGLTexStorage2DMultisample.
multisample_texture_tex_storage_2d_non_color_depth_or_stencil_
internal_formats_receted.

An illegal internal format should generate a
GL_INVALID_ENUM error.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/teximage.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index c76ad54..14af9cd 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -5617,6 +5617,14 @@ _mesa_texture_image_multisample(struct gl_context *ctx, 
GLuint dims,
}
 
if (!is_renderable_texture_format(ctx, internalformat)) {
+  /* Accroding to OpenGL ES CTS, internal format error,
+   * should generate GL_INVALID_ENUM.
+   */
+  if(_mesa_is_gles31(ctx))
+   _mesa_error(ctx, GL_INVALID_ENUM,
+"%s(internalformat=%s)",
+func, _mesa_lookup_enum_by_nr(internalformat));
+  else
   _mesa_error(ctx, GL_INVALID_OPERATION,
 "%s(internalformat=%s)",
 func, _mesa_lookup_enum_by_nr(internalformat));
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/6] mesa/es3.1 : Correct error code for zero samples

2015-06-23 Thread Marta Lofstedt
From: Marta Lofstedt 

According to GLES 3.1 CTS test:
ES31-CTS.texture_storage_multisample.
APIGLTexStorage2DMultisample.
multisample_texture_tex_storage_2d_zero_sample-

A call to glTexStorageMultisample with target
GL_TEXTURE_2D_MULTISAMPLE and zero samples,
should return GL_INVALID_VALUE.

However, with above the piglit test:
gl-3.2-layered-rendering-framebuffertexture fails.
Hence, only limit this for GLES 3.1 contexts.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/teximage.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 14af9cd..98f0223 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -5588,6 +5588,16 @@ _mesa_texture_image_multisample(struct gl_context *ctx, 
GLuint dims,
GLenum sample_count_error;
bool dsa = strstr(func, "ture") ? true : false;
 
+   /*
+*  According to OpenGL ES 3.1 CTS zero samples
+*  should generate GL_INVALID_VALUE
+*/
+   if(samples == 0 && _mesa_is_gles31(ctx))
+   {
+  _mesa_error(ctx, GL_INVALID_VALUE, "%s(target)", func);
+  return;
+   }
+
if (!(ctx->Extensions.ARB_texture_multisample
   && _mesa_is_desktop_gl(ctx))) {
   _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/6] mesa/es3.1: Do not allow zero size multisampled textures

2015-06-23 Thread Marta Lofstedt
From: Marta Lofstedt 

According to GLES 3.1 CTS test:
ES31-CTS.texture_storage_multisample.
APIGLTexStorage2DMultisample.
multisample_texture_tex_storage_2d_
invalid_and_border_case_texture_sizes.

Textures of size 0x0 are not allowed for
GL_TEXTURE_2D_MULTISAMPLE.

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/teximage.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 3d85615..c76ad54 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1483,6 +1483,13 @@ _mesa_legal_texture_dimensions(struct gl_context *ctx, 
GLenum target,
  if (height > 0 && !_mesa_is_pow_two(height - 2 * border))
 return GL_FALSE;
   }
+  /*
+  *  according to GLES 3.1 CTS it is not OK with
+  *  zero size multisampled textures
+  */
+  if (width == 0 && height == 0 && GL_TEXTURE_2D_MULTISAMPLE == target)
+ return GL_FALSE;
+
   return GL_TRUE;
 
case GL_TEXTURE_3D:
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 0/6] OpenGL ES 3.1 API checks and corner cases.

2015-06-23 Thread Marta Lofstedt
This is a series of patches that solves a couple of
API check and corner cases issues that the OpenGL ES 3.1
CTS exploits.

Marta Lofstedt (6):
  mesa/es3.1: Do not allow zero size multisampled textures
  mesa/es3.1: Correct error code for illegal internal formats
  mesa/es3.1 : Correct error code for zero samples
  mesa/es3.1 : Correct error code for defect texture target
  mesa/es31: AtomicBufferBindings should be initialized to zero.
  mesa/es3.1: Fix error code for glCreateShaderProgram

 src/mesa/main/bufferobj.c | 11 ---
 src/mesa/main/shaderapi.c |  9 +
 src/mesa/main/teximage.c  | 25 +
 src/mesa/main/texobj.c| 11 +++
 4 files changed, 53 insertions(+), 3 deletions(-)

-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa/es3.1: Enable GL_ARB_separate_shader_objects for GLES 3.1

2015-06-23 Thread Marta Lofstedt
From: Marta Lofstedt 

Signed-off-by: Marta Lofstedt 
---
 src/mesa/main/get_hash_params.py | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 74ff3ba..f7134a9 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -407,6 +407,10 @@ descriptor=[
 { "apis": ["GL", "GL_CORE", "GLES3"], "params": [
 # GL_ARB_sampler_objects / GL 3.3 / GLES 3.0
   [ "SAMPLER_BINDING", "LOC_CUSTOM, TYPE_INT, GL_SAMPLER_BINDING, NO_EXTRA" ],
+
+# GL_ARB_vertex_attrib_binding / GLES 3.1
+  [ "MAX_VERTEX_ATTRIB_RELATIVE_OFFSET", 
"CONTEXT_ENUM(Const.MaxVertexAttribRelativeOffset), NO_EXTRA" ],
+  [ "MAX_VERTEX_ATTRIB_BINDINGS", 
"CONTEXT_ENUM(Const.MaxVertexAttribBindings), NO_EXTRA" ],
 ]},
 
 # Enums in OpenGL Core profile and ES 3.1
@@ -776,10 +780,6 @@ descriptor=[
   [ "MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicBuffers), extra_ARB_shader_atomic_counters" 
],
   [ "MAX_COMBINED_ATOMIC_COUNTERS", 
"CONTEXT_INT(Const.MaxCombinedAtomicCounters), 
extra_ARB_shader_atomic_counters" ],
 
-# GL_ARB_vertex_attrib_binding
-  [ "MAX_VERTEX_ATTRIB_RELATIVE_OFFSET", 
"CONTEXT_ENUM(Const.MaxVertexAttribRelativeOffset), NO_EXTRA" ],
-  [ "MAX_VERTEX_ATTRIB_BINDINGS", 
"CONTEXT_ENUM(Const.MaxVertexAttribBindings), NO_EXTRA" ],
-
 # GL_ARB_shader_image_load_store
   [ "MAX_IMAGE_UNITS", "CONTEXT_INT(Const.MaxImageUnits), 
extra_ARB_shader_image_load_store"],
   [ "MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS", 
"CONTEXT_INT(Const.MaxCombinedImageUnitsAndFragmentOutputs), 
extra_ARB_shader_image_load_store"],
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


  1   2   >