Mesa (master): st/mesa: turn on OES_viewport_array when dependencies are met

2016-09-22 Thread Ilia Mirkin
Module: Mesa
Branch: master
Commit: c0a7e931e36e7d8a244da5947ec6de023b58b0a5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c0a7e931e36e7d8a244da5947ec6de023b58b0a5

Author: Ilia Mirkin 
Date:   Fri Sep 16 15:43:31 2016 -0400

st/mesa: turn on OES_viewport_array when dependencies are met

Signed-off-by: Ilia Mirkin 

---

 docs/features.txt  | 2 +-
 docs/relnotes/12.1.0.html  | 1 +
 src/mesa/state_tracker/st_extensions.c | 5 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/docs/features.txt b/docs/features.txt
index cb62286..fbb3952 100644
--- a/docs/features.txt
+++ b/docs/features.txt
@@ -319,7 +319,7 @@ Khronos, ARB, and OES extensions that are not part of any 
OpenGL or OpenGL ES ve
   GL_OES_texture_half_float DONE (i965, r300, 
r600, radeonsi, nv30, nv50, nvc0, softpipe, llvmpipe)
   GL_OES_texture_half_float_linear  DONE (i965, r300, 
r600, radeonsi, nv30, nv50, nvc0, softpipe, llvmpipe)
   GL_OES_texture_view   not started - based on 
GL_ARB_texture_view
-  GL_OES_viewport_array not started - based on 
GL_ARB_viewport_array and GL_ARB_fragment_layer_viewport
+  GL_OES_viewport_array DONE (nvc0, radeonsi)
   GLX_ARB_context_flush_control not started
   GLX_ARB_robustness_application_isolation  not started
   GLX_ARB_robustness_share_group_isolation  not started
diff --git a/docs/relnotes/12.1.0.html b/docs/relnotes/12.1.0.html
index fb1d714..cdd8909 100644
--- a/docs/relnotes/12.1.0.html
+++ b/docs/relnotes/12.1.0.html
@@ -65,6 +65,7 @@ Note: some of the new features are only available with 
certain drivers.
 GL_OES_primitive_bounding_box on i965/gen7+, nvc0, radeonsi
 GL_OES_texture_cube_map_array on i965/gen8+, nvc0, radeonsi
 GL_OES_tessellation_shader on i965/gen7+, nvc0, radeonsi
+GL_OES_viewport_array on nvc0, radeonsi
 GL_ANDROID_extension_pack_es31a on i965/gen9+
 
 
diff --git a/src/mesa/state_tracker/st_extensions.c 
b/src/mesa/state_tracker/st_extensions.c
index 807fbfb..ef17aba 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -1226,6 +1226,11 @@ void st_init_extensions(struct pipe_screen *screen,
   extensions->OES_geometry_shader &&
   extensions->ARB_texture_cube_map_array;
 
+   extensions->OES_viewport_array =
+  extensions->ARB_ES3_1_compatibility &&
+  extensions->OES_geometry_shader &&
+  extensions->ARB_viewport_array;
+
extensions->OES_primitive_bounding_box = 
extensions->ARB_ES3_1_compatibility;
consts->NoPrimitiveBoundingBoxOutput = true;
 }

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: move ARB_viewport_array params to a GLES 3.1-accessible section

2016-09-22 Thread Ilia Mirkin
Module: Mesa
Branch: master
Commit: 381b15dc20a42edd1125a5a47423a71d89064f7a
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=381b15dc20a42edd1125a5a47423a71d89064f7a

Author: Ilia Mirkin 
Date:   Fri Sep 16 13:43:30 2016 -0400

mesa: move ARB_viewport_array params to a GLES 3.1-accessible section

This is needed for GL_OES_viewport_array.

Signed-off-by: Ilia Mirkin 
Reviewed-by: Anuj Phogat 

