Discussion:
[PATCH] mesa: define nir_spirv_supported_capabilities
Add Reply
Alejandro Piñeiro
2017-12-06 08:57:18 UTC
Reply
Permalink
Raw Message
Until now it was part of spirv_to_nir_options. But it will be used on
the implementation of ARB_gl_spirv and ARB_spirv_extensions, and added
to the OpenGL context, as a way to save what SPIR-V capabilities the
current OpenGL implementation supports.
---

We are sending this commit in advance of a v3 of the initial gl_spirv
and spirv_extensions support series. The issue is that lately there
were a lot of activity on the spirv/spir_to_nir code base, and we are
being fixing rebase conflicts constantly. Getting this commit on
master would make things easier.

FWIW, this patch is similar to one that Ian Romanick already granted
Rb, but that was dropped after all the mentioned changes:
https://lists.freedesktop.org/archives/mesa-dev/2017-November/178261.html

src/compiler/spirv/nir_spirv.h | 16 +++-------------
src/mesa/main/mtypes.h | 12 ++++++++++++
2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 43ec19d5a50..113bd710a00 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -28,7 +28,8 @@
#ifndef _NIR_SPIRV_H_
#define _NIR_SPIRV_H_

-#include "nir/nir.h"
+#include "compiler/nir/nir.h"
+#include "main/mtypes.h"

#ifdef __cplusplus
extern "C" {
@@ -57,18 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;

- struct {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
- } caps;
+ struct nir_spirv_supported_capabilities caps;

struct {
void (*func)(void *private_data,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b478f6158e2..7da05aa3ee9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3579,6 +3579,18 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};

+struct nir_spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};

/**
* Constants which may be overridden by device driver during context creation
--
2.11.0
Pierre Moreau
2017-12-06 12:29:25 UTC
Reply
Permalink
Raw Message
Hello Alejandro,

As far as I understand, nir_spirv_supported_capabilities is being filled in by
the driver and then fetched by the API entrypoint to check the capabilities
required by the SPIR-V binary given as input. And this is done regardless of
the input IR used by the driver, be it NIR, LLVM IR, TGSI or others. So
couldn’t it be just named spirv_supported_capabilities? Unless it also reflects
the capabilities supported by the IR being used.

I guess nir_spirv_supported_capabilities could be extended later on to also add
capabilities specific to OpenCL when clover reaches OpenCL 1.2 support (and can
start accepting SPIR-V binaries as input through the cl_khr_il_program
extension), or would it be better to have a separate one for OpenCL?

I haven’t had time to look at the whole gl_spirv series yet, so I am sorry if
this is something that has already been brought and answered in that thread.

Regards,
Pierre
Post by Alejandro Piñeiro
Until now it was part of spirv_to_nir_options. But it will be used on
the implementation of ARB_gl_spirv and ARB_spirv_extensions, and added
to the OpenGL context, as a way to save what SPIR-V capabilities the
current OpenGL implementation supports.
---
We are sending this commit in advance of a v3 of the initial gl_spirv
and spirv_extensions support series. The issue is that lately there
were a lot of activity on the spirv/spir_to_nir code base, and we are
being fixing rebase conflicts constantly. Getting this commit on
master would make things easier.
FWIW, this patch is similar to one that Ian Romanick already granted
https://lists.freedesktop.org/archives/mesa-dev/2017-November/178261.html
src/compiler/spirv/nir_spirv.h | 16 +++-------------
src/mesa/main/mtypes.h | 12 ++++++++++++
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 43ec19d5a50..113bd710a00 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -28,7 +28,8 @@
#ifndef _NIR_SPIRV_H_
#define _NIR_SPIRV_H_
-#include "nir/nir.h"
+#include "compiler/nir/nir.h"
+#include "main/mtypes.h"
#ifdef __cplusplus
extern "C" {
@@ -57,18 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;
- struct {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
- } caps;
+ struct nir_spirv_supported_capabilities caps;
struct {
void (*func)(void *private_data,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b478f6158e2..7da05aa3ee9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3579,6 +3579,18 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};
+struct nir_spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
/**
* Constants which may be overridden by device driver during context creation
--
2.11.0
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Alejandro Piñeiro
2017-12-06 13:23:49 UTC
Reply
Permalink
Raw Message
Post by Pierre Moreau
Hello Alejandro,
As far as I understand, nir_spirv_supported_capabilities is being filled in by
the driver and then fetched by the API entrypoint to check the capabilities
required by the SPIR-V binary given as input. And this is done regardless of
the input IR used by the driver, be it NIR, LLVM IR, TGSI or others. So
couldn’t it be just named spirv_supported_capabilities? Unless it also reflects
the capabilities supported by the IR being used.
Good point. spirv_supported_capabilities is probably a better name,
although right now, it would be only used on the spirv to nir pass. I
will not send a new version of the patch with just the renaming, but for
anyone interested on review the commit, I will use that name.
Post by Pierre Moreau
I guess nir_spirv_supported_capabilities could be extended later on to also add
capabilities specific to OpenCL when clover reaches OpenCL 1.2 support (and can
start accepting SPIR-V binaries as input through the cl_khr_il_program
extension), or would it be better to have a separate one for OpenCL?
Probably it would be re-used, but I don't know the specifics of OpenCL
to ensure 100% that.
Post by Pierre Moreau
I haven’t had time to look at the whole gl_spirv series yet, so I am sorry if
this is something that has already been brought and answered in that thread.
No sorries, your feedback was good and welcomed.
Post by Pierre Moreau
Regards,
Pierre
Post by Alejandro Piñeiro
Until now it was part of spirv_to_nir_options. But it will be used on
the implementation of ARB_gl_spirv and ARB_spirv_extensions, and added
to the OpenGL context, as a way to save what SPIR-V capabilities the
current OpenGL implementation supports.
---
We are sending this commit in advance of a v3 of the initial gl_spirv
and spirv_extensions support series. The issue is that lately there
were a lot of activity on the spirv/spir_to_nir code base, and we are
being fixing rebase conflicts constantly. Getting this commit on
master would make things easier.
FWIW, this patch is similar to one that Ian Romanick already granted
https://lists.freedesktop.org/archives/mesa-dev/2017-November/178261.html
src/compiler/spirv/nir_spirv.h | 16 +++-------------
src/mesa/main/mtypes.h | 12 ++++++++++++
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 43ec19d5a50..113bd710a00 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -28,7 +28,8 @@
#ifndef _NIR_SPIRV_H_
#define _NIR_SPIRV_H_
-#include "nir/nir.h"
+#include "compiler/nir/nir.h"
+#include "main/mtypes.h"
#ifdef __cplusplus
extern "C" {
@@ -57,18 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;
- struct {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
- } caps;
+ struct nir_spirv_supported_capabilities caps;
struct {
void (*func)(void *private_data,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b478f6158e2..7da05aa3ee9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3579,6 +3579,18 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};
+struct nir_spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
/**
* Constants which may be overridden by device driver during context creation
--
2.11.0
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Timothy Arceri
2017-12-07 04:48:46 UTC
Reply
Permalink
Raw Message
Post by Alejandro Piñeiro
Post by Pierre Moreau
Hello Alejandro,
As far as I understand, nir_spirv_supported_capabilities is being filled in by
the driver and then fetched by the API entrypoint to check the capabilities
required by the SPIR-V binary given as input. And this is done regardless of
the input IR used by the driver, be it NIR, LLVM IR, TGSI or others. So
couldn’t it be just named spirv_supported_capabilities? Unless it also reflects
the capabilities supported by the IR being used.
Good point. spirv_supported_capabilities is probably a better name,
although right now, it would be only used on the spirv to nir pass. I
will not send a new version of the patch with just the renaming, but for
anyone interested on review the commit, I will use that name.
I would be much happier with this being in mtypes.h with that name. So
Post by Alejandro Piñeiro
Post by Pierre Moreau
I guess nir_spirv_supported_capabilities could be extended later on to also add
capabilities specific to OpenCL when clover reaches OpenCL 1.2 support (and can
start accepting SPIR-V binaries as input through the cl_khr_il_program
extension), or would it be better to have a separate one for OpenCL?
Probably it would be re-used, but I don't know the specifics of OpenCL
to ensure 100% that.
Post by Pierre Moreau
I haven’t had time to look at the whole gl_spirv series yet, so I am sorry if
this is something that has already been brought and answered in that thread.
No sorries, your feedback was good and welcomed.
Post by Pierre Moreau
Regards,
Pierre
Post by Alejandro Piñeiro
Until now it was part of spirv_to_nir_options. But it will be used on
the implementation of ARB_gl_spirv and ARB_spirv_extensions, and added
to the OpenGL context, as a way to save what SPIR-V capabilities the
current OpenGL implementation supports.
---
We are sending this commit in advance of a v3 of the initial gl_spirv
and spirv_extensions support series. The issue is that lately there
were a lot of activity on the spirv/spir_to_nir code base, and we are
being fixing rebase conflicts constantly. Getting this commit on
master would make things easier.
FWIW, this patch is similar to one that Ian Romanick already granted
https://lists.freedesktop.org/archives/mesa-dev/2017-November/178261.html
src/compiler/spirv/nir_spirv.h | 16 +++-------------
src/mesa/main/mtypes.h | 12 ++++++++++++
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 43ec19d5a50..113bd710a00 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -28,7 +28,8 @@
#ifndef _NIR_SPIRV_H_
#define _NIR_SPIRV_H_
-#include "nir/nir.h"
+#include "compiler/nir/nir.h"
+#include "main/mtypes.h"
#ifdef __cplusplus
extern "C" {
@@ -57,18 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;
- struct {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
- } caps;
+ struct nir_spirv_supported_capabilities caps;
struct {
void (*func)(void *private_data,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b478f6158e2..7da05aa3ee9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3579,6 +3579,18 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};
+struct nir_spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
/**
* Constants which may be overridden by device driver during context creation
--
2.11.0
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Jason Ekstrand
2017-12-07 05:23:24 UTC
Reply
Permalink
Raw Message
Post by Alejandro Piñeiro
Post by Pierre Moreau
Hello Alejandro,
As far as I understand, nir_spirv_supported_capabilities is being filled in by
the driver and then fetched by the API entrypoint to check the capabilities
required by the SPIR-V binary given as input. And this is done regardless of
the input IR used by the driver, be it NIR, LLVM IR, TGSI or others. So
couldn’t it be just named spirv_supported_capabilities? Unless it also reflects
the capabilities supported by the IR being used.
Good point. spirv_supported_capabilities is probably a better name,
although right now, it would be only used on the spirv to nir pass. I
will not send a new version of the patch with just the renaming, but for
anyone interested on review the commit, I will use that name.
I would be much happier with this being in mtypes.h with that name. So if
Ugh... I just now got around to looking at this and saw that it went in
mtypes.h. Can we please move it? We've worked very hard to keep the
Vulkan driver from having to pull in any GL headers and data structures and
now a fairly core piece lives in mtypes.h.

--Jason
Post by Alejandro Piñeiro
I guess nir_spirv_supported_capabilities could be extended later on to
Post by Pierre Moreau
also add
capabilities specific to OpenCL when clover reaches OpenCL 1.2 support (and can
start accepting SPIR-V binaries as input through the cl_khr_il_program
extension), or would it be better to have a separate one for OpenCL?
Probably it would be re-used, but I don't know the specifics of OpenCL
to ensure 100% that.
Post by Pierre Moreau
I haven’t had time to look at the whole gl_spirv series yet, so I am sorry if
this is something that has already been brought and answered in that thread.
No sorries, your feedback was good and welcomed.
Post by Pierre Moreau
Regards,
Pierre
Post by Alejandro Piñeiro
Until now it was part of spirv_to_nir_options. But it will be used on
the implementation of ARB_gl_spirv and ARB_spirv_extensions, and added
to the OpenGL context, as a way to save what SPIR-V capabilities the
current OpenGL implementation supports.
---
We are sending this commit in advance of a v3 of the initial gl_spirv
and spirv_extensions support series. The issue is that lately there
were a lot of activity on the spirv/spir_to_nir code base, and we are
being fixing rebase conflicts constantly. Getting this commit on
master would make things easier.
FWIW, this patch is similar to one that Ian Romanick already granted
https://lists.freedesktop.org/archives/mesa-dev/2017-Novembe
r/178261.html
src/compiler/spirv/nir_spirv.h | 16 +++-------------
src/mesa/main/mtypes.h | 12 ++++++++++++
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/compiler/spirv/nir_spirv.h
b/src/compiler/spirv/nir_spirv.h
index 43ec19d5a50..113bd710a00 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -28,7 +28,8 @@
#ifndef _NIR_SPIRV_H_
#define _NIR_SPIRV_H_
-#include "nir/nir.h"
+#include "compiler/nir/nir.h"
+#include "main/mtypes.h"
#ifdef __cplusplus
extern "C" {
@@ -57,18 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;
- struct {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
- } caps;
+ struct nir_spirv_supported_capabilities caps;
struct {
void (*func)(void *private_data,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b478f6158e2..7da05aa3ee9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3579,6 +3579,18 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};
+struct nir_spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
/**
* Constants which may be overridden by device driver during context creation
--
2.11.0
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Alejandro Piñeiro
2017-12-07 08:17:20 UTC
Reply
Permalink
Raw Message
Post by Pierre Moreau
Hello Alejandro,
As far as I understand, nir_spirv_supported_capabilities
is being filled in by
the driver and then fetched by the API entrypoint to check
the capabilities
required by the SPIR-V binary given as input. And this is
done regardless of
the input IR used by the driver, be it NIR, LLVM IR, TGSI
or others. So
couldn’t it be just named spirv_supported_capabilities?
Unless it also reflects
the capabilities supported by the IR being used.
Good point. spirv_supported_capabilities is probably a better name,
although right now, it would be only used on the spirv to nir pass. I
will not send a new version of the patch with just the
renaming, but for
anyone interested on review the commit, I will use that name.
I would be much happier with this being in mtypes.h with that
Ugh... I just now got around to looking at this and saw that it went
in mtypes.h.  Can we please move it?  We've worked very hard to keep
the Vulkan driver from having to pull in any GL headers and data
structures and now a fairly core piece lives in mtypes.h.
Hmm, sorry for not waiting for more feedback. This is the second
reviewed patch that modify mtypes.h, so I assumed that it was fine.

Additionally, I didn't rename it as Ian's review didn't ask to, but both
Timothy and Pierre prefer a more general "spirv_supported_capabilities".
So how about this?:
   * Rename it to spirv_supported_capabilities
   * Move it to compiler/spirv/spirv.h (would need to add #include
<stdbool.h> due the booleans on the struct there)
   * Add a "compiler/spirv/spirv.h" include on mtypes.h

I already have the patches locally, so if you agree with this, it is
just about sending them.
Post by Pierre Moreau
--Jason
 
I guess nir_spirv_supported_capabilities could be extended
later on to also add
capabilities specific to OpenCL when clover reaches OpenCL
1.2 support (and can
start accepting SPIR-V binaries as input through the
cl_khr_il_program
extension), or would it be better to have a separate one
for OpenCL?
Probably it would be re-used, but I don't know the specifics of OpenCL
to ensure 100% that.
I haven’t had time to look at the whole gl_spirv series
yet, so I am sorry if
this is something that has already been brought and
answered in that thread.
No sorries, your feedback was good and welcomed.
Regards,
Pierre
On 2017-12-06 — 09 <tel:2017-12-06%20%E2%80%94%2009>:57,
Until now it was part of spirv_to_nir_options. But it
will be used on
the implementation of ARB_gl_spirv and
ARB_spirv_extensions, and added
to the OpenGL context, as a way to save what SPIR-V
capabilities the
current OpenGL implementation supports.
---
We are sending this commit in advance of a v3 of the
initial gl_spirv
and spirv_extensions support series. The issue is that
lately there
were a lot of activity on the spirv/spir_to_nir code
base, and we are
being fixing rebase conflicts constantly. Getting this
commit on
master would make things easier.
FWIW, this patch is similar to one that Ian Romanick
already granted
https://lists.freedesktop.org/archives/mesa-dev/2017-November/178261.html
<https://lists.freedesktop.org/archives/mesa-dev/2017-November/178261.html>
  src/compiler/spirv/nir_spirv.h | 16 +++-------------
  src/mesa/main/mtypes.h         | 12 ++++++++++++
  2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/compiler/spirv/nir_spirv.h
b/src/compiler/spirv/nir_spirv.h
index 43ec19d5a50..113bd710a00 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -28,7 +28,8 @@
  #ifndef _NIR_SPIRV_H_
  #define _NIR_SPIRV_H_
  -#include "nir/nir.h"
+#include "compiler/nir/nir.h"
+#include "main/mtypes.h"
    #ifdef __cplusplus
  extern "C" {
@@ -57,18 +58,7 @@ struct spirv_to_nir_options {
      */
     bool lower_workgroup_access_to_offsets;
  -   struct {
-      bool float64;
-      bool image_ms_array;
-      bool tessellation;
-      bool draw_parameters;
-      bool image_read_without_format;
-      bool image_write_without_format;
-      bool int64;
-      bool multiview;
-      bool variable_pointers;
-      bool storage_16bit;
-   } caps;
+   struct nir_spirv_supported_capabilities caps;
       struct {
        void (*func)(void *private_data,
diff --git a/src/mesa/main/mtypes.h
b/src/mesa/main/mtypes.h
index b478f6158e2..7da05aa3ee9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3579,6 +3579,18 @@ struct gl_program_constants
     GLuint MaxShaderStorageBlocks;
  };
  +struct nir_spirv_supported_capabilities {
+   bool float64;
+   bool image_ms_array;
+   bool tessellation;
+   bool draw_parameters;
+   bool image_read_without_format;
+   bool image_write_without_format;
+   bool int64;
+   bool multiview;
+   bool variable_pointers;
+   bool storage_16bit;
+};
    /**
   * Constants which may be overridden by device
driver during context creation
--
2.11.0
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
<https://lists.freedesktop.org/mailman/listinfo/mesa-dev>
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
<https://lists.freedesktop.org/mailman/listinfo/mesa-dev>
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
<https://lists.freedesktop.org/mailman/listinfo/mesa-dev>
Alejandro Piñeiro
2017-12-07 08:29:27 UTC
Reply
Permalink
Raw Message
To avoid any vulkan driver to include the GL mtypes.h. Renamed as
eventually this could be used by drivers not using nir.
---

Sending the proposed alternative in advance, so if Jason agrees, it is
just about Rb it.

src/compiler/spirv/nir_spirv.h | 4 ++--
src/compiler/spirv/spirv.h | 15 +++++++++++++++
src/mesa/main/mtypes.h | 14 +-------------
3 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 113bd710a00..71f44e07dba 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -29,7 +29,7 @@
#define _NIR_SPIRV_H_

#include "compiler/nir/nir.h"
-#include "main/mtypes.h"
+#include "compiler/spirv/spirv.h"

#ifdef __cplusplus
extern "C" {
@@ -58,7 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;

- struct nir_spirv_supported_capabilities caps;
+ struct spirv_supported_capabilities caps;

struct {
void (*func)(void *private_data,
diff --git a/src/compiler/spirv/spirv.h b/src/compiler/spirv/spirv.h
index 61559a1c9ca..ce2dcf7657f 100644
--- a/src/compiler/spirv/spirv.h
+++ b/src/compiler/spirv/spirv.h
@@ -48,6 +48,8 @@
#ifndef spirv_H
#define spirv_H

+#include <stdbool.h>
+
typedef unsigned int SpvId;

#define SPV_VERSION 0x10200
@@ -994,5 +996,18 @@ typedef enum SpvOp_ {
SpvOpMax = 0x7fffffff,
} SpvOp;

+struct spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
+
#endif // #ifndef spirv_H

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7b7137624c7..0f1a0f70827 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -49,6 +49,7 @@
#include "util/bitscan.h"
#include "util/simple_mtx.h"
#include "util/u_dynarray.h"
+#include "compiler/spirv/spirv.h"


#ifdef __cplusplus
@@ -3578,19 +3579,6 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};

-struct nir_spirv_supported_capabilities {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
-};
-
/**
* Constants which may be overridden by device driver during context creation
* but are never changed after that.
--
2.11.0
Alejandro Piñeiro
2017-12-07 08:38:41 UTC
Reply
Permalink
Raw Message
To avoid any vulkan driver to include the GL mtypes.h. Renamed as
eventually this could be used by drivers not using nir.

v2: remove compiler/spirv/spirv.h from mtypes (Alejandro)
---

The include on v1 was a leftover, when I tested if adding the
SpirVCapabilities on gl_constant was working fine, but it is not
needed on this patch, but on a following one.

Sorry for the noise.

src/compiler/spirv/nir_spirv.h | 4 ++--
src/compiler/spirv/spirv.h | 15 +++++++++++++++
src/mesa/main/mtypes.h | 13 -------------
3 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 113bd710a00..71f44e07dba 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -29,7 +29,7 @@
#define _NIR_SPIRV_H_

#include "compiler/nir/nir.h"
-#include "main/mtypes.h"
+#include "compiler/spirv/spirv.h"

#ifdef __cplusplus
extern "C" {
@@ -58,7 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;

- struct nir_spirv_supported_capabilities caps;
+ struct spirv_supported_capabilities caps;

struct {
void (*func)(void *private_data,
diff --git a/src/compiler/spirv/spirv.h b/src/compiler/spirv/spirv.h
index 61559a1c9ca..ce2dcf7657f 100644
--- a/src/compiler/spirv/spirv.h
+++ b/src/compiler/spirv/spirv.h
@@ -48,6 +48,8 @@
#ifndef spirv_H
#define spirv_H

+#include <stdbool.h>
+
typedef unsigned int SpvId;

#define SPV_VERSION 0x10200
@@ -994,5 +996,18 @@ typedef enum SpvOp_ {
SpvOpMax = 0x7fffffff,
} SpvOp;

+struct spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
+
#endif // #ifndef spirv_H

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7b7137624c7..397b113dfbc 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3578,19 +3578,6 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};

-struct nir_spirv_supported_capabilities {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
-};
-
/**
* Constants which may be overridden by device driver during context creation
* but are never changed after that.
--
2.11.0
Jason Ekstrand
2017-12-07 15:56:49 UTC
Reply
Permalink
Raw Message
Post by Alejandro Piñeiro
To avoid any vulkan driver to include the GL mtypes.h. Renamed as
eventually this could be used by drivers not using nir.
v2: remove compiler/spirv/spirv.h from mtypes (Alejandro)
---
The include on v1 was a leftover, when I tested if adding the
SpirVCapabilities on gl_constant was working fine, but it is not
needed on this patch, but on a following one.
Sorry for the noise.
src/compiler/spirv/nir_spirv.h | 4 ++--
src/compiler/spirv/spirv.h | 15 +++++++++++++++
src/mesa/main/mtypes.h | 13 -------------
3 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_
spirv.h
index 113bd710a00..71f44e07dba 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -29,7 +29,7 @@
#define _NIR_SPIRV_H_
#include "compiler/nir/nir.h"
-#include "main/mtypes.h"
+#include "compiler/spirv/spirv.h"
#ifdef __cplusplus
extern "C" {
@@ -58,7 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;
- struct nir_spirv_supported_capabilities caps;
+ struct spirv_supported_capabilities caps;
struct {
void (*func)(void *private_data,
diff --git a/src/compiler/spirv/spirv.h b/src/compiler/spirv/spirv.h
index 61559a1c9ca..ce2dcf7657f 100644
--- a/src/compiler/spirv/spirv.h
+++ b/src/compiler/spirv/spirv.h
@@ -48,6 +48,8 @@
#ifndef spirv_H
#define spirv_H
+#include <stdbool.h>
+
typedef unsigned int SpvId;
#define SPV_VERSION 0x10200
@@ -994,5 +996,18 @@ typedef enum SpvOp_ {
SpvOpMax = 0x7fffffff,
} SpvOp;
+struct spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
+
We shouldn't add things to spirv/spirv.h. That's a header we pull in from
Khronos so we really shouldn't be touching it. Other possibly reasonable
options include:

1) compiler/shader_info.h
2) A new spirv/spirv_capabilities.h header
3) Add a couple of predeclarations to spirv/nir_spirv.h, drop the nir.h
include, and put it there.

I think option 1 is probably the most sane. It's not really shader_info
but it's kind-of like that.
Post by Alejandro Piñeiro
#endif // #ifndef spirv_H
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7b7137624c7..397b113dfbc 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3578,19 +3578,6 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};
-struct nir_spirv_supported_capabilities {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
-};
-
/**
* Constants which may be overridden by device driver during context creation
* but are never changed after that.
--
2.11.0
Alejandro Piñeiro
2017-12-07 16:12:21 UTC
Reply
Permalink
Raw Message
To avoid any vulkan driver to include the GL mtypes.h. Renamed as
eventually this could be used by drivers not using nir.

v2: remove compiler/spirv/spirv.h from mtypes (Alejandro)
v3: added the definition at compiler/shader_info.h (Jason Ekstrand)
---

Sorry for not realizing that spirv.h was a generated file. I also
preferred to add it to shader_info.h. Both options 2 and 3 seemed
somewhat an overkill

src/compiler/shader_info.h | 13 +++++++++++++
src/compiler/spirv/nir_spirv.h | 4 ++--
src/mesa/main/mtypes.h | 13 -------------
3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h
index bcb3f0fffac..c9140ba9752 100644
--- a/src/compiler/shader_info.h
+++ b/src/compiler/shader_info.h
@@ -31,6 +31,19 @@
extern "C" {
#endif

+struct spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
+
typedef struct shader_info {
const char *name;

diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 113bd710a00..a2c40e57d18 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -29,7 +29,7 @@
#define _NIR_SPIRV_H_

#include "compiler/nir/nir.h"
-#include "main/mtypes.h"
+#include "compiler/shader_info.h"

#ifdef __cplusplus
extern "C" {
@@ -58,7 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;

- struct nir_spirv_supported_capabilities caps;
+ struct spirv_supported_capabilities caps;

struct {
void (*func)(void *private_data,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7b7137624c7..397b113dfbc 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3578,19 +3578,6 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};

-struct nir_spirv_supported_capabilities {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
-};
-
/**
* Constants which may be overridden by device driver during context creation
* but are never changed after that.
--
2.11.0
Jason Ekstrand
2017-12-07 16:13:29 UTC
Reply
Permalink
Raw Message
Thanks!
Post by Alejandro Piñeiro
To avoid any vulkan driver to include the GL mtypes.h. Renamed as
eventually this could be used by drivers not using nir.
v2: remove compiler/spirv/spirv.h from mtypes (Alejandro)
v3: added the definition at compiler/shader_info.h (Jason Ekstrand)
---
Sorry for not realizing that spirv.h was a generated file. I also
preferred to add it to shader_info.h. Both options 2 and 3 seemed
somewhat an overkill
src/compiler/shader_info.h | 13 +++++++++++++
src/compiler/spirv/nir_spirv.h | 4 ++--
src/mesa/main/mtypes.h | 13 -------------
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h
index bcb3f0fffac..c9140ba9752 100644
--- a/src/compiler/shader_info.h
+++ b/src/compiler/shader_info.h
@@ -31,6 +31,19 @@
extern "C" {
#endif
+struct spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
+
typedef struct shader_info {
const char *name;
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_
spirv.h
index 113bd710a00..a2c40e57d18 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -29,7 +29,7 @@
#define _NIR_SPIRV_H_
#include "compiler/nir/nir.h"
-#include "main/mtypes.h"
+#include "compiler/shader_info.h"
#ifdef __cplusplus
extern "C" {
@@ -58,7 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;
- struct nir_spirv_supported_capabilities caps;
+ struct spirv_supported_capabilities caps;
struct {
void (*func)(void *private_data,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7b7137624c7..397b113dfbc 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3578,19 +3578,6 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};
-struct nir_spirv_supported_capabilities {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
-};
-
/**
* Constants which may be overridden by device driver during context creation
* but are never changed after that.
--
2.11.0
Pierre Moreau
2017-12-07 19:42:46 UTC
Reply
Permalink
Raw Message
Thank you for the changes!
Post by Alejandro Piñeiro
To avoid any vulkan driver to include the GL mtypes.h. Renamed as
eventually this could be used by drivers not using nir.
v2: remove compiler/spirv/spirv.h from mtypes (Alejandro)
v3: added the definition at compiler/shader_info.h (Jason Ekstrand)
---
Sorry for not realizing that spirv.h was a generated file. I also
preferred to add it to shader_info.h. Both options 2 and 3 seemed
somewhat an overkill
src/compiler/shader_info.h | 13 +++++++++++++
src/compiler/spirv/nir_spirv.h | 4 ++--
src/mesa/main/mtypes.h | 13 -------------
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h
index bcb3f0fffac..c9140ba9752 100644
--- a/src/compiler/shader_info.h
+++ b/src/compiler/shader_info.h
@@ -31,6 +31,19 @@
extern "C" {
#endif
+struct spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
+
typedef struct shader_info {
const char *name;
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 113bd710a00..a2c40e57d18 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -29,7 +29,7 @@
#define _NIR_SPIRV_H_
#include "compiler/nir/nir.h"
-#include "main/mtypes.h"
+#include "compiler/shader_info.h"
#ifdef __cplusplus
extern "C" {
@@ -58,7 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;
- struct nir_spirv_supported_capabilities caps;
+ struct spirv_supported_capabilities caps;
struct {
void (*func)(void *private_data,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7b7137624c7..397b113dfbc 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3578,19 +3578,6 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};
-struct nir_spirv_supported_capabilities {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
-};
-
/**
* Constants which may be overridden by device driver during context creation
* but are never changed after that.
--
2.11.0
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Ian Romanick
2017-12-06 20:11:12 UTC
Reply
Permalink
Raw Message
Post by Pierre Moreau
Hello Alejandro,
As far as I understand, nir_spirv_supported_capabilities is being filled in by
the driver and then fetched by the API entrypoint to check the capabilities
required by the SPIR-V binary given as input. And this is done regardless of
the input IR used by the driver, be it NIR, LLVM IR, TGSI or others. So
couldn’t it be just named spirv_supported_capabilities? Unless it also reflects
the capabilities supported by the IR being used.
I guess nir_spirv_supported_capabilities could be extended later on to also add
capabilities specific to OpenCL when clover reaches OpenCL 1.2 support (and can
start accepting SPIR-V binaries as input through the cl_khr_il_program
extension), or would it be better to have a separate one for OpenCL?
I expect that over time there will be overlap between SPIR-V
functionality exposed in OpenCL, Vulkan, and OpenGL extensions. There
already are some cases of this. Given that, I think having a single
master list of supported capabilities makes sense.
Post by Pierre Moreau
I haven’t had time to look at the whole gl_spirv series yet, so I am sorry if
this is something that has already been brought and answered in that thread.
Regards,
Pierre
Post by Alejandro Piñeiro
Until now it was part of spirv_to_nir_options. But it will be used on
the implementation of ARB_gl_spirv and ARB_spirv_extensions, and added
to the OpenGL context, as a way to save what SPIR-V capabilities the
current OpenGL implementation supports.
---
We are sending this commit in advance of a v3 of the initial gl_spirv
and spirv_extensions support series. The issue is that lately there
were a lot of activity on the spirv/spir_to_nir code base, and we are
being fixing rebase conflicts constantly. Getting this commit on
master would make things easier.
FWIW, this patch is similar to one that Ian Romanick already granted
https://lists.freedesktop.org/archives/mesa-dev/2017-November/178261.html
src/compiler/spirv/nir_spirv.h | 16 +++-------------
src/mesa/main/mtypes.h | 12 ++++++++++++
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 43ec19d5a50..113bd710a00 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -28,7 +28,8 @@
#ifndef _NIR_SPIRV_H_
#define _NIR_SPIRV_H_
-#include "nir/nir.h"
+#include "compiler/nir/nir.h"
+#include "main/mtypes.h"
#ifdef __cplusplus
extern "C" {
@@ -57,18 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;
- struct {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
- } caps;
+ struct nir_spirv_supported_capabilities caps;
struct {
void (*func)(void *private_data,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b478f6158e2..7da05aa3ee9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3579,6 +3579,18 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};
+struct nir_spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
/**
* Constants which may be overridden by device driver during context creation
--
2.11.0
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Ian Romanick
2017-12-06 20:11:56 UTC
Reply
Permalink
Raw Message
Post by Alejandro Piñeiro
Until now it was part of spirv_to_nir_options. But it will be used on
the implementation of ARB_gl_spirv and ARB_spirv_extensions, and added
to the OpenGL context, as a way to save what SPIR-V capabilities the
current OpenGL implementation supports.
---
We are sending this commit in advance of a v3 of the initial gl_spirv
and spirv_extensions support series. The issue is that lately there
were a lot of activity on the spirv/spir_to_nir code base, and we are
being fixing rebase conflicts constantly. Getting this commit on
master would make things easier.
FWIW, this patch is similar to one that Ian Romanick already granted
https://lists.freedesktop.org/archives/mesa-dev/2017-November/178261.html
src/compiler/spirv/nir_spirv.h | 16 +++-------------
src/mesa/main/mtypes.h | 12 ++++++++++++
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 43ec19d5a50..113bd710a00 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -28,7 +28,8 @@
#ifndef _NIR_SPIRV_H_
#define _NIR_SPIRV_H_
-#include "nir/nir.h"
+#include "compiler/nir/nir.h"
+#include "main/mtypes.h"
#ifdef __cplusplus
extern "C" {
@@ -57,18 +58,7 @@ struct spirv_to_nir_options {
*/
bool lower_workgroup_access_to_offsets;
- struct {
- bool float64;
- bool image_ms_array;
- bool tessellation;
- bool draw_parameters;
- bool image_read_without_format;
- bool image_write_without_format;
- bool int64;
- bool multiview;
- bool variable_pointers;
- bool storage_16bit;
- } caps;
+ struct nir_spirv_supported_capabilities caps;
struct {
void (*func)(void *private_data,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b478f6158e2..7da05aa3ee9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3579,6 +3579,18 @@ struct gl_program_constants
GLuint MaxShaderStorageBlocks;
};
+struct nir_spirv_supported_capabilities {
+ bool float64;
+ bool image_ms_array;
+ bool tessellation;
+ bool draw_parameters;
+ bool image_read_without_format;
+ bool image_write_without_format;
+ bool int64;
+ bool multiview;
+ bool variable_pointers;
+ bool storage_16bit;
+};
/**
* Constants which may be overridden by device driver during context creation
Loading...