Re: [Mesa-dev] [PATCH] android: enable VK_ANDROID_native_buffer

2018-05-16 Thread Jason Ekstrand



On May 15, 2018 22:59:20 Tapani Pälli  wrote:


On 05/16/2018 08:46 AM, Jason Ekstrand wrote:

On Tue, May 15, 2018 at 10:42 PM, Tapani Pälli > wrote:

Patch changes entrypoints generator to not skip this extension even
though it is set as disabled in the xml. We also need compilation
flag VK_USE_PLATFORM_ANDROID_KHR to be enabled and a small fix to
vk_icd.h because of following compilation error:

vk_icd.h:116:5: error: must use 'struct' tag to refer to type
'ANativeWindow'

It looks like this extension got disabled in commit 69f447553c.

Signed-off-by: Tapani Pälli >
---
Android.common.mk    | 1 +
include/vulkan/vk_icd.h | 2 +-
src/intel/vulkan/anv_entrypoints_gen.py | 5 -
3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Android.common.mk 
b/Android.common.mk 
index e8aed48c31..999e17789b 100644
--- a/Android.common.mk 
+++ b/Android.common.mk 
@@ -73,6 +73,7 @@ LOCAL_CFLAGS += \
   -DHAVE_ENDIAN_H \
   -DHAVE_ZLIB \
   -DMAJOR_IN_SYSMACROS \
+   -DVK_USE_PLATFORM_ANDROID_KHR \
   -fvisibility=hidden \
   -Wno-sign-compare

diff --git a/include/vulkan/vk_icd.h b/include/vulkan/vk_icd.h
index 7b54fb5774..77709c9f8d 100644
--- a/include/vulkan/vk_icd.h
+++ b/include/vulkan/vk_icd.h
@@ -113,7 +113,7 @@ typedef struct {

#ifdef VK_USE_PLATFORM_ANDROID_KHR
typedef struct {
-ANativeWindow* window;
+struct ANativeWindow* window;


Please submit a PR against the Vulkan-LoaderAndValidationLayers for
this.  I belive the core issue is that we're including it from C whereas
most people are using C++.


Yeah, that is the case. Will submit PR.


} VkIcdSurfaceAndroid;
#endif //VK_USE_PLATFORM_ANDROID_KHR

diff --git a/src/intel/vulkan/anv_entrypoints_gen.py
b/src/intel/vulkan/anv_entrypoints_gen.py
index d603ac1b20..53ffbe30b9 100644
--- a/src/intel/vulkan/anv_entrypoints_gen.py
+++ b/src/intel/vulkan/anv_entrypoints_gen.py
@@ -495,7 +495,10 @@ def get_entrypoints(doc,
entrypoints_to_defines, start_index):
if ext_name not in supported_exts:
continue

-if extension.attrib['supported'] != 'vulkan':
+# VK_ANDROID_native_buffer is set as 'disabled' but Mesa
+# supports it.
+if (extension.attrib['supported'] != 'vulkan' and
+ext_name != 'VK_ANDROID_native_buffer'):


Is this continue even needed anymore?  I honestly don't remember what
it's here for.


It is currently skipping only VK_ANDROID_native_buffer, I was not sure
if we want to get rid of it. Maybe it could only print warning in case
something is not enabled?


I think it's left over from when we had two XML files and wanted to skip 
the disabled version.  Now that we don't, we should be able to drop it 
entirely.





continue

ext = supported_exts[ext_name]
--
2.14.3

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



// Tapani




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


Re: [Mesa-dev] [PATCH] android: enable VK_ANDROID_native_buffer

2018-05-15 Thread Tapani Pälli



On 05/16/2018 08:46 AM, Jason Ekstrand wrote:
On Tue, May 15, 2018 at 10:42 PM, Tapani Pälli > wrote:


Patch changes entrypoints generator to not skip this extension even
though it is set as disabled in the xml. We also need compilation
flag VK_USE_PLATFORM_ANDROID_KHR to be enabled and a small fix to
vk_icd.h because of following compilation error:

vk_icd.h:116:5: error: must use 'struct' tag to refer to type
'ANativeWindow'

It looks like this extension got disabled in commit 69f447553c.

Signed-off-by: Tapani Pälli >
---
Android.common.mk                        | 1 +
  include/vulkan/vk_icd.h                 | 2 +-
  src/intel/vulkan/anv_entrypoints_gen.py | 5 -
  3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Android.common.mk 
b/Android.common.mk 
index e8aed48c31..999e17789b 100644
--- a/Android.common.mk 
+++ b/Android.common.mk 
@@ -73,6 +73,7 @@ LOCAL_CFLAGS += \
         -DHAVE_ENDIAN_H \
         -DHAVE_ZLIB \
         -DMAJOR_IN_SYSMACROS \
+       -DVK_USE_PLATFORM_ANDROID_KHR \
         -fvisibility=hidden \
         -Wno-sign-compare

diff --git a/include/vulkan/vk_icd.h b/include/vulkan/vk_icd.h
index 7b54fb5774..77709c9f8d 100644
--- a/include/vulkan/vk_icd.h
+++ b/include/vulkan/vk_icd.h
@@ -113,7 +113,7 @@ typedef struct {

  #ifdef VK_USE_PLATFORM_ANDROID_KHR
  typedef struct {
-    ANativeWindow* window;
+    struct ANativeWindow* window;


Please submit a PR against the Vulkan-LoaderAndValidationLayers for 
this.  I belive the core issue is that we're including it from C whereas 
most people are using C++.


Yeah, that is the case. Will submit PR.


  } VkIcdSurfaceAndroid;
  #endif //VK_USE_PLATFORM_ANDROID_KHR

diff --git a/src/intel/vulkan/anv_entrypoints_gen.py
b/src/intel/vulkan/anv_entrypoints_gen.py
index d603ac1b20..53ffbe30b9 100644
--- a/src/intel/vulkan/anv_entrypoints_gen.py
+++ b/src/intel/vulkan/anv_entrypoints_gen.py
@@ -495,7 +495,10 @@ def get_entrypoints(doc,
entrypoints_to_defines, start_index):
          if ext_name not in supported_exts:
              continue

-        if extension.attrib['supported'] != 'vulkan':
+        # VK_ANDROID_native_buffer is set as 'disabled' but Mesa
+        # supports it.
+        if (extension.attrib['supported'] != 'vulkan' and
+            ext_name != 'VK_ANDROID_native_buffer'):


Is this continue even needed anymore?  I honestly don't remember what 
it's here for.


It is currently skipping only VK_ANDROID_native_buffer, I was not sure 
if we want to get rid of it. Maybe it could only print warning in case 
something is not enabled?



              continue

          ext = supported_exts[ext_name]
-- 
2.14.3


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





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


Re: [Mesa-dev] [PATCH] android: enable VK_ANDROID_native_buffer

2018-05-15 Thread Jason Ekstrand
On Tue, May 15, 2018 at 10:42 PM, Tapani Pälli 
wrote:

> Patch changes entrypoints generator to not skip this extension even
> though it is set as disabled in the xml. We also need compilation
> flag VK_USE_PLATFORM_ANDROID_KHR to be enabled and a small fix to
> vk_icd.h because of following compilation error:
>
> vk_icd.h:116:5: error: must use 'struct' tag to refer to type
> 'ANativeWindow'
>
> It looks like this extension got disabled in commit 69f447553c.
>
> Signed-off-by: Tapani Pälli 
> ---
>  Android.common.mk   | 1 +
>  include/vulkan/vk_icd.h | 2 +-
>  src/intel/vulkan/anv_entrypoints_gen.py | 5 -
>  3 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/Android.common.mk b/Android.common.mk
> index e8aed48c31..999e17789b 100644
> --- a/Android.common.mk
> +++ b/Android.common.mk
> @@ -73,6 +73,7 @@ LOCAL_CFLAGS += \
> -DHAVE_ENDIAN_H \
> -DHAVE_ZLIB \
> -DMAJOR_IN_SYSMACROS \
> +   -DVK_USE_PLATFORM_ANDROID_KHR \
> -fvisibility=hidden \
> -Wno-sign-compare
>
> diff --git a/include/vulkan/vk_icd.h b/include/vulkan/vk_icd.h
> index 7b54fb5774..77709c9f8d 100644
> --- a/include/vulkan/vk_icd.h
> +++ b/include/vulkan/vk_icd.h
> @@ -113,7 +113,7 @@ typedef struct {
>
>  #ifdef VK_USE_PLATFORM_ANDROID_KHR
>  typedef struct {
> -ANativeWindow* window;
> +struct ANativeWindow* window;
>

Please submit a PR against the Vulkan-LoaderAndValidationLayers for this.
I belive the core issue is that we're including it from C whereas most
people are using C++.


>  } VkIcdSurfaceAndroid;
>  #endif //VK_USE_PLATFORM_ANDROID_KHR
>
> diff --git a/src/intel/vulkan/anv_entrypoints_gen.py
> b/src/intel/vulkan/anv_entrypoints_gen.py
> index d603ac1b20..53ffbe30b9 100644
> --- a/src/intel/vulkan/anv_entrypoints_gen.py
> +++ b/src/intel/vulkan/anv_entrypoints_gen.py
> @@ -495,7 +495,10 @@ def get_entrypoints(doc, entrypoints_to_defines,
> start_index):
>  if ext_name not in supported_exts:
>  continue
>
> -if extension.attrib['supported'] != 'vulkan':
> +# VK_ANDROID_native_buffer is set as 'disabled' but Mesa
> +# supports it.
> +if (extension.attrib['supported'] != 'vulkan' and
> +ext_name != 'VK_ANDROID_native_buffer'):
>

Is this continue even needed anymore?  I honestly don't remember what it's
here for.


>  continue
>
>  ext = supported_exts[ext_name]
> --
> 2.14.3
>
> ___
> 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