---

 src/mesa/main/get_hash_params.py | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index b2aef7b..f65960a 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -613,6 +613,12 @@ descriptor=[
 
 # GL_OES_primitive_bounding_box
   [ "PRIMITIVE_BOUNDING_BOX_ARB", "CONTEXT_FLOAT8(PrimitiveBoundingBox), 
extra_OES_primitive_bounding_box" ],
+
+# GL_ARB_viewport_array / GL_OES_viewport_array
+  [ "MAX_VIEWPORTS", "CONTEXT_INT(Const.MaxViewports), 
extra_ARB_viewport_array" ],
+  [ "VIEWPORT_SUBPIXEL_BITS", "CONTEXT_INT(Const.ViewportSubpixelBits), 
extra_ARB_viewport_array" ],
+  [ "VIEWPORT_BOUNDS_RANGE", "CONTEXT_FLOAT2(Const.ViewportBounds), 
extra_ARB_viewport_array" ],
+  [ "VIEWPORT_INDEX_PROVOKING_VERTEX", 
"CONTEXT_ENUM(Const.LayerAndVPIndexProvokingVertex), extra_ARB_viewport_array" 
],
 ]},
 
 { "apis": ["GL_CORE", "GLES32"], "params": [
@@ -940,12 +946,6 @@ descriptor=[
 
 # Enums restricted to OpenGL Core profile
 { "apis": ["GL_CORE"], "params": [
-# GL_ARB_viewport_array
-  [ "MAX_VIEWPORTS", "CONTEXT_INT(Const.MaxViewports), 
extra_ARB_viewport_array" ],
-  [ "VIEWPORT_SUBPIXEL_BITS", "CONTEXT_INT(Const.ViewportSubpixelBits), 
extra_ARB_viewport_array" ],
-  [ "VIEWPORT_BOUNDS_RANGE", "CONTEXT_FLOAT2(Const.ViewportBounds), 
extra_ARB_viewport_array" ],
-  [ "VIEWPORT_INDEX_PROVOKING_VERTEX", 
"CONTEXT_ENUM(Const.LayerAndVPIndexProvokingVertex), extra_ARB_viewport_array" 
],
-
 # GL_ARB_shader_subroutine
   [ "MAX_SUBROUTINES", "CONST(MAX_SUBROUTINES), extra_ARB_shader_subroutine" ],
   [ "MAX_SUBROUTINE_UNIFORM_LOCATIONS", 
"CONST(MAX_SUBROUTINE_UNIFORM_LOCATIONS), extra_ARB_shader_subroutine" ],

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: add new entrypoints for GL_OES_viewport_array

2016-09-22 Thread Ilia Mirkin
Module: Mesa
Branch: master
Commit: 411a72d4a2eb69e45701c5e19049f6c543a78f24
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=411a72d4a2eb69e45701c5e19049f6c543a78f24

Author: Ilia Mirkin 
Date:   Fri Sep 16 13:38:36 2016 -0400

mesa: add new entrypoints for GL_OES_viewport_array

Signed-off-by: Ilia Mirkin 
Reviewed-by: Anuj Phogat 

---

 src/mapi/glapi/gen/apiexec.py   | 12 
 src/mapi/glapi/gen/es_EXT.xml   | 50 +
 src/mesa/main/tests/dispatch_sanity.cpp | 11 
 src/mesa/main/viewport.c| 12 
 src/mesa/main/viewport.h|  6 
 5 files changed, 85 insertions(+), 6 deletions(-)

diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py
index b4f4cf6..4bdc95d 100644
--- a/src/mapi/glapi/gen/apiexec.py
+++ b/src/mapi/glapi/gen/apiexec.py
@@ -133,12 +133,12 @@ functions = {
 #
 # Mesa does not support either of the geometry shader extensions, so
 # OpenGL 3.2 is required.
-"ViewportArrayv": exec_info(core=32),
-"ViewportIndexedf": exec_info(core=32),
-"ViewportIndexedfv": exec_info(core=32),
-"ScissorArrayv": exec_info(core=32),
-"ScissorIndexed": exec_info(core=32),
-"ScissorIndexedv": exec_info(core=32),
+"ViewportArrayv": exec_info(core=32, es2=31),
+"ViewportIndexedf": exec_info(core=32, es2=31),
+"ViewportIndexedfv": exec_info(core=32, es2=31),
+"ScissorArrayv": exec_info(core=32, es2=31),
+"ScissorIndexed": exec_info(core=32, es2=31),
+"ScissorIndexedv": exec_info(core=32, es2=31),
 "DepthRangeArrayv": exec_info(core=32),
 "DepthRangeIndexed": exec_info(core=32),
 # GetFloati_v also GL_ARB_shader_atomic_counters
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 332dc5e..3e705eb 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -1342,4 +1342,54 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index c87b1dc..0d3b6ab 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2613,5 +2613,16 @@ const struct function gles31_functions_possible[] = {
/* GL_OES_primitive_bound_box */
{ "glPrimitiveBoundingBoxOES", 31, -1 },
 
+   /* GL_OES_viewport_array */
+   { "glViewportArrayvOES", 31, -1 },
+   { "glViewportIndexedfOES", 31, -1 },
+   { "glViewportIndexedfvOES", 31, -1 },
+   { "glScissorArrayvOES", 31, -1 },
+   { "glScissorIndexedOES", 31, -1 },
+   { "glScissorIndexedvOES", 31, -1 },
+   { "glDepthRangeArrayfvOES", 31, -1 },
+   { "glDepthRangeIndexedfOES", 31, -1 },
+   { "glGetFloati_vOES", 31, -1 },
+
{ NULL, 0, -1 },
  };
diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
index 681e46b..f6eaa0f 100644
--- a/src/mesa/main/viewport.c
+++ b/src/mesa/main/viewport.c
@@ -330,6 +330,12 @@ _mesa_DepthRangeArrayv(GLuint first, GLsizei count, const 
GLclampd *v)
   ctx->Driver.DepthRange(ctx);
 }
 
+void GLAPIENTRY
+_mesa_DepthRangeArrayfvOES(GLuint first, GLsizei count, const GLfloat *v)
+{
+
+}
+
 /**
  * Update a single DepthRange
  *
@@ -358,6 +364,12 @@ _mesa_DepthRangeIndexed(GLuint index, GLclampd nearval, 
GLclampd farval)
_mesa_set_depth_range(ctx, index, nearval, farval);
 }
 
+void GLAPIENTRY
+_mesa_DepthRangeIndexedfOES(GLuint index, GLfloat nearval, GLfloat farval)
+{
+
+}
+
 /** 
  * Initialize the context viewport attribute group.
  * \param ctx  the GL context.
diff --git a/src/mesa/main/viewport.h b/src/mesa/main/viewport.h
index b0675db..3951319 100644
--- a/src/mesa/main/viewport.h
+++ b/src/mesa/main/viewport.h
@@ -58,8 +58,14 @@ extern void GLAPIENTRY
 _mesa_DepthRangeArrayv(GLuint first, GLsizei count, const GLclampd * v);
 
 extern void GLAPIENTRY
+_mesa_DepthRangeArrayfvOES(GLuint first, GLsizei count, const GLfloat * v);
+
+extern void GLAPIENTRY
 _mesa_DepthRangeIndexed(GLuint index, GLclampd n, GLclampd f);
 
+extern void GLAPIENTRY
+_mesa_DepthRangeIndexedfOES(GLuint index, GLfloat n, GLfloat f);
+
 extern void
 _mesa_set_depth_range(struct gl_context *ctx, unsigned idx,
   GLclampd nearval, GLclampd farval);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): glsl: add OES_viewport_array enables and use them to expose gl_ViewportIndex

2016-09-22 Thread Ilia Mirkin
Module: Mesa
Branch: master
Commit: 70aef97f9e22323200eb8d1a02a9b35f4f4d5fe8
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=70aef97f9e22323200eb8d1a02a9b35f4f4d5fe8

Author: Ilia Mirkin 
Date:   Fri Sep 16 13:59:27 2016 -0400

glsl: add OES_viewport_array enables and use them to expose gl_ViewportIndex

Signed-off-by: Ilia Mirkin 
Reviewed-by: Anuj Phogat 

---

 src/compiler/glsl/builtin_variables.cpp | 9 ++---
 src/compiler/glsl/glsl_parser_extras.h  | 2 ++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl/builtin_variables.cpp 
b/src/compiler/glsl/builtin_variables.cpp
index b66ad00..36a8667 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -876,7 +876,8 @@ builtin_variable_generator::generate_constants()
}
 
if (state->is_version(410, 0) ||
-   state->ARB_viewport_array_enable)
+   state->ARB_viewport_array_enable ||
+   state->OES_viewport_array_enable)
   add_const("gl_MaxViewports", state->Const.MaxViewports);
 
if (state->has_tessellation_shader()) {
@@ -1096,7 +1097,8 @@ builtin_variable_generator::generate_gs_special_vars()
 
var = add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer");
var->data.interpolation = INTERP_MODE_FLAT;
-   if (state->is_version(410, 0) || state->ARB_viewport_array_enable) {
+   if (state->is_version(410, 0) || state->ARB_viewport_array_enable ||
+   state->OES_viewport_array_enable) {
   var = add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
   var->data.interpolation = INTERP_MODE_FLAT;
}
@@ -1226,7 +1228,8 @@ builtin_variable_generator::generate_fs_special_vars()
}
 
if (state->is_version(430, 0) ||
-   state->ARB_fragment_layer_viewport_enable) {
+   state->ARB_fragment_layer_viewport_enable ||
+   state->OES_viewport_array_enable) {
   var = add_input(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
   var->data.interpolation = INTERP_MODE_FLAT;
}
diff --git a/src/compiler/glsl/glsl_parser_extras.h 
b/src/compiler/glsl/glsl_parser_extras.h
index e19f6ad..f4050e3 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -698,6 +698,8 @@ struct _mesa_glsl_parse_state {
bool OES_texture_cube_map_array_warn;
bool OES_texture_storage_multisample_2d_array_enable;
bool OES_texture_storage_multisample_2d_array_warn;
+   bool OES_viewport_array_enable;
+   bool OES_viewport_array_warn;
 
/* All other extensions go here, sorted alphabetically.
 */

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: add implementations for new float depth functions

2016-09-22 Thread Ilia Mirkin
Module: Mesa
Branch: master
Commit: 0f01aa803332760079bde36218a3e884f2613db6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f01aa803332760079bde36218a3e884f2613db6

Author: Ilia Mirkin 
Date:   Fri Sep 16 13:52:18 2016 -0400

mesa: add implementations for new float depth functions

This just up-converts them to doubles. Not great, but this is what all
the other variants also do.

Signed-off-by: Ilia Mirkin 
Reviewed-by: Anuj Phogat 

---

 src/mesa/main/viewport.c | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
index f6eaa0f..f59723f 100644
--- a/src/mesa/main/viewport.c
+++ b/src/mesa/main/viewport.c
@@ -333,7 +333,24 @@ _mesa_DepthRangeArrayv(GLuint first, GLsizei count, const 
GLclampd *v)
 void GLAPIENTRY
 _mesa_DepthRangeArrayfvOES(GLuint first, GLsizei count, const GLfloat *v)
 {
+   int i;
+   GET_CURRENT_CONTEXT(ctx);
+
+   if (MESA_VERBOSE & VERBOSE_API)
+  _mesa_debug(ctx, "glDepthRangeArrayfv %d %d\n", first, count);
 
+   if ((first + count) > ctx->Const.MaxViewports) {
+  _mesa_error(ctx, GL_INVALID_VALUE,
+  "glDepthRangeArrayfv: first (%d) + count (%d) >= 
MaxViewports (%d)",
+  first, count, ctx->Const.MaxViewports);
+  return;
+   }
+
+   for (i = 0; i < count; i++)
+  set_depth_range_no_notify(ctx, i + first, v[i * 2], v[i * 2 + 1]);
+
+   if (ctx->Driver.DepthRange)
+  ctx->Driver.DepthRange(ctx);
 }
 
 /**
@@ -367,7 +384,7 @@ _mesa_DepthRangeIndexed(GLuint index, GLclampd nearval, 
GLclampd farval)
 void GLAPIENTRY
 _mesa_DepthRangeIndexedfOES(GLuint index, GLfloat nearval, GLfloat farval)
 {
-
+   _mesa_DepthRangeIndexed(index, nearval, farval);
 }
 
 /** 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mesa: add GL_OES_viewport_array to the extension string

2016-09-22 Thread Ilia Mirkin
Module: Mesa
Branch: master
Commit: 5644a90801795a4da2042d712e5d6c4a69cc3e0d
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5644a90801795a4da2042d712e5d6c4a69cc3e0d

Author: Ilia Mirkin 
Date:   Fri Sep 16 13:53:03 2016 -0400

mesa: add GL_OES_viewport_array to the extension string

The expectation is that drivers will set this based on
OES_geometry_shader and ARB_viewport_array support. This is a separate
enable on the same reasoning as for OES_texture_cube_map_array.

Signed-off-by: Ilia Mirkin 
Reviewed-by: Anuj Phogat 

---

 src/compiler/glsl/glsl_parser_extras.cpp | 1 +
 src/mesa/main/extensions_table.h | 1 +
 src/mesa/main/mtypes.h   | 1 +
 3 files changed, 3 insertions(+)

diff --git a/src/compiler/glsl/glsl_parser_extras.cpp 
b/src/compiler/glsl/glsl_parser_extras.cpp
index 84d923f..b108afd 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -654,6 +654,7 @@ static const _mesa_glsl_extension 
_mesa_glsl_supported_extensions[] = {
EXT(OES_texture_buffer),
EXT(OES_texture_cube_map_array),
EXT_AEP(OES_texture_storage_multisample_2d_array),
+   EXT(OES_viewport_array),
 
/* All other extensions go here, sorted alphabetically.
 */
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index c40dd79..e7669bb 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -390,6 +390,7 @@ EXT(OES_texture_npot, 
ARB_texture_non_power_of_two
 EXT(OES_texture_stencil8, ARB_texture_stencil8 
  ,  x ,  x ,  x ,  30, 2014)
 EXT(OES_texture_storage_multisample_2d_array, ARB_texture_multisample  
  ,  x ,  x ,  x ,  31, 2014)
 EXT(OES_vertex_array_object , dummy_true   
  ,  x ,  x , ES1, ES2, 2010)
+EXT(OES_viewport_array  , OES_viewport_array   
  ,  x ,  x ,  x ,  31, 2010)
 
 EXT(S3_s3tc , ANGLE_texture_compression_dxt
  , GLL, GLC,  x ,  x , 1999)
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index d82b8ce..85aeb1e 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3952,6 +3952,7 @@ struct gl_extensions
GLboolean OES_standard_derivatives;
GLboolean OES_texture_buffer;
GLboolean OES_texture_cube_map_array;
+   GLboolean OES_viewport_array;
/* vendor extensions */
GLboolean AMD_performance_monitor;
GLboolean AMD_pinned_memory;

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mapi: export all GLES 3.2 functions in libGLESv2.so

2016-09-22 Thread Dylan Baker
Module: Mesa
Branch: master
Commit: e66a2b879b73bf48800fec7353dafe8fc693ecdb
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e66a2b879b73bf48800fec7353dafe8fc693ecdb

Author: Dylan Baker 
Date:   Thu Sep 22 11:30:42 2016 -0700

mapi: export all GLES 3.2 functions in libGLESv2.so

See commit 5921f372c89a68fac6ddefc009442721d9df4db2 for the rational of
this commit.

Signed-off-by: Dylan Baker 
Reviewed-by: Ilia Mirkin 
Reviewed-by: Kenneth Graunke 

---

 src/mapi/glapi/gen/static_data.py | 12 
 1 file changed, 12 insertions(+)

diff --git a/src/mapi/glapi/gen/static_data.py 
b/src/mapi/glapi/gen/static_data.py
index 2f403e9..25e78bf 100644
--- a/src/mapi/glapi/gen/static_data.py
+++ b/src/mapi/glapi/gen/static_data.py
@@ -484,17 +484,22 @@ functions = [
 "BindVertexBuffer",
 "BindVertexBuffers",
 "Bitmap",
+"BlendBarrier",
 "BlendColor",
 "BlendColorEXT",
 "BlendEquation",
 "BlendEquationEXT",
+"BlendEquationi",
 "BlendEquationiARB",
 "BlendEquationSeparate",
+"BlendEquationSeparatei",
 "BlendEquationSeparateiARB",
 "BlendFunc",
+"BlendFunci",
 "BlendFunciARB",
 "BlendFuncSeparate",
 "BlendFuncSeparateEXT",
+"BlendFuncSeparatei",
 "BlendFuncSeparateiARB",
 "BlitFramebuffer",
 "BufferData",
@@ -825,6 +830,7 @@ functions = [
 "GetFramebufferAttachmentParameteriv",
 "GetFramebufferAttachmentParameterivEXT",
 "GetFramebufferParameteriv",
+"GetGraphicsResetStatus",
 "GetGraphicsResetStatusARB",
 "GetHandleARB",
 "GetHistogram",
@@ -864,8 +870,11 @@ functions = [
 "GetnSeparableFilterARB",
 "GetnTexImageARB",
 "GetnUniformdvARB",
+"GetnUniformfv",
 "GetnUniformfvARB",
+"GetnUniformiv",
 "GetnUniformivARB",
+"GetnUniformuiv",
 "GetnUniformuivARB",
 "GetObjectLabel",
 "GetObjectParameterfvARB",
@@ -1160,6 +1169,7 @@ functions = [
 "Orthof",
 "Orthox",
 "PassThrough",
+"PatchParameteri",
 "PauseTransformFeedback",
 "PixelMapfv",
 "PixelMapuiv",
@@ -1191,6 +1201,7 @@ functions = [
 "PopDebugGroup",
 "PopMatrix",
 "PopName",
+"PrimitiveBoundingBox",
 "PrimitiveRestartIndex",
 "PrimitiveRestartIndexNV",
 "PrimitiveRestartNV",
@@ -1273,6 +1284,7 @@ functions = [
 "RasterPos4s",
 "RasterPos4sv",
 "ReadBuffer",
+"ReadnPixels",
 "ReadnPixelsARB",
 "ReadPixels",
 "Rectd",

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mapi: sort static_data.py functions

2016-09-22 Thread Dylan Baker
Module: Mesa
Branch: master
Commit: ce83e36ec0f045cca618fc83d34e8c68f1f1a1c2
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ce83e36ec0f045cca618fc83d34e8c68f1f1a1c2

Author: Dylan Baker 
Date:   Thu Sep 22 11:38:28 2016 -0700

mapi: sort static_data.py functions

Sorted by vim's builtin "sort i" (keeping the sorting case insensitive)

v2:
 - uses case insensitive sorting (Ken)

Signed-off-by: Dylan Baker 
Acked-by: Ilia Mirkin  (v1)
Reviewed-by: Kenneth Graunke 

---

 src/mapi/glapi/gen/static_data.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/static_data.py 
b/src/mapi/glapi/gen/static_data.py
index 396f941..2f403e9 100644
--- a/src/mapi/glapi/gen/static_data.py
+++ b/src/mapi/glapi/gen/static_data.py
@@ -790,8 +790,8 @@ functions = [
 "GetAttachedShaders",
 "GetAttribLocation",
 "GetAttribLocationARB",
-"GetBooleanIndexedvEXT",
 "GetBooleani_v",
+"GetBooleanIndexedvEXT",
 "GetBooleanv",
 "GetBufferParameteri64v",
 "GetBufferParameteriv",
@@ -833,8 +833,8 @@ functions = [
 "GetInfoLogARB",
 "GetInteger64i_v",
 "GetInteger64v",
-"GetIntegerIndexedvEXT",
 "GetIntegeri_v",
+"GetIntegerIndexedvEXT",
 "GetIntegerv",
 "GetLightfv",
 "GetLightiv",

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): mapi: retab static_data.py to be consistent

2016-09-22 Thread Dylan Baker
Module: Mesa
Branch: master
Commit: 2fd51cf8ca4d1baedf8c830663f238e0286e4b97
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2fd51cf8ca4d1baedf8c830663f238e0286e4b97

Author: Dylan Baker 
Date:   Thu Sep 22 10:58:45 2016 -0700

mapi: retab static_data.py to be consistent

This file currently uses a mixture of 3 and 4 space indent. I have
changed it all to 4 space indent, matching the settings in
$ROOT/.editorconfig.

This was generated with sed:
sed -i -e 's@^   "@"@g'

Signed-off-by: Dylan Baker 
Acked-by: Ilia Mirkin 
Reviewed-by: Kenneth Graunke 

---

 src/mapi/glapi/gen/static_data.py | 2570 ++---
 1 file changed, 1285 insertions(+), 1285 deletions(-)

Diff:   
http://cgit.freedesktop.org/mesa/mesa/diff/?id=2fd51cf8ca4d1baedf8c830663f238e0286e4b97
___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): nir: Allow opt_peephole_sel to be more aggressive in flattening IFs.

2016-09-22 Thread Eric Anholt
Module: Mesa
Branch: master
Commit: 36f0f0318275f65f8744ec6f9471702e2f58e6d5
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=36f0f0318275f65f8744ec6f9471702e2f58e6d5

Author: Eric Anholt 
Date:   Tue Sep  6 19:45:51 2016 -0700

nir: Allow opt_peephole_sel to be more aggressive in flattening IFs.

VC4 was running into a major performance regression from enabling control
flow in the glmark2 conditionals test, because of short if statements
containing an ffract.

This pass seems like it was was trying to ensure that we only flattened
IFs that should be entirely a win by guaranteeing that there would be
fewer bcsels than there were MOVs otherwise.  However, if the number of
ALU ops is small, we can avoid the overhead of branching (which itself
costs cycles) and still get a win, even if it means moving real
instructions out of the THEN/ELSE blocks.

For now, just turn on aggressive flattening on vc4.  i965 will need some
tuning to avoid regressions.  It does looks like this may be useful to
replace freedreno code.

Improves glmark2 -b conditionals:fragment-steps=5:vertex-steps=0 from 47
fps to 95 fps on vc4.

vc4 shader-db:
total instructions in shared programs: 101282 -> 99543 (-1.72%)
instructions in affected programs: 17365 -> 15626 (-10.01%)
total uniforms in shared programs: 31295 -> 31172 (-0.39%)
uniforms in affected programs: 3580 -> 3457 (-3.44%)
total estimated cycles in shared programs: 225182 -> 223746 (-0.64%)
estimated cycles in affected programs: 26085 -> 24649 (-5.51%)

v2: Update shader-db output.

Reviewed-by: Ian Romanick  (v1)

---

 src/compiler/nir/nir.h |  2 +-
 src/compiler/nir/nir_opt_peephole_select.c | 82 --
 src/gallium/drivers/vc4/vc4_program.c  |  2 +-
 src/mesa/drivers/dri/i965/brw_nir.c|  2 +-
 4 files changed, 57 insertions(+), 31 deletions(-)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index aac247c..8d1afb9 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2600,7 +2600,7 @@ bool nir_opt_dead_cf(nir_shader *shader);
 
 bool nir_opt_gcm(nir_shader *shader, bool value_number);
 
-bool nir_opt_peephole_select(nir_shader *shader);
+bool nir_opt_peephole_select(nir_shader *shader, unsigned limit);
 
 bool nir_opt_remove_phis(nir_shader *shader);
 
diff --git a/src/compiler/nir/nir_opt_peephole_select.c 
b/src/compiler/nir/nir_opt_peephole_select.c
index 633e9f4..6a73d73 100644
--- a/src/compiler/nir/nir_opt_peephole_select.c
+++ b/src/compiler/nir/nir_opt_peephole_select.c
@@ -32,23 +32,33 @@
  * Implements a small peephole optimization that looks for
  *
  * if (cond) {
- *
+ *
  * } else {
- *
+ *
  * }
  * phi
  * ...
  * phi
  *
- * and replaces it with a series of selects.  It can also handle the case
- * where, instead of being empty, the if may contain some move operations
- * whose only use is one of the following phi nodes.  This happens all the
- * time when the SSA form comes from a conditional assignment with a
- * swizzle.
+ * and replaces it with:
+ *
+ * 
+ * 
+ * bcsel
+ * ...
+ * bcsel
+ *
+ * where the SSA defs are ALU operations or other cheap instructions (not
+ * texturing, for example).
+ *
+ * If the number of ALU operations in the branches is greater than the limit
+ * parameter, then the optimization is skipped.  In limit=0 mode, the SSA defs
+ * must only be MOVs which we expect to get copy-propagated away once they're
+ * out of the inner blocks.
  */
 
 static bool
-block_check_for_allowed_instrs(nir_block *block)
+block_check_for_allowed_instrs(nir_block *block, unsigned *count, bool alu_ok)
 {
nir_foreach_instr(instr, block) {
   switch (instr->type) {
@@ -67,6 +77,11 @@ block_check_for_allowed_instrs(nir_block *block)
 }
 break;
 
+ case nir_intrinsic_load_uniform:
+if (!alu_ok)
+   return false;
+break;
+
  default:
 return false;
  }
@@ -89,29 +104,36 @@ block_check_for_allowed_instrs(nir_block *block)
  case nir_op_vec2:
  case nir_op_vec3:
  case nir_op_vec4:
-/* It must be a move-like operation. */
 break;
  default:
-return false;
+if (!alu_ok) {
+   /* It must be a move-like operation. */
+   return false;
+}
+break;
  }
 
- /* Can't handle saturate */
- if (mov->dest.saturate)
-return false;
-
  /* It must be SSA */
  if (!mov->dest.dest.is_ssa)
 return false;
 
- /* It cannot have any if-uses */
- if (!list_empty(>dest.dest.ssa.if_uses))
-return false;
+ if (alu_ok) {
+(*count)++;
+ } else {
+/* Can't handle saturate */
+if (mov->dest.saturate)
+   return false;
 
- /* The only 

Mesa (master): spirv: fix AtomicLoad/Store on images

2016-09-22 Thread Lionel Landwerlin
Module: Mesa
Branch: master
Commit: 9adfa695ac144cfd7c9bb9d0c63d280861f3add4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9adfa695ac144cfd7c9bb9d0c63d280861f3add4

Author: Lionel Landwerlin 
Date:   Mon Sep 19 17:14:18 2016 +0100

spirv: fix AtomicLoad/Store on images

OpAtomicLoad/Store should have pointer to images just like the rest of the
atomic operators. These couple of lines were poorly copied from the
ssbo/shared_vars cases (the only ones currently tests by the CTS).

Fixes 2afb950161f8 ("spirv/nir: Add support for OpAtomicLoad/Store")
Reviewed-by: Jason Ekstrand 

---

 src/compiler/spirv/spirv_to_nir.c | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/compiler/spirv/spirv_to_nir.c 
b/src/compiler/spirv/spirv_to_nir.c
index 04add3e..de2cebc 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1671,6 +1671,7 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
case SpvOpAtomicIDecrement:
case SpvOpAtomicIAdd:
case SpvOpAtomicISub:
+   case SpvOpAtomicLoad:
case SpvOpAtomicSMin:
case SpvOpAtomicUMin:
case SpvOpAtomicSMax:
@@ -1681,17 +1682,9 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
   image = *vtn_value(b, w[3], vtn_value_type_image_pointer)->image;
   break;
 
-   case SpvOpAtomicLoad: {
-  image.image =
- vtn_value(b, w[3], vtn_value_type_access_chain)->access_chain;
-  break;
-   }
-
-   case SpvOpAtomicStore: {
-  image.image =
- vtn_value(b, w[1], vtn_value_type_access_chain)->access_chain;
+   case SpvOpAtomicStore:
+  image = *vtn_value(b, w[1], vtn_value_type_image_pointer)->image;
   break;
-   }
 
case SpvOpImageQuerySize:
   image.image =

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit