[Mesa-dev] [Bug 107477] [DXVK] Setting high shader quality in GTA V results in LLVM error

2018-08-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107477

--- Comment #3 from Clément Guérin  ---
Created attachment 141244
  --> https://bugs.freedesktop.org/attachment.cgi?id=141244&action=edit
GTA 5 RADV_DEBUG log

Here's the log attached as requested.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] Add NV_fragment_shader_interlock support.

2018-08-22 Thread Kevin Rogovin
From: Kevin Rogovin 

The main purpose for having NV_fragment_shader_interlock
extension is because that extension is also for GLES31 while
the ARB extension is for GL only.

v2: Add to review notes (requested by Emil Velikov)

Reviewed-by: Plamena Manolova 
---
 docs/relnotes/18.3.0.html|  1 +
 src/compiler/glsl/builtin_functions.cpp  | 18 ++
 src/compiler/glsl/glsl_parser.yy |  6 --
 src/compiler/glsl/glsl_parser_extras.cpp |  1 +
 src/compiler/glsl/glsl_parser_extras.h   |  2 ++
 src/mesa/main/extensions_table.h |  1 +
 6 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/docs/relnotes/18.3.0.html b/docs/relnotes/18.3.0.html
index ac2cc1e893..9989897515 100644
--- a/docs/relnotes/18.3.0.html
+++ b/docs/relnotes/18.3.0.html
@@ -53,6 +53,7 @@ Note: some of the new features are only available with 
certain drivers.
 
 GL_AMD_framebuffer_multisample_advanced on radeonsi.
 GL_EXT_window_rectangles on radeonsi.
+GL_NV_fragment_shader_interlock on i965.
 
 
 Bug fixes
diff --git a/src/compiler/glsl/builtin_functions.cpp 
b/src/compiler/glsl/builtin_functions.cpp
index 7119903795..e7b78c0158 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -519,6 +519,12 @@ supports_arb_fragment_shader_interlock(const 
_mesa_glsl_parse_state *state)
return state->ARB_fragment_shader_interlock_enable;
 }
 
+static bool
+supports_nv_fragment_shader_interlock(const _mesa_glsl_parse_state *state)
+{
+   return state->NV_fragment_shader_interlock_enable;
+}
+
 static bool
 shader_clock(const _mesa_glsl_parse_state *state)
 {
@@ -3331,6 +3337,18 @@ builtin_builder::create_builtins()
supports_arb_fragment_shader_interlock),
 NULL);
 
+   add_function("beginInvocationInterlockNV",
+_invocation_interlock(
+   "__intrinsic_begin_invocation_interlock",
+   supports_nv_fragment_shader_interlock),
+NULL);
+
+   add_function("endInvocationInterlockNV",
+_invocation_interlock(
+   "__intrinsic_end_invocation_interlock",
+   supports_nv_fragment_shader_interlock),
+NULL);
+
add_function("anyInvocationARB",
 _vote("__intrinsic_vote_any", vote),
 NULL);
diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
index cb7376995d..bc2571b684 100644
--- a/src/compiler/glsl/glsl_parser.yy
+++ b/src/compiler/glsl/glsl_parser.yy
@@ -1450,10 +1450,12 @@ layout_qualifier_id:
   "only valid in fragment shader input layout 
declaration.");
   } else if (pixel_interlock_ordered + pixel_interlock_unordered +
  sample_interlock_ordered + sample_interlock_unordered > 0 &&
- !state->ARB_fragment_shader_interlock_enable) {
+ !state->ARB_fragment_shader_interlock_enable &&
+ !state->NV_fragment_shader_interlock_enable) {
  _mesa_glsl_error(& @1, state,
   "interlock layout qualifier present, but the "
-  "GL_ARB_fragment_shader_interlock extension is not "
+  "GL_ARB_fragment_shader_interlock or "
+  "GL_NV_fragment_shader_interlock extension is not "
   "enabled.");
   } else {
  $$.flags.q.pixel_interlock_ordered = pixel_interlock_ordered;
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp 
b/src/compiler/glsl/glsl_parser_extras.cpp
index 6d92f24ea2..393942b62c 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -724,6 +724,7 @@ static const _mesa_glsl_extension 
_mesa_glsl_supported_extensions[] = {
EXT_AEP(EXT_texture_cube_map_array),
EXT(INTEL_conservative_rasterization),
EXT(MESA_shader_integer_functions),
+   EXT(NV_fragment_shader_interlock),
EXT(NV_image_formats),
 };
 
diff --git a/src/compiler/glsl/glsl_parser_extras.h 
b/src/compiler/glsl/glsl_parser_extras.h
index 59a173418b..3b17b54f0a 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -810,6 +810,8 @@ struct _mesa_glsl_parse_state {
bool INTEL_conservative_rasterization_warn;
bool MESA_shader_integer_functions_enable;
bool MESA_shader_integer_functions_warn;
+   bool NV_fragment_shader_interlock_enable;
+   bool NV_fragment_shader_interlock_warn;
bool NV_image_formats_enable;
bool NV_image_formats_warn;
/*@}*/
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index af5ce118da..746e821886 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -346,6 +346,7 @@ EXT(NV_draw_buffers , dummy_true
 EXT(NV_fbo_color_attachments, dummy_true   
  ,  x ,  x ,  x , ES2, 2010)
 EX

Re: [Mesa-dev] [PATCH] Add NV_fragment_shader_interlock support.

2018-08-22 Thread Kevin Rogovin
Hi,

 My request for an account was NAK'd by the i965 maintainer. As such, I
will post a v2 with the update to release notes requested and I hope
Plamena can push that for me.

Best Regards,
 -Kevin Rogovin

On Tue, Aug 21, 2018 at 12:39 PM Emil Velikov 
wrote:

> Hi Kevin,
>
> On 20 August 2018 at 15:11, Kevin Rogovin  wrote:
> > Hi Plamena,
> >
> >  Thankyou for the fast review. Can you push it or have someone push it?
> (I
> > do not have push rights)
> >
> You have contributed a number of good patches in Mesa, always
> listening to feedback.
> I would welcome if you're given commit access to the repository.
>
> https://www.mesa3d.org/repository.html#developer
> https://bugs.freedesktop.org/show_bug.cgi?id=99601
>
> That said, can you please add a note about the new extension in the
> release notes.
>
> Thanks
> Emil
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 6/5] egl/android: continue to next device if dri2_create_screen fails

2018-08-22 Thread Tomasz Figa
On Thu, Aug 23, 2018 at 1:44 AM Emil Velikov  wrote:
>
> Hi Tomasz,
>
> On 21 August 2018 at 14:54, Tomasz Figa  wrote:
> > Hi Emil,
> >
> > On Tue, Aug 14, 2018 at 2:05 AM Emil Velikov  
> > wrote:
> >>
> >> From: Emil Velikov 
> >>
> >> Unlike the other platforms, here we aim do guess if the device that we
> >> somewhat arbitrarily picked, is supported or not.
> >>
> >> It seems a bit fiddly, but considering EGL_EXT_explicit_device and
> >> EGL_MESA_query_renderer are MIA, this is the best we can do for the
> >> moment.
> >>
> >> With those (proposed) extensions userspace will be able to create a
> >> separate EGL display for each device, query device details and make the
> >> conscious decision which one to use.
> >>
> >> Cc: Robert Foss 
> >> Cc: Tomasz Figa 
> >> Signed-off-by: Emil Velikov 
> >> ---
> >>  src/egl/drivers/dri2/platform_android.c | 29 -
> >>  1 file changed, 19 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/src/egl/drivers/dri2/platform_android.c 
> >> b/src/egl/drivers/dri2/platform_android.c
> >> index 50dd7a5e1b4..cac59847b89 100644
> >> --- a/src/egl/drivers/dri2/platform_android.c
> >> +++ b/src/egl/drivers/dri2/platform_android.c
> >> @@ -1295,6 +1295,25 @@ droid_open_device(_EGLDisplay *disp)
> >>   continue;
> >>}
> >>/* Found a device */
> >> +
> >> +  /* Check that the device is supported, by attempting to:
> >> +   * - load the dri module
> >> +   * - and, create a screen
> >> +   */
> >> +  if (!droid_load_driver(disp)) {
> >> + _eglLog(_EGL_WARNING, "DRI2: failed to load driver");
> >> + close(fd);
> >> + fd = -1;
> >> + continue;
> >> +  }
> >> +
> >> +  if (!dri2_create_screen(disp)) {
> >> + _eglLog(_EGL_WARNING, "DRI2: failed to create screen");
> >> + close(fd);
> >> + fd = -1;
> >> + continue;
> >> +  }
> >
> > Don't we also need to do these tests when determining if the device is
> > a suitable fallback? The fallback fd is set much earlier, in the same
> > block as the continue statement, so the code below wouldn't execute.
> >
> Let me see if I got this correctly:
>  - when a "vendor" is requested we use that, falling back to the first
> other driver where screen creation succeeds
>  - if one isn't requested, we pick the first device that can create a screen
>
> Is that right?

Yes, seems to match my idea.

Just to make sure we're not going to be masking some failures with
fallbacks, I think we should make sure that if "vendor" is requested
and found, we don't fallback, even if the matched device fails to
create a screen.

Best regards,
Tomasz
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 3/7] mesa: Add support for AMD_depth_clamp_separate

2018-08-22 Thread Sagar Ghuge

On 08/22/2018 04:31 PM, Marek Olšák wrote:
> On Wed, Aug 22, 2018 at 5:52 PM Sagar Ghuge  wrote:
>>
>> Enable _mesa_PushAttrib() and _mesa_PopAttrib() to handle
>> GL_DEPTH_CLAMP_NEAR_AMD and GL_DEPTH_CLAMP_FAR_AMD tokens.
>>
>> Remove DepthClamp, because DepthClampNear + DepthClampFar replaces it,
>> as suggested by Marek Olsak.
>>
>> Driver that enables AMD_depth_clamp_separate will only ever look at
>> DepthClampNear and DepthClampFar, as suggested by Ian Romanick.
>>
>> v2: 1) Remove unnecessary parentheses (Marek Olsak)
>> 2) if AMD_depth_clamp_separate is unsupported, TEST_AND_UPDATE
>>GL_DEPTH_CLAMP only (Marek Olsak)
>> 3) Clamp against near and far plane separately (Marek Olsak)
>> 4) Clip point separately for near and far Z clipping plane (Marek
>>Olsak)
>>
>> Signed-off-by: Sagar Ghuge 
>> ---
>>  src/mesa/drivers/dri/i965/genX_state_upload.c | 11 ++--
>>  src/mesa/main/attrib.c| 40 +++---
>>  src/mesa/main/enable.c|  9 ++-
>>  src/mesa/main/get.c   |  4 ++
>>  src/mesa/main/get_hash_params.py  |  2 +-
>>  src/mesa/main/mtypes.h|  1 -
>>  src/mesa/main/rastpos.c   | 55 ---
>>  src/mesa/state_tracker/st_atom_rasterizer.c   |  3 +-
>>  src/mesa/state_tracker/st_cb_drawpixels.c |  3 +-
>>  src/mesa/swrast/s_span.c  |  2 +-
>>  src/mesa/tnl/t_vb_program.c   |  6 +-
>>  src/mesa/tnl/t_vb_vertex.c|  8 ++-
>>  12 files changed, 111 insertions(+), 33 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c 
>> b/src/mesa/drivers/dri/i965/genX_state_upload.c
>> index c051848985..dc54cb67af 100644
>> --- a/src/mesa/drivers/dri/i965/genX_state_upload.c
>> +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
>> @@ -1399,7 +1399,8 @@ genX(upload_clip_state)(struct brw_context *brw)
>>clip.ScreenSpaceViewportYMax = 1;
>>
>>clip.ViewportXYClipTestEnable = true;
>> -  clip.ViewportZClipTestEnable = !ctx->Transform.DepthClamp;
>> +  clip.ViewportZClipTestEnable = !(ctx->Transform.DepthClampNear &&
>> +   ctx->Transform.DepthClampFar);
>>
>>/* _NEW_TRANSFORM */
>>if (GEN_GEN == 5 || GEN_IS_G4X) {
>> @@ -1493,7 +1494,8 @@ genX(upload_clip_state)(struct brw_context *brw)
>>clip.UserClipDistanceCullTestEnableBitmask =
>>   brw_vue_prog_data(brw->vs.base.prog_data)->cull_distance_mask;
>>
>> -  clip.ViewportZClipTestEnable = !ctx->Transform.DepthClamp;
>> +  clip.ViewportZClipTestEnable = !(ctx->Transform.DepthClampNear &&
>> +   ctx->Transform.DepthClampFar);
>>  #endif
>>
>>/* _NEW_LIGHT */
>> @@ -2338,7 +2340,7 @@ genX(upload_cc_viewport)(struct brw_context *brw)
>> for (unsigned i = 0; i < viewport_count; i++) {
>>/* _NEW_VIEWPORT | _NEW_TRANSFORM */
>>const struct gl_viewport_attrib *vp = &ctx->ViewportArray[i];
>> -  if (ctx->Transform.DepthClamp) {
>> +  if (ctx->Transform.DepthClampNear && ctx->Transform.DepthClampFar) {
>>   ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
>>   ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
>>} else {
>> @@ -4605,7 +4607,8 @@ genX(upload_raster)(struct brw_context *brw)
>>raster.ScissorRectangleEnable = ctx->Scissor.EnableFlags;
>>
>>/* _NEW_TRANSFORM */
>> -  if (!ctx->Transform.DepthClamp) {
>> +  if (!(ctx->Transform.DepthClampNear &&
>> +ctx->Transform.DepthClampFar)) {
>>  #if GEN_GEN >= 9
>>   raster.ViewportZFarClipTestEnable = true;
>>   raster.ViewportZNearClipTestEnable = true;
>> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
>> index cbe93ab6fa..a46fec73fd 100644
>> --- a/src/mesa/main/attrib.c
>> +++ b/src/mesa/main/attrib.c
>> @@ -72,7 +72,8 @@ struct gl_enable_attrib
>> GLbitfield ClipPlanes;
>> GLboolean ColorMaterial;
>> GLboolean CullFace;
>> -   GLboolean DepthClamp;
>> +   GLboolean DepthClampNear;
>> +   GLboolean DepthClampFar;
>> GLboolean DepthTest;
>> GLboolean Dither;
>> GLboolean Fog;
>> @@ -336,7 +337,8 @@ _mesa_PushAttrib(GLbitfield mask)
>>attr->ClipPlanes = ctx->Transform.ClipPlanesEnabled;
>>attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
>>attr->CullFace = ctx->Polygon.CullFlag;
>> -  attr->DepthClamp = ctx->Transform.DepthClamp;
>> +  attr->DepthClampNear = ctx->Transform.DepthClampNear;
>> +  attr->DepthClampFar = ctx->Transform.DepthClampFar;
>>attr->DepthTest = ctx->Depth.Test;
>>attr->Dither = ctx->Color.DitherFlag;
>>attr->Fog = ctx->Fog.Enabled;
>> @@ -627,8 +629,18 @@ pop_enable_group(struct gl_context *ctx, const struct 
>> gl_enable_attrib *enable)
>> TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial,
>>  

Re: [Mesa-dev] [PATCH] radv: remove dead variables after splitting per member structs

2018-08-22 Thread Timothy Arceri

On 23/08/18 09:57, Timothy Arceri wrote:

On 22/08/18 20:34, Samuel Pitoiset wrote:

Otherwise, nir_lower_clip_cull_distance_arrays might report
wrong number of output clips/culls because it relies on
shader output variables and some of them might be dead.

This fixes a rendering issue with Dolphin and Super Mario
Sunshine.

Fixes: b0c643d8f5 ("spirv: Use NIR per-member splitting")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107610
C: 18.2 
Signed-off-by: Samuel Pitoiset 
---
  src/amd/vulkan/radv_shader.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 7d4265cfda..207e5b050e 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -259,9 +259,6 @@ radv_shader_compile_to_nir(struct radv_device 
*device,

   */
  NIR_PASS_V(nir, nir_lower_constant_initializers, 
nir_var_shader_out);

-    NIR_PASS_V(nir, nir_remove_dead_variables,
-   nir_var_shader_in | nir_var_shader_out | 
nir_var_system_value);

-
  /* Now that we've deleted all but the main function, we can 
go ahead and

   * lower the rest of the constant initializers.
   */
@@ -273,6 +270,9 @@ radv_shader_compile_to_nir(struct radv_device 
*device,

  NIR_PASS_V(nir, nir_split_var_copies);
  NIR_PASS_V(nir, nir_split_per_member_structs);


I see you already pushed but I would have suggested adding a comment 
here saying this must be called after nir_split_per_member_structs.


And obviously including the 'why' we need to call it after 
nir_split_per_member_structs too.


 So
this didn't get accidentally moved again in future. Seems like a subtle 
bug to track down. Any patch to add the comment would have my r-b.



+    NIR_PASS_V(nir, nir_remove_dead_variables,
+   nir_var_shader_in | nir_var_shader_out | 
nir_var_system_value);

+
  NIR_PASS_V(nir, nir_lower_system_values);
  NIR_PASS_V(nir, nir_lower_clip_cull_distance_arrays);
  }


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

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


Re: [Mesa-dev] [PATCH] radv: remove dead variables after splitting per member structs

2018-08-22 Thread Timothy Arceri



On 22/08/18 20:34, Samuel Pitoiset wrote:

Otherwise, nir_lower_clip_cull_distance_arrays might report
wrong number of output clips/culls because it relies on
shader output variables and some of them might be dead.

This fixes a rendering issue with Dolphin and Super Mario
Sunshine.

Fixes: b0c643d8f5 ("spirv: Use NIR per-member splitting")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107610
C: 18.2 
Signed-off-by: Samuel Pitoiset 
---
  src/amd/vulkan/radv_shader.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 7d4265cfda..207e5b050e 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -259,9 +259,6 @@ radv_shader_compile_to_nir(struct radv_device *device,
 */
NIR_PASS_V(nir, nir_lower_constant_initializers, 
nir_var_shader_out);
  
-		NIR_PASS_V(nir, nir_remove_dead_variables,

-  nir_var_shader_in | nir_var_shader_out | 
nir_var_system_value);
-
/* Now that we've deleted all but the main function, we can go 
ahead and
 * lower the rest of the constant initializers.
 */
@@ -273,6 +270,9 @@ radv_shader_compile_to_nir(struct radv_device *device,
NIR_PASS_V(nir, nir_split_var_copies);
NIR_PASS_V(nir, nir_split_per_member_structs);
  


I see you already pushed but I would have suggested adding a comment 
here saying this must be called after nir_split_per_member_structs. So 
this didn't get accidentally moved again in future. Seems like a subtle 
bug to track down. Any patch to add the comment would have my r-b.



+   NIR_PASS_V(nir, nir_remove_dead_variables,
+  nir_var_shader_in | nir_var_shader_out | 
nir_var_system_value);
+
NIR_PASS_V(nir, nir_lower_system_values);
NIR_PASS_V(nir, nir_lower_clip_cull_distance_arrays);
}


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


Re: [Mesa-dev] [PATCH] glsl/linker: Allow unused in blocks which are not declated on previous stage

2018-08-22 Thread Timothy Arceri

On 21/08/18 19:42, Vadym Shovkoplias wrote:

Hi Timothy, Alejandro,

Thanks for the review comments!
I'd just like to mention that the same approach is already used 
in link_varyings.cpp file in 
function cross_validate_outputs_to_inputs(). Here is a code snippet:


if (*input->data.used *&& !input->get_interface_type() &&
                 !input->data.explicit_location &&
!prog->SeparateShader)
                linker_error(prog,
                             "%s shader input `%s' "
                             "has no matching output in the previous
stage\n",

_mesa_shader_stage_to_string(consumer->Stage),

                             input->name);


This code is used for the same purpose to validate input and output 
variables which is also done during linking stage.

So basically I just used the same check but for interface blocks.

This was implemented some time ago in the following patch:

commit 18004c338f6be8af2e36d2f54972c60136229aeb
Author: Samuel Iglesias Gonsalvez mailto:sigles...@igalia.com>>
Date:   Fri Nov 28 11:23:20 2014 +0100

     glsl: fail when a shader's input var has not an equivalent out
var in previous



Suggest please does this mean that it is safe to use "used" field while 
linking ?


I don't think it is but I'm willing to put this in the who cares basket. 
Worst case scenario we get an error message when we probably shouldn't.


I believe the spec text is worded this way so these unused blockes can 
be removed by opts during linking before validation is done. Ideally 
that is what we would do too. For now this patch is:


Reviewed-by: Timothy Arceri 

However I don't think you should update the comment Alejandro is taking 
about because I believe it is still correct. used is not set for fixed 
function or ARB asm style programs.




On Tue, Aug 21, 2018 at 12:00 PM, Alejandro Piñeiro 
mailto:apinhe...@igalia.com>> wrote:


On 21/08/18 03:02, Timothy Arceri wrote:
 > On 20/08/18 23:31, vadym.shovkoplias wrote:
 >>  From Section 4.3.4 (Inputs) of the GLSL 1.50 spec:
 >>
 >>  "Only the input variables that are actually read need to be
written
 >>   by the previous stage; it is allowed to have superfluous
 >>   declarations of input variables."
 >>
 >> Fixes:
 >>  * interstage-multiple-shader-objects.shader_test
 >>
 >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101247

 >> Signed-off-by: Vadym Shovkoplias
mailto:vadym.shovkopl...@globallogic.com>>
 >> ---
 >>   src/compiler/glsl/link_interface_blocks.cpp | 8 +++-
 >>   1 file changed, 7 insertions(+), 1 deletion(-)
 >>
 >> diff --git a/src/compiler/glsl/link_interface_blocks.cpp
 >> b/src/compiler/glsl/link_interface_blocks.cpp
 >> index e5eca9460e..801fbcd5d9 100644
 >> --- a/src/compiler/glsl/link_interface_blocks.cpp
 >> +++ b/src/compiler/glsl/link_interface_blocks.cpp
 >> @@ -417,9 +417,15 @@ validate_interstage_inout_blocks(struct
 >> gl_shader_program *prog,
 >>  * write to any of the pre-defined outputs (e.g. if the
 >> vertex shader
 >>  * does not write to gl_Position, etc), which is allowed and
 >> results in
 >>  * undefined behavior.
 >> +   *
 >> +   * From Section 4.3.4 (Inputs) of the GLSL 1.50 spec:
 >> +   *
 >> +   *    "Only the input variables that are actually read
need to
 >> be written
 >> +   * by the previous stage; it is allowed to have
superfluous
 >> +   * declarations of input variables."
 >>  */
 >>     if (producer_def == NULL &&
 >> -  !is_builtin_gl_in_block(var, consumer->Stage)) {
 >> +  !is_builtin_gl_in_block(var, consumer->Stage) &&
 >> var->data.used) {
 >
 > This concerns me a little. As far as I remember 'used' was added to
 > make compiler warning better but it's not 100% reliable.

+1 on the concerns thing. In addition to be used mostly for warnings, we
need to take into account his description comment at ir.h:

  "
    * This is only maintained in the ast_to_hir.cpp path, not in
    * Mesa's fixed function or ARB program paths.
  "

So if we start to use this while linking, then we need to ensure that it
is maintained outside the ast_to_hir pass (or at least, ensure that it
is correct after that pass). And if we got that, then that comment
became obsolete, and should be removed as part of the patch.

>
>>    linker_error(prog, "Input block `%s' is not an output of "
>>     "the previous stage\n",
>> var->get_interface_type()->name);
>>    return;
>>
 > ___
 > mesa-dev mailing 

Re: [Mesa-dev] [PATCH 1/2] meson: fix egl build for surfaceless

2018-08-22 Thread Dylan Baker
Quoting Gurchetan Singh (2018-08-22 16:08:33)
> Without this, I get:
> 
>  > platform_surfaceless.c:38:10: fatal error: 'loader.h' file not found
>  > #include "loader.h"
>  >  ^~
>  > 1 error generated.
> 
> Fixes: 108d257a16859898f5ce02f4759c5c58f9b8c050 ("meson: build libEGL")
> 
> v2: Split up patches, modify commit message (Dylan)
> ---
>  src/egl/meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/egl/meson.build b/src/egl/meson.build
> index c7c22d3637..9c0b6b4b4a 100644
> --- a/src/egl/meson.build
> +++ b/src/egl/meson.build
> @@ -114,6 +114,7 @@ if with_platform_drm
>  endif
>  if with_platform_surfaceless
>files_egl += files('drivers/dri2/platform_surfaceless.c')
> +  incs_for_egl += [inc_loader]
>  endif
>  if with_platform_wayland
>deps_for_egl += [dep_wayland_client, dep_wayland_server, 
> dep_wayland_egl_headers]
> -- 
> 2.16.4
> 

For the series, Reviewed-by: Dylan Baker 

I'll go ahead and push these, thanks for fixing this.

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 4/7] mesa: add support for GL_AMD_depth_clamp_separate tokens

2018-08-22 Thread Marek Olšák
Reviewed-by: Marek Olšák 

Marek
On Wed, Aug 22, 2018 at 4:32 PM Sagar Ghuge  wrote:
>
> _mesa_set_enable() and _mesa_IsEnabled() extended to accept new two
> tokens GL_DEPTH_CLAMP_NEAR_AMD and GL_DEPTH_CLAMP_FAR_AMD.
>
> v2: Remove unnecessary parentheses (Marek Olsak)
>
> Signed-off-by: Sagar Ghuge 
> ---
>  src/mesa/main/enable.c | 36 
>  1 file changed, 36 insertions(+)
>
> diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
> index 4bde9052bc..042b9d1f0a 100644
> --- a/src/mesa/main/enable.c
> +++ b/src/mesa/main/enable.c
> @@ -1017,6 +1017,30 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, 
> GLboolean state)
>   ctx->Transform.DepthClampFar = state;
>   break;
>
> +  case GL_DEPTH_CLAMP_NEAR_AMD:
> + if (!_mesa_is_desktop_gl(ctx))
> +goto invalid_enum_error;
> + CHECK_EXTENSION(AMD_depth_clamp_separate, cap);
> + if (ctx->Transform.DepthClampNear == state)
> +return;
> + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 :
> +   _NEW_TRANSFORM);
> + ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp;
> + ctx->Transform.DepthClampNear = state;
> + break;
> +
> +  case GL_DEPTH_CLAMP_FAR_AMD:
> + if (!_mesa_is_desktop_gl(ctx))
> +goto invalid_enum_error;
> + CHECK_EXTENSION(AMD_depth_clamp_separate, cap);
> + if (ctx->Transform.DepthClampFar == state)
> +return;
> + FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 :
> +   _NEW_TRANSFORM);
> + ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp;
> + ctx->Transform.DepthClampFar = state;
> + break;
> +
>case GL_FRAGMENT_SHADER_ATI:
>   if (ctx->API != API_OPENGL_COMPAT)
>  goto invalid_enum_error;
> @@ -1689,6 +1713,18 @@ _mesa_IsEnabled( GLenum cap )
>   return (ctx->Transform.DepthClampNear ||
>   ctx->Transform.DepthClampFar);
>
> +  case GL_DEPTH_CLAMP_NEAR_AMD:
> + if (!_mesa_is_desktop_gl(ctx))
> +goto invalid_enum_error;
> + CHECK_EXTENSION(AMD_depth_clamp_separate);
> + return ctx->Transform.DepthClampNear;
> +
> +  case GL_DEPTH_CLAMP_FAR_AMD:
> + if (!_mesa_is_desktop_gl(ctx))
> +goto invalid_enum_error;
> + CHECK_EXTENSION(AMD_depth_clamp_separate);
> + return ctx->Transform.DepthClampFar;
> +
>case GL_FRAGMENT_SHADER_ATI:
>   if (ctx->API != API_OPENGL_COMPAT)
>  goto invalid_enum_error;
> --
> 2.17.1
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 3/7] mesa: Add support for AMD_depth_clamp_separate

2018-08-22 Thread Marek Olšák
On Wed, Aug 22, 2018 at 5:52 PM Sagar Ghuge  wrote:
>
> Enable _mesa_PushAttrib() and _mesa_PopAttrib() to handle
> GL_DEPTH_CLAMP_NEAR_AMD and GL_DEPTH_CLAMP_FAR_AMD tokens.
>
> Remove DepthClamp, because DepthClampNear + DepthClampFar replaces it,
> as suggested by Marek Olsak.
>
> Driver that enables AMD_depth_clamp_separate will only ever look at
> DepthClampNear and DepthClampFar, as suggested by Ian Romanick.
>
> v2: 1) Remove unnecessary parentheses (Marek Olsak)
> 2) if AMD_depth_clamp_separate is unsupported, TEST_AND_UPDATE
>GL_DEPTH_CLAMP only (Marek Olsak)
> 3) Clamp against near and far plane separately (Marek Olsak)
> 4) Clip point separately for near and far Z clipping plane (Marek
>Olsak)
>
> Signed-off-by: Sagar Ghuge 
> ---
>  src/mesa/drivers/dri/i965/genX_state_upload.c | 11 ++--
>  src/mesa/main/attrib.c| 40 +++---
>  src/mesa/main/enable.c|  9 ++-
>  src/mesa/main/get.c   |  4 ++
>  src/mesa/main/get_hash_params.py  |  2 +-
>  src/mesa/main/mtypes.h|  1 -
>  src/mesa/main/rastpos.c   | 55 ---
>  src/mesa/state_tracker/st_atom_rasterizer.c   |  3 +-
>  src/mesa/state_tracker/st_cb_drawpixels.c |  3 +-
>  src/mesa/swrast/s_span.c  |  2 +-
>  src/mesa/tnl/t_vb_program.c   |  6 +-
>  src/mesa/tnl/t_vb_vertex.c|  8 ++-
>  12 files changed, 111 insertions(+), 33 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c 
> b/src/mesa/drivers/dri/i965/genX_state_upload.c
> index c051848985..dc54cb67af 100644
> --- a/src/mesa/drivers/dri/i965/genX_state_upload.c
> +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
> @@ -1399,7 +1399,8 @@ genX(upload_clip_state)(struct brw_context *brw)
>clip.ScreenSpaceViewportYMax = 1;
>
>clip.ViewportXYClipTestEnable = true;
> -  clip.ViewportZClipTestEnable = !ctx->Transform.DepthClamp;
> +  clip.ViewportZClipTestEnable = !(ctx->Transform.DepthClampNear &&
> +   ctx->Transform.DepthClampFar);
>
>/* _NEW_TRANSFORM */
>if (GEN_GEN == 5 || GEN_IS_G4X) {
> @@ -1493,7 +1494,8 @@ genX(upload_clip_state)(struct brw_context *brw)
>clip.UserClipDistanceCullTestEnableBitmask =
>   brw_vue_prog_data(brw->vs.base.prog_data)->cull_distance_mask;
>
> -  clip.ViewportZClipTestEnable = !ctx->Transform.DepthClamp;
> +  clip.ViewportZClipTestEnable = !(ctx->Transform.DepthClampNear &&
> +   ctx->Transform.DepthClampFar);
>  #endif
>
>/* _NEW_LIGHT */
> @@ -2338,7 +2340,7 @@ genX(upload_cc_viewport)(struct brw_context *brw)
> for (unsigned i = 0; i < viewport_count; i++) {
>/* _NEW_VIEWPORT | _NEW_TRANSFORM */
>const struct gl_viewport_attrib *vp = &ctx->ViewportArray[i];
> -  if (ctx->Transform.DepthClamp) {
> +  if (ctx->Transform.DepthClampNear && ctx->Transform.DepthClampFar) {
>   ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
>   ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
>} else {
> @@ -4605,7 +4607,8 @@ genX(upload_raster)(struct brw_context *brw)
>raster.ScissorRectangleEnable = ctx->Scissor.EnableFlags;
>
>/* _NEW_TRANSFORM */
> -  if (!ctx->Transform.DepthClamp) {
> +  if (!(ctx->Transform.DepthClampNear &&
> +ctx->Transform.DepthClampFar)) {
>  #if GEN_GEN >= 9
>   raster.ViewportZFarClipTestEnable = true;
>   raster.ViewportZNearClipTestEnable = true;
> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
> index cbe93ab6fa..a46fec73fd 100644
> --- a/src/mesa/main/attrib.c
> +++ b/src/mesa/main/attrib.c
> @@ -72,7 +72,8 @@ struct gl_enable_attrib
> GLbitfield ClipPlanes;
> GLboolean ColorMaterial;
> GLboolean CullFace;
> -   GLboolean DepthClamp;
> +   GLboolean DepthClampNear;
> +   GLboolean DepthClampFar;
> GLboolean DepthTest;
> GLboolean Dither;
> GLboolean Fog;
> @@ -336,7 +337,8 @@ _mesa_PushAttrib(GLbitfield mask)
>attr->ClipPlanes = ctx->Transform.ClipPlanesEnabled;
>attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
>attr->CullFace = ctx->Polygon.CullFlag;
> -  attr->DepthClamp = ctx->Transform.DepthClamp;
> +  attr->DepthClampNear = ctx->Transform.DepthClampNear;
> +  attr->DepthClampFar = ctx->Transform.DepthClampFar;
>attr->DepthTest = ctx->Depth.Test;
>attr->Dither = ctx->Color.DitherFlag;
>attr->Fog = ctx->Fog.Enabled;
> @@ -627,8 +629,18 @@ pop_enable_group(struct gl_context *ctx, const struct 
> gl_enable_attrib *enable)
> TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial,
> GL_COLOR_MATERIAL);
> TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
> -   TEST_AND_UPDATE(ctx->Transform.Depth

[Mesa-dev] [PATCH 1/2] meson: fix egl build for surfaceless

2018-08-22 Thread Gurchetan Singh
Without this, I get:

 > platform_surfaceless.c:38:10: fatal error: 'loader.h' file not found
 > #include "loader.h"
 >  ^~
 > 1 error generated.

Fixes: 108d257a16859898f5ce02f4759c5c58f9b8c050 ("meson: build libEGL")

v2: Split up patches, modify commit message (Dylan)
---
 src/egl/meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/egl/meson.build b/src/egl/meson.build
index c7c22d3637..9c0b6b4b4a 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -114,6 +114,7 @@ if with_platform_drm
 endif
 if with_platform_surfaceless
   files_egl += files('drivers/dri2/platform_surfaceless.c')
+  incs_for_egl += [inc_loader]
 endif
 if with_platform_wayland
   deps_for_egl += [dep_wayland_client, dep_wayland_server, 
dep_wayland_egl_headers]
-- 
2.16.4

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


[Mesa-dev] [PATCH 2/2] meson: fix egl build for android

2018-08-22 Thread Gurchetan Singh
Haven't tested this, but we do include loader.h
in platform_android.c

Fixes: c5ec1556859b7d33637c9fad13d3473c7b2f9eb3 ("meson: wire up egl/android")
---
 src/egl/meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/egl/meson.build b/src/egl/meson.build
index 9c0b6b4b4a..06922c6c3c 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -130,6 +130,7 @@ endif
 if with_platform_android
   deps_for_egl += dep_android
   files_egl += files('drivers/dri2/platform_android.c')
+  incs_for_egl += [inc_loader]
 endif
 if with_platform_haiku
   incs_for_egl += inc_haikugl
-- 
2.16.4

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


Re: [Mesa-dev] [PATCH] i965: Replace checks for rb->Name with FlipY

2018-08-22 Thread Jason Ekstrand
On Wed, Aug 22, 2018 at 5:35 PM Fritz Koenig  wrote:

> On Wed, Aug 22, 2018 at 3:09 PM Jason Ekstrand 
> wrote:
> >
> > Two questions:
> >
> >  1) Have you grep'd through the rest of i965 looking for Name to make
> sure you got them all?
>
> Yes, I have.  I believe that I got them all now.
>
> >  2) Have you had a chance to run it through our CI system?
>
> No I haven't.  How do I kick that off?
>

It looks like Chad still has CI access; he can do it.

--Jason


> >
> > On Wed, Aug 22, 2018 at 5:00 PM Fritz Koenig 
> wrote:
> >>
> >> In the GL_MESA_framebuffer_flip_y implementation
> >> _mesa_is_winsys_fbo checks were replaced with
> >> FlipY checks.  rb->Name is also used to determine
> >> if a buffer is winsys.
> >> ---
> >>  src/mesa/drivers/dri/i965/brw_blorp.c| 20 +---
> >>  src/mesa/drivers/dri/i965/intel_pixel_read.c |  4 ++--
> >>  2 files changed, 11 insertions(+), 13 deletions(-)
> >>
> >> diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c
> b/src/mesa/drivers/dri/i965/brw_blorp.c
> >> index 7476cee43a..7c232f6ba9 100644
> >> --- a/src/mesa/drivers/dri/i965/brw_blorp.c
> >> +++ b/src/mesa/drivers/dri/i965/brw_blorp.c
> >> @@ -1220,12 +1220,12 @@ do_single_blorp_clear(struct brw_context *brw,
> struct gl_framebuffer *fb,
> >>
> >> x0 = fb->_Xmin;
> >> x1 = fb->_Xmax;
> >> -   if (rb->Name != 0) {
> >> -  y0 = fb->_Ymin;
> >> -  y1 = fb->_Ymax;
> >> -   } else {
> >> +   if (fb->FlipY) {
> >>y0 = rb->Height - fb->_Ymax;
> >>y1 = rb->Height - fb->_Ymin;
> >> +   } else {
> >> +  y0 = fb->_Ymin;
> >> +  y1 = fb->_Ymax;
> >> }
> >>
> >> /* If the clear region is empty, just return. */
> >> @@ -1411,9 +1411,8 @@ brw_blorp_clear_depth_stencil(struct brw_context
> *brw,
> >> if (!(mask & (BUFFER_BITS_DEPTH_STENCIL)))
> >>return;
> >>
> >> -   uint32_t x0, x1, y0, y1, rb_name, rb_height;
> >> +   uint32_t x0, x1, y0, y1, rb_height;
> >> if (depth_rb) {
> >> -  rb_name = depth_rb->Name;
> >>rb_height = depth_rb->Height;
> >>if (stencil_rb) {
> >>   assert(depth_rb->Width == stencil_rb->Width);
> >> @@ -1421,18 +1420,17 @@ brw_blorp_clear_depth_stencil(struct
> brw_context *brw,
> >>}
> >> } else {
> >>assert(stencil_rb);
> >> -  rb_name = stencil_rb->Name;
> >>rb_height = stencil_rb->Height;
> >> }
> >>
> >> x0 = fb->_Xmin;
> >> x1 = fb->_Xmax;
> >> -   if (rb_name != 0) {
> >> -  y0 = fb->_Ymin;
> >> -  y1 = fb->_Ymax;
> >> -   } else {
> >> +   if (fb->FlipY) {
> >>y0 = rb_height - fb->_Ymax;
> >>y1 = rb_height - fb->_Ymin;
> >> +   } else {
> >> +  y0 = fb->_Ymin;
> >> +  y1 = fb->_Ymax;
> >> }
> >>
> >> /* If the clear region is empty, just return. */
> >> diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c
> b/src/mesa/drivers/dri/i965/intel_pixel_read.c
> >> index 6ed7895bc7..8a90b207ad 100644
> >> --- a/src/mesa/drivers/dri/i965/intel_pixel_read.c
> >> +++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c
> >> @@ -181,7 +181,7 @@ intel_readpixels_tiled_memcpy(struct gl_context *
> ctx,
> >>  * tiled_to_linear a negative pitch so that it walks through the
> >>  * client's data backwards as it walks through the renderbufer
> forwards.
> >>  */
> >> -   if (rb->Name == 0) {
> >> +   if (ctx->ReadBuffer->FlipY) {
> >>yoffset = rb->Height - yoffset - height;
> >>pixels += (ptrdiff_t) (height - 1) * dst_pitch;
> >>dst_pitch = -dst_pitch;
> >> @@ -249,7 +249,7 @@ intel_readpixels_blorp(struct gl_context *ctx,
> >> return brw_blorp_download_miptree(brw, irb->mt, rb->Format, swizzle,
> >>   irb->mt_level, x, y,
> irb->mt_layer,
> >>   w, h, 1, GL_TEXTURE_2D, format,
> type,
> >> - rb->Name == 0, pixels, packing);
> >> + ctx->ReadBuffer->FlipY, pixels,
> packing);
> >>  }
> >>
> >>  void
> >> --
> >> 2.18.0.1017.ga543ac7ca45-goog
> >>
> >> ___
> >> mesa-dev mailing list
> >> mesa-dev@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965: Replace checks for rb->Name with FlipY

2018-08-22 Thread Fritz Koenig
On Wed, Aug 22, 2018 at 3:09 PM Jason Ekstrand  wrote:
>
> Two questions:
>
>  1) Have you grep'd through the rest of i965 looking for Name to make sure 
> you got them all?

Yes, I have.  I believe that I got them all now.

>  2) Have you had a chance to run it through our CI system?

No I haven't.  How do I kick that off?
>
> On Wed, Aug 22, 2018 at 5:00 PM Fritz Koenig  wrote:
>>
>> In the GL_MESA_framebuffer_flip_y implementation
>> _mesa_is_winsys_fbo checks were replaced with
>> FlipY checks.  rb->Name is also used to determine
>> if a buffer is winsys.
>> ---
>>  src/mesa/drivers/dri/i965/brw_blorp.c| 20 +---
>>  src/mesa/drivers/dri/i965/intel_pixel_read.c |  4 ++--
>>  2 files changed, 11 insertions(+), 13 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c 
>> b/src/mesa/drivers/dri/i965/brw_blorp.c
>> index 7476cee43a..7c232f6ba9 100644
>> --- a/src/mesa/drivers/dri/i965/brw_blorp.c
>> +++ b/src/mesa/drivers/dri/i965/brw_blorp.c
>> @@ -1220,12 +1220,12 @@ do_single_blorp_clear(struct brw_context *brw, 
>> struct gl_framebuffer *fb,
>>
>> x0 = fb->_Xmin;
>> x1 = fb->_Xmax;
>> -   if (rb->Name != 0) {
>> -  y0 = fb->_Ymin;
>> -  y1 = fb->_Ymax;
>> -   } else {
>> +   if (fb->FlipY) {
>>y0 = rb->Height - fb->_Ymax;
>>y1 = rb->Height - fb->_Ymin;
>> +   } else {
>> +  y0 = fb->_Ymin;
>> +  y1 = fb->_Ymax;
>> }
>>
>> /* If the clear region is empty, just return. */
>> @@ -1411,9 +1411,8 @@ brw_blorp_clear_depth_stencil(struct brw_context *brw,
>> if (!(mask & (BUFFER_BITS_DEPTH_STENCIL)))
>>return;
>>
>> -   uint32_t x0, x1, y0, y1, rb_name, rb_height;
>> +   uint32_t x0, x1, y0, y1, rb_height;
>> if (depth_rb) {
>> -  rb_name = depth_rb->Name;
>>rb_height = depth_rb->Height;
>>if (stencil_rb) {
>>   assert(depth_rb->Width == stencil_rb->Width);
>> @@ -1421,18 +1420,17 @@ brw_blorp_clear_depth_stencil(struct brw_context 
>> *brw,
>>}
>> } else {
>>assert(stencil_rb);
>> -  rb_name = stencil_rb->Name;
>>rb_height = stencil_rb->Height;
>> }
>>
>> x0 = fb->_Xmin;
>> x1 = fb->_Xmax;
>> -   if (rb_name != 0) {
>> -  y0 = fb->_Ymin;
>> -  y1 = fb->_Ymax;
>> -   } else {
>> +   if (fb->FlipY) {
>>y0 = rb_height - fb->_Ymax;
>>y1 = rb_height - fb->_Ymin;
>> +   } else {
>> +  y0 = fb->_Ymin;
>> +  y1 = fb->_Ymax;
>> }
>>
>> /* If the clear region is empty, just return. */
>> diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c 
>> b/src/mesa/drivers/dri/i965/intel_pixel_read.c
>> index 6ed7895bc7..8a90b207ad 100644
>> --- a/src/mesa/drivers/dri/i965/intel_pixel_read.c
>> +++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c
>> @@ -181,7 +181,7 @@ intel_readpixels_tiled_memcpy(struct gl_context * ctx,
>>  * tiled_to_linear a negative pitch so that it walks through the
>>  * client's data backwards as it walks through the renderbufer forwards.
>>  */
>> -   if (rb->Name == 0) {
>> +   if (ctx->ReadBuffer->FlipY) {
>>yoffset = rb->Height - yoffset - height;
>>pixels += (ptrdiff_t) (height - 1) * dst_pitch;
>>dst_pitch = -dst_pitch;
>> @@ -249,7 +249,7 @@ intel_readpixels_blorp(struct gl_context *ctx,
>> return brw_blorp_download_miptree(brw, irb->mt, rb->Format, swizzle,
>>   irb->mt_level, x, y, irb->mt_layer,
>>   w, h, 1, GL_TEXTURE_2D, format, type,
>> - rb->Name == 0, pixels, packing);
>> + ctx->ReadBuffer->FlipY, pixels, 
>> packing);
>>  }
>>
>>  void
>> --
>> 2.18.0.1017.ga543ac7ca45-goog
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965: Replace checks for rb->Name with FlipY

2018-08-22 Thread Jason Ekstrand
Two questions:

 1) Have you grep'd through the rest of i965 looking for Name to make sure
you got them all?
 2) Have you had a chance to run it through our CI system?

On Wed, Aug 22, 2018 at 5:00 PM Fritz Koenig  wrote:

> In the GL_MESA_framebuffer_flip_y implementation
> _mesa_is_winsys_fbo checks were replaced with
> FlipY checks.  rb->Name is also used to determine
> if a buffer is winsys.
> ---
>  src/mesa/drivers/dri/i965/brw_blorp.c| 20 +---
>  src/mesa/drivers/dri/i965/intel_pixel_read.c |  4 ++--
>  2 files changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c
> b/src/mesa/drivers/dri/i965/brw_blorp.c
> index 7476cee43a..7c232f6ba9 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp.c
> +++ b/src/mesa/drivers/dri/i965/brw_blorp.c
> @@ -1220,12 +1220,12 @@ do_single_blorp_clear(struct brw_context *brw,
> struct gl_framebuffer *fb,
>
> x0 = fb->_Xmin;
> x1 = fb->_Xmax;
> -   if (rb->Name != 0) {
> -  y0 = fb->_Ymin;
> -  y1 = fb->_Ymax;
> -   } else {
> +   if (fb->FlipY) {
>y0 = rb->Height - fb->_Ymax;
>y1 = rb->Height - fb->_Ymin;
> +   } else {
> +  y0 = fb->_Ymin;
> +  y1 = fb->_Ymax;
> }
>
> /* If the clear region is empty, just return. */
> @@ -1411,9 +1411,8 @@ brw_blorp_clear_depth_stencil(struct brw_context
> *brw,
> if (!(mask & (BUFFER_BITS_DEPTH_STENCIL)))
>return;
>
> -   uint32_t x0, x1, y0, y1, rb_name, rb_height;
> +   uint32_t x0, x1, y0, y1, rb_height;
> if (depth_rb) {
> -  rb_name = depth_rb->Name;
>rb_height = depth_rb->Height;
>if (stencil_rb) {
>   assert(depth_rb->Width == stencil_rb->Width);
> @@ -1421,18 +1420,17 @@ brw_blorp_clear_depth_stencil(struct brw_context
> *brw,
>}
> } else {
>assert(stencil_rb);
> -  rb_name = stencil_rb->Name;
>rb_height = stencil_rb->Height;
> }
>
> x0 = fb->_Xmin;
> x1 = fb->_Xmax;
> -   if (rb_name != 0) {
> -  y0 = fb->_Ymin;
> -  y1 = fb->_Ymax;
> -   } else {
> +   if (fb->FlipY) {
>y0 = rb_height - fb->_Ymax;
>y1 = rb_height - fb->_Ymin;
> +   } else {
> +  y0 = fb->_Ymin;
> +  y1 = fb->_Ymax;
> }
>
> /* If the clear region is empty, just return. */
> diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c
> b/src/mesa/drivers/dri/i965/intel_pixel_read.c
> index 6ed7895bc7..8a90b207ad 100644
> --- a/src/mesa/drivers/dri/i965/intel_pixel_read.c
> +++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c
> @@ -181,7 +181,7 @@ intel_readpixels_tiled_memcpy(struct gl_context * ctx,
>  * tiled_to_linear a negative pitch so that it walks through the
>  * client's data backwards as it walks through the renderbufer
> forwards.
>  */
> -   if (rb->Name == 0) {
> +   if (ctx->ReadBuffer->FlipY) {
>yoffset = rb->Height - yoffset - height;
>pixels += (ptrdiff_t) (height - 1) * dst_pitch;
>dst_pitch = -dst_pitch;
> @@ -249,7 +249,7 @@ intel_readpixels_blorp(struct gl_context *ctx,
> return brw_blorp_download_miptree(brw, irb->mt, rb->Format, swizzle,
>   irb->mt_level, x, y, irb->mt_layer,
>   w, h, 1, GL_TEXTURE_2D, format, type,
> - rb->Name == 0, pixels, packing);
> + ctx->ReadBuffer->FlipY, pixels,
> packing);
>  }
>
>  void
> --
> 2.18.0.1017.ga543ac7ca45-goog
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] i965: Replace checks for rb->Name with FlipY

2018-08-22 Thread Fritz Koenig
In the GL_MESA_framebuffer_flip_y implementation
_mesa_is_winsys_fbo checks were replaced with
FlipY checks.  rb->Name is also used to determine
if a buffer is winsys.
---
 src/mesa/drivers/dri/i965/brw_blorp.c| 20 +---
 src/mesa/drivers/dri/i965/intel_pixel_read.c |  4 ++--
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c 
b/src/mesa/drivers/dri/i965/brw_blorp.c
index 7476cee43a..7c232f6ba9 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -1220,12 +1220,12 @@ do_single_blorp_clear(struct brw_context *brw, struct 
gl_framebuffer *fb,
 
x0 = fb->_Xmin;
x1 = fb->_Xmax;
-   if (rb->Name != 0) {
-  y0 = fb->_Ymin;
-  y1 = fb->_Ymax;
-   } else {
+   if (fb->FlipY) {
   y0 = rb->Height - fb->_Ymax;
   y1 = rb->Height - fb->_Ymin;
+   } else {
+  y0 = fb->_Ymin;
+  y1 = fb->_Ymax;
}
 
/* If the clear region is empty, just return. */
@@ -1411,9 +1411,8 @@ brw_blorp_clear_depth_stencil(struct brw_context *brw,
if (!(mask & (BUFFER_BITS_DEPTH_STENCIL)))
   return;
 
-   uint32_t x0, x1, y0, y1, rb_name, rb_height;
+   uint32_t x0, x1, y0, y1, rb_height;
if (depth_rb) {
-  rb_name = depth_rb->Name;
   rb_height = depth_rb->Height;
   if (stencil_rb) {
  assert(depth_rb->Width == stencil_rb->Width);
@@ -1421,18 +1420,17 @@ brw_blorp_clear_depth_stencil(struct brw_context *brw,
   }
} else {
   assert(stencil_rb);
-  rb_name = stencil_rb->Name;
   rb_height = stencil_rb->Height;
}
 
x0 = fb->_Xmin;
x1 = fb->_Xmax;
-   if (rb_name != 0) {
-  y0 = fb->_Ymin;
-  y1 = fb->_Ymax;
-   } else {
+   if (fb->FlipY) {
   y0 = rb_height - fb->_Ymax;
   y1 = rb_height - fb->_Ymin;
+   } else {
+  y0 = fb->_Ymin;
+  y1 = fb->_Ymax;
}
 
/* If the clear region is empty, just return. */
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c 
b/src/mesa/drivers/dri/i965/intel_pixel_read.c
index 6ed7895bc7..8a90b207ad 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c
@@ -181,7 +181,7 @@ intel_readpixels_tiled_memcpy(struct gl_context * ctx,
 * tiled_to_linear a negative pitch so that it walks through the
 * client's data backwards as it walks through the renderbufer forwards.
 */
-   if (rb->Name == 0) {
+   if (ctx->ReadBuffer->FlipY) {
   yoffset = rb->Height - yoffset - height;
   pixels += (ptrdiff_t) (height - 1) * dst_pitch;
   dst_pitch = -dst_pitch;
@@ -249,7 +249,7 @@ intel_readpixels_blorp(struct gl_context *ctx,
return brw_blorp_download_miptree(brw, irb->mt, rb->Format, swizzle,
  irb->mt_level, x, y, irb->mt_layer,
  w, h, 1, GL_TEXTURE_2D, format, type,
- rb->Name == 0, pixels, packing);
+ ctx->ReadBuffer->FlipY, pixels, packing);
 }
 
 void
-- 
2.18.0.1017.ga543ac7ca45-goog

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


[Mesa-dev] [PATCH] glapi: actually implement GL_EXT_robustness for GLES

2018-08-22 Thread Marek Olšák
From: Marek Olšák 

The extension was exposed but not the functions.

This fixes:
dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.readn_pixels

dEQP-GLES31.functional.debug.negative_coverage.get_error.state.get_nuniformfv

dEQP-GLES31.functional.debug.negative_coverage.get_error.state.get_nuniformiv

Cc: 18.1 18.2 
---
 src/mapi/glapi/gen/KHR_robustness_es.xml | 32 
 1 file changed, 32 insertions(+)

diff --git a/src/mapi/glapi/gen/KHR_robustness_es.xml 
b/src/mapi/glapi/gen/KHR_robustness_es.xml
index 84f6fd2cdb9..82b7edf31a7 100644
--- a/src/mapi/glapi/gen/KHR_robustness_es.xml
+++ b/src/mapi/glapi/gen/KHR_robustness_es.xml
@@ -53,11 +53,43 @@
 
 
 
 
 
 
 
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
-- 
2.17.1

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


[Mesa-dev] [PATCH v2 3/7] mesa: Add support for AMD_depth_clamp_separate

2018-08-22 Thread Sagar Ghuge
Enable _mesa_PushAttrib() and _mesa_PopAttrib() to handle
GL_DEPTH_CLAMP_NEAR_AMD and GL_DEPTH_CLAMP_FAR_AMD tokens.

Remove DepthClamp, because DepthClampNear + DepthClampFar replaces it,
as suggested by Marek Olsak.

Driver that enables AMD_depth_clamp_separate will only ever look at
DepthClampNear and DepthClampFar, as suggested by Ian Romanick.

v2: 1) Remove unnecessary parentheses (Marek Olsak)
2) if AMD_depth_clamp_separate is unsupported, TEST_AND_UPDATE
   GL_DEPTH_CLAMP only (Marek Olsak)
3) Clamp against near and far plane separately (Marek Olsak)
4) Clip point separately for near and far Z clipping plane (Marek
   Olsak)

Signed-off-by: Sagar Ghuge 
---
 src/mesa/drivers/dri/i965/genX_state_upload.c | 11 ++--
 src/mesa/main/attrib.c| 40 +++---
 src/mesa/main/enable.c|  9 ++-
 src/mesa/main/get.c   |  4 ++
 src/mesa/main/get_hash_params.py  |  2 +-
 src/mesa/main/mtypes.h|  1 -
 src/mesa/main/rastpos.c   | 55 ---
 src/mesa/state_tracker/st_atom_rasterizer.c   |  3 +-
 src/mesa/state_tracker/st_cb_drawpixels.c |  3 +-
 src/mesa/swrast/s_span.c  |  2 +-
 src/mesa/tnl/t_vb_program.c   |  6 +-
 src/mesa/tnl/t_vb_vertex.c|  8 ++-
 12 files changed, 111 insertions(+), 33 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c 
b/src/mesa/drivers/dri/i965/genX_state_upload.c
index c051848985..dc54cb67af 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -1399,7 +1399,8 @@ genX(upload_clip_state)(struct brw_context *brw)
   clip.ScreenSpaceViewportYMax = 1;
 
   clip.ViewportXYClipTestEnable = true;
-  clip.ViewportZClipTestEnable = !ctx->Transform.DepthClamp;
+  clip.ViewportZClipTestEnable = !(ctx->Transform.DepthClampNear &&
+   ctx->Transform.DepthClampFar);
 
   /* _NEW_TRANSFORM */
   if (GEN_GEN == 5 || GEN_IS_G4X) {
@@ -1493,7 +1494,8 @@ genX(upload_clip_state)(struct brw_context *brw)
   clip.UserClipDistanceCullTestEnableBitmask =
  brw_vue_prog_data(brw->vs.base.prog_data)->cull_distance_mask;
 
-  clip.ViewportZClipTestEnable = !ctx->Transform.DepthClamp;
+  clip.ViewportZClipTestEnable = !(ctx->Transform.DepthClampNear &&
+   ctx->Transform.DepthClampFar);
 #endif
 
   /* _NEW_LIGHT */
@@ -2338,7 +2340,7 @@ genX(upload_cc_viewport)(struct brw_context *brw)
for (unsigned i = 0; i < viewport_count; i++) {
   /* _NEW_VIEWPORT | _NEW_TRANSFORM */
   const struct gl_viewport_attrib *vp = &ctx->ViewportArray[i];
-  if (ctx->Transform.DepthClamp) {
+  if (ctx->Transform.DepthClampNear && ctx->Transform.DepthClampFar) {
  ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
  ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
   } else {
@@ -4605,7 +4607,8 @@ genX(upload_raster)(struct brw_context *brw)
   raster.ScissorRectangleEnable = ctx->Scissor.EnableFlags;
 
   /* _NEW_TRANSFORM */
-  if (!ctx->Transform.DepthClamp) {
+  if (!(ctx->Transform.DepthClampNear &&
+ctx->Transform.DepthClampFar)) {
 #if GEN_GEN >= 9
  raster.ViewportZFarClipTestEnable = true;
  raster.ViewportZNearClipTestEnable = true;
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index cbe93ab6fa..a46fec73fd 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -72,7 +72,8 @@ struct gl_enable_attrib
GLbitfield ClipPlanes;
GLboolean ColorMaterial;
GLboolean CullFace;
-   GLboolean DepthClamp;
+   GLboolean DepthClampNear;
+   GLboolean DepthClampFar;
GLboolean DepthTest;
GLboolean Dither;
GLboolean Fog;
@@ -336,7 +337,8 @@ _mesa_PushAttrib(GLbitfield mask)
   attr->ClipPlanes = ctx->Transform.ClipPlanesEnabled;
   attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
   attr->CullFace = ctx->Polygon.CullFlag;
-  attr->DepthClamp = ctx->Transform.DepthClamp;
+  attr->DepthClampNear = ctx->Transform.DepthClampNear;
+  attr->DepthClampFar = ctx->Transform.DepthClampFar;
   attr->DepthTest = ctx->Depth.Test;
   attr->Dither = ctx->Color.DitherFlag;
   attr->Fog = ctx->Fog.Enabled;
@@ -627,8 +629,18 @@ pop_enable_group(struct gl_context *ctx, const struct 
gl_enable_attrib *enable)
TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial,
GL_COLOR_MATERIAL);
TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
-   TEST_AND_UPDATE(ctx->Transform.DepthClamp, enable->DepthClamp,
-   GL_DEPTH_CLAMP);
+
+   if (!ctx->Extensions.AMD_depth_clamp_separate) {
+  TEST_AND_UPDATE(ctx->Transform.DepthClampNear && 
ctx->Transform.DepthClampFar,
+  enable->DepthClampNear

Re: [Mesa-dev] [PATCH] amd/addrlib: Fix include path for c99_compat.h

2018-08-22 Thread Mariusz Ceier
Oh, ok, no problem ;) I just sent v2.


On 22 August 2018 at 21:44, Dylan Baker  wrote:
> Quoting Kai Wasserbäch (2018-08-22 14:23:07)
>> Hey Mariusz,
>> Mariusz Ceier wrote on 8/22/18 10:16 PM:
>> > Without this patch mesa doesn't compile:
>> >
>> > In file included from ../mesa-/src/amd/addrlib/addrinterface.cpp:39:
>> > ../mesa-/src/util/macros.h:29:10: fatal error: c99_compat.h: No such 
>> > file or directory
>> >  #include "c99_compat.h"
>> >   ^~
>> > compilation terminated.
>> >
>> > Signed-off-by: Mariusz Ceier 
>>
>> please add:
>>  Fixes 15ca5ce99a (amd/addrlib: mark returnCode as MAYBE_UNUSED in)
>> and you can have my
>>  Acked-by: Kai Wasserbäch 
>>
>> No R-b from me, because I have never used meson to build Mesa and don't plan 
>> to
>> do so before Debian's packaging switches to it.
>>
>> Cheers,
>> Kai
>
> I've added the relevant Fixes and a-b tag, plus my r-b and pushed.
>
> Reviewed-by: Dylan Baker 
>
> Dylan
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] amd/addrlib: Fix include path for c99_compat.h

2018-08-22 Thread Dylan Baker
Quoting Kai Wasserbäch (2018-08-22 14:23:07)
> Hey Mariusz,
> Mariusz Ceier wrote on 8/22/18 10:16 PM:
> > Without this patch mesa doesn't compile:
> > 
> > In file included from ../mesa-/src/amd/addrlib/addrinterface.cpp:39:
> > ../mesa-/src/util/macros.h:29:10: fatal error: c99_compat.h: No such 
> > file or directory
> >  #include "c99_compat.h"
> >   ^~
> > compilation terminated.
> > 
> > Signed-off-by: Mariusz Ceier 
> 
> please add:
>  Fixes 15ca5ce99a (amd/addrlib: mark returnCode as MAYBE_UNUSED in)
> and you can have my
>  Acked-by: Kai Wasserbäch 
> 
> No R-b from me, because I have never used meson to build Mesa and don't plan 
> to
> do so before Debian's packaging switches to it.
> 
> Cheers,
> Kai

I've added the relevant Fixes and a-b tag, plus my r-b and pushed.

Reviewed-by: Dylan Baker 

Dylan


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2] amd/addrlib: Fix include path for c99_compat.h

2018-08-22 Thread Mariusz Ceier
Without this patch mesa doesn't compile:

In file included from ../mesa-/src/amd/addrlib/addrinterface.cpp:39:
../mesa-/src/util/macros.h:29:10: fatal error: c99_compat.h: No such file 
or directory
 #include "c99_compat.h"
  ^~
compilation terminated.

Fixes 15ca5ce99a (amd/addrlib: mark returnCode as MAYBE_UNUSED in 
ElemGetExportNorm)

Signed-off-by: Mariusz Ceier 
Acked-by: Kai Wasserbäch 
---
 src/amd/addrlib/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/addrlib/meson.build b/src/amd/addrlib/meson.build
index a7e9dc8c18..b9550afd2a 100644
--- a/src/amd/addrlib/meson.build
+++ b/src/amd/addrlib/meson.build
@@ -57,7 +57,7 @@ libamdgpu_addrlib = static_library(
 include_directories(
   'core', 'inc/chip/gfx9', 'inc/chip/r800', 'gfx9/chip', 'r800/chip',
 ),
-inc_amd_common, inc_src,
+inc_amd_common, inc_common, inc_src,
   ],
   cpp_args : cpp_vis_args,
 )
-- 
2.18.0

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


Re: [Mesa-dev] [PATCH] vulkan/wsi: fix pointer-integer conversion warnings

2018-08-22 Thread Grazvydas Ignotas
On Tue, Aug 21, 2018 at 1:05 AM, Bas Nieuwenhuizen
 wrote:
> Reviewed-by: Bas Nieuwenhuizen 
>
> Did you have access to push?

Yeah, just pushed everything.

Gražvydas

>
> On Mon, Aug 20, 2018 at 11:40 PM, Grazvydas Ignotas  wrote:
>> For 32bit build. Trivial.
>> ---
>>  src/vulkan/wsi/wsi_common_display.c | 4 ++--
>>  src/vulkan/wsi/wsi_common_x11.c | 2 +-
>>  2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/vulkan/wsi/wsi_common_display.c 
>> b/src/vulkan/wsi/wsi_common_display.c
>> index e6cba188dfa..1e90bba460c 100644
>> --- a/src/vulkan/wsi/wsi_common_display.c
>> +++ b/src/vulkan/wsi/wsi_common_display.c
>> @@ -1515,11 +1515,11 @@ wsi_register_vblank_event(struct wsi_display_fence 
>> *fence,
>> for (;;) {
>>int ret = drmCrtcQueueSequence(wsi->fd, connector->crtc_id,
>>   flags,
>>   frame_requested,
>>   frame_queued,
>> - (uint64_t) fence);
>> + (uintptr_t) fence);
>>
>>if (!ret)
>>   return VK_SUCCESS;
>>
>>if (errno != ENOMEM) {
>> @@ -2340,11 +2340,11 @@ wsi_get_randr_output_display(VkPhysicalDevice 
>> physical_device,
>>wsi_display_get_output(wsi_device, connection, (xcb_randr_output_t) 
>> output);
>>
>> if (connector)
>>*display = wsi_display_connector_to_handle(connector);
>> else
>> -  *display = NULL;
>> +  *display = VK_NULL_HANDLE;
>> return VK_SUCCESS;
>>  }
>>
>>  #endif
>>
>> diff --git a/src/vulkan/wsi/wsi_common_x11.c 
>> b/src/vulkan/wsi/wsi_common_x11.c
>> index 7b930884b47..aaa4d1e658e 100644
>> --- a/src/vulkan/wsi/wsi_common_x11.c
>> +++ b/src/vulkan/wsi/wsi_common_x11.c
>> @@ -1323,11 +1323,11 @@ x11_surface_create_swapchain(VkIcdSurfaceBase 
>> *icd_surface,
>>  * last completion mode, to ensure we don't get into reallocation
>>  * cycles. If we are starting anew, we set 'COPY', as that is the only
>>  * mode which provokes reallocation when anything changes, to make
>>  * sure we have the most optimal allocation.
>>  */
>> -   struct x11_swapchain *old_chain = (void *) pCreateInfo->oldSwapchain;
>> +   struct x11_swapchain *old_chain = (void *)(intptr_t) 
>> pCreateInfo->oldSwapchain;
>> if (old_chain)
>>chain->last_present_mode = old_chain->last_present_mode;
>> else
>>chain->last_present_mode = XCB_PRESENT_COMPLETE_MODE_COPY;
>>
>> --
>> 2.17.1
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] amd/addrlib: Fix include path for c99_compat.h

2018-08-22 Thread Kai Wasserbäch
Hey Mariusz,
Mariusz Ceier wrote on 8/22/18 10:16 PM:
> Without this patch mesa doesn't compile:
> 
> In file included from ../mesa-/src/amd/addrlib/addrinterface.cpp:39:
> ../mesa-/src/util/macros.h:29:10: fatal error: c99_compat.h: No such file 
> or directory
>  #include "c99_compat.h"
>   ^~
> compilation terminated.
> 
> Signed-off-by: Mariusz Ceier 

please add:
 Fixes 15ca5ce99a (amd/addrlib: mark returnCode as MAYBE_UNUSED in)
and you can have my
 Acked-by: Kai Wasserbäch 

No R-b from me, because I have never used meson to build Mesa and don't plan to
do so before Debian's packaging switches to it.

Cheers,
Kai



signature.asc
Description: OpenPGP digital signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/7] Implement AMD_depth_clamp_separate extension

2018-08-22 Thread Ian Romanick
I sent a minor comment on patch 6.  The rest of the series is

Reviewed-by: Ian Romanick 

On 08/21/2018 05:02 PM, Sagar Ghuge wrote:
> This patch series implements AMD_depth_clamp_separate extension.
> Previously I sent patches for comments and based on Ian and Marek's
> suggestions, I did some changes. 
> 
> 1) Get rid of DepthClamp as DepthClampNear + DepthClampFar replaces it
> (Marek Olsak & Ian Romanick)
> 
> 2) Make sure that patch series should build at every commit (Ian
> Romanick)
> 
> 3) Change the sequence of patches (Ian Romanick)
> 
> 4) Wrote a piglit test, in order to test the extension behavior. It is
> also available as a branch on GitLab : 
> 
> https://gitlab.freedesktop.org/sagarghuge/piglit/commits/amd_depth_clamp_separate
> 
> This series is also available as a branch on GitLab:
> 
> https://gitlab.freedesktop.org/sagarghuge/mesa/commits/ext_amd_depth_clamp_sep
> 
> 
> Sagar Ghuge (7):
>   glapi: define AMD_depth_clamp_separate
>   mesa: Add types for AMD_depth_clamp_separate.
>   mesa: Add support for AMD_depth_clamp_separate
>   mesa: add support for GL_AMD_depth_clamp_separate tokens
>   mesa: add EXTRA_EXT for AMD_depth_clamp_separate
>   i965: add functional changes for AMD_depth_clamp_separate
>   i965: enable AMD_depth_clamp_separate
> 
>  include/GL/glcorearb.h|  2 +
>  .../glapi/gen/AMD_depth_clamp_separate.xml| 15 +++
>  src/mapi/glapi/gen/Makefile.am|  1 +
>  src/mapi/glapi/gen/gl_API.xml |  3 ++
>  src/mapi/glapi/gen/meson.build|  1 +
>  src/mesa/drivers/dri/i965/genX_state_upload.c | 34 ++
>  src/mesa/drivers/dri/i965/intel_extensions.c  |  1 +
>  src/mesa/main/attrib.c| 21 ++---
>  src/mesa/main/enable.c| 45 +--
>  src/mesa/main/extensions_table.h  |  1 +
>  src/mesa/main/get.c   |  5 +++
>  src/mesa/main/get_hash_params.py  |  7 ++-
>  src/mesa/main/mtypes.h|  4 +-
>  src/mesa/main/rastpos.c   |  6 ++-
>  src/mesa/state_tracker/st_atom_rasterizer.c   |  3 +-
>  src/mesa/state_tracker/st_cb_drawpixels.c |  3 +-
>  src/mesa/swrast/s_span.c  |  2 +-
>  src/mesa/tnl/t_vb_program.c   |  6 ++-
>  src/mesa/tnl/t_vb_vertex.c|  8 ++--
>  19 files changed, 137 insertions(+), 31 deletions(-)
>  create mode 100644 src/mapi/glapi/gen/AMD_depth_clamp_separate.xml
> 

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


[Mesa-dev] [Bug 107457] [Tracker] Mesa 18.2 release tracker

2018-08-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107457
Bug 107457 depends on bug 107359, which changed state.

Bug 107359 Summary: [Regression] [bisected] [OpenGL CTS] [SKL,BDW] 
KHR-GL46.texture_barrier*-texels, 
GTF-GL46.gtf21.GL2FixedTests.buffer_corners.buffer_corners, and 
GTF-GL46.gtf21.GL2FixedTests.stencil_plane_corners.stencil_plane_corners fail 
with some configuration
https://bugs.freedesktop.org/show_bug.cgi?id=107359

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 6/7] i965: add functional changes for AMD_depth_clamp_separate

2018-08-22 Thread Ilia Mirkin
I admit to always being confused by depth, but:

On Wed, Aug 22, 2018, 16:23 Sagar Ghuge  wrote:

> Gen >= 9 have ability to control clamping of depth values separately at
> near and far plane.
>
> z_w is clamped to the range [min(n,f), 0] if clamping at near plane is
> enabled, [0, max(n,f)] if clamping at far plane is enabled and [min(n,f)
> max(n,f)] if clamping at both plane is enabled.
>
> v2: 1) Use better coding style (Ian Romanick)
>
> Signed-off-by: Sagar Ghuge 
> Reviewed-by: Ian Romanick 
> ---
>  src/mesa/drivers/dri/i965/genX_state_upload.c | 20 ++-
>  1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c
> b/src/mesa/drivers/dri/i965/genX_state_upload.c
> index dc54cb67af..b49c5839b5 100644
> --- a/src/mesa/drivers/dri/i965/genX_state_upload.c
> +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
> @@ -2343,6 +2343,12 @@ genX(upload_cc_viewport)(struct brw_context *brw)
>if (ctx->Transform.DepthClampNear && ctx->Transform.DepthClampFar) {
>   ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
>   ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
> +  } else if (ctx->Transform.DepthClampNear) {
> + ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
> + ccv.MaximumDepth = 0.0;
>

Should this be 1.0? If so, probably should add some tests that would catch
it.

Cheers,

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


[Mesa-dev] [PATCH v2 4/7] mesa: add support for GL_AMD_depth_clamp_separate tokens

2018-08-22 Thread Sagar Ghuge
_mesa_set_enable() and _mesa_IsEnabled() extended to accept new two
tokens GL_DEPTH_CLAMP_NEAR_AMD and GL_DEPTH_CLAMP_FAR_AMD.

v2: Remove unnecessary parentheses (Marek Olsak)

Signed-off-by: Sagar Ghuge 
---
 src/mesa/main/enable.c | 36 
 1 file changed, 36 insertions(+)

diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 4bde9052bc..042b9d1f0a 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1017,6 +1017,30 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, 
GLboolean state)
  ctx->Transform.DepthClampFar = state;
  break;
 
+  case GL_DEPTH_CLAMP_NEAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate, cap);
+ if (ctx->Transform.DepthClampNear == state)
+return;
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 :
+   _NEW_TRANSFORM);
+ ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp;
+ ctx->Transform.DepthClampNear = state;
+ break;
+
+  case GL_DEPTH_CLAMP_FAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate, cap);
+ if (ctx->Transform.DepthClampFar == state)
+return;
+ FLUSH_VERTICES(ctx, ctx->DriverFlags.NewDepthClamp ? 0 :
+   _NEW_TRANSFORM);
+ ctx->NewDriverState |= ctx->DriverFlags.NewDepthClamp;
+ ctx->Transform.DepthClampFar = state;
+ break;
+
   case GL_FRAGMENT_SHADER_ATI:
  if (ctx->API != API_OPENGL_COMPAT)
 goto invalid_enum_error;
@@ -1689,6 +1713,18 @@ _mesa_IsEnabled( GLenum cap )
  return (ctx->Transform.DepthClampNear ||
  ctx->Transform.DepthClampFar);
 
+  case GL_DEPTH_CLAMP_NEAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate);
+ return ctx->Transform.DepthClampNear;
+
+  case GL_DEPTH_CLAMP_FAR_AMD:
+ if (!_mesa_is_desktop_gl(ctx))
+goto invalid_enum_error;
+ CHECK_EXTENSION(AMD_depth_clamp_separate);
+ return ctx->Transform.DepthClampFar;
+
   case GL_FRAGMENT_SHADER_ATI:
  if (ctx->API != API_OPENGL_COMPAT)
 goto invalid_enum_error;
-- 
2.17.1

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


[Mesa-dev] [PATCH v2 6/7] i965: add functional changes for AMD_depth_clamp_separate

2018-08-22 Thread Sagar Ghuge
Gen >= 9 have ability to control clamping of depth values separately at
near and far plane.

z_w is clamped to the range [min(n,f), 0] if clamping at near plane is
enabled, [0, max(n,f)] if clamping at far plane is enabled and [min(n,f)
max(n,f)] if clamping at both plane is enabled.

v2: 1) Use better coding style (Ian Romanick)

Signed-off-by: Sagar Ghuge 
Reviewed-by: Ian Romanick 
---
 src/mesa/drivers/dri/i965/genX_state_upload.c | 20 ++-
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c 
b/src/mesa/drivers/dri/i965/genX_state_upload.c
index dc54cb67af..b49c5839b5 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -2343,6 +2343,12 @@ genX(upload_cc_viewport)(struct brw_context *brw)
   if (ctx->Transform.DepthClampNear && ctx->Transform.DepthClampFar) {
  ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
  ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
+  } else if (ctx->Transform.DepthClampNear) {
+ ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
+ ccv.MaximumDepth = 0.0;
+  } else if (ctx->Transform.DepthClampFar) {
+ ccv.MinimumDepth = 0.0;
+ ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
   } else {
  ccv.MinimumDepth = 0.0;
  ccv.MaximumDepth = 1.0;
@@ -4607,15 +4613,19 @@ genX(upload_raster)(struct brw_context *brw)
   raster.ScissorRectangleEnable = ctx->Scissor.EnableFlags;
 
   /* _NEW_TRANSFORM */
+#if GEN_GEN < 9
   if (!(ctx->Transform.DepthClampNear &&
-ctx->Transform.DepthClampFar)) {
+ctx->Transform.DepthClampFar))
+ raster.ViewportZClipTestEnable = true;
+#endif
+
 #if GEN_GEN >= 9
- raster.ViewportZFarClipTestEnable = true;
+  if (!ctx->Transform.DepthClampNear)
  raster.ViewportZNearClipTestEnable = true;
-#else
- raster.ViewportZClipTestEnable = true;
+
+  if (!ctx->Transform.DepthClampFar)
+ raster.ViewportZFarClipTestEnable = true;
 #endif
-  }
 
   /* BRW_NEW_CONSERVATIVE_RASTERIZATION */
 #if GEN_GEN >= 9
-- 
2.17.1

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


[Mesa-dev] [PATCH] amd/addrlib: Fix include path for c99_compat.h

2018-08-22 Thread Mariusz Ceier
Without this patch mesa doesn't compile:

In file included from ../mesa-/src/amd/addrlib/addrinterface.cpp:39:
../mesa-/src/util/macros.h:29:10: fatal error: c99_compat.h: No such file 
or directory
 #include "c99_compat.h"
  ^~
compilation terminated.

Signed-off-by: Mariusz Ceier 
---
 src/amd/addrlib/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/addrlib/meson.build b/src/amd/addrlib/meson.build
index a7e9dc8c18..b9550afd2a 100644
--- a/src/amd/addrlib/meson.build
+++ b/src/amd/addrlib/meson.build
@@ -57,7 +57,7 @@ libamdgpu_addrlib = static_library(
 include_directories(
   'core', 'inc/chip/gfx9', 'inc/chip/r800', 'gfx9/chip', 'r800/chip',
 ),
-inc_amd_common, inc_src,
+inc_amd_common, inc_common, inc_src,
   ],
   cpp_args : cpp_vis_args,
 )
-- 
2.18.0

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


Re: [Mesa-dev] [PATCH v2 2/7] mesa: Add types for AMD_depth_clamp_separate.

2018-08-22 Thread Marek Olšák
Reviewed-by: Marek Olšák 

Marek
On Wed, Aug 22, 2018 at 4:00 PM Sagar Ghuge  wrote:
>
> Add some basic types and storage for the AMD_depth_clamp_separate
> extension.
>
> v2: 1) Drop unnecessary definition (Marek Olsak)
> 2) Expose extension in compatibility profile (Marek Olsak)
>
> Signed-off-by: Sagar Ghuge 
> ---
>  src/mesa/main/extensions_table.h | 1 +
>  src/mesa/main/mtypes.h   | 3 +++
>  2 files changed, 4 insertions(+)
>
> diff --git a/src/mesa/main/extensions_table.h 
> b/src/mesa/main/extensions_table.h
> index 746e821886..b7ff437032 100644
> --- a/src/mesa/main/extensions_table.h
> +++ b/src/mesa/main/extensions_table.h
> @@ -9,6 +9,7 @@
>  EXT(3DFX_texture_compression_FXT1   , TDFX_texture_compression_FXT1  
> , GLL, GLC,  x ,  x , 1999)
>
>  EXT(AMD_conservative_depth  , ARB_conservative_depth 
> , GLL, GLC,  x ,  x , 2009)
> +EXT(AMD_depth_clamp_separate, AMD_depth_clamp_separate   
> , GLL, GLC,  x ,  x , 2009)
>  EXT(AMD_draw_buffers_blend  , ARB_draw_buffers_blend 
> , GLL, GLC,  x ,  x , 2009)
>  EXT(AMD_framebuffer_multisample_advanced, 
> AMD_framebuffer_multisample_advanced   , GLL, GLC,  x , ES2, 2018)
>  EXT(AMD_performance_monitor , AMD_performance_monitor
> , GLL, GLC,  x , ES2, 2007)
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 50ef898fc4..3df657cc5d 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -1283,6 +1283,8 @@ struct gl_transform_attrib
> GLboolean RescaleNormals;   /**< GL_EXT_rescale_normal */
> GLboolean RasterPositionUnclipped;   /**< GL_IBM_rasterpos_clip */
> GLboolean DepthClamp;   /**< GL_ARB_depth_clamp */
> +   GLboolean DepthClampNear;   /**< 
> GL_AMD_depth_clamp_separate */
> +   GLboolean DepthClampFar;/**< 
> GL_AMD_depth_clamp_separate */
> /** GL_ARB_clip_control */
> GLenum16 ClipOrigin;   /**< GL_LOWER_LEFT or GL_UPPER_LEFT */
> GLenum16 ClipDepthMode;/**< GL_NEGATIVE_ONE_TO_ONE or GL_ZERO_TO_ONE */
> @@ -4256,6 +4258,7 @@ struct gl_extensions
> GLboolean OES_viewport_array;
> /* vendor extensions */
> GLboolean AMD_framebuffer_multisample_advanced;
> +   GLboolean AMD_depth_clamp_separate;
> GLboolean AMD_performance_monitor;
> GLboolean AMD_pinned_memory;
> GLboolean AMD_seamless_cubemap_per_texture;
> --
> 2.17.1
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 6/7] i965: add functional changes for AMD_depth_clamp_separate

2018-08-22 Thread Ian Romanick
On 08/21/2018 05:02 PM, Sagar Ghuge wrote:
> Gen >= 9 have ability to control clamping of depth values separately at
> near and far plane.
> 
> z_w is clamped to the range [min(n,f), 0] if clamping at near plane is
> enabled, [0, max(n,f)] if clamping at far plane is enabled and [min(n,f)
> max(n,f)] if clamping at both plane is enabled.
> 
> Signed-off-by: Sagar Ghuge 
> ---
>  src/mesa/drivers/dri/i965/genX_state_upload.c | 23 +++
>  1 file changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c 
> b/src/mesa/drivers/dri/i965/genX_state_upload.c
> index dc54cb67af..4e978bed91 100644
> --- a/src/mesa/drivers/dri/i965/genX_state_upload.c
> +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
> @@ -2343,7 +2343,13 @@ genX(upload_cc_viewport)(struct brw_context *brw)
>if (ctx->Transform.DepthClampNear && ctx->Transform.DepthClampFar) {
>   ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
>   ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
> -  } else {
> +  } else if (ctx->Transform.DepthClampNear) {
> + ccv.MinimumDepth = MIN2(vp->Near, vp->Far);
> + ccv.MaximumDepth = 0.0;
> +  } else if (ctx->Transform.DepthClampFar) {
> + ccv.MinimumDepth = 0.0;
> + ccv.MaximumDepth = MAX2(vp->Near, vp->Far);
> +  }else {
  ^
Missing space here.

With that fixed, this patch is

Reviewed-by: Ian Romanick 

>   ccv.MinimumDepth = 0.0;
>   ccv.MaximumDepth = 1.0;
>}
> @@ -4607,16 +4613,23 @@ genX(upload_raster)(struct brw_context *brw)
>raster.ScissorRectangleEnable = ctx->Scissor.EnableFlags;
>  
>/* _NEW_TRANSFORM */
> +#if GEN_GEN < 9
>if (!(ctx->Transform.DepthClampNear &&
>  ctx->Transform.DepthClampFar)) {
> -#if GEN_GEN >= 9
> - raster.ViewportZFarClipTestEnable = true;
> - raster.ViewportZNearClipTestEnable = true;
> -#else
>   raster.ViewportZClipTestEnable = true;
> +  }
>  #endif
> +
> +#if GEN_GEN >= 9
> +  if (!ctx->Transform.DepthClampNear) {
> + raster.ViewportZNearClipTestEnable = true;
>}

If the condition and the body of an if-statement are each a single text
line, it's okay to omit the { }.  If either the condition or the single
statement of the body are long enough to require line-wrapping, we still
require the { } because it improves readability.

You don't need to change this here.  I just thought I'd let you know for
future reference.  It's "coder's preference." :)

>  
> +  if (!ctx->Transform.DepthClampFar) {
> + raster.ViewportZFarClipTestEnable = true;
> +  }
> +#endif
> +
>/* BRW_NEW_CONSERVATIVE_RASTERIZATION */
>  #if GEN_GEN >= 9
>raster.ConservativeRasterizationEnable =
> 

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


[Mesa-dev] [PATCH v2 2/7] mesa: Add types for AMD_depth_clamp_separate.

2018-08-22 Thread Sagar Ghuge
Add some basic types and storage for the AMD_depth_clamp_separate
extension.

v2: 1) Drop unnecessary definition (Marek Olsak)
2) Expose extension in compatibility profile (Marek Olsak)

Signed-off-by: Sagar Ghuge 
---
 src/mesa/main/extensions_table.h | 1 +
 src/mesa/main/mtypes.h   | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 746e821886..b7ff437032 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -9,6 +9,7 @@
 EXT(3DFX_texture_compression_FXT1   , TDFX_texture_compression_FXT1
  , GLL, GLC,  x ,  x , 1999)
 
 EXT(AMD_conservative_depth  , ARB_conservative_depth   
  , GLL, GLC,  x ,  x , 2009)
+EXT(AMD_depth_clamp_separate, AMD_depth_clamp_separate 
  , GLL, GLC,  x ,  x , 2009)
 EXT(AMD_draw_buffers_blend  , ARB_draw_buffers_blend   
  , GLL, GLC,  x ,  x , 2009)
 EXT(AMD_framebuffer_multisample_advanced, 
AMD_framebuffer_multisample_advanced   , GLL, GLC,  x , ES2, 2018)
 EXT(AMD_performance_monitor , AMD_performance_monitor  
  , GLL, GLC,  x , ES2, 2007)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 50ef898fc4..3df657cc5d 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1283,6 +1283,8 @@ struct gl_transform_attrib
GLboolean RescaleNormals;   /**< GL_EXT_rescale_normal */
GLboolean RasterPositionUnclipped;   /**< GL_IBM_rasterpos_clip */
GLboolean DepthClamp;   /**< GL_ARB_depth_clamp */
+   GLboolean DepthClampNear;   /**< 
GL_AMD_depth_clamp_separate */
+   GLboolean DepthClampFar;/**< 
GL_AMD_depth_clamp_separate */
/** GL_ARB_clip_control */
GLenum16 ClipOrigin;   /**< GL_LOWER_LEFT or GL_UPPER_LEFT */
GLenum16 ClipDepthMode;/**< GL_NEGATIVE_ONE_TO_ONE or GL_ZERO_TO_ONE */
@@ -4256,6 +4258,7 @@ struct gl_extensions
GLboolean OES_viewport_array;
/* vendor extensions */
GLboolean AMD_framebuffer_multisample_advanced;
+   GLboolean AMD_depth_clamp_separate;
GLboolean AMD_performance_monitor;
GLboolean AMD_pinned_memory;
GLboolean AMD_seamless_cubemap_per_texture;
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH v2 2/7]] mesa: Add types for AMD_depth_clamp_separate.

2018-08-22 Thread Sagar Ghuge
Please ignore this patch. Subject contains extra bracket. 
I will resend the patch. 

On 08/22/2018 12:54 PM, Sagar Ghuge wrote:
> Add some basic types and storage for the AMD_depth_clamp_separate
> extension.
> 
> v2: 1) Drop unnecessary definition (Marek Olsak)
> 2) Expose extension in compatibility profile (Marek Olsak)
> 
> Signed-off-by: Sagar Ghuge 
> ---
>  src/mesa/main/extensions_table.h | 1 +
>  src/mesa/main/mtypes.h   | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/src/mesa/main/extensions_table.h 
> b/src/mesa/main/extensions_table.h
> index 746e821886..b7ff437032 100644
> --- a/src/mesa/main/extensions_table.h
> +++ b/src/mesa/main/extensions_table.h
> @@ -9,6 +9,7 @@
>  EXT(3DFX_texture_compression_FXT1   , TDFX_texture_compression_FXT1  
> , GLL, GLC,  x ,  x , 1999)
>  
>  EXT(AMD_conservative_depth  , ARB_conservative_depth 
> , GLL, GLC,  x ,  x , 2009)
> +EXT(AMD_depth_clamp_separate, AMD_depth_clamp_separate   
> , GLL, GLC,  x ,  x , 2009)
>  EXT(AMD_draw_buffers_blend  , ARB_draw_buffers_blend 
> , GLL, GLC,  x ,  x , 2009)
>  EXT(AMD_framebuffer_multisample_advanced, 
> AMD_framebuffer_multisample_advanced   , GLL, GLC,  x , ES2, 2018)
>  EXT(AMD_performance_monitor , AMD_performance_monitor
> , GLL, GLC,  x , ES2, 2007)
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 50ef898fc4..3df657cc5d 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -1283,6 +1283,8 @@ struct gl_transform_attrib
> GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */
> GLboolean RasterPositionUnclipped;   /**< GL_IBM_rasterpos_clip */
> GLboolean DepthClamp; /**< GL_ARB_depth_clamp */
> +   GLboolean DepthClampNear; /**< 
> GL_AMD_depth_clamp_separate */
> +   GLboolean DepthClampFar;  /**< 
> GL_AMD_depth_clamp_separate */
> /** GL_ARB_clip_control */
> GLenum16 ClipOrigin;   /**< GL_LOWER_LEFT or GL_UPPER_LEFT */
> GLenum16 ClipDepthMode;/**< GL_NEGATIVE_ONE_TO_ONE or GL_ZERO_TO_ONE */
> @@ -4256,6 +4258,7 @@ struct gl_extensions
> GLboolean OES_viewport_array;
> /* vendor extensions */
> GLboolean AMD_framebuffer_multisample_advanced;
> +   GLboolean AMD_depth_clamp_separate;
> GLboolean AMD_performance_monitor;
> GLboolean AMD_pinned_memory;
> GLboolean AMD_seamless_cubemap_per_texture;
> 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v2 2/7]] mesa: Add types for AMD_depth_clamp_separate.

2018-08-22 Thread Sagar Ghuge
Add some basic types and storage for the AMD_depth_clamp_separate
extension.

v2: 1) Drop unnecessary definition (Marek Olsak)
2) Expose extension in compatibility profile (Marek Olsak)

Signed-off-by: Sagar Ghuge 
---
 src/mesa/main/extensions_table.h | 1 +
 src/mesa/main/mtypes.h   | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 746e821886..b7ff437032 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -9,6 +9,7 @@
 EXT(3DFX_texture_compression_FXT1   , TDFX_texture_compression_FXT1
  , GLL, GLC,  x ,  x , 1999)
 
 EXT(AMD_conservative_depth  , ARB_conservative_depth   
  , GLL, GLC,  x ,  x , 2009)
+EXT(AMD_depth_clamp_separate, AMD_depth_clamp_separate 
  , GLL, GLC,  x ,  x , 2009)
 EXT(AMD_draw_buffers_blend  , ARB_draw_buffers_blend   
  , GLL, GLC,  x ,  x , 2009)
 EXT(AMD_framebuffer_multisample_advanced, 
AMD_framebuffer_multisample_advanced   , GLL, GLC,  x , ES2, 2018)
 EXT(AMD_performance_monitor , AMD_performance_monitor  
  , GLL, GLC,  x , ES2, 2007)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 50ef898fc4..3df657cc5d 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1283,6 +1283,8 @@ struct gl_transform_attrib
GLboolean RescaleNormals;   /**< GL_EXT_rescale_normal */
GLboolean RasterPositionUnclipped;   /**< GL_IBM_rasterpos_clip */
GLboolean DepthClamp;   /**< GL_ARB_depth_clamp */
+   GLboolean DepthClampNear;   /**< 
GL_AMD_depth_clamp_separate */
+   GLboolean DepthClampFar;/**< 
GL_AMD_depth_clamp_separate */
/** GL_ARB_clip_control */
GLenum16 ClipOrigin;   /**< GL_LOWER_LEFT or GL_UPPER_LEFT */
GLenum16 ClipDepthMode;/**< GL_NEGATIVE_ONE_TO_ONE or GL_ZERO_TO_ONE */
@@ -4256,6 +4258,7 @@ struct gl_extensions
GLboolean OES_viewport_array;
/* vendor extensions */
GLboolean AMD_framebuffer_multisample_advanced;
+   GLboolean AMD_depth_clamp_separate;
GLboolean AMD_performance_monitor;
GLboolean AMD_pinned_memory;
GLboolean AMD_seamless_cubemap_per_texture;
-- 
2.17.1

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


Re: [Mesa-dev] [PATCH mesa] vk/wsi: avoid reading uninitialised memory

2018-08-22 Thread Caio Marcelo de Oliveira Filho
On Tue, Jul 17, 2018 at 01:18:42PM +0100, Eric Engestrom wrote:
> It will be ignored by x11_swapchain_result() anyway (because reaching
> the `fail` label without setting `result` means the swapchain status was
> already a hard error), but the compiler still complains about reading
> uninitialised memory.
> 
> While at it, drop the unused assignment right before returning.
> 
> Signed-off-by: Eric Engestrom 
> ---
>  src/vulkan/wsi/wsi_common_x11.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Caio Marcelo de Oliveira Filho 

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


Re: [Mesa-dev] [PATCH 7/9] intel/nir: Use the new dead write vars pass

2018-08-22 Thread Jason Ekstrand
shader-db numbers?

On Wed, Aug 15, 2018 at 4:57 PM Caio Marcelo de Oliveira Filho <
caio.olive...@intel.com> wrote:

> ---
>  src/intel/compiler/brw_nir.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c
> index 31ffbe613ec..afc73e58c71 100644
> --- a/src/intel/compiler/brw_nir.c
> +++ b/src/intel/compiler/brw_nir.c
> @@ -543,6 +543,7 @@ brw_nir_optimize(nir_shader *nir, const struct
> brw_compiler *compiler,
>progress = false;
>OPT(nir_lower_vars_to_ssa);
>OPT(nir_opt_copy_prop_vars);
> +  OPT(nir_opt_dead_write_vars);
>
>if (is_scalar) {
>   OPT(nir_lower_alu_to_scalar);
> --
> 2.18.0
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 5/9] nir: Add a local dead write vars removal pass

2018-08-22 Thread Jason Ekstrand
On Wed, Aug 15, 2018 at 4:57 PM Caio Marcelo de Oliveira Filho <
caio.olive...@intel.com> wrote:

> Instead of doing this as part of the existing (local) copy prop vars
> pass.  This is an intermediate step before changing both the dead
> write and the copy prop vars to act on the whole program instead of on
> local blocks.  The nature of data we store and the way we iterate is
> different enough that would be awkward keeping those together.
> ---
>  src/compiler/Makefile.sources  |   1 +
>  src/compiler/nir/meson.build   |   1 +
>  src/compiler/nir/nir.h |   2 +
>  src/compiler/nir/nir_opt_dead_write_vars.c | 243 +
>  4 files changed, 247 insertions(+)
>  create mode 100644 src/compiler/nir/nir_opt_dead_write_vars.c
>
> diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
> index 27a54e0be09..fa93ad08a16 100644
> --- a/src/compiler/Makefile.sources
> +++ b/src/compiler/Makefile.sources
> @@ -274,6 +274,7 @@ NIR_FILES = \
> nir/nir_opt_cse.c \
> nir/nir_opt_dce.c \
> nir/nir_opt_dead_cf.c \
> +   nir/nir_opt_dead_write_vars.c \
> nir/nir_opt_gcm.c \
> nir/nir_opt_global_to_local.c \
> nir/nir_opt_if.c \
> diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build
> index 8708f9b069c..1c164a548a7 100644
> --- a/src/compiler/nir/meson.build
> +++ b/src/compiler/nir/meson.build
> @@ -158,6 +158,7 @@ files_libnir = files(
>'nir_opt_cse.c',
>'nir_opt_dce.c',
>'nir_opt_dead_cf.c',
> +  'nir_opt_dead_write_vars.c',
>'nir_opt_gcm.c',
>'nir_opt_global_to_local.c',
>'nir_opt_if.c',
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index d0fa693884b..becf6e351c3 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -2968,6 +2968,8 @@ bool nir_opt_dce(nir_shader *shader);
>
>  bool nir_opt_dead_cf(nir_shader *shader);
>
> +bool nir_opt_dead_write_vars(nir_shader *shader);
> +
>  bool nir_opt_gcm(nir_shader *shader, bool value_number);
>
>  bool nir_opt_if(nir_shader *shader);
> diff --git a/src/compiler/nir/nir_opt_dead_write_vars.c
> b/src/compiler/nir/nir_opt_dead_write_vars.c
> new file mode 100644
> index 000..822bfa5595d
> --- /dev/null
> +++ b/src/compiler/nir/nir_opt_dead_write_vars.c
> @@ -0,0 +1,243 @@
> +/*
> + * Copyright © 2018 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> next
> + * paragraph) shall be included in all copies or substantial portions of
> the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
> SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> DEALINGS
> + * IN THE SOFTWARE.
> + */
> +
> +#include "nir.h"
> +#include "nir_builder.h"
> +#include "nir_deref.h"
> +
> +#include "util/u_dynarray.h"
> +
> +struct state {
> +   void *mem_ctx;
> +
> +   /* Maps nir_deref_instr to a corresponding nir_deref_path.  Avoids
> +* rebuilding the paths for the same deref. */
> +   struct hash_table *paths;
> +   void *path_lin_ctx;
> +};
> +
> +static nir_deref_path *
> +get_path(struct state *state, nir_deref_instr *deref)
> +{
> +   struct hash_entry *entry = _mesa_hash_table_search(state->paths,
> deref);
> +   if (!entry) {
> +  nir_deref_path *path = linear_zalloc_child(state->path_lin_ctx,
> sizeof(nir_deref_path));
> +  nir_deref_path_init(path, deref, state->mem_ctx);
> +  _mesa_hash_table_insert(state->paths, deref, path);
> +  return path;
> +   } else {
> +  return entry->data;
> +   }
> +}
>

Do you have any proof that this actually helps?  The deref_path stuff was
designed to be put on the stack and absolutely as efficient as possible.
In the common case of a deref chain with only a couple of elements, I would
expect to actually be more work to look it up in a hash table.


> +
> +/* Entry for unused_writes arrays. */
> +struct write_entry {
> +   /* If NULL indicates the entry is free to be reused. */
> +   nir_intrinsic_instr *intrin;
> +   uintptr_t mask;
> +   nir_deref_path *path;
> +};
> +
> +static void
> +clear_unused_for_modes(

[Mesa-dev] [PATCH piglit] egl_khr_create_context: Proper invalid attributes for EGL 1.5

2018-08-22 Thread Miguel A. Vico
When EGL_KHR_create_context was originally written,
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR was an invalid
attribute for OpenGL ES.

After moving the extension to core EGL 1.5, the aforementioned
attribute was made valid for both OpenGL and OpenGL ES.

Check whether the EGL version is lower than 1.5 before checking
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR is an invalid
attribute.

Signed-off-by: Miguel A Vico Moya 
---
 .../egl/spec/egl_khr_create_context/common.c  |  5 ++--
 .../egl/spec/egl_khr_create_context/common.h  |  8 +++
 .../invalid-attribute-gles.c  | 24 +++
 3 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/tests/egl/spec/egl_khr_create_context/common.c 
b/tests/egl/spec/egl_khr_create_context/common.c
index a443ced97..ba0311bff 100644
--- a/tests/egl/spec/egl_khr_create_context/common.c
+++ b/tests/egl/spec/egl_khr_create_context/common.c
@@ -27,6 +27,8 @@
 
 static Display *dpy = NULL;
 EGLDisplay egl_dpy;
+EGLint egl_major;
+EGLint egl_minor;
 EGLConfig cfg;
 EGLContext ctx;
 
@@ -87,7 +89,6 @@ EGL_KHR_create_context_setup(EGLint renderable_type_mask)
EGL_NONE
};
EGLint count;
-   EGLint major, minor;
 
dpy = XOpenDisplay(NULL);
if (dpy == NULL) {
@@ -101,7 +102,7 @@ EGL_KHR_create_context_setup(EGLint renderable_type_mask)
piglit_report_result(PIGLIT_FAIL);
}
 
-   if (!eglInitialize(egl_dpy, &major, &minor)) {
+   if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
fprintf(stderr, "eglInitialize() failed\n");
piglit_report_result(PIGLIT_FAIL);
}
diff --git a/tests/egl/spec/egl_khr_create_context/common.h 
b/tests/egl/spec/egl_khr_create_context/common.h
index f4f42760c..269610f01 100644
--- a/tests/egl/spec/egl_khr_create_context/common.h
+++ b/tests/egl/spec/egl_khr_create_context/common.h
@@ -51,6 +51,8 @@
 #endif
 
 extern EGLDisplay egl_dpy;
+extern EGLint egl_major;
+extern EGLint egl_minor;
 extern EGLConfig cfg;
 extern EGLContext ctx;
 
@@ -75,3 +77,9 @@ version_is_valid_for_context(int ctx_major, int major, int 
minor)
}
return false;
 }
+
+static inline bool
+check_egl_version(int major, int minor)
+{
+   return ((egl_major > major) || ((egl_major == major) && (egl_minor >= 
minor)));
+}
diff --git a/tests/egl/spec/egl_khr_create_context/invalid-attribute-gles.c 
b/tests/egl/spec/egl_khr_create_context/invalid-attribute-gles.c
index 7d23e5673..d2b98818c 100644
--- a/tests/egl/spec/egl_khr_create_context/invalid-attribute-gles.c
+++ b/tests/egl/spec/egl_khr_create_context/invalid-attribute-gles.c
@@ -79,6 +79,22 @@ int main(int argc, char **argv)
 *attribute is only meaningful for OpenGL contexts, and specifying 
it
 *for other types of contexts, including OpenGL ES contexts, will
 *generate an error."
+*
+* However, after making the extension part of core EGL 1.5,
+* EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR was made a valid
+* attribute for OpenGL ES contexts:
+*
+*"The attribute EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY
+*specifies reset notification behavior for a context supporting
+*robust buffer access.  The attribute value may be either
+*EGL_NO_RESET_NOTIFICATION or EGL_LOSE_CONTEXT_ON_RESET, which
+*respectively result in reset notification behavior of
+*GL_NO_RESET_NOTIFICATION_ARB and GL_LOSE_CONTEXT_ON_RESET_ARB, as
+*described by the OpenGL GL_ARB_robustness extension, or by
+*equivalent functionality.
+*
+*This attribute is supported only for OpenGL and OpenGL ES
+*contexts."
 */
EGLint bad_attributes[] = {
0x,
@@ -97,6 +113,14 @@ int main(int argc, char **argv)
}
 
for (i = 0; i < ARRAY_SIZE(bad_attributes); i++) {
+   /* Skip EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR if
+* it's EGL 1.5+
+*/
+   if ((bad_attributes[i] == 
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR) &&
+   check_egl_version(1, 5)) {
+   continue;
+   }
+
pass = try_attribute(bad_attributes[i]) && pass;
}
 
-- 
2.18.0

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


Re: [Mesa-dev] [PATCH] nir/vars_to_ssa: Don't build deref nodes for non-local variables

2018-08-22 Thread Caio Marcelo de Oliveira Filho
On Mon, Jul 09, 2018 at 05:11:54PM -0700, Jason Ekstrand wrote:
> ---
>  src/compiler/nir/nir_lower_vars_to_ssa.c | 18 ++
>  1 file changed, 14 insertions(+), 4 deletions(-)

This patch is

Reviewed-by: Caio Marcelo de Oliveira Filho 


I also verified it pass the test that was failing in the previous
version.

dEQP-VK.spirv_assembly.instruction.graphics.decoration_group.multiple_decoration_groups_on_same_variable_tessc


Thanks,
Caio
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v4 46/49] appveyor: use chocolatey (cinst) to install winflexbison

2018-08-22 Thread Jose Fonseca

On 22/08/18 18:05, Dylan Baker wrote:

v2: - fix typos in commit message
---
  appveyor.yml | 6 +-
  1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index 15a31da9411..b26a3c624e8 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -34,7 +34,6 @@ branches:
  clone_depth: 100
  
  cache:

-- win_flex_bison-2.5.9.zip
  - llvm-5.0.1-msvc2015-mtd.7z
  - subprojects\packagecache
  
@@ -46,7 +45,6 @@ init:

  - git config --global core.autocrlf true
  
  environment:

-  WINFLEXBISON_ARCHIVE: win_flex_bison-2.5.9.zip
LLVM_ARCHIVE: llvm-5.0.1-msvc2015-mtd.7z
matrix:
  - BUILD_SYSTEM: meson
@@ -72,9 +70,7 @@ install:
  - if "%BUILD_SYSTEM%"=="meson" ninja --version
  - if "%BUILD_SYSTEM%"=="meson" call "C:\Program Files (x86)\Microsoft Visual 
Studio 14.0\VC\vcvarsall.bat" x86
  # Install flex/bison
-- if not exist "%WINFLEXBISON_ARCHIVE%" appveyor DownloadFile 
"https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdownloads.sourceforge.net%2Fproject%2Fwinflexbison%2Fold_versions%2F%25WINFLEXBISON_ARCHIVE%25&data=02%7C01%7Cjfonseca%40vmware.com%7C075d2af0e3d4415da59f08d6085217c0%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636705546029228240&sdata=yX%2BTOaizEhvzgHGwArmD4BQcJ54Tr5FCo8H6jFX1DN0%3D&reserved=0";
-- 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
-- set Path=%CD%\winflexbison;%Path%
+- cinst -y winflexbison
  - win_flex --version
  - win_bison --version
  # Download and extract LLVM



I'm afraid this is a bad idea, because AppVeyor -> SourceForge downloads 
are not very reliable.


IIRC, we used to get winflex via cinst, but abandoned because of this.

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


Re: [Mesa-dev] [PATCH 4/9] nir: Give end_block its own index

2018-08-22 Thread Jason Ekstrand
Seems reasonable

Reviewed-by: Jason Ekstrand 

On Wed, Aug 15, 2018 at 4:58 PM Caio Marcelo de Oliveira Filho <
caio.olive...@intel.com> wrote:

> Since there's no particular reason for the index to be 0, choose an
> index that is not used by other block.  This is convenient when we
> store "per-block" data in an array AND look for the successors
> data (e.g. any kind of backwards data-flow analysis).
> ---
>  src/compiler/nir/nir.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
> index e12aa5d80f5..1a5cfc27b74 100644
> --- a/src/compiler/nir/nir.c
> +++ b/src/compiler/nir/nir.c
> @@ -1641,7 +1641,7 @@ nir_index_blocks(nir_function_impl *impl)
>block->index = index++;
> }
>
> -   impl->num_blocks = index;
> +   impl->num_blocks = impl->end_block->index = index;
>

Mind dropping in a quick comment saying that end_block isn't really in the
program which is why it's index is >= num_blocks.


>  }
>
>  static bool
> --
> 2.18.0
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/9] nir: Skip common instructions when comparing deref paths

2018-08-22 Thread Jason Ekstrand
Reviewed-by: Jason Ekstrand 

On Wed, Aug 15, 2018 at 4:57 PM Caio Marcelo de Oliveira Filho <
caio.olive...@intel.com> wrote:

> Deref paths may share the same deref instructions in their chains,
> e.g.
>
> ssa_100 = deref_var A
> ssa_101 = deref_struct "array_field" of ssa_100
> ssa_102 = deref_array "[1]" of ssa_101
> ssa_103 = deref_struct "field_a" of ssa_102
> ssa_104 = deref_struct "field_a" of ssa_103
>
> when comparing the two last deref instructions, their paths will share
> a common sequence ssa_100, ssa_101, ssa_102.  This patch skips to next
> iteration if the deref instructions are the same.  Path[0] (the var)
> is still handled specially, so in the case above, only ssa_101 and
> ssa_102 will be skipped.
> ---
>  src/compiler/nir/nir_deref.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
> index d013b423a8b..c8851688f9d 100644
> --- a/src/compiler/nir/nir_deref.c
> +++ b/src/compiler/nir/nir_deref.c
> @@ -294,6 +294,9 @@ nir_compare_deref_paths(nir_deref_path *a_path,
>nir_deref_instr *a_tail = *(a_p++);
>nir_deref_instr *b_tail = *(b_p++);
>
> +  if (a_tail == b_tail)
> + continue;
> +
>switch (a_tail->deref_type) {
>case nir_deref_type_array:
>case nir_deref_type_array_wildcard: {
> --
> 2.18.0
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 05/12] amd/addrlib: mark physicalSliceSize as MAYBE_UNUSED in Addr::V1::EgBasedLib::HwlGetSizeAdjustmentMicroTiled

2018-08-22 Thread Marek Olšák
Pushed, thanks!

Marek
On Wed, Aug 22, 2018 at 11:30 AM Kai Wasserbäch
 wrote:
>
> Kai Wasserbäch wrote on 8/22/18 5:19 PM:
> > Hey Marek,
> > Marek Olšák wrote on 8/22/18 3:13 AM:
> >> Get you send me a "git fetch" line that I can use to download your patches?
> >
> > sure. I rebased them on top of the current master and pushed the five 
> > patches to
> > a new branch fix-warnings2-addrlibv2 on the FDO GitLab. Find the pull 
> > request
> > for that below:
> >
> > The following changes since commit 4c43ec461de4f122d5d6566361d064c816e4ef69:
> >
> >   ac/nir: fix getting GLSL type of array of samplers for TG4 (2018-08-22
> > 15:23:11 +0200)
> >
> > are available in the Git repository at:
> >
> >   https://gitlab.freedesktop.org/curan/mesa.git fix-warnings2-addrlibv2
> >
> > for you to fetch changes up to 88f825e915cd3d52b13489633e1c805bf2cf765b:
>
> I had to redo this, because I forgot to include your R-bs and also the v2 
> notes.
> Now it should read „[...] fetch changes up to
> 418ca1d6285aa8fa37d39884adab41f8989825eb“.
>
> >   amd/addrlib: mark physicalSliceSize as MAYBE_UNUSED in
> > Addr::V1::EgBasedLib::HwlGetSizeAdjustmentMicroTiled (2018-08-22 17:08:04 
> > +0200)
> >
> > 
> > Kai Wasserbäch (5):
> >   amd/addrlib: mark returnCode as MAYBE_UNUSED in ElemGetExportNorm
> >   amd/addrlib: mark microBlockDim as MAYBE_UNUSED in
> > Addr::V2::Gfx9Lib::HwlComputeBlock256Equation
> >   amd/addrlib: mark *pEqToCheck as MAYBE_UNUSED in
> > Addr::V2::Gfx9Lib::ComputeStereoInfo
> >   amd/addrlib: mark numPipes as MAYBE_UNUSED in
> > Addr::V1::EgBasedLib::SanityCheckMacroTiled
> >   amd/addrlib: mark physicalSliceSize as MAYBE_UNUSED in
> > Addr::V1::EgBasedLib::HwlGetSizeAdjustmentMicroTiled
> >
> >  src/amd/Makefile.addrlib.am  | 1 +
> >  src/amd/addrlib/addrinterface.cpp| 4 +++-
> >  src/amd/addrlib/gfx9/gfx9addrlib.cpp | 6 --
> >  src/amd/addrlib/r800/egbaddrlib.cpp  | 6 --
> >  4 files changed, 12 insertions(+), 5 deletions(-)
> >
> > Cheers,
> > Kai
> >
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
>
> --
>
> Kai Wasserbäch (Kai Wasserbaech)
>
> E-Mail: k...@dev.carbon-project.org
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] meson: fix egl build for surfaceless and android

2018-08-22 Thread Dylan Baker
Both of these changes look correct to me, could you split them into two separate
patches though? To the one that adds inc_loader to surfaceless add:
Fixes: 108d257a16859898f5ce02f4759c5c58f9b8c050 ("meson: build libEGL")

To the one that adds it for android add:
Fixes: c5ec1556859b7d33637c9fad13d3473c7b2f9eb3 ("meson: wire up egl/android")

Please CC me on the v2 and I'll get it merged promptly.

Thanks,
Dylan

Quoting Gurchetan Singh (2018-08-22 10:48:06)
> Without this, I get:
> 
>  > platform_surfaceless.c:38:10: fatal error: 'loader.h' file not found
>  > #include "loader.h"
>  >  ^~
>  > 1 error generated.
> 
> I also included this for platform_android, but I haven't tested that
> case.
> ---
>  src/egl/meson.build | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/egl/meson.build b/src/egl/meson.build
> index c7c22d3637..06922c6c3c 100644
> --- a/src/egl/meson.build
> +++ b/src/egl/meson.build
> @@ -114,6 +114,7 @@ if with_platform_drm
>  endif
>  if with_platform_surfaceless
>files_egl += files('drivers/dri2/platform_surfaceless.c')
> +  incs_for_egl += [inc_loader]
>  endif
>  if with_platform_wayland
>deps_for_egl += [dep_wayland_client, dep_wayland_server, 
> dep_wayland_egl_headers]
> @@ -129,6 +130,7 @@ endif
>  if with_platform_android
>deps_for_egl += dep_android
>files_egl += files('drivers/dri2/platform_android.c')
> +  incs_for_egl += [inc_loader]
>  endif
>  if with_platform_haiku
>incs_for_egl += inc_haikugl
> -- 
> 2.16.4
> 


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965/icl: Allow headerless sampler messages for pre-emptable contexts

2018-08-22 Thread Anuj Phogat
On Mon, Aug 20, 2018 at 2:13 PM Kenneth Graunke  wrote:
>
> On Monday, August 20, 2018 10:26:29 AM PDT Anuj Phogat wrote:
> > On Mon, Aug 20, 2018 at 12:18 AM Kenneth Graunke wrote:
> [snip]
> > > I don't know if people are trying to enable pre-emption during GPGPU
> > > work on pre-Gen11.  If so, that probably will not work, and we'd either
> > > need to avoid headerless messages (gross) or disable preemption (maybe
> > > also bad...)
> > >
> > Why do you think it'll be problem for Pre-Gen11? I don't see a bit 
> > disallowing
> > preemption+headerless message for pre-Gen11.
>
> What's the more likely scenario?
>
> Timeline A:
>
> 1. Preemption support was newly added; it didn't work with headerless
> 2. Somebody realized it was important and added a fix to make them work,
>but added it as a chicken bit that requires manual intervention.
> 3. They enabled the chicken bit by default, so things work right away.
> 4. They remove the chicken bit; the hardware just works.
>
> Timeline B:
>
> 1. Preemption support was added and headerless works perfectly
> 2. Someone breaks headerless but adds a chicken bit to work around it
> 3. Someone enables the fix by default
> 4. They remove the chicken bit; the hardware just works.
>
> IMHO, the first scenario is the most likely sequence of events.
Makes sense. Thanks for explaining.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] EGL_MESA_query_renderer

2018-08-22 Thread Rob Clark
On Wed, Aug 22, 2018 at 1:43 PM Emil Velikov  wrote:
>
> On 21 August 2018 at 14:40, Rob Clark  wrote:
> > On Tue, Aug 21, 2018 at 5:19 AM Emil Velikov  
> > wrote:
> >>
> >> HI all,
> >>
> >> On 20 August 2018 at 20:01, Rob Clark  wrote:
> >> > +Emil since he had some interest in this extension too
> >> >
> >> >
> >> Bth since I did not hear anything last week, so I sat down and wrote
> >> the spec, implementation and tests on Sunday ;-)
> >> I'll try to find some time to cleanup and sent out the patches later today.
> >>
> >> To reiterate my earlier suggestion
> >>
> >> "He can work on it in parallel and compare/cross-review one another's work.
> >>
> >> If people are not keen on the duplication effort, the time could be
> >> invested that into other parts of the project (distro/flatpak
> >> packaging, etc.)"
> >>
> >>
> >> > On Mon, Aug 20, 2018 at 1:55 AM Veluri Mithun  
> >> > wrote:
> >> >>
> >> >> Hi Nicolai and Rob,
> >> >>
> >> >> I've started to work on the extension and once finish writing 
> >> >> procedures, functions and spec file related this, I'll create pull 
> >> >> request to Khronos official Registry source code repo at Github.
> >> >>
> >> >> I'm following the steps present here https://www.mesa3d.org/devinfo.html
> >> >> it has instructions for GL extensions and I feel that only a few 
> >> >> differences will be there and the rest it will be similar for EGL 
> >> >> extension
> >> >>
> >> >> To add a new GL extension to Mesa you have to do at least the following.
> >> >>
> >> >> If glext.h doesn't define the extension, edit include/GL/gl.h and add 
> >> >> code like this:
> >> >>
> >> >>  #ifndef GL_EXT_the_extension_name
> >> >>  #define GL_EXT_the_extension_name 1
> >> >>  /* declare the new enum tokens */
> >> >>  /* prototype the new functions */
> >> >>  /* TYPEDEFS for the new functions */
> >> >>  #endif
> >> >>
> >> >>
> >> >> here for my confirmation I need to ask that I should define it in 
> >> >> include/EGL/eglmesaext.h right?
> >> >
> >> > So, looks like eglmesaext.h basically just exists for extensions that
> >> > haven't showed up in eglext.h from Khronos yet.  So I guess this would
> >> > be the place.
> >> >
> >> That's what I've done yes.
> >>
> >> > At any rate, probably the first step is to write an initial version of
> >> > docs/specs/EGL_MESA_query_renderer.txt and send that out for review.
> >> >
> >> Personally, I'd suggest working on an glXGetScreenDriver and
> >> glXGetDriverConfig equivalent for EGL.
> >> That in itself will be a _fairly_ laborious task, which seems to have
> >> been underestimated/missed in the initial plan.
> >
> > so, it was earlier discussed that
> > glXGetScreenDriver()/glXGetDriverConfig() equivalents could be lumped
> > into this extension, which is I guess not what you have done.  (I'm
> > not too picky, it could be a separate extension, we just kinda lumped
> > it all together)
> >
> Personal suggestion is to keep them separate - they are somewhat unrelated.
> An EGL extension which maps to the GLX one, and something else for the
> glX hacks.
>
> In either case, designing is the most important/time consuming thing.
> Checking that the API is sane and can work with GLVND is crucial IMHO.
> This thread lists some details about the incompat. with the glX and GLVND.
>
> https://lists.freedesktop.org/archives/mesa-dev/2017-May/155838.html
>
>
> >> It would involve a) writing another EGL extension or b) Wayland
> >> protocol or c) other mechanism.
> >
> > I haven't looked into the details, but I guess in the EGL on x11 case,
> > it would re-use however these work with glx?
> >
> In theory ... looking at the implementation glXGetScreenDriver
> It calls back via the DRI1/DRI2 protocol asking for the driver name.
> So the DRI3 (only) case is broken.

iirc, dri3 is similar case to wayland, where we should enumerate the
rendernodes, since there is no relationship between the screen and the
gpu, ie. buffers are allocated on client side and pushed to server.

> We should be able to fix that by storing the driver_name (if we don't
> already) in the [GLX]Display.
> With similar approach on the EGL side.
>
> Haven't looked at the other API.
>
> > And in the EGL on wayland case, we can enumerate the drm rendernode
> > devices on the client side.. there shouldn't really be any display
> > server side component, so I guess we don't need any protocol.
> >
> Eek, looping through nodes. You do recall that this (depending on a
> number of factors), can wake up every device on the system.

*shrug*

If that is a problem, then maybe we need to invent some new uapi that
can query the devices without waking them up.. until then I guess we
have to live with the unintended wakeup.

BR,
-R


> My suggestions above could work, although another think to consider
> why the driver name is needed in the first place?
> That is the key information that it provides that we find so
> user-friendly/needed?
>
> Having a the marketing string name (l

Re: [Mesa-dev] EGL_MESA_query_renderer

2018-08-22 Thread Emil Velikov
On 22 August 2018 at 06:24, Veluri Mithun  wrote:
> Hi all,
>
> On Tue, Aug 21, 2018 at 2:49 PM Emil Velikov 
> wrote:
>>
>> HI all,
>>
>> On 20 August 2018 at 20:01, Rob Clark  wrote:
>> > +Emil since he had some interest in this extension too
>> >
>> >
>> Bth since I did not hear anything last week, so I sat down and wrote
>> the spec, implementation and tests on Sunday ;-)
>> I'll try to find some time to cleanup and sent out the patches later
>> today.
>
> I can see only tests
> here(https://gitlab.freedesktop.org/mesa/piglit/compare/2fa9b8fa3e81e230977c2b16ca5b03dd6d85d69b...166c6e3a955c7ed6ac9c514abb6da30b04f81c8e)
> may I please know more about these tests...
>
> and in mesa dev list also I didn't find any patch related to spec and
> imlplementation..!(If had not missed any mail :-) )

Real life got in the way - you know shopping, cooking, doing laundry ;-)

>>
>>
>> To reiterate my earlier suggestion
>>
>> "He can work on it in parallel and compare/cross-review one another's
>> work.
>>
>> If people are not keen on the duplication effort, the time could be
>> invested that into other parts of the project (distro/flatpak
>> packaging, etc.)"
>
> Actual plan(proposal) is to first create extension then use that in adriconf
> and then packaging.
> But, If you( @Jean Hertel , @Rob Clark )are okay if I do packaging before
> creating extension(adriconf can't configure drivers in wayland) then I can
> continue with packaging. Later after we finish extension I can come to
> adding wayland support in adriconf. Rob and Jean pl. give your opinoin about
> this.
>
Please stick with your mentor suggestions, more than a random person
who arrived late.

>>
>> Personally, I'd suggest working on an glXGetScreenDriver and
>> glXGetDriverConfig equivalent for EGL.
>> That in itself will be a _fairly_ laborious task, which seems to have
>> been underestimated/missed in the initial plan.
>>
>> It would involve a) writing another EGL extension or b) Wayland
>> protocol or c) other mechanism.
>
>
> This extension is intended to provied the similar functionality as like
> glXGetScreenDriver and GlXGetDriverConfig work in X11. Something like
> EGLGetDriverConfig and EGLGETScreenDriver (or EGLGETDisplayDriver I think..
> ) in wayland server.
>
> To be more clear EGLGETDriverConfig should provide an xml format string with
> all the options in different languages as seen in X11 when xdriinfo is run
> and EGLDIsplayDriver should return a driver name(string eg: i965) of current
> driver in use.
>
> And also EGLQueryRendererInteger which returns id like pciID(like in x11).
>
> Only after we achevie these through any EGL extension, adriconf can
> configure drivers in wayland protocol.

My earlier reply has some tips/ideas. Feel free to borrow as much as
you like from there.

>>
>>
>> > I don't think this extension should require any driver specific
>> > functionality?  (But maybe some window system specific
>> > functionality??)
>> >
>> Extensions piggy-backs on the DRI extension - implementation is ~200 loc
>> ;-)
>>
>> >> EGL_MESA_drm_image_formats is what I can refer I think, Do you know any
>> >> other extensions?
>> >
>> > That is probably a reasonable one to look at.  Probably git-blame on
>> > eglmesaext.h and eglext.h and then going at looking at the patches
>> > around there which add the corresponding extensions would be useful.
>> > (Maybe eglext.h less useful, since it probably has a lot of "resyncing
>> > Khronos headers" type commits..)
>> >
>> Rob is on spot, yet again. Many header and synced from Khronos. I
>> would ignore those and look at the rest for examples.
>> Personally I started with the GLX extension, tweaking it here and there
>> ;-)
>>
>>
>> Something that kind of hit me, why is the project status/emails like
>> these happening in private?
>> It doesn't seem to follow the open-source mantra and others interested
>> in learning about Mesa/adriconf are left in the dark.
>>
>> On my GSoC pretty much everything was done on the public discussion
>> medium. The next year when Varad was doing a GSoC same thing happened.
>> Am I missing something?
>
> I'm sry about this!
>
We live and we learn. Don't worry about it.

HTH
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 107654] Account request Kevin Rogovin

2018-08-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=107654

Kenneth Graunke  changed:

   What|Removed |Added

   Assignee|sitewranglers@lists.freedes |mesa-dev@lists.freedesktop.
   |ktop.org|org
 Resolution|--- |WONTFIX
 Status|NEW |RESOLVED
  Component|New Accounts|Other
Product|freedesktop.org |Mesa
 QA Contact||mesa-dev@lists.freedesktop.
   ||org

--- Comment #3 from Kenneth Graunke  ---
NAK for the time being, as the i965 maintainer.  The 24 patches are over the
course of 5 years, with about 1-2 small series a year.  For now, this is easy
for people with commit access to review and push as needed.

I'd like to see a) a more recent string of contributions, and b) better
evidence of established rapport and trust between the applicant and other
developers/reviewers/community members.

We will continue to review/push Kevin's patches and can reevaluate this in the
future.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] meson: fix egl build for surfaceless and android

2018-08-22 Thread Gurchetan Singh
Without this, I get:

 > platform_surfaceless.c:38:10: fatal error: 'loader.h' file not found
 > #include "loader.h"
 >  ^~
 > 1 error generated.

I also included this for platform_android, but I haven't tested that
case.
---
 src/egl/meson.build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/egl/meson.build b/src/egl/meson.build
index c7c22d3637..06922c6c3c 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -114,6 +114,7 @@ if with_platform_drm
 endif
 if with_platform_surfaceless
   files_egl += files('drivers/dri2/platform_surfaceless.c')
+  incs_for_egl += [inc_loader]
 endif
 if with_platform_wayland
   deps_for_egl += [dep_wayland_client, dep_wayland_server, 
dep_wayland_egl_headers]
@@ -129,6 +130,7 @@ endif
 if with_platform_android
   deps_for_egl += dep_android
   files_egl += files('drivers/dri2/platform_android.c')
+  incs_for_egl += [inc_loader]
 endif
 if with_platform_haiku
   incs_for_egl += inc_haikugl
-- 
2.16.4

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


[Mesa-dev] [PATCH/RFC] glsl: allow redeclaring variables as 'precise invariant'

2018-08-22 Thread Erik Faye-Lund
There's seems to be nothing in the GLSL (ES) specifications that diallow
redeclaring a variable as both 'precise' and 'invariant' in the same
statement. But the way the parse-rules are structured this fails to
parse, because this is handled in single_declaration, which has an
exhaustive list of qualifiers here, and it does not include an option
with both.

So let's factor out the precise/invariant handling from the
type_qualifier rule so we can reuse it, as there's some intricate
subtleties here.

For reference: glslangValidator already allows this.

Signed-off-by: Erik Faye-Lund 
---

My yacc/bison skills aren't all that, so I wouldn't be too surprised if
this the wrong approach. This is why I'm posting this as an RFC. I'm
hoping someone can tell me if this is the right kind of approach or not.

This fixes a failure to compile a shader that appears in virgl after
an invariant output has been lowered to precise TGSI-opcodes, and
re-emitted GLSL for it (in virglrenderer). The problematic shader comes from
dEQP-GLES2.functional.shaders.invariance.highp.subexpression_precision_lowp.

 src/compiler/glsl/glsl_parser.yy | 77 +++-
 1 file changed, 36 insertions(+), 41 deletions(-)

diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy
index cb7376995d..042e654a26 100644
--- a/src/compiler/glsl/glsl_parser.yy
+++ b/src/compiler/glsl/glsl_parser.yy
@@ -187,6 +187,7 @@ static bool match_layout_qualifier(const char *s1, const 
char *s2,
 %type  statement_list
 %type  simple_statement
 %type  precision_qualifier
+%type  invariant_or_precise_qualifier
 %type  type_qualifier
 %type  auxiliary_storage_qualifier
 %type  storage_qualifier
@@ -1106,7 +1107,7 @@ single_declaration:
   $$->declarations.push_tail(&decl->link);
   state->symbols->add_variable(new(state) ir_variable(NULL, $2, 
ir_var_auto));
}
-   | INVARIANT variable_identifier
+   | invariant_or_precise_qualifier variable_identifier
{
   void *ctx = state->linalloc;
   ast_declaration *decl = new(ctx) ast_declaration($2, NULL, NULL);
@@ -1114,19 +1115,8 @@ single_declaration:
 
   $$ = new(ctx) ast_declarator_list(NULL);
   $$->set_location_range(@1, @2);
-  $$->invariant = true;
-
-  $$->declarations.push_tail(&decl->link);
-   }
-   | PRECISE variable_identifier
-   {
-  void *ctx = state->linalloc;
-  ast_declaration *decl = new(ctx) ast_declaration($2, NULL, NULL);
-  decl->set_location(@2);
-
-  $$ = new(ctx) ast_declarator_list(NULL);
-  $$->set_location_range(@1, @2);
-  $$->precise = true;
+  $$->invariant = $1.flags.q.invariant;
+  $$->precise = $1.flags.q.precise;
 
   $$->declarations.push_tail(&decl->link);
}
@@ -1889,7 +1879,7 @@ interpolation_qualifier:
}
;
 
-type_qualifier:
+invariant_or_precise_qualifier:
/* Single qualifiers */
INVARIANT
{
@@ -1901,31 +1891,7 @@ type_qualifier:
   memset(& $$, 0, sizeof($$));
   $$.flags.q.precise = 1;
}
-   | auxiliary_storage_qualifier
-   | storage_qualifier
-   | interpolation_qualifier
-   | layout_qualifier
-   | memory_qualifier
-   | subroutine_qualifier
-   | precision_qualifier
-   {
-  memset(&$$, 0, sizeof($$));
-  $$.precision = $1;
-   }
-
-   /* Multiple qualifiers:
-* In GLSL 4.20, these can be specified in any order.  In earlier versions,
-* they appear in this order (see GLSL 1.50 section 4.7 & comments below):
-*
-*invariant interpolation auxiliary storage precision  ...or...
-*layout storage precision
-*
-* Each qualifier's rule ensures that the accumulated qualifiers on the 
right
-* side don't contain any that must appear on the left hand side.
-* For example, when processing a storage qualifier, we check that there are
-* no auxiliary, interpolation, layout, invariant, or precise qualifiers to 
the right.
-*/
-   | PRECISE type_qualifier
+   | PRECISE invariant_or_precise_qualifier
{
   if ($2.flags.q.precise)
  _mesa_glsl_error(&@1, state, "duplicate \"precise\" qualifier");
@@ -1933,7 +1899,7 @@ type_qualifier:
   $$ = $2;
   $$.flags.q.precise = 1;
}
-   | INVARIANT type_qualifier
+   | INVARIANT invariant_or_precise_qualifier
{
   if ($2.flags.q.invariant)
  _mesa_glsl_error(&@1, state, "duplicate \"invariant\" qualifier");
@@ -1958,6 +1924,35 @@ type_qualifier:
   if (state->is_version(430, 300) && $$.flags.q.in)
  _mesa_glsl_error(&@1, state, "invariant qualifiers cannot be used 
with shader inputs");
}
+
+type_qualifier:
+   /* Single qualifiers */
+   invariant_or_precise_qualifier
+   | auxiliary_storage_qualifier
+   | storage_qualifier
+   | interpolation_qualifier
+   | layout_qualifier
+   | memory_qualifier
+   | subroutine_qualifier
+   | precision_qualifier
+   {
+  memset(&$$, 0, sizeof($$));
+  $$.precision = $1;
+   }
+
+   /* Multiple qualifiers:
+* In GLSL 4.20, these can 

Re: [Mesa-dev] [PATCH 2/9] nir: Export deref comparison functions

2018-08-22 Thread Jason Ekstrand
Thanks!  I've been wanting to do this ever since I added that function.  I
just didn't have a second consumer.

Reviewed-by: Jason Ekstrand 

On Wed, Aug 15, 2018 at 4:57 PM Caio Marcelo de Oliveira Filho <
caio.olive...@intel.com> wrote:

> Reviewed-by: Timothy Arceri 
> ---
>  src/compiler/nir/nir_deref.c  | 109 
>  src/compiler/nir/nir_deref.h  |  10 ++
>  src/compiler/nir/nir_opt_copy_prop_vars.c | 145 ++
>  3 files changed, 132 insertions(+), 132 deletions(-)
>
> diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
> index c03acf83597..d013b423a8b 100644
> --- a/src/compiler/nir/nir_deref.c
> +++ b/src/compiler/nir/nir_deref.c
> @@ -270,3 +270,112 @@ nir_fixup_deref_modes(nir_shader *shader)
>}
> }
>  }
> +
> +/** Returns true if the storage referrenced to by deref completely
> contains
> + * the storage referenced by sub.
> + */
> +nir_deref_compare_result
> +nir_compare_deref_paths(nir_deref_path *a_path,
> +nir_deref_path *b_path)
> +{
> +   if (a_path->path[0]->var != b_path->path[0]->var)
> +  return 0;
> +
> +   /* Start off assuming they fully compare.  We ignore equality for
> now.  In
> +* the end, we'll determine that by containment.
> +*/
> +   nir_deref_compare_result result = nir_derefs_may_alias_bit |
> + nir_derefs_a_contains_b_bit |
> + nir_derefs_b_contains_a_bit;
> +
> +   nir_deref_instr **a_p = &a_path->path[1];
> +   nir_deref_instr **b_p = &b_path->path[1];
> +   while (*a_p != NULL && *b_p != NULL) {
> +  nir_deref_instr *a_tail = *(a_p++);
> +  nir_deref_instr *b_tail = *(b_p++);
> +
> +  switch (a_tail->deref_type) {
> +  case nir_deref_type_array:
> +  case nir_deref_type_array_wildcard: {
> + assert(b_tail->deref_type == nir_deref_type_array ||
> +b_tail->deref_type == nir_deref_type_array_wildcard);
> +
> + if (a_tail->deref_type == nir_deref_type_array_wildcard) {
> +if (b_tail->deref_type != nir_deref_type_array_wildcard)
> +   result &= ~nir_derefs_b_contains_a_bit;
> + } else if (b_tail->deref_type == nir_deref_type_array_wildcard) {
> +if (a_tail->deref_type != nir_deref_type_array_wildcard)
> +   result &= ~nir_derefs_a_contains_b_bit;
> + } else {
> +assert(a_tail->deref_type == nir_deref_type_array &&
> +   b_tail->deref_type == nir_deref_type_array);
> +assert(a_tail->arr.index.is_ssa && b_tail->arr.index.is_ssa);
> +
> +nir_const_value *a_index_const =
> +   nir_src_as_const_value(a_tail->arr.index);
> +nir_const_value *b_index_const =
> +   nir_src_as_const_value(b_tail->arr.index);
> +if (a_index_const && b_index_const) {
> +   /* If they're both direct and have different offsets, they
> +* don't even alias much less anything else.
> +*/
> +   if (a_index_const->u32[0] != b_index_const->u32[0])
> +  return 0;
> +} else if (a_tail->arr.index.ssa == b_tail->arr.index.ssa) {
> +   /* They're the same indirect, continue on */
> +} else {
> +   /* They're not the same index so we can't prove anything
> about
> +* containment.
> +*/
> +   result &= ~(nir_derefs_a_contains_b_bit |
> nir_derefs_b_contains_a_bit);
> +}
> + }
> + break;
> +  }
> +
> +  case nir_deref_type_struct: {
> + /* If they're different struct members, they don't even alias */
> + if (a_tail->strct.index != b_tail->strct.index)
> +return 0;
> + break;
> +  }
> +
> +  default:
> + unreachable("Invalid deref type");
> +  }
> +   }
> +
> +   /* If a is longer than b, then it can't contain b */
> +   if (*a_p != NULL)
> +  result &= ~nir_derefs_a_contains_b_bit;
> +   if (*b_p != NULL)
> +  result &= ~nir_derefs_b_contains_a_bit;
> +
> +   /* If a contains b and b contains a they must be equal. */
> +   if ((result & nir_derefs_a_contains_b_bit) && (result &
> nir_derefs_b_contains_a_bit))
> +  result |= nir_derefs_equal_bit;
> +
> +   return result;
> +}
> +
> +nir_deref_compare_result
> +nir_compare_derefs(nir_deref_instr *a, nir_deref_instr *b)
> +{
> +   if (a == b) {
> +  return nir_derefs_equal_bit | nir_derefs_may_alias_bit |
> + nir_derefs_a_contains_b_bit | nir_derefs_b_contains_a_bit;
> +   }
> +
> +   nir_deref_path a_path, b_path;
> +   nir_deref_path_init(&a_path, a, NULL);
> +   nir_deref_path_init(&b_path, b, NULL);
> +   assert(a_path.path[0]->deref_type == nir_deref_type_var);
> +   assert(b_path.path[0]->deref_type == nir_deref_type_var);
> +
> +   nir_deref_compare_result result = nir_compare_deref

Re: [Mesa-dev] [PATCH 1/9] util/dynarray: add a clone function

2018-08-22 Thread Jason Ekstrand
On Thu, Aug 16, 2018 at 12:30 AM Thomas Helland 
wrote:

> 2018-08-15 23:56 GMT+02:00 Caio Marcelo de Oliveira Filho
> :
> > ---
> >  src/util/u_dynarray.h | 9 +
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/src/util/u_dynarray.h b/src/util/u_dynarray.h
> > index dcbbc06d161..4920fe04b67 100644
> > --- a/src/util/u_dynarray.h
> > +++ b/src/util/u_dynarray.h
> > @@ -102,6 +102,15 @@ util_dynarray_resize(struct util_dynarray *buf,
> unsigned newsize)
> > return p;
> >  }
> >
> > +static inline void
> > +util_dynarray_clone(struct util_dynarray *buf, struct util_dynarray
> *mem_ctx,
>
> I think we should keep the mem_ctx a void *.
> Apart from that this patch is:
>

Yes, please.  With that fixed,

Reviewed-by: Jason Ekstrand 


> Reviewed-by: Thomas Helland 
>
> > +struct util_dynarray *from_buf)
> > +{
> > +   util_dynarray_init(buf, mem_ctx);
> > +   util_dynarray_resize(buf, from_buf->size);
> > +   memcpy(buf->data, from_buf->data, from_buf->size);
> > +}
> > +
> >  static inline void *
> >  util_dynarray_grow(struct util_dynarray *buf, int diff)
> >  {
> > --
> > 2.18.0
> >
> > ___
> > mesa-dev mailing list
> > mesa-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH v4 38/49] meson: Set visibility and compat args for graw

2018-08-22 Thread Dylan Baker
---
 src/gallium/targets/graw-gdi/meson.build  | 1 +
 src/gallium/targets/graw-null/meson.build | 2 ++
 src/gallium/targets/graw-xlib/meson.build | 1 +
 3 files changed, 4 insertions(+)

diff --git a/src/gallium/targets/graw-gdi/meson.build 
b/src/gallium/targets/graw-gdi/meson.build
index e04b454ab53..b742b0a11a2 100644
--- a/src/gallium/targets/graw-gdi/meson.build
+++ b/src/gallium/targets/graw-gdi/meson.build
@@ -21,6 +21,7 @@
 libgraw_gdi = shared_library(
   'graw',
   'graw_gdi.c',
+  c_args : [c_vis_args, c_msvc_compat_args],
   include_directories : [
 inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
 inc_gallium_winsys_sw,
diff --git a/src/gallium/targets/graw-null/meson.build 
b/src/gallium/targets/graw-null/meson.build
index 8a294f41307..0b7c6ff40e6 100644
--- a/src/gallium/targets/graw-null/meson.build
+++ b/src/gallium/targets/graw-null/meson.build
@@ -21,12 +21,14 @@
 libgraw_util = static_library(
   'graw_util',
   ['graw_util.c'],
+  c_args : [c_vis_args, c_msvc_compat_args],
   include_directories : inc_common,
 )
 
 libgraw_null = shared_library(
   'graw_null',
   ['graw_null.c'],
+  c_args : [c_vis_args, c_msvc_compat_args],
   include_directories : inc_common,
   link_with : [libmesa_util, libgallium],
 )
diff --git a/src/gallium/targets/graw-xlib/meson.build 
b/src/gallium/targets/graw-xlib/meson.build
index aab99ba64c1..13567355d2c 100644
--- a/src/gallium/targets/graw-xlib/meson.build
+++ b/src/gallium/targets/graw-xlib/meson.build
@@ -21,6 +21,7 @@
 libgraw_xlib = shared_library(
   'graw_xlib',
   ['graw_xlib.c'],
+  c_args : [c_vis_args],
   include_directories : [inc_common, inc_gallium_drivers, inc_gallium_winsys],
   link_with : [
 libgraw_util, libmesa_util, libgallium, libws_xlib
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 17/49] meson: Add necessary defines for mesa_gallium on windows

2018-08-22 Thread Dylan Baker
v4: - Retain scons comments for windows specific defines

Reviewed-by: Eric Anholt 
---
 src/mesa/meson.build | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/mesa/meson.build b/src/mesa/meson.build
index ea884977db8..100b0d61487 100644
--- a/src/mesa/meson.build
+++ b/src/mesa/meson.build
@@ -730,11 +730,23 @@ libmesa_classic = static_library(
   build_by_default : false,
 )
 
+_mesa_gallium_args = []
+if with_platform_windows
+  _mesa_gallium_args += [
+'-D_GDI32_',# prevent gl* being declared __declspec(dllimport) in MS 
headers
+'-DBUILD_GL32'  # declare gl* as __declspec(dllexport) in Mesa headers
+  ]
+  if not with_gles2
+# prevent _glapi_* from being declared __declspec(dllimport)
+_mesa_gallium_args += '-D_GLAPI_NO_EXPORTS'
+  endif
+endif
+
 libmesa_gallium = static_library(
   'mesa_gallium',
   [files_libmesa_common, files_libmesa_gallium],
-  c_args : [c_vis_args, c_msvc_compat_args],
-  cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
+  c_args : [c_vis_args, c_msvc_compat_args, _mesa_gallium_args],
+  cpp_args : [cpp_vis_args, cpp_msvc_compat_args, _mesa_gallium_args],
   include_directories : [inc_common, inc_libmesa_asm, 
include_directories('main')],
   link_with : [libglsl, libmesa_sse41],
   dependencies : [idep_nir_headers, dep_vdpau],
-- 
2.18.0

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


Re: [Mesa-dev] [PATCH v2 10/11] nir: Add an array copy optimization

2018-08-22 Thread Caio Marcelo de Oliveira Filho
> I've applied your suggestions.  Please double-check:
> 
> https://gitlab.freedesktop.org/jekstrand/mesa/commit/28c01e9a0ce84ff53fa8805e4a35a691ea3fc744

Reviewed-by: Caio Marcelo de Oliveira Filho 

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


[Mesa-dev] [PATCH v4 31/49] meson: disable sse4.1 optimizations with msvc

2018-08-22 Thread Dylan Baker
There isn't an obvious command line switch here, /arch:AVX *might* be
the right thing, but meson doesn't know what to do here either and
leaves the -msse4.1 and -mstackrealign.
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 05a03f687cd..9c445c58e52 100644
--- a/meson.build
+++ b/meson.build
@@ -910,7 +910,7 @@ if host_machine.system() == 'windows'
   endif
 endif
 
-if host_machine.cpu_family().startswith('x86')
+if host_machine.cpu_family().startswith('x86') and cc.get_id() != 'msvc'
   pre_args += '-DUSE_SSE41'
   with_sse41 = true
   sse41_args = ['-msse4.1']
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 33/49] meson: don't define GLX_USE_TLS for windows

2018-08-22 Thread Dylan Baker
Because the macros for exporting dll symbols and using TLS are mutually
exclusive.
---
 meson.build | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 9c445c58e52..66d25967df9 100644
--- a/meson.build
+++ b/meson.build
@@ -329,7 +329,10 @@ if with_egl and not (with_platform_drm or 
with_platform_surfaceless)
   endif
 endif
 
-pre_args += '-DGLX_USE_TLS'
+if host_machine.system() != 'windows'
+  # On windows Thread local storage and dll export are mutually exclusive
+  pre_args += '-DGLX_USE_TLS'
+endif
 if with_glx != 'disabled'
   if not (with_platform_x11 and with_any_opengl)
 error('Cannot build GLX support without X11 platform support and at least 
one OpenGL API')
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 47/49] appveyor: use msbuild instead of ninja

2018-08-22 Thread Dylan Baker
I think that most windows users probably find using msbuild more
interesting than ninja, even if ninja is faster. I've left the ninja
build in case someone wants to look at it.

- v4: Add /m switch to make build somewhat faster
---
 appveyor.yml | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index b26a3c624e8..6277e9636d9 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -66,8 +66,7 @@ install:
 - if "%BUILD_SYSTEM%"=="meson" py -3.7-64 -m pip install mako meson
 - if "%BUILD_SYSTEM%"=="meson" set Path=C:\Python37-x64\Scripts;%Path%
 - if "%BUILD_SYSTEM%"=="meson" meson --version
-- if "%BUILD_SYSTEM%"=="meson" cinst -y ninja pkgconfiglite
-- if "%BUILD_SYSTEM%"=="meson" ninja --version
+- if "%BUILD_SYSTEM%"=="meson" cinst -y pkgconfiglite
 - if "%BUILD_SYSTEM%"=="meson" call "C:\Program Files (x86)\Microsoft Visual 
Studio 14.0\VC\vcvarsall.bat" x86
 # Install flex/bison
 - cinst -y winflexbison
@@ -81,8 +80,9 @@ install:
 
 build_script:
 - if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1
-- if "%BUILD_SYSTEM%"=="meson" meson builddir -Dbuild-tests=true
-- if "%BUILD_SYSTEM%"=="meson" ninja -C builddir
+- if "%BUILD_SYSTEM%"=="meson" meson builddir --backend=vs2015 
-Dbuild-tests=true
+- if "%BUILD_SYSTEM%"=="meson" cd builddir
+- if "%BUILD_SYSTEM%"=="meson" msbuild mesa.sln /m
 
 after_build:
 - if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1 check
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 36/49] meson: Don't build glsl cache_test for windows

2018-08-22 Thread Dylan Baker
v2: - Use new with_shader_cache variable instead of
  host_machine.system() == 'windows'
---
 src/compiler/glsl/tests/meson.build | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/compiler/glsl/tests/meson.build 
b/src/compiler/glsl/tests/meson.build
index 2a41e30a28d..b4fdb868381 100644
--- a/src/compiler/glsl/tests/meson.build
+++ b/src/compiler/glsl/tests/meson.build
@@ -29,18 +29,19 @@ test(
   )
 )
 
-test(
-  'cache_test',
-  executable(
+if with_shader_cache
+  test(
 'cache_test',
-'cache_test.c',
-c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
-include_directories : [inc_common, inc_glsl],
-link_with : [libglsl],
-dependencies : [dep_clock, dep_thread],
+executable(
+  'cache_test',
+  'cache_test.c',
+  c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
+  include_directories : [inc_common, inc_glsl],
+  link_with : [libglsl],
+  dependencies : [dep_clock, dep_thread],
+)
   )
-)
-
+endif
 
 test(
   'general_ir_test',
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 28/49] meson: Add support for using win_flex and win_bison on windows

2018-08-22 Thread Dylan Baker
---
 meson.build | 27 +--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 9de29b832a0..c5baaf60c68 100644
--- a/meson.build
+++ b/meson.build
@@ -1364,8 +1364,31 @@ endif
 
 # pthread stubs. Lets not and say we didn't
 
-prog_bison = find_program('bison', required : with_any_opengl)
-prog_flex = find_program('flex', required : with_any_opengl)
+if host_machine.system() == 'windows'
+  # Prefer the winflexbison versions, they're much easier to install and have
+  # better windows support.
+
+  prog_flex = find_program('win_flex', required : false)
+  if prog_flex.found()
+# windows compatibility (uses  instead of  and _isatty,
+# _fileno functions)
+prog_flex = [prog_flex, '--wincompat']
+  else
+prog_flex = [find_program('lex', 'flex', required : with_any_opengl)]
+  endif
+  # Force flex to use const keyword in prototypes, as relies on __cplusplus or
+  # __STDC__ macro to determine whether it's safe to use const keyword, but
+  # MSVC never defines __STDC__ unless we disable all MSVC extensions.
+  prog_flex += '-DYY_USE_CONST='
+
+  prog_bison = find_program('win_bison', required : false)
+  if not prog_bison.found()
+prog_bison = find_program('yacc', 'bison', required : with_any_opengl)
+  endif
+else
+  prog_bison = find_program('bison', required : with_any_opengl)
+  prog_flex = find_program('flex', required : with_any_opengl)
+endif
 
 dep_selinux = null_dep
 if get_option('selinux')
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 29/49] meson: make nm binary optional

2018-08-22 Thread Dylan Baker
This makes nm not required, but used if found. In general I imagine that
this means that on windows nm wont be found, and on other platforms it
will.

v2: - fix gbm and egl symbols check tests to only be run if nm is found
- reword commit message to reflect the code change
---
 meson.build | 5 -
 src/egl/meson.build | 2 +-
 src/gbm/meson.build | 2 +-
 src/mapi/es1api/meson.build | 2 +-
 src/mapi/es2api/meson.build | 2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index c5baaf60c68..05a03f687cd 100644
--- a/meson.build
+++ b/meson.build
@@ -1586,8 +1586,11 @@ endif
 
 pkg = import('pkgconfig')
 
+prog_nm = find_program('nm', required : false)
 env_test = environment()
-env_test.set('NM', find_program('nm').path())
+if prog_nm.found()
+  env_test.set('NM', prog_nm.path())
+endif
 
 subdir('include')
 subdir('bin')
diff --git a/src/egl/meson.build b/src/egl/meson.build
index c7c22d36371..b6bbcfccd77 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -194,7 +194,7 @@ pkg.generate(
   extra_cflags : gl_pkgconfig_c_flags,
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   if with_glvnd
 # TODO: add glvnd symbol check
   else
diff --git a/src/gbm/meson.build b/src/gbm/meson.build
index 2e9d380c0b4..97516dfbc6c 100644
--- a/src/gbm/meson.build
+++ b/src/gbm/meson.build
@@ -68,7 +68,7 @@ pkg.generate(
   libraries_private : '-ldl',  # FIXME: autotools lists this a incomplete
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   test(
 'gbm-symbols-check',
 find_program('gbm-symbols-check'),
diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index 32b7cc3eaee..74cd69b8130 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -59,7 +59,7 @@ pkg.generate(
   libraries_private : gl_priv_libs,
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   test(
 'es1-ABI-check',
 find_program('ABI-check'),
diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
index 9e847e6e077..04cde895f89 100644
--- a/src/mapi/es2api/meson.build
+++ b/src/mapi/es2api/meson.build
@@ -59,7 +59,7 @@ pkg.generate(
   libraries_private : gl_priv_libs,
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   test(
 'es2-ABI-check',
 find_program('ABI-check'),
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 37/49] glsl/tests: define ssize_t on windows

2018-08-22 Thread Dylan Baker
---
 src/compiler/glsl/tests/blob_test.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/compiler/glsl/tests/blob_test.c 
b/src/compiler/glsl/tests/blob_test.c
index 1cc97236e7e..21b8b1efdc1 100644
--- a/src/compiler/glsl/tests/blob_test.c
+++ b/src/compiler/glsl/tests/blob_test.c
@@ -28,6 +28,10 @@
 #include 
 #include 
 #include 
+#ifdef _MSC_VER
+#include 
+typedef SSIZE_T ssize_t;
+#endif
 
 #include "util/ralloc.h"
 #include "blob.h"
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 46/49] appveyor: use chocolatey (cinst) to install winflexbison

2018-08-22 Thread Dylan Baker
v2: - fix typos in commit message
---
 appveyor.yml | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index 15a31da9411..b26a3c624e8 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -34,7 +34,6 @@ branches:
 clone_depth: 100
 
 cache:
-- win_flex_bison-2.5.9.zip
 - llvm-5.0.1-msvc2015-mtd.7z
 - subprojects\packagecache
 
@@ -46,7 +45,6 @@ init:
 - git config --global core.autocrlf true
 
 environment:
-  WINFLEXBISON_ARCHIVE: win_flex_bison-2.5.9.zip
   LLVM_ARCHIVE: llvm-5.0.1-msvc2015-mtd.7z
   matrix:
 - BUILD_SYSTEM: meson
@@ -72,9 +70,7 @@ install:
 - if "%BUILD_SYSTEM%"=="meson" ninja --version
 - if "%BUILD_SYSTEM%"=="meson" call "C:\Program Files (x86)\Microsoft Visual 
Studio 14.0\VC\vcvarsall.bat" x86
 # Install flex/bison
-- if not exist "%WINFLEXBISON_ARCHIVE%" appveyor DownloadFile 
"https://downloads.sourceforge.net/project/winflexbison/old_versions/%WINFLEXBISON_ARCHIVE%";
-- 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
-- set Path=%CD%\winflexbison;%Path%
+- cinst -y winflexbison
 - win_flex --version
 - win_bison --version
 # Download and extract LLVM
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 35/49] util/tests: Use define instead of VLA

2018-08-22 Thread Dylan Baker
To allow the this test to be built with MSVC, which doesn't support
VLAs.
---
 src/util/tests/hash_table/clear.c | 13 +++--
 src/util/tests/hash_table/delete_management.c | 13 +++--
 src/util/tests/hash_table/insert_many.c   | 11 ++-
 src/util/tests/hash_table/meson.build |  1 +
 src/util/tests/hash_table/random_entry.c  |  7 ---
 src/util/tests/string_buffer/meson.build  |  1 +
 6 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/src/util/tests/hash_table/clear.c 
b/src/util/tests/hash_table/clear.c
index 526700bfb0f..19494844608 100644
--- a/src/util/tests/hash_table/clear.c
+++ b/src/util/tests/hash_table/clear.c
@@ -23,6 +23,8 @@
 
 #include "hash_table.h"
 
+#define SIZE 1000
+
 static void *make_key(uint32_t i)
 {
   return (void *)(uintptr_t)(1 + i);
@@ -54,13 +56,12 @@ int main()
 {
struct hash_table *ht;
struct hash_entry *entry;
-   const uint32_t size = 1000;
-   bool flags[size];
+   bool flags[SIZE];
uint32_t i;
 
ht = _mesa_hash_table_create(NULL, key_hash, key_equal);
 
-   for (i = 0; i < size; ++i) {
+   for (i = 0; i < SIZE; ++i) {
   flags[i] = false;
   _mesa_hash_table_insert(ht, make_key(i), &flags[i]);
}
@@ -70,19 +71,19 @@ int main()
 
/* Check that delete_function was called and that repopulating the table
 * works. */
-   for (i = 0; i < size; ++i) {
+   for (i = 0; i < SIZE; ++i) {
   assert(flags[i]);
   flags[i] = false;
   _mesa_hash_table_insert(ht, make_key(i), &flags[i]);
}
 
/* Check that exactly the right set of entries is in the table. */
-   for (i = 0; i < size; ++i) {
+   for (i = 0; i < SIZE; ++i) {
   assert(_mesa_hash_table_search(ht, make_key(i)));
}
 
hash_table_foreach(ht, entry) {
-  assert(key_id(entry->key) < size);
+  assert(key_id(entry->key) < SIZE);
}
 
_mesa_hash_table_destroy(ht, NULL);
diff --git a/src/util/tests/hash_table/delete_management.c 
b/src/util/tests/hash_table/delete_management.c
index 127d81b3ca9..e3be9fb3d99 100644
--- a/src/util/tests/hash_table/delete_management.c
+++ b/src/util/tests/hash_table/delete_management.c
@@ -30,6 +30,8 @@
 #include 
 #include "hash_table.h"
 
+#define SIZE 1
+
 static uint32_t
 key_value(const void *key)
 {
@@ -47,8 +49,7 @@ main(int argc, char **argv)
 {
struct hash_table *ht;
struct hash_entry *entry;
-   unsigned size = 1;
-   uint32_t keys[size];
+   uint32_t keys[SIZE];
uint32_t i;
 
(void) argc;
@@ -56,7 +57,7 @@ main(int argc, char **argv)
 
ht = _mesa_hash_table_create(NULL, key_value, uint32_t_key_equals);
 
-   for (i = 0; i < size; i++) {
+   for (i = 0; i < SIZE; i++) {
   keys[i] = i;
 
   _mesa_hash_table_insert(ht, keys + i, NULL);
@@ -69,7 +70,7 @@ main(int argc, char **argv)
}
 
/* Make sure that all our entries were present at the end. */
-   for (i = size - 100; i < size; i++) {
+   for (i = SIZE - 100; i < SIZE; i++) {
   entry = _mesa_hash_table_search(ht, keys + i);
   assert(entry);
   assert(key_value(entry->key) == i);
@@ -79,8 +80,8 @@ main(int argc, char **argv)
for (entry = _mesa_hash_table_next_entry(ht, NULL);
 entry != NULL;
 entry = _mesa_hash_table_next_entry(ht, entry)) {
-  assert(key_value(entry->key) >= size - 100 &&
- key_value(entry->key) < size);
+  assert(key_value(entry->key) >= SIZE - 100 &&
+ key_value(entry->key) < SIZE);
}
assert(ht->entries == 100);
 
diff --git a/src/util/tests/hash_table/insert_many.c 
b/src/util/tests/hash_table/insert_many.c
index b07e40842bf..6bd35d5c0c7 100644
--- a/src/util/tests/hash_table/insert_many.c
+++ b/src/util/tests/hash_table/insert_many.c
@@ -30,6 +30,8 @@
 #include 
 #include "hash_table.h"
 
+#define SIZE 1
+
 static uint32_t
 key_value(const void *key)
 {
@@ -47,8 +49,7 @@ main(int argc, char **argv)
 {
struct hash_table *ht;
struct hash_entry *entry;
-   unsigned size = 1;
-   uint32_t keys[size];
+   uint32_t keys[SIZE];
uint32_t i;
 
(void) argc;
@@ -56,18 +57,18 @@ main(int argc, char **argv)
 
ht = _mesa_hash_table_create(NULL, key_value, uint32_t_key_equals);
 
-   for (i = 0; i < size; i++) {
+   for (i = 0; i < SIZE; i++) {
   keys[i] = i;
 
   _mesa_hash_table_insert(ht, keys + i, NULL);
}
 
-   for (i = 0; i < size; i++) {
+   for (i = 0; i < SIZE; i++) {
   entry = _mesa_hash_table_search(ht, keys + i);
   assert(entry);
   assert(key_value(entry->key) == i);
}
-   assert(ht->entries == size);
+   assert(ht->entries == SIZE);
 
_mesa_hash_table_destroy(ht, NULL);
 
diff --git a/src/util/tests/hash_table/meson.build 
b/src/util/tests/hash_table/meson.build
index c7b03f19c56..93605d1e77f 100644
--- a/src/util/tests/hash_table/meson.build
+++ b/src/util/tests/hash_table/meson.build
@@ -27,6 +27,7 @@ foreach t : ['clear', 'collision', 'delete_and_lookup', 
'delete_management',
 execut

[Mesa-dev] [PATCH v4 45/49] appveyor: Add support for meson as well as scons

2018-08-22 Thread Dylan Baker
v4: - Rebase on python3 generators
- Cache meson wraps
- Build x86 instead of x86_64, since that's what the pre-build LLVM
  is
---
 appveyor.yml | 36 
 1 file changed, 24 insertions(+), 12 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index 73be3c57df8..15a31da9411 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -36,6 +36,7 @@ clone_depth: 100
 cache:
 - win_flex_bison-2.5.9.zip
 - llvm-5.0.1-msvc2015-mtd.7z
+- subprojects\packagecache
 
 os: Visual Studio 2015
 
@@ -47,22 +48,29 @@ init:
 environment:
   WINFLEXBISON_ARCHIVE: win_flex_bison-2.5.9.zip
   LLVM_ARCHIVE: llvm-5.0.1-msvc2015-mtd.7z
+  matrix:
+- BUILD_SYSTEM: meson
+- BUILD_SYSTEM: scons
 
 install:
 # Check git config
 - git config core.autocrlf
 # Check pip
-- python --version
-- python -m pip --version
+- py -2.7-32 --version
+- py -2.7-32 -m pip --version
+- py -3.7-64 --version
+- py -3.7-64 -m pip --version
 # Install Mako
-- python -m pip install Mako==1.0.6
-# Install pywin32 extensions, needed by SCons
-- python -m pip install pypiwin32
-# Install python wheels, necessary to install SCons via pip
-- python -m pip install wheel
-# Install SCons
-- python -m pip install scons==2.5.1
-- scons --version
+- if "%BUILD_SYSTEM%"=="scons" py -2.7-32 -m pip install pypiwin32 wheel mako
+- if "%BUILD_SYSTEM%"=="scons" py -2.7-32 -m pip install scons==2.5.1
+- if "%BUILD_SYSTEM%"=="scons" set Path=C:\Python27\Scripts;%Path%
+- if "%BUILD_SYSTEM%"=="scons" scons --version
+- if "%BUILD_SYSTEM%"=="meson" py -3.7-64 -m pip install mako meson
+- if "%BUILD_SYSTEM%"=="meson" set Path=C:\Python37-x64\Scripts;%Path%
+- if "%BUILD_SYSTEM%"=="meson" meson --version
+- if "%BUILD_SYSTEM%"=="meson" cinst -y ninja pkgconfiglite
+- if "%BUILD_SYSTEM%"=="meson" ninja --version
+- if "%BUILD_SYSTEM%"=="meson" call "C:\Program Files (x86)\Microsoft Visual 
Studio 14.0\VC\vcvarsall.bat" x86
 # Install flex/bison
 - if not exist "%WINFLEXBISON_ARCHIVE%" appveyor DownloadFile 
"https://downloads.sourceforge.net/project/winflexbison/old_versions/%WINFLEXBISON_ARCHIVE%";
 - 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
@@ -76,10 +84,14 @@ install:
 - set LLVM=%CD%\llvm
 
 build_script:
-- scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.0 llvm=1
+- if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1
+- if "%BUILD_SYSTEM%"=="meson" meson builddir -Dbuild-tests=true
+- if "%BUILD_SYSTEM%"=="meson" ninja -C builddir
 
 after_build:
-- scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.0 llvm=1 check
+- if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1 check
+# Doesn't work yet, a large number of tests fail
+#- if "%BUILD_SYSTEM%"=="meson" ninja -C builddir test
 
 
 # It's possible to setup notification here, as described in
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 40/49] meson: Fix gtest linkage on msvc

2018-08-22 Thread Dylan Baker
We need to add an extra flag (/SUBSYSTEM:CONSOLE) to get the msvc linker
to find main() in a static library.
---
 src/gtest/meson.build | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/gtest/meson.build b/src/gtest/meson.build
index 91a49240416..ed0d6974bd3 100644
--- a/src/gtest/meson.build
+++ b/src/gtest/meson.build
@@ -25,7 +25,14 @@ libgtest = static_library(
   build_by_default : false,
 )
 
+_gtest_link_args = []
+if cpp.get_id() == 'msvc'
+  # required to use main() from a static library
+  _gtest_link_args += '/SUBSYSTEM:CONSOLE'
+endif
+
 idep_gtest = declare_dependency(
   link_with : libgtest,
+  link_args : _gtest_link_args,
   include_directories : include_directories('include', is_system : true),
 )
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 41/49] meson: disable graw tests on mingw

2018-08-22 Thread Dylan Baker
I can't figure out why symbols are being exposed that shouldn't.
---
 src/gallium/tests/meson.build | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/tests/meson.build b/src/gallium/tests/meson.build
index 15b9f549647..1d08da2ac10 100644
--- a/src/gallium/tests/meson.build
+++ b/src/gallium/tests/meson.build
@@ -25,4 +25,8 @@ endif
 if with_gallium_softpipe
   subdir('unit')
 endif
-subdir('graw')
+if host_machine.system() == 'windows' and cpp.get_id() != 'gcc'
+  # This has linking errors I can't figure out with MinGW. works fine with
+  # MSVC, works fine with GCC on Linux.
+  subdir('graw')
+endif
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 10/49] meson: build getopt when using msvc

2018-08-22 Thread Dylan Baker
v4: - Don't wrap a single file in a list to match mesa style
- Use null_dep instead of empty list

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt  (v3)
Reviewed-by: Eric Engestrom 
---
 src/getopt/meson.build | 29 +
 src/meson.build|  5 +
 2 files changed, 34 insertions(+)
 create mode 100644 src/getopt/meson.build

diff --git a/src/getopt/meson.build b/src/getopt/meson.build
new file mode 100644
index 000..9a1f666d7ae
--- /dev/null
+++ b/src/getopt/meson.build
@@ -0,0 +1,29 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+libgetopt = static_library(
+  'getopt',
+  'getopt_long.c',
+)
+
+idep_getopt = declare_dependency(
+  link_with : libgetopt,
+  include_directories : include_directories('.', is_system : true),
+)
diff --git a/src/meson.build b/src/meson.build
index af881cff70b..b9e7f0879c0 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -47,6 +47,11 @@ sha1_h = custom_target(
 )
 
 subdir('gtest')
+if cc.get_id() == 'msvc'
+  subdir('getopt')
+else
+  idep_getopt = null_dep
+endif
 subdir('util')
 subdir('mapi')
 # TODO: opengl
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 34/49] meson: Add idep_getopt for tests

2018-08-22 Thread Dylan Baker
There are quite a few tests that require getopt, when using MSVC we need
to use the bundled version of getopt since there isn't a system version.
---
 src/compiler/glsl/glcpp/meson.build | 2 +-
 src/compiler/glsl/meson.build   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/compiler/glsl/glcpp/meson.build 
b/src/compiler/glsl/glcpp/meson.build
index be0e6ece54c..976986ff17b 100644
--- a/src/compiler/glsl/glcpp/meson.build
+++ b/src/compiler/glsl/glcpp/meson.build
@@ -58,7 +58,7 @@ libglcpp = static_library(
 glcpp = executable(
   'glcpp',
   'glcpp.c',
-  dependencies : [dep_m],
+  dependencies : [dep_m, idep_getopt],
   include_directories : [inc_common],
   link_with : [libglcpp, libglsl_util],
   c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args],
diff --git a/src/compiler/glsl/meson.build b/src/compiler/glsl/meson.build
index 7e4dd2929a3..45b72dfb3b9 100644
--- a/src/compiler/glsl/meson.build
+++ b/src/compiler/glsl/meson.build
@@ -229,7 +229,7 @@ libglsl_standalone = static_library(
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
   include_directories : [inc_common],
   link_with : [libglsl, libglsl_util, libmesa_util],
-  dependencies : [dep_thread],
+  dependencies : [dep_thread, idep_getopt],
   build_by_default : false,
 )
 
@@ -238,7 +238,7 @@ glsl_compiler = executable(
   'main.cpp',
   c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
-  dependencies : [dep_clock, dep_thread],
+  dependencies : [dep_clock, dep_thread, idep_getopt],
   include_directories : [inc_common],
   link_with : [libglsl_standalone],
   build_by_default : with_tools.contains('glsl'),
@@ -252,7 +252,7 @@ glsl_test = executable(
   c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
   cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
   include_directories : [inc_common],
-  dependencies : [dep_clock, dep_thread],
+  dependencies : [dep_clock, dep_thread, idep_getopt],
   link_with : [libglsl, libglsl_standalone, libglsl_util],
   build_by_default : with_tools.contains('glsl'),
   install : with_tools.contains('glsl'),
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 13/49] meson: don't allow glvnd on windows

2018-08-22 Thread Dylan Baker
Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 5102ffe0c7c..32a731e2024 100644
--- a/meson.build
+++ b/meson.build
@@ -356,7 +356,9 @@ endif
 
 with_glvnd = get_option('glvnd')
 if with_glvnd
-  if with_glx == 'xlib' or with_glx == 'gallium-xlib'
+  if with_platform_windows
+error('glvnd cannot be used on Windows')
+  elif with_glx == 'xlib' or with_glx == 'gallium-xlib'
 error('Cannot build glvnd support for GLX that is not DRI based.')
   elif with_glx == 'disabled' and not with_egl
 error('glvnd requires DRI based GLX and/or EGL')
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 39/49] meson: don't build gallium trivial tests on windows

2018-08-22 Thread Dylan Baker
They require the pipe-loaders, which require xmlconfig, which doesn't
build with msvc.
---
 src/gallium/tests/meson.build | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/tests/meson.build b/src/gallium/tests/meson.build
index 0ee04350c87..15b9f549647 100644
--- a/src/gallium/tests/meson.build
+++ b/src/gallium/tests/meson.build
@@ -18,7 +18,10 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-subdir('trivial')
+if not with_platform_windows
+  # pipe-loader doesn't build on windows.
+  subdir('trivial')
+endif
 if with_gallium_softpipe
   subdir('unit')
 endif
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 16/49] meson: Add windows defines to glapi

2018-08-22 Thread Dylan Baker
These are needed to control the export or symbols due to differences
between the way windows and *nix handle symbol exports.

Reviewed-by: Eric Anholt 
---
 src/mapi/es1api/meson.build   | 10 +-
 src/mapi/es2api/meson.build   | 10 +-
 src/mapi/glapi/meson.build| 13 -
 src/mapi/shared-glapi/meson.build |  9 -
 4 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index d8a77a41df2..32b7cc3eaee 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -27,11 +27,19 @@ es1_glapi_mapi_tmp_h = custom_target(
   capture : true,
 )
 
+_es1_c_args = []
+if with_platform_windows
+  _es1_c_args += ['-D_GDI32_', '-DBUILD_GL32']
+endif
+
 libglesv1_cm = shared_library(
   'GLESv1_CM',
   ['../entry.c', es1_glapi_mapi_tmp_h],
   c_args : [
-c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
+c_msvc_compat_args,
+c_vis_args,
+_es1_c_args,
+'-DMAPI_MODE_BRIDGE',
 '-DMAPI_ABI_HEADER="@0@"'.format(es1_glapi_mapi_tmp_h.full_path()),
   ],
   link_args : [ld_args_gc_sections],
diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
index 891e6f7b27b..9e847e6e077 100644
--- a/src/mapi/es2api/meson.build
+++ b/src/mapi/es2api/meson.build
@@ -27,11 +27,19 @@ es2_glapi_mapi_tmp_h = custom_target(
   capture : true,
 )
 
+_es2_c_args = []
+if with_platform_windows
+  _es2_c_args += ['-D_GDI32_', '-DBUILD_GL32']
+endif
+
 libgles2 = shared_library(
   'GLESv2',
   ['../entry.c', es2_glapi_mapi_tmp_h],
   c_args : [
-c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
+c_msvc_compat_args,
+c_vis_args,
+_es2_c_args,
+'-DMAPI_MODE_BRIDGE',
 '-DMAPI_ABI_HEADER="@0@"'.format(es2_glapi_mapi_tmp_h.full_path()),
   ],
   link_args : [ld_args_gc_sections],
diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build
index 2509e19eaa3..9ecc29ece31 100644
--- a/src/mapi/glapi/meson.build
+++ b/src/mapi/glapi/meson.build
@@ -25,7 +25,7 @@ inc_glapi = include_directories('.')
 static_glapi_files = []
 static_glapi_args = []
 
-if ['apple', 'windows'].contains(with_dri_platform)
+if with_dri and ['apple', 'windows'].contains(with_dri_platform)
   static_glapi_files += [glapi_gentable_c, glapitable_h]
 endif
 
@@ -45,8 +45,19 @@ if with_shared_glapi
 '-DMAPI_MODE_BRIDGE',
 '-DMAPI_ABI_HEADER="@0@"'.format(glapi_mapi_tmp_h.full_path()),
   ]
+  if with_platform_windows
+static_glapi_args += ['-D_GDI32_', '-DBUILD_GL32']
+  endif
 else
   static_glapi_args += '-DMAPI_MODE_UTIL'
+  if with_platform_windows
+static_glapi_args += ['-D_GDI32_', '-DBUILD_GL32', '-DKHRONOS_DLL_EXPORTS']
+if with_gles1 or with_gles2
+  static_glapi_args += '-D_GLAPI_DLL_EXPORTS'
+else
+  static_glapi_args += '-D_GLAPI_NO_EXPORTS'
+endif
+  endif
   static_glapi_files += files(
 'glapi_dispatch.c',
 'glapi_entrypoint.c',
diff --git a/src/mapi/shared-glapi/meson.build 
b/src/mapi/shared-glapi/meson.build
index 44e86f845f6..c818dfce30e 100644
--- a/src/mapi/shared-glapi/meson.build
+++ b/src/mapi/shared-glapi/meson.build
@@ -36,11 +36,18 @@ shared_glapi_mapi_tmp_h = custom_target(
   capture : true,
 )
 
+_glapi_c_args = []
+if with_platform_windows
+  _glapi_c_args += ['-D_GLAPI_DLL_EXPORTS']
+endif
+
 libglapi = shared_library(
   'glapi',
   [files_mapi_glapi, files_mapi_util, shared_glapi_mapi_tmp_h],
   c_args : [
-c_msvc_compat_args, '-DMAPI_MODE_GLAPI',
+_glapi_c_args,
+c_msvc_compat_args,
+'-DMAPI_MODE_GLAPI',
 '-DMAPI_ABI_HEADER="@0@"'.format(shared_glapi_mapi_tmp_h.full_path()),
   ],
   link_args : [ld_args_gc_sections],
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 26/49] meson: fix pipe-loader compilation for windows

2018-08-22 Thread Dylan Baker
v2: - Add missing D to pound define
- Simply define the variable rather than set it to 1 (mirrors
  android.mk not scons)
---
 src/gallium/auxiliary/pipe-loader/meson.build | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/pipe-loader/meson.build 
b/src/gallium/auxiliary/pipe-loader/meson.build
index 32e8188c68b..c5db4e18203 100644
--- a/src/gallium/auxiliary/pipe-loader/meson.build
+++ b/src/gallium/auxiliary/pipe-loader/meson.build
@@ -27,13 +27,18 @@ files_pipe_loader = files(
 )
 
 libpipe_loader_defines = []
+libpipe_loader_links = []
 
 if dep_libdrm.found()
   files_pipe_loader += files('pipe_loader_drm.c')
+  libpipe_loader_links += libloader
 endif
 if with_gallium_drisw_kms
   libpipe_loader_defines += '-DHAVE_PIPE_LOADER_KMS'
 endif
+if not (with_gallium_st_nine or with_gallium_opencl)
+  libpipe_loader_defines += '-DDROP_PIPE_LOADER_MISC'
+endif
 
 libpipe_loader_static = static_library(
   'pipe_loader_static',
@@ -46,7 +51,7 @@ libpipe_loader_static = static_library(
 c_vis_args, '-DHAVE_PIPE_LOADER_DRI', '-DGALLIUM_STATIC_TARGETS=1',
 libpipe_loader_defines,
   ],
-  link_with : [libloader, libxmlconfig],
+  link_with : [libpipe_loader_links, libxmlconfig],
   dependencies : [dep_libdrm],
   build_by_default : false,
 )
@@ -64,7 +69,7 @@ libpipe_loader_dynamic = static_library(
   join_paths(get_option('prefix'), get_option('libdir'), 'gallium-pipe')
 )
   ],
-  link_with : [libloader, libxmlconfig],
+  link_with : [libpipe_loader_links, libxmlconfig],
   dependencies : [dep_libdrm],
   build_by_default : false,
 )
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 25/49] util/xmlconfig: include strndup.h for windows

2018-08-22 Thread Dylan Baker
---
 src/util/xmlconfig.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c
index 5264f2598b4..51cc5f3dd87 100644
--- a/src/util/xmlconfig.c
+++ b/src/util/xmlconfig.c
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include "strndup.h"
 #include "xmlconfig.h"
 #include "u_process.h"
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 04/49] add a git ignore for subprojects

2018-08-22 Thread Dylan Baker
Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 subprojects/.gitignore | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 subprojects/.gitignore

diff --git a/subprojects/.gitignore b/subprojects/.gitignore
new file mode 100644
index 000..68a882edba6
--- /dev/null
+++ b/subprojects/.gitignore
@@ -0,0 +1,3 @@
+*
+!*.wrap
+!.gitignore
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 23/49] meson: Don't check for posix_memalign on windows

2018-08-22 Thread Dylan Baker
There's a mingw bug for this, it exports __builtin_posix_memalign but
not posix_memalign, so the check will succeed, but compiling will fail.
---
 meson.build | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 0f37117e3fc..c89b805e71f 100644
--- a/meson.build
+++ b/meson.build
@@ -1048,13 +1048,22 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 
'linux/futex.h', 'endian.h', 'dlfcn.h'
 pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
   endif
 endforeach
-
-foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 
'memfd_create']
+foreach f : ['strtof', 'mkostemp', 'timespec_get', 'memfd_create']
   if cc.has_function(f)
 pre_args += '-DHAVE_@0@'.format(f.to_upper())
   endif
 endforeach
 
+# MinGW provides a __builtin_posix_memalign function, but not a posix_memalign.
+# This means that this check will succeed, but then compilation will later
+# fail. MSVC doesn't have this function at all, so only check for it on
+# non-windows platforms.
+if host_machine.system() != 'windows'
+  if cc.has_function('posix_memalign')
+pre_args += '-DHAVE_POSIX_MEMALIGN'
+  endif
+endif
+
 # strtod locale support
 if cc.links('''
 #define _GNU_SOURCE
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 15/49] meson: Make shader-cache a trillean instead of boolean

2018-08-22 Thread Dylan Baker
So that it can be implicitly disabled on windows, where it doesn't
compile.

v2: - Use an auto-option rather than automagic.
- fix shader_cache check (== -> !=)
v4: - Use new with_shader_cache instead of get_option('shader-cache')
  elsewhere in the meson build
---
 meson.build   | 18 ++
 meson_options.txt |  5 +++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/meson.build b/meson.build
index 6cdb6888d1e..0f37117e3fc 100644
--- a/meson.build
+++ b/meson.build
@@ -728,9 +728,19 @@ if get_option('buildtype') == 'debug'
   pre_args += '-DDEBUG'
 endif
 
-if get_option('shader-cache')
-  pre_args += '-DENABLE_SHADER_CACHE'
-elif with_amd_vk
+with_shader_cache = false
+_shader_cache = get_option('shader-cache')
+if _shader_cache != 'false'
+  if host_machine.system() == 'windows'
+if _shader_cache == 'true'
+  error('Shader Cache does not currently work on Windows')
+endif
+  else
+pre_args += '-DENABLE_SHADER_CACHE'
+with_shader_cache = true
+  endif
+endif
+if with_amd_vk and not with_shader_cache
   error('Radv requires shader cache support')
 endif
 
@@ -1112,7 +1122,7 @@ if cc.has_function('dl_iterate_phdr')
   pre_args += '-DHAVE_DL_ITERATE_PHDR'
 elif with_intel_vk
   error('Intel "Anvil" Vulkan driver requires the dl_iterate_phdr function')
-elif with_dri_i965 and get_option('shader-cache')
+elif with_dri_i965 and with_shader_cache
   error('Intel i965 GL driver requires dl_iterate_phdr when built with shader 
caching.')
 endif
 
diff --git a/meson_options.txt b/meson_options.txt
index b8df253b323..cb21a68f131 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -158,8 +158,9 @@ option(
 )
 option(
   'shader-cache',
-  type : 'boolean',
-  value : true,
+  type : 'combo',
+  value : 'auto',
+  choices : ['auto', 'true', 'false'],
   description : 'Build with on-disk shader cache support'
 )
 option(
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 24/49] meson: Add support for wrapping llvm

2018-08-22 Thread Dylan Baker
For building on Windows (when not using cygwin), the assumption is that
LLVM will have to be handled via a binary wrap. In this case the user
wanting to use LLVM is this way will need to create a directory in
subprojects (any name is fine), and pass that name via the -Dllvm-wrap
option (for example, assuming subprojects/llvm, -Dllvm-wrap=llvm), which
must have a meson.build file and the installed LLVM to link with (this
can be either static or dynamic). There is documentation for what this
needs to look like and how to define it.

v2: - Use  in html docs
---
 docs/meson.html   |  66 +
 meson.build   | 131 +++---
 meson_options.txt |   6 +
 .../drivers/swr/rasterizer/jitter/meson.build |  13 +-
 4 files changed, 163 insertions(+), 53 deletions(-)

diff --git a/docs/meson.html b/docs/meson.html
index 29907a60a9c..b64ca2ec35e 100644
--- a/docs/meson.html
+++ b/docs/meson.html
@@ -132,6 +132,72 @@ dependency interface. It will search $PATH 
(or %PATH%
 llvm-config, so using an LLVM from a non-standard path is as easy as
 PATH=/path/with/llvm-config:$PATH meson build.
 
+
+On windows (and in other cases), using llvm-config is either undesirable
+or impossible. Meson's solution for this is a
+http://mesonbuild.com/Wrap-dependency-system-manual.html";>wrap, in
+this case a "binary wrap". Follow the steps below:
+
+Install the binaries and headers into a directory under the 
$mesa_src/subprojects
+Add a meson build.build file to that directory (more on that 
later)
+add -Dllvm-wrap=$directory to your meson configuration 
(where $directory is the the directory under subprojects
+
+
+The wrap file must define the following:
+
+ext_llvm: a declare_dependency() object with 
include_directories, dependencies, and version set)
+
+
+It may also define:
+
+irbuilder_h: a file() object pointing to 
llvm/IR/IRBuilder.h (for SWR)
+
+
+such a meson.build file might look like:
+
+project('llvm', ['cpp'])
+
+cpp = meson.get_compiler('cpp')
+
+_deps = []
+_search = join_paths(meson.current_source_dir(), 'lib')
+foreach d : ['libLLVMCodeGen', 'libLLVMScalarOpts', 'libLLVMAnalysis',
+ 'libLLVMTransformUtils', 'libLLVMCore', 'libLLVMX86CodeGen',
+ 'libLLVMSelectionDAG', 'libLLVMipo', 'libLLVMAsmPrinter',
+ 'libLLVMInstCombine', 'libLLVMInstrumentation', 'libLLVMMC',
+ 'libLLVMGlobalISel', 'libLLVMObjectYAML', 'libLLVMDebugInfoPDB',
+ 'libLLVMVectorize', 'libLLVMPasses', 'libLLVMSupport',
+ 'libLLVMLTO', 'libLLVMObject', 'libLLVMDebugInfoCodeView',
+ 'libLLVMDebugInfoDWARF', 'libLLVMOrcJIT', 'libLLVMProfileData',
+ 'libLLVMObjCARCOpts', 'libLLVMBitReader', 'libLLVMCoroutines',
+ 'libLLVMBitWriter', 'libLLVMRuntimeDyld', 'libLLVMMIRParser',
+ 'libLLVMX86Desc', 'libLLVMAsmParser', 'libLLVMTableGen',
+ 'libLLVMFuzzMutate', 'libLLVMLinker', 'libLLVMMCParser',
+ 'libLLVMExecutionEngine', 'libLLVMCoverage', 'libLLVMInterpreter',
+ 'libLLVMTarget', 'libLLVMX86AsmParser', 'libLLVMSymbolize',
+ 'libLLVMDebugInfoMSF', 'libLLVMMCJIT', 'libLLVMXRay',
+ 'libLLVMX86AsmPrinter', 'libLLVMX86Disassembler',
+ 'libLLVMMCDisassembler', 'libLLVMOption', 'libLLVMIRReader',
+ 'libLLVMLibDriver', 'libLLVMDlltoolDriver', 'libLLVMDemangle',
+ 'libLLVMBinaryFormat', 'libLLVMLineEditor',
+ 'libLLVMWindowsManifest', 'libLLVMX86Info', 'libLLVMX86Utils']
+  _deps += cpp.find_library(d, dirs : _search)
+endforeach
+
+ext_llvm = declare_dependency(
+  include_directories : include_directories('include'),
+  dependencies : _deps,
+  version : '6.0.0',
+)
+
+irbuilder_h = files('include/llvm/IR/IRBuilder.h')
+
+
+It is very important that version is defined and is accurate, if it is not,
+workarounds for the wrong version of LLVM might be used resulting in build
+failures.
+
+
 
 
 
diff --git a/meson.build b/meson.build
index c89b805e71f..d7884823ebc 100644
--- a/meson.build
+++ b/meson.build
@@ -1255,59 +1255,94 @@ else
 endif
 
 _llvm = get_option('llvm')
-if _llvm == 'auto'
-  dep_llvm = dependency(
-'llvm',
-version : _llvm_version,
-modules : llvm_modules,
-optional_modules : llvm_optional_modules,
-required : with_amd_vk or with_gallium_radeonsi or with_gallium_swr or 
with_gallium_opencl,
-  )
-  with_llvm = dep_llvm.found()
-elif _llvm == 'true'
-  dep_llvm = dependency(
-'llvm',
-version : _llvm_version,
-modules : llvm_modules,
-optional_modules : llvm_optional_modules,
-  )
-  with_llvm = true
-else
-  dep_llvm = null_dep
-  with_llvm = false
-endif
-if with_llvm
-  _llvm_version = dep_llvm.version().split('.')
-  # Development versions of LLVM have an 'svn' or 'git' suffix, we don't want
-  # that for our version checks.
-  # svn suffixes are stripped by meson as of 0.4

[Mesa-dev] [PATCH v4 20/49] meson: build libgl-gdi target

2018-08-22 Thread Dylan Baker
v4: - Fix check for broken mingw (should be for x86 not x86_64)
- Add comment about why check is needed
---
 src/gallium/meson.build   |  1 +
 src/gallium/targets/libgl-gdi/meson.build | 46 +++
 2 files changed, 47 insertions(+)
 create mode 100644 src/gallium/targets/libgl-gdi/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index a4f28dc4757..5019477788b 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -193,6 +193,7 @@ if with_gallium_st_nine
 endif
 if with_platform_windows
   subdir('state_trackers/wgl')
+  subdir('targets/libgl-gdi')
 endif
 if with_tests
   subdir('targets/graw-null')
diff --git a/src/gallium/targets/libgl-gdi/meson.build 
b/src/gallium/targets/libgl-gdi/meson.build
new file mode 100644
index 000..c4c7c772d38
--- /dev/null
+++ b/src/gallium/targets/libgl-gdi/meson.build
@@ -0,0 +1,46 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+# DEF parser in certain versions of MinGW is busted, as does not behave as
+# MSVC. mingw-w64 works fine.
+if cc.get_id() == 'gcc' and host_machine.cpu_family() != 'x86_64'
+  ogldef = files('../../state_trackers/wgl/opengl32.mingw.def')[0]
+else
+  ogldef = files('../../state_trackers/wgl/opengl32.def')[0]
+endif
+
+libopengl32 = shared_library(
+  'opengl32',
+  ['libgl_gdi.c'],
+  vs_module_defs : ogldef,
+  include_directories : [
+inc_common, inc_wgl, inc_gallium_winsys_sw, inc_gallium_drivers,
+  ],
+  link_whole : [libwgl],
+  link_with : [
+libmesa_util, libgallium, libglsl, libmesa_gallium, libwsgdi,
+libglapi_static, libglapi
+  ],
+  dependencies : [
+dep_ws2_32, idep_nir, driver_swrast, driver_swr,
+  ],
+  name_prefix : '',  # otherwise mingw will create libopengl32.dll
+  install : true,
+)
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 19/49] meson: build wgl state tracker

2018-08-22 Thread Dylan Baker
v4: - Handle enable gles properly
- Add comments about what various #defines do

Reviewed-by: Eric Anholt 
---
 src/gallium/meson.build|  3 ++
 src/gallium/state_trackers/wgl/meson.build | 57 ++
 2 files changed, 60 insertions(+)
 create mode 100644 src/gallium/state_trackers/wgl/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 7754dbdee3c..a4f28dc4757 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -191,6 +191,9 @@ if with_gallium_st_nine
   subdir('state_trackers/nine')
   subdir('targets/d3dadapter9')
 endif
+if with_platform_windows
+  subdir('state_trackers/wgl')
+endif
 if with_tests
   subdir('targets/graw-null')
   if with_glx == 'gallium-xlib'
diff --git a/src/gallium/state_trackers/wgl/meson.build 
b/src/gallium/state_trackers/wgl/meson.build
new file mode 100644
index 000..c57568f07f4
--- /dev/null
+++ b/src/gallium/state_trackers/wgl/meson.build
@@ -0,0 +1,57 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+inc_wgl = include_directories('.')
+_c_args_wgl = []
+if with_gles1 or with_gles2
+  # prevent _glapi_* from being declared __declspec(dllimport)
+  _c_args_wgl += '-D_GLAPI_NO_EXPORTS'
+endif
+
+libwgl = static_library(
+  'wgl',
+  files(
+'stw_context.c',
+'stw_device.c',
+'stw_ext_context.c',
+'stw_ext_extensionsstring.c',
+'stw_ext_pbuffer.c',
+'stw_ext_pixelformat.c',
+'stw_ext_rendertexture.c',
+'stw_ext_swapinterval.c',
+'stw_framebuffer.c',
+'stw_getprocaddress.c',
+'stw_nopfuncs.c',
+'stw_nopfuncs.h',
+'stw_pixelformat.c',
+'stw_st.c',
+'stw_tls.c',
+'stw_wgl.c',
+  ),
+  c_args : [
+'-D_GDI32_', # prevent wgl* being declared 
__declspec(dllimport)
+'-DBUILD_GL32',  # declare gl* as __declspec(dllexport) in Mesa 
headers
+'-DWIN32_LEAN_AND_MEAN', # 
http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx
+_c_args_wgl
+  ],
+  include_directories : [
+inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_mapi, inc_mesa,
+  ],
+)
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 02/49] Replace uses of _mesa_bitcount with util_bitcount

2018-08-22 Thread Dylan Baker
and _mesa_bitcount_64 with util_bitcount_64. This fixes a build problem
in nir for platforms that don't have popcount or popcountll, such as
32bit msvc.

v4: - add this patch
---
 src/compiler/glsl/ir_constant_expression.cpp  |  2 +-
 src/compiler/glsl/ir_expression_operation.py  |  2 +-
 src/compiler/glsl/link_varyings.cpp   |  5 ++-
 src/compiler/glsl/linker.cpp  |  9 +++--
 src/compiler/nir/nir.c|  6 +--
 src/gallium/state_trackers/glx/xlib/glx_api.c |  7 ++--
 src/gallium/state_trackers/glx/xlib/xm_api.c  | 11 +++---
 src/gallium/targets/libgl-xlib/Makefile.am|  1 +
 src/intel/blorp/blorp_blit.c  |  5 ++-
 src/intel/compiler/brw_fs.cpp |  3 +-
 src/intel/compiler/brw_fs_nir.cpp |  3 +-
 src/intel/compiler/brw_nir.c  |  5 ++-
 src/intel/compiler/brw_vec4.cpp   |  3 +-
 src/intel/compiler/brw_vec4_visitor.cpp   |  3 +-
 src/intel/vulkan/anv_blorp.c  |  2 +-
 src/intel/vulkan/anv_image.c  |  9 +++--
 src/intel/vulkan/anv_nir_lower_multiview.c|  8 ++--
 src/intel/vulkan/anv_pipeline.c   |  2 +-
 src/intel/vulkan/anv_private.h|  7 ++--
 src/intel/vulkan/genX_cmd_buffer.c|  4 +-
 src/intel/vulkan/genX_query.c | 14 +++
 src/mesa/drivers/common/meta.c|  5 ++-
 src/mesa/drivers/dri/i965/brw_curbe.c |  3 +-
 src/mesa/drivers/dri/i965/brw_draw_upload.c   |  3 +-
 .../drivers/dri/i965/brw_performance_query.c  |  5 ++-
 src/mesa/drivers/dri/i965/brw_wm.c|  7 ++--
 src/mesa/drivers/x11/Makefile.am  |  1 +
 src/mesa/drivers/x11/fakeglx.c|  7 ++--
 src/mesa/drivers/x11/meson.build  |  2 +-
 src/mesa/drivers/x11/xm_api.c | 17 +
 src/mesa/main/arrayobj.c  |  5 ++-
 src/mesa/main/buffers.c   |  7 ++--
 src/mesa/main/imports.c   | 38 ---
 src/mesa/main/imports.h   | 15 
 src/mesa/program/program_parse.y  |  4 +-
 35 files changed, 101 insertions(+), 129 deletions(-)

diff --git a/src/compiler/glsl/ir_constant_expression.cpp 
b/src/compiler/glsl/ir_constant_expression.cpp
index c9788c70535..bfc22c0011a 100644
--- a/src/compiler/glsl/ir_constant_expression.cpp
+++ b/src/compiler/glsl/ir_constant_expression.cpp
@@ -39,7 +39,7 @@
 #include "ir.h"
 #include "compiler/glsl_types.h"
 #include "util/hash_table.h"
-#include "main/imports.h"
+#include "util/u_math.h"
 
 static float
 dot_f(ir_constant *op0, ir_constant *op1)
diff --git a/src/compiler/glsl/ir_expression_operation.py 
b/src/compiler/glsl/ir_expression_operation.py
index 16b98690a6d..306fc35f605 100644
--- a/src/compiler/glsl/ir_expression_operation.py
+++ b/src/compiler/glsl/ir_expression_operation.py
@@ -535,7 +535,7 @@ ir_expression_operation = [
 
# Bit operations, part of ARB_gpu_shader5.
operation("bitfield_reverse", 1, source_types=(uint_type, int_type), 
c_expression="bitfield_reverse({src0})"),
-   operation("bit_count", 1, source_types=(uint_type, int_type), 
dest_type=int_type, c_expression="_mesa_bitcount({src0})"),
+   operation("bit_count", 1, source_types=(uint_type, int_type), 
dest_type=int_type, c_expression="util_bitcount({src0})"),
operation("find_msb", 1, source_types=(uint_type, int_type), 
dest_type=int_type, c_expression={'u': "find_msb_uint({src0})", 'i': 
"find_msb_int({src0})"}),
operation("find_lsb", 1, source_types=(uint_type, int_type), 
dest_type=int_type, c_expression="find_msb_uint({src0} & -{src0})"),
 
diff --git a/src/compiler/glsl/link_varyings.cpp 
b/src/compiler/glsl/link_varyings.cpp
index 211633d9ee3..52e493cb599 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -38,6 +38,7 @@
 #include "link_varyings.h"
 #include "main/macros.h"
 #include "util/hash_table.h"
+#include "util/u_math.h"
 #include "program.h"
 
 
@@ -2879,13 +2880,13 @@ link_varyings(struct gl_shader_program *prog, unsigned 
first, unsigned last,
 
 /* This must be done after all dead varyings are eliminated. */
 if (sh_i != NULL) {
-   unsigned slots_used = _mesa_bitcount_64(reserved_out_slots);
+   unsigned slots_used = util_bitcount64(reserved_out_slots);
if (!check_against_output_limit(ctx, prog, sh_i, slots_used)) {
   return false;
}
 }
 
-unsigned slots_used = _mesa_bitcount_64(reserved_in_slots);
+unsigned slots_used = util_bitcount64(reserved_in_slots);
 if (!check_against_input_limit(ctx, prog, sh_next, slots_used))
return false;
 
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 3ce78fe6428..ea481c17885 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.c

[Mesa-dev] [PATCH v4 49/49] appveyor: cache pip packages

2018-08-22 Thread Dylan Baker
---
 appveyor.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/appveyor.yml b/appveyor.yml
index 2c45f534ec3..2cb520b9604 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -36,6 +36,7 @@ clone_depth: 100
 cache:
 - llvm-5.0.1-msvc2015-mtd.7z
 - subprojects\packagecache
+- '%LOCALAPPDATA%\pip\Cache'
 
 os: Visual Studio 2015
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 00/49] Meson for Windows

2018-08-22 Thread Dylan Baker
This is the 4th iteration of my meson for windows series. It includes
(hopefully) all of the review feedback I got on the v3, as well as a few new
fixes and features, namely the appveyor build now uses the same LLVM as scons to
build LLVMPipe (I would like to build SWR, but that requires LLVM 6.0.0, and the
provided LLVM is 5.0.1). It also has a fix for building nir tests with 32-bit
MSVC, due to a dependency on mesa main that is header only with GCC, Clang, and
64-bit MSVC.

This is available on my gitlab:
https://gitlab.freedesktop.org/dbaker/mesa meson-windows

And the appveyor results are here for this exact set of patches:
https://ci.appveyor.com/project/dcbaker/mesa/build/87

Dylan Baker (49):
  move u_math to src/util
  Replace uses of _mesa_bitcount with util_bitcount
  meson: always define libglapi
  add a git ignore for subprojects
  meson: add a zlib subproject
  meson: add a expat subproject
  glapi: export glapi_destroy_multithread when building shared-glapi on
windows
  glsl: fix general_ir_test with mingw
  meson: fix dl detection on non cygwin windows
  meson: build getopt when using msvc
  meson: Add a platform for windows
  meson: don't build glx or dri by default on windows
  meson: don't allow glvnd on windows
  meson: add windows compiler checks and libraries
  meson: Make shader-cache a trillean instead of boolean
  meson: Add windows defines to glapi
  meson: Add necessary defines for mesa_gallium on windows
  meson: build gallium gdi winsys
  meson: build wgl state tracker
  meson: build libgl-gdi target
  meson: build graw-gdi target
  meson: fix gallium-osmesa to build for windows
  meson: Don't check for posix_memalign on windows
  meson: Add support for wrapping llvm
  util/xmlconfig: include strndup.h for windows
  meson: fix pipe-loader compilation for windows
  meson: don't look for rt on windows
  meson: Add support for using win_flex and win_bison on windows
  meson: make nm binary optional
  meson: for incluse of inttypes.h for glcpp with msvc
  meson: disable sse4.1 optimizations with msvc
  meson: add switches for SWR with MSVC
  meson: don't define GLX_USE_TLS for windows
  meson: Add idep_getopt for tests
  util/tests: Use define instead of VLA
  meson: Don't build glsl cache_test for windows
  glsl/tests: define ssize_t on windows
  meson: Set visibility and compat args for graw
  meson: don't build gallium trivial tests on windows
  meson: Fix gtest linkage on msvc
  meson: disable graw tests on mingw
  meson: don't build or run mesa-sha1 test on windows
  tests/vma: fix build with MSVC
  meson: maintain names of shared API libraries
  appveyor: Add support for meson as well as scons
  appveyor: use chocolatey (cinst) to install winflexbison
  appveyor: use msbuild instead of ninja
  appveyor: Add a wrap for llvm
  appveyor: cache pip packages

 appveyor.yml  |  49 ++-
 build-support/appveyor-llvm.meson.build   |  56 +++
 docs/meson.html   |  66 +++
 meson.build   | 401 --
 meson_options.txt |  12 +-
 src/broadcom/cle/v3d_packet_helpers.h |   2 +-
 src/compiler/glsl/glcpp/meson.build   |  16 +-
 src/compiler/glsl/ir_constant_expression.cpp  |   2 +-
 src/compiler/glsl/ir_expression_operation.py  |   2 +-
 src/compiler/glsl/link_varyings.cpp   |   5 +-
 src/compiler/glsl/linker.cpp  |   9 +-
 src/compiler/glsl/meson.build |   6 +-
 src/compiler/glsl/tests/blob_test.c   |   4 +
 src/compiler/glsl/tests/general_ir_test.cpp   |  14 +-
 src/compiler/glsl/tests/meson.build   |  21 +-
 src/compiler/nir/nir.c|   6 +-
 src/egl/meson.build   |   2 +-
 src/gallium/auxiliary/Makefile.sources|   2 -
 src/gallium/auxiliary/meson.build |   2 -
 src/gallium/auxiliary/pipe-loader/meson.build |   9 +-
 src/gallium/auxiliary/util/u_format.c |   2 +-
 src/gallium/auxiliary/util/u_format_bptc.c|   2 +-
 src/gallium/auxiliary/util/u_format_latc.c|   2 +-
 src/gallium/auxiliary/util/u_format_other.c   |   2 +-
 src/gallium/auxiliary/util/u_format_pack.py   |   2 +-
 src/gallium/auxiliary/util/u_format_rgtc.c|   2 +-
 src/gallium/auxiliary/util/u_format_s3tc.c|   2 +-
 src/gallium/auxiliary/util/u_format_yuv.h |   2 +-
 src/gallium/auxiliary/util/u_format_zs.c  |   2 +-
 src/gallium/drivers/swr/meson.build   |   3 +-
 .../drivers/swr/rasterizer/jitter/meson.build |  13 +-
 src/gallium/meson.build   |  14 +-
 src/gallium/state_trackers/glx/xlib/glx_api.c |   7 +-
 src/gallium/state_trackers/glx/xlib/xm_api.c  |  11 +-
 src/gallium/state_trackers/osmesa/meson.build |  12 +-
 .../{osmesa => wgl}/meson.build   |  39 +-
 .../{graw-xlib => graw-gdi}/meson.build   |  21 +-
 src/gallium/targets/graw-null/meson.build |   2 +
 src/gallium/targ

[Mesa-dev] [PATCH v4 03/49] meson: always define libglapi

2018-08-22 Thread Dylan Baker
This allows the identifier to be used even if shared-glapi isn't build,
which simplifies a bunch of things.

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 src/mapi/meson.build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mapi/meson.build b/src/mapi/meson.build
index 798586bfb0c..0be80047e4d 100644
--- a/src/mapi/meson.build
+++ b/src/mapi/meson.build
@@ -30,6 +30,8 @@ mapi_abi_py = files('mapi_abi.py')
 subdir('glapi')
 if with_shared_glapi
   subdir('shared-glapi')
+else
+  libglapi = []
 endif
 if with_gles1
   subdir('es1api')
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 05/49] meson: add a zlib subproject

2018-08-22 Thread Dylan Baker
To help windows build

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 meson.build   |  2 +-
 subprojects/zlib.wrap | 10 ++
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 subprojects/zlib.wrap

diff --git a/meson.build b/meson.build
index 1b3dfa221c9..d75762295ac 100644
--- a/meson.build
+++ b/meson.build
@@ -1056,7 +1056,7 @@ else
 endif
 
 # TODO: some of these may be conditional
-dep_zlib = dependency('zlib', version : '>= 1.2.3')
+dep_zlib = dependency('zlib', version : '>= 1.2.3', fallback : ['zlib', 
'zlib_dep'])
 pre_args += '-DHAVE_ZLIB'
 dep_thread = dependency('threads')
 if dep_thread.found() and host_machine.system() != 'windows'
diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap
new file mode 100644
index 000..f459463bb59
--- /dev/null
+++ b/subprojects/zlib.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = zlib-1.2.11
+
+source_url = http://zlib.net/fossils/zlib-1.2.11.tar.gz
+source_filename = zlib-1.2.11.tar.gz
+source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
+
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/2/get_zip
+patch_filename = zlib-1.2.11-2-wrap.zip
+patch_hash = aed811a48707be2a374a230c01e2efa17b385fe7e88f4ac0ee122093766aab2b
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 07/49] glapi: export glapi_destroy_multithread when building shared-glapi on windows

2018-08-22 Thread Dylan Baker
Which will allow meson to build a shared glapi build with mingw.

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 src/mapi/glapi/glapi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h
index d5d4e0a03a6..cbdef2e4c5a 100644
--- a/src/mapi/glapi/glapi.h
+++ b/src/mapi/glapi/glapi.h
@@ -114,7 +114,7 @@ _GLAPI_EXPORT extern void *_glapi_Context;
 #endif /* defined (GLX_USE_TLS) */
 
 
-void
+_GLAPI_EXPORT void
 _glapi_destroy_multithread(void);
 
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 18/49] meson: build gallium gdi winsys

2018-08-22 Thread Dylan Baker
Reviewed-by: Eric Anholt 
---
 src/gallium/meson.build   |  6 ++
 src/gallium/winsys/sw/gdi/meson.build | 27 +++
 2 files changed, 33 insertions(+)
 create mode 100644 src/gallium/winsys/sw/gdi/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 561af9d339c..7754dbdee3c 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -21,6 +21,7 @@
 
 inc_gallium_drivers = include_directories('drivers')
 inc_gallium_winsys = include_directories('winsys')
+inc_gallium_winsys_sw = include_directories('winsys/sw')
 
 subdir('auxiliary')
 subdir('auxiliary/pipe-loader')
@@ -35,6 +36,11 @@ if with_gallium_drisw_kms
 else
   libswkmsdri = []
 endif
+if with_platform_windows
+  subdir('winsys/sw/gdi')
+else
+  libwsgdi = []
+endif
 subdir('winsys/sw/wrapper')
 if with_platform_haiku
   subdir('winsys/sw/hgl')
diff --git a/src/gallium/winsys/sw/gdi/meson.build 
b/src/gallium/winsys/sw/gdi/meson.build
new file mode 100644
index 000..ac6c7cf0aa2
--- /dev/null
+++ b/src/gallium/winsys/sw/gdi/meson.build
@@ -0,0 +1,27 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+libwsgdi = static_library(
+  'wsgdi',
+  'gdi_sw_winsys.c',
+  include_directories : [
+inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
+  ],
+)
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 11/49] meson: Add a platform for windows

2018-08-22 Thread Dylan Baker
This mirrors the haiku build which uses a platform.

v2: - Fix some rebase problems

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 meson.build   | 8 ++--
 meson_options.txt | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index a5cb5be226c..1af610573d5 100644
--- a/meson.build
+++ b/meson.build
@@ -225,10 +225,12 @@ _platforms = get_option('platforms')
 if _platforms.contains('auto')
   if system_has_kms_drm
 _platforms = ['x11', 'wayland', 'drm', 'surfaceless']
-  elif ['darwin', 'windows', 'cygwin'].contains(host_machine.system())
+  elif ['darwin', 'cygwin'].contains(host_machine.system())
 _platforms = ['x11', 'surfaceless']
   elif ['haiku'].contains(host_machine.system())
 _platforms = ['haiku']
+  elif host_machine.system() == 'windows'
+_platforms = ['windows']
   else
 error('Unknown OS. Please pass -Dplatforms to set platforms. Patches 
gladly accepted to fix this.')
   endif
@@ -240,6 +242,7 @@ with_platform_wayland = _platforms.contains('wayland')
 with_platform_drm = _platforms.contains('drm')
 with_platform_haiku = _platforms.contains('haiku')
 with_platform_surfaceless = _platforms.contains('surfaceless')
+with_platform_windows = _platforms.contains('windows')
 
 with_platforms = false
 if _platforms.length() != 0 and _platforms != ['']
@@ -375,7 +378,8 @@ if with_any_vk and (with_platform_x11 and not with_dri3)
   error('Vulkan drivers require dri3 for X11 support')
 endif
 if with_dri or with_gallium
-  if with_glx == 'disabled' and not with_egl and not with_platform_haiku
+  if (with_glx == 'disabled' and not with_egl and not with_platform_haiku and
+  not with_platform_windows)
 error('building dri or gallium drivers require at least one window system')
   endif
 endif
diff --git a/meson_options.txt b/meson_options.txt
index 5bb560b61fb..b8df253b323 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -24,6 +24,7 @@ option(
   value : ['auto'],
   choices : [
 '', 'auto', 'x11', 'wayland', 'drm', 'surfaceless', 'haiku', 'android',
+'windows',
   ],
   description : 'comma separated list of window systems to support. If this is 
set to auto all platforms applicable to the OS will be enabled.'
 )
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 30/49] meson: for incluse of inttypes.h for glcpp with msvc

2018-08-22 Thread Dylan Baker
Because we provide a copy if MSVC doesn't, and we need it to make flex
do what we want.
---
 src/compiler/glsl/glcpp/meson.build | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/glcpp/meson.build 
b/src/compiler/glsl/glcpp/meson.build
index 769406f5331..be0e6ece54c 100644
--- a/src/compiler/glsl/glcpp/meson.build
+++ b/src/compiler/glsl/glcpp/meson.build
@@ -35,13 +35,23 @@ glcpp_lex = custom_target(
   command : [prog_flex, '-o', '@OUTPUT@', '@INPUT@'],
 )
 
+_extra_args = []
+if cpp.get_id() == 'msvc'
+  # Flex relies on __STDC_VERSION__>=199901L to decide when to include C99
+  # inttypes.h.  We always have inttypes.h available with MSVC (either the one
+  # bundled with MSVC 2013, or the one we bundle ourselves), but we can't just
+  # define __STDC_VERSION__ without breaking stuff, as MSVC doesn't fully
+  # support C99.  There's also no way to premptively include stdint.
+  _extra_args += '-FIinttypes.h'
+endif
+
 libglcpp = static_library(
   'glcpp',
   [glcpp_lex, glcpp_parse, files('glcpp.h', 'pp.c')],
   link_with : libmesa_util,
   include_directories : [inc_common],
-  c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args],
-  cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
+  c_args : [c_vis_args, no_override_init_args, c_msvc_compat_args, 
_extra_args],
+  cpp_args : [cpp_vis_args, cpp_msvc_compat_args, _extra_args],
   build_by_default : false,
 )
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 06/49] meson: add a expat subproject

2018-08-22 Thread Dylan Baker
For Windows

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 meson.build|  2 +-
 subprojects/expat.wrap | 10 ++
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 subprojects/expat.wrap

diff --git a/meson.build b/meson.build
index d75762295ac..9298c5ecce6 100644
--- a/meson.build
+++ b/meson.build
@@ -1070,7 +1070,7 @@ if with_amd_vk or with_gallium_radeonsi or 
with_gallium_r600 or with_gallium_ope
 else
   dep_elf = null_dep
 endif
-dep_expat = dependency('expat')
+dep_expat = dependency('expat', fallback : ['expat', 'expat_dep'])
 # this only exists on linux so either this is linux and it will be found, or
 # its not linux and and wont
 dep_m = cc.find_library('m', required : false)
diff --git a/subprojects/expat.wrap b/subprojects/expat.wrap
new file mode 100644
index 000..0b7c53e54db
--- /dev/null
+++ b/subprojects/expat.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = expat-2.2.5
+
+source_url = 
https://github.com/libexpat/libexpat/releases/download/R_2_2_5/expat-2.2.5.tar.bz2
+source_filename = expat-2.2.5.tar.bz2
+source_hash = d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6
+
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/expat/2.2.5/4/get_zip
+patch_filename = expat-2.2.5-4-wrap.zip
+patch_hash = 25748839be2bbdd2ff586d1a05aa6fc37aeada75c78416df6e8347a6321abaac
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 43/49] tests/vma: fix build with MSVC

2018-08-22 Thread Dylan Baker
---
 src/util/tests/vma/vma_random_test.cpp | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/util/tests/vma/vma_random_test.cpp 
b/src/util/tests/vma/vma_random_test.cpp
index 1f194fcdf92..9246176cbf2 100644
--- a/src/util/tests/vma/vma_random_test.cpp
+++ b/src/util/tests/vma/vma_random_test.cpp
@@ -34,7 +34,15 @@
 #include 
 #include 
 
+#ifndef _WIN32
 #include 
+#else
+#define errx(code, msg, ...) \
+   do {  \
+  fprintf(stderr, msg, __VA_ARGS__); \
+  exit(code);\
+   } while (0);
+#endif
 
 #include "vma.h"
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 14/49] meson: add windows compiler checks and libraries

2018-08-22 Thread Dylan Baker
v4: - Fix typo in warning code (4246 -> 4267)
- Copy comments from scons for what MSVC warnings codes do
- Merge linker argument changes into this commit
---
 meson.build | 155 +++-
 1 file changed, 106 insertions(+), 49 deletions(-)

diff --git a/meson.build b/meson.build
index 32a731e2024..6cdb6888d1e 100644
--- a/meson.build
+++ b/meson.build
@@ -781,69 +781,124 @@ endif
 # TODO: this is very incomplete
 if ['linux', 'cygwin'].contains(host_machine.system())
   pre_args += '-D_GNU_SOURCE'
+elif host_machine.system() == 'windows'
+  pre_args += [
+'-D_WINDOWS', '-D_WIN32_WINNT=0x0601', '-D_WINVER=0x0601',
+'-DPIPE_SUBSYSTEM_WINDOWS_USER',
+'-D_USE_MATH_DEFINES',  # XXX: scons doesn't use this for mingw
+  ]
+  if cc.get_id() == 'msvc'
+pre_args += [
+  '-DVC_EXTRALEAN',
+  '-D_CRT_SECURE_NO_WARNINGS',
+  '-D_CRT_SECURE_NO_DEPRECATE',
+  '-D_SCL_SECURE_NO_WARNINGS',
+  '-D_SCL_SECURE_NO_DEPRECATE',
+  '-D_ALLOW_KEYWORD_MACROS',
+  '-D_HAS_EXCEPTIONS=0', # Tell C++ STL to not use exceptions
+]
+  else
+pre_args += ['-D__MSVCRT_VERSION__=0x0700']
+  endif
 endif
 
 # Check for generic C arguments
 c_args = []
-foreach a : ['-Wall', '-Werror=implicit-function-declaration',
- '-Werror=missing-prototypes', '-fno-math-errno',
- '-fno-trapping-math', '-Qunused-arguments']
-  if cc.has_argument(a)
-c_args += a
-  endif
-endforeach
-if cc.has_argument('-Wmissing-field-initializers')
-  c_args += '-Wno-missing-field-initializers'
-endif
-
 c_vis_args = []
-if cc.has_argument('-fvisibility=hidden')
-  c_vis_args += '-fvisibility=hidden'
-endif
-
-# Check for generic C++ arguments
+c_msvc_compat_args = []
+no_override_init_args = []
 cpp_args = []
-foreach a : ['-Wall', '-fno-math-errno', '-fno-trapping-math',
- '-Qunused-arguments']
-  if cpp.has_argument(a)
-cpp_args += a
+cpp_vis_args = []
+cpp_msvc_compat_args = []
+if cc.get_id() == 'msvc'
+  foreach a : ['/wd4018',  # signed/unsigned mismatch
+   '/wd4056',  # overflow in floating-point constant arithmetic
+   '/wd4244',  # conversion from 'type1' to 'type2', possible loss 
of data
+   '/wd4267',  # 'var' : conversion from 'size_t' to 'type', 
possible loss of data
+   '/wd4305',  # trancation from 'type1' to 'type2'
+   '/wd4351',  # new behavior: elements of array 'array' will be 
default initialized
+   '/wd4756',  # overflow in constant arithmetic
+   '/wd4800',  # forcing value to bool 'true' or 'false' 
(performance warning)
+   '/wd4996']  # disabled deprecated POSIX name warnings
+if cc.has_argument(a)
+  c_args += a
+endif
+if cpp.has_argument(a)
+  cpp_args += a
+endif
+  endforeach
+  if cc.has_argument('-Wmicrosoft-enum-value')  # Clang
+c_args += '-Wno-microsoft-enum-value'
+cpp_args += '-Wno-microsoft-enum-value'
   endif
-endforeach
-
-# For some reason, the test for -Wno-foo always succeeds with gcc, even if the
-# option is not supported. Hence, check for -Wfoo instead.
-
-foreach a : ['non-virtual-dtor', 'missing-field-initializers']
-  if cpp.has_argument('-W' + a)
-cpp_args += '-Wno-' + a
+else
+  foreach a : ['-Wall', '-Werror=implicit-function-declaration',
+   '-Werror=missing-prototypes', '-fno-math-errno',
+   '-fno-trapping-math', '-Qunused-arguments']
+if cc.has_argument(a)
+  c_args += a
+endif
+  endforeach
+  if cc.has_argument('-Wmissing-field-initializers')
+c_args += '-Wno-missing-field-initializers'
   endif
-endforeach
 
-no_override_init_args = []
-foreach a : ['override-init', 'initializer-overrides']
-  if cc.has_argument('-W' + a)
-no_override_init_args += '-Wno-' + a
+  c_vis_args = []
+  if cc.has_argument('-fvisibility=hidden')
+c_vis_args += '-fvisibility=hidden'
   endif
-endforeach
 
-cpp_vis_args = []
-if cpp.has_argument('-fvisibility=hidden')
-  cpp_vis_args += '-fvisibility=hidden'
-endif
+  # For some reason, the test for -Wno-foo always succeeds with gcc, even if
+  # the option is not supported. Hence, check for -Wfoo instead.
+  foreach a : ['non-virtual-dtor', 'missing-field-initializers']
+if cpp.has_argument('-W' + a)
+  cpp_args += '-Wno-' + a
+endif
+  endforeach
 
-# Check for C and C++ arguments for MSVC2013 compatibility. These are only used
-# in parts of the mesa code base that need to compile with old versions of
-# MSVC, mainly common code
-c_msvc_compat_args = []
-cpp_msvc_compat_args = []
-foreach a : ['-Werror=pointer-arith', '-Werror=vla']
-  if cc.has_argument(a)
-c_msvc_compat_args += a
+  foreach a : ['override-init', 'initializer-overrides']
+if cc.has_argument('-W' + a)
+  no_override_init_args += '-Wno-' + a
+endif
+  endforeach
+
+  if cpp.has_argument('-fvisibility=hidden')
+cpp_vis_args += '-fvisibility=hidden'
   endif
-  if c

[Mesa-dev] [PATCH v4 32/49] meson: add switches for SWR with MSVC

2018-08-22 Thread Dylan Baker
---
 src/gallium/drivers/swr/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/swr/meson.build 
b/src/gallium/drivers/swr/meson.build
index b95c8bc1bf8..ec4d80e4bb2 100644
--- a/src/gallium/drivers/swr/meson.build
+++ b/src/gallium/drivers/swr/meson.build
@@ -191,6 +191,7 @@ swr_arch_defines = []
 
 swr_avx_args = cpp.first_supported_argument(
   '-target-cpu=sandybridge', '-mavx', '-march=core-avx', '-tp=sandybridge',
+  '/arch:AVX',
   prefix : '''
 #if !defined(__AVX__)
 # error
@@ -215,7 +216,7 @@ endif
 
 if with_swr_arches.contains('avx2')
   swr_avx2_args = cpp.first_supported_argument(
-'-target-cpu=haswell', '-march=core-avx2', '-tp=haswell',
+'-target-cpu=haswell', '-march=core-avx2', '-tp=haswell', '/arch:AVX2',
 prefix : '''
   #if !defined(__AVX2__)
   # error
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 48/49] appveyor: Add a wrap for llvm

2018-08-22 Thread Dylan Baker
The appveyor build has a copy of llvm 5.0.1 that scons uses, meson can
also use this to build llvm pipe (though not swr, which requires 6.0.0)
as well.

This requires a plain buildtype, since we need to compile single
threaded to link with the provided LLVM, as well as a 32 bit build for
the same reason.

v4: - New in this version
---
 appveyor.yml|  8 ++--
 build-support/appveyor-llvm.meson.build | 56 +
 2 files changed, 61 insertions(+), 3 deletions(-)
 create mode 100644 build-support/appveyor-llvm.meson.build

diff --git a/appveyor.yml b/appveyor.yml
index 6277e9636d9..2c45f534ec3 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -75,12 +75,14 @@ install:
 # Download and extract LLVM
 - if not exist "%LLVM_ARCHIVE%" appveyor DownloadFile 
"https://people.freedesktop.org/~jrfonseca/llvm/%LLVM_ARCHIVE%";
 - 7z x -y "%LLVM_ARCHIVE%" > nul
-- mkdir llvm\bin
-- set LLVM=%CD%\llvm
+- if "%BUILD_SYSTEM%"=="scons" mkdir llvm\bin
+- if "%BUILD_SYSTEM%"=="scons" set LLVM=%CD%\llvm
+- if "%BUILD_SYSTEM%"=="meson" move llvm subprojects\
+- if "%BUILD_SYSTEM%"=="meson" copy build-support\appveyor-llvm.meson.build 
subprojects\llvm\meson.build
 
 build_script:
 - if "%BUILD_SYSTEM%"=="scons" scons -j%NUMBER_OF_PROCESSORS% 
MSVC_VERSION=14.0 llvm=1
-- if "%BUILD_SYSTEM%"=="meson" meson builddir --backend=vs2015 
-Dbuild-tests=true
+- if "%BUILD_SYSTEM%"=="meson" meson builddir --backend=vs2015 
--buildtype=plain -Dc_args="/MTd /ZI /Ob0 /Od /RTC1"  -Dcpp_args="/MTd /ZI /Ob0 
/Od /RTC1" -Dbuild-tests=true -Dllvm=true -Dllvm-wrap=llvm 
 - if "%BUILD_SYSTEM%"=="meson" cd builddir
 - if "%BUILD_SYSTEM%"=="meson" msbuild mesa.sln /m
 
diff --git a/build-support/appveyor-llvm.meson.build 
b/build-support/appveyor-llvm.meson.build
new file mode 100644
index 000..1f0ad1c148b
--- /dev/null
+++ b/build-support/appveyor-llvm.meson.build
@@ -0,0 +1,56 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+# This wrap is used by appveyor to build with meson against a pre-compiled llvm
+project('llvm', ['cpp'])
+
+cpp = meson.get_compiler('cpp')
+
+_deps = []
+_search = join_paths(meson.current_source_dir(), 'lib')
+foreach d : ['LLVMAnalysis', 'LLVMAsmParser', 'LLVMAsmPrinter',
+ 'LLVMBinaryFormat', 'LLVMBitReader', 'LLVMBitWriter',
+ 'LLVMCodeGen', 'LLVMCore', 'LLVMCoroutines', 'LLVMCoverage',
+ 'LLVMDebugInfoCodeView', 'LLVMDebugInfoDWARF', 'LLVMDebugInfoMSF',
+ 'LLVMDebugInfoPDB', 'LLVMDemangle', 'LLVMDlltoolDriver',
+ 'LLVMExecutionEngine', 'LLVMGlobalISel', 'LLVMInstCombine',
+ 'LLVMInstrumentation', 'LLVMInterpreter', 'LLVMipo',
+ 'LLVMIRReader', 'LLVMLibDriver', 'LLVMLineEditor', 'LLVMLinker',
+ 'LLVMLTO', 'LLVMMCDisassembler', 'LLVMMCJIT', 'LLVMMC',
+ 'LLVMMCParser', 'LLVMMIRParser', 'LLVMObjCARCOpts', 'LLVMObject',
+ 'LLVMObjectYAML', 'LLVMOption', 'LLVMOrcJIT', 'LLVMPasses',
+ 'LLVMProfileData', 'LLVMRuntimeDyld', 'LLVMScalarOpts',
+ 'LLVMSelectionDAG', 'LLVMSupport', 'LLVMSymbolize',
+ 'LLVMTableGen', 'LLVMTarget', 'LLVMTransformUtils',
+ 'LLVMVectorize', 'LLVMX86AsmParser', 'LLVMX86AsmPrinter',
+ 'LLVMX86CodeGen', 'LLVMX86Desc', 'LLVMX86Disassembler',
+ 'LLVMX86Info', 'LLVMX86Utils', 'LLVMXRay']
+  _deps += cpp.find_library(d, dirs : _search)
+endforeach
+
+ext_llvm = declare_dependency(
+  include_directories : include_directories('include'),
+  dependencies : _deps,
+  version : '5.0.1',
+)
+
+irbuilder_h = files('include/llvm/IR/IRBuilder.h')
+
+# vim: ft=meson.build
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 21/49] meson: build graw-gdi target

2018-08-22 Thread Dylan Baker
---
 src/gallium/meson.build  |  4 ++-
 src/gallium/targets/graw-gdi/meson.build | 36 
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 src/gallium/targets/graw-gdi/meson.build

diff --git a/src/gallium/meson.build b/src/gallium/meson.build
index 5019477788b..e4e0b88e7fc 100644
--- a/src/gallium/meson.build
+++ b/src/gallium/meson.build
@@ -197,7 +197,9 @@ if with_platform_windows
 endif
 if with_tests
   subdir('targets/graw-null')
-  if with_glx == 'gallium-xlib'
+  if with_platform_windows
+subdir('targets/graw-gdi')
+  elif with_glx == 'gallium-xlib'
 subdir('targets/graw-xlib')
   endif
   subdir('tests')
diff --git a/src/gallium/targets/graw-gdi/meson.build 
b/src/gallium/targets/graw-gdi/meson.build
new file mode 100644
index 000..e04b454ab53
--- /dev/null
+++ b/src/gallium/targets/graw-gdi/meson.build
@@ -0,0 +1,36 @@
+# Copyright © 2018 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+libgraw_gdi = shared_library(
+  'graw',
+  'graw_gdi.c',
+  include_directories : [
+inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_drivers,
+inc_gallium_winsys_sw,
+  ],
+  link_with : [
+libgraw_util, libmesa_util, libgallium, libwsgdi,
+  ],
+  dependencies : [
+dep_ws2_32, driver_swrast,
+  ],
+)
+
+libgraw = libgraw_gdi
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 09/49] meson: fix dl detection on non cygwin windows

2018-08-22 Thread Dylan Baker
v4: - Don't run checks on Windows that will always fail

Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt  (v3)
Reviewed-by: Eric Engestrom 
---
 meson.build | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/meson.build b/meson.build
index 9298c5ecce6..a5cb5be226c 100644
--- a/meson.build
+++ b/meson.build
@@ -1030,14 +1030,15 @@ if build_machine.system() != 'darwin'
 endif
 
 # check for dl support
-if cc.has_function('dlopen')
-  dep_dl = null_dep
-else
-  dep_dl = cc.find_library('dl')
-endif
-if cc.has_function('dladdr', dependencies : dep_dl)
-  # This is really only required for megadrivers
-  pre_args += '-DHAVE_DLADDR'
+dep_dl = null_dep
+if host_machine.system() != 'windows'
+  if not cc.has_function('dlopen')
+dep_dl = cc.find_library('dl')
+  endif
+  if cc.has_function('dladdr', dependencies : dep_dl)
+# This is really only required for megadrivers
+pre_args += '-DHAVE_DLADDR'
+  endif
 endif
 
 if cc.has_function('dl_iterate_phdr')
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 22/49] meson: fix gallium-osmesa to build for windows

2018-08-22 Thread Dylan Baker
v2: - set so_version to '' (only affects windows)
- always set lib prefix to 'lib', even on msvc
---
 src/gallium/state_trackers/osmesa/meson.build | 12 ++--
 src/gallium/targets/osmesa/meson.build| 11 ++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/osmesa/meson.build 
b/src/gallium/state_trackers/osmesa/meson.build
index 912a6226f74..26ec8084f93 100644
--- a/src/gallium/state_trackers/osmesa/meson.build
+++ b/src/gallium/state_trackers/osmesa/meson.build
@@ -1,4 +1,4 @@
-# Copyright © 2017 Intel Corporation
+# Copyright © 2017-2018 Intel Corporation
 
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -18,10 +18,18 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
+osmesa_st_c_args = []
+if with_platform_windows
+  osmesa_st_c_args += ['-DBUILD_GL32', '-DWIN32_LEAN_AND_MEAN']
+  if not with_gles1
+osmesa_st_c_args += ['-D_GLAPI_NO_EXPORTS']
+  endif
+endif
+
 libosmesa_st = static_library(
   'osmesa_st',
   'osmesa.c',
-  c_args : ['-DGALLIUM_SOFTPIPE'],
+  c_args : osmesa_st_c_args,
   include_directories : [
 inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_mapi, inc_mesa,
   ],
diff --git a/src/gallium/targets/osmesa/meson.build 
b/src/gallium/targets/osmesa/meson.build
index b4ae8f4b6ec..d92117988eb 100644
--- a/src/gallium/targets/osmesa/meson.build
+++ b/src/gallium/targets/osmesa/meson.build
@@ -32,12 +32,19 @@ if with_ld_version_script
   osmesa_link_deps += files('osmesa.sym')
 endif
 
+if cc.get_id() == 'gcc' and host_machine.cpu_family() != 'x86_64'
+  osmesa_def = 'osmesa.mingw.def'
+else
+  osmesa_def = 'osmesa.def'
+endif
+
 libosmesa = shared_library(
   osmesa_lib_name,
   'target.c',
   c_args : [c_vis_args],
   cpp_args : cpp_vis_args,
   link_args : [ld_args_gc_sections, osmesa_link_args],
+  vs_module_defs : osmesa_def,
   include_directories : [
 inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_winsys,
 inc_gallium_drivers,
@@ -48,10 +55,12 @@ libosmesa = shared_library(
 libmesa_gallium, libgallium, libglapi_static, libws_null, osmesa_link_with,
   ],
   dependencies : [
-dep_selinux, dep_thread, dep_clock, dep_unwind,
+dep_ws2_32, dep_selinux, dep_thread, dep_clock, dep_unwind,
 driver_swrast, driver_swr,
   ],
+  soversion : host_machine.system() == 'windows' ? '' : '8',
   version : '8.0.0',
+  name_prefix : 'lib',
   install : true,
 )
 
-- 
2.18.0

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


[Mesa-dev] [PATCH v4 01/49] move u_math to src/util

2018-08-22 Thread Dylan Baker
Currently we have two sets of functions for bit counts, one in gallium
and one in core mesa. The ones in core mesa are header only in many
cases, since they reduce to "#define _mesa_bitcount popcount", but they
provide a fallback implementation. This is important because 32bit msvc
doesn't have popcountll, just popcount; so when nir (for example)
includes the core mesa header it doesn't (and shouldn't) link with core
mesa. To fix this we'll promote the version out of gallium util, then
replace the core mesa uses with the util version, since nir (and other
non-core mesa users) can and do link with mesautils.

v4: - Add this patch
---
 src/broadcom/cle/v3d_packet_helpers.h   | 2 +-
 src/gallium/auxiliary/Makefile.sources  | 2 --
 src/gallium/auxiliary/meson.build   | 2 --
 src/gallium/auxiliary/util/u_format.c   | 2 +-
 src/gallium/auxiliary/util/u_format_bptc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_latc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_other.c | 2 +-
 src/gallium/auxiliary/util/u_format_pack.py | 2 +-
 src/gallium/auxiliary/util/u_format_rgtc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_s3tc.c  | 2 +-
 src/gallium/auxiliary/util/u_format_yuv.h   | 2 +-
 src/gallium/auxiliary/util/u_format_zs.c| 2 +-
 src/util/Makefile.sources   | 2 ++
 src/util/meson.build| 2 ++
 src/{gallium/auxiliary => }/util/u_math.c   | 0
 src/{gallium/auxiliary => }/util/u_math.h   | 2 +-
 16 files changed, 15 insertions(+), 15 deletions(-)
 rename src/{gallium/auxiliary => }/util/u_math.c (100%)
 rename src/{gallium/auxiliary => }/util/u_math.h (99%)

diff --git a/src/broadcom/cle/v3d_packet_helpers.h 
b/src/broadcom/cle/v3d_packet_helpers.h
index f340b790697..c46089a0e60 100644
--- a/src/broadcom/cle/v3d_packet_helpers.h
+++ b/src/broadcom/cle/v3d_packet_helpers.h
@@ -26,7 +26,7 @@
 #include 
 #include 
 #include 
-#include 
+#include "util/u_math.h"
 
 #ifdef HAVE_VALGRIND
 #include 
diff --git a/src/gallium/auxiliary/Makefile.sources 
b/src/gallium/auxiliary/Makefile.sources
index 626cde123af..4251ddc0edf 100644
--- a/src/gallium/auxiliary/Makefile.sources
+++ b/src/gallium/auxiliary/Makefile.sources
@@ -294,8 +294,6 @@ C_SOURCES := \
util/u_linear.h \
util/u_log.c \
util/u_log.h \
-   util/u_math.c \
-   util/u_math.h \
util/u_memory.h \
util/u_mm.c \
util/u_mm.h \
diff --git a/src/gallium/auxiliary/meson.build 
b/src/gallium/auxiliary/meson.build
index 858c9d0c79c..38bc681e5bc 100644
--- a/src/gallium/auxiliary/meson.build
+++ b/src/gallium/auxiliary/meson.build
@@ -314,8 +314,6 @@ files_libgallium = files(
   'util/u_linear.h',
   'util/u_log.c',
   'util/u_log.h',
-  'util/u_math.c',
-  'util/u_math.h',
   'util/u_memory.h',
   'util/u_mm.c',
   'util/u_mm.h',
diff --git a/src/gallium/auxiliary/util/u_format.c 
b/src/gallium/auxiliary/util/u_format.c
index 1dd724d9b84..6445f2647cf 100644
--- a/src/gallium/auxiliary/util/u_format.c
+++ b/src/gallium/auxiliary/util/u_format.c
@@ -32,11 +32,11 @@
  * @author Jose Fonseca 
  */
 
-#include "u_math.h"
 #include "u_memory.h"
 #include "u_format.h"
 #include "u_format_s3tc.h"
 #include "u_surface.h"
+#include "util/u_math.h"
 
 #include "pipe/p_defines.h"
 
diff --git a/src/gallium/auxiliary/util/u_format_bptc.c 
b/src/gallium/auxiliary/util/u_format_bptc.c
index 87ec4139e09..519a541e380 100644
--- a/src/gallium/auxiliary/util/u_format_bptc.c
+++ b/src/gallium/auxiliary/util/u_format_bptc.c
@@ -23,10 +23,10 @@
  *
  **/
 
-#include "u_math.h"
 #include "u_format.h"
 #include "u_format_bptc.h"
 #include "util/format_srgb.h"
+#include "util/u_math.h"
 
 #define BPTC_BLOCK_DECODE
 #include "../../../mesa/main/texcompress_bptc_tmp.h"
diff --git a/src/gallium/auxiliary/util/u_format_latc.c 
b/src/gallium/auxiliary/util/u_format_latc.c
index 7b2bb00693f..f145081d56d 100644
--- a/src/gallium/auxiliary/util/u_format_latc.c
+++ b/src/gallium/auxiliary/util/u_format_latc.c
@@ -23,11 +23,11 @@
  **/
 
 #include 
-#include "u_math.h"
 #include "u_format.h"
 #include "u_format_rgtc.h"
 #include "u_format_latc.h"
 #include "util/rgtc.h"
+#include "util/u_math.h"
 
 void
 util_format_latc1_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, 
unsigned i, unsigned j)
diff --git a/src/gallium/auxiliary/util/u_format_other.c 
b/src/gallium/auxiliary/util/u_format_other.c
index 025e096a95c..213cb9fd941 100644
--- a/src/gallium/auxiliary/util/u_format_other.c
+++ b/src/gallium/auxiliary/util/u_format_other.c
@@ -26,8 +26,8 @@
  **/
 
 
-#include "u_math.h"
 #include "u_format_other.h"
+#include "util/u_math.h"
 #include "util/format_rgb9e5.h"
 #include "util/format_r11g11b10f.h"
 
diff --git a/src/gallium/auxiliary/util/u_format_pack.py 
b/src/ga

[Mesa-dev] [PATCH v4 12/49] meson: don't build glx or dri by default on windows

2018-08-22 Thread Dylan Baker
Signed-off-by: Dylan Baker 
Reviewed-by: Eric Anholt 
---
 meson.build | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 1af610573d5..5102ffe0c7c 100644
--- a/meson.build
+++ b/meson.build
@@ -264,8 +264,12 @@ if with_glx == 'auto'
   elif with_platform_haiku
 with_glx = 'disabled'
   elif with_gallium
-# Even when building just gallium drivers the user probably wants dri
-with_glx = 'dri'
+if host_machine.system() == 'windows'
+  with_glx = 'disabled'
+else
+  # Even when building just gallium drivers the user probably wants dri
+  with_glx = 'dri'
+endif
   elif with_platform_x11 and with_any_opengl and not with_any_vk
 # The automatic behavior should not be to turn on xlib based glx when
 # building only vulkan drivers
-- 
2.18.0

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


  1   2   >