<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Dec 7, 2017 at 12:38 AM, Alejandro Piñeiro <span dir="ltr"><<a href="mailto:apinheiro@igalia.com" target="_blank">apinheiro@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">To avoid any vulkan driver to include the GL mtypes.h. Renamed as<br>
eventually this could be used by drivers not using nir.<br>
<br>
</span>v2: remove compiler/spirv/spirv.h from mtypes (Alejandro)<br>
---<br>
<br>
The include on v1 was a leftover, when I tested if adding the<br>
SpirVCapabilities on gl_constant was working fine, but it is not<br>
needed on this patch, but on a following one.<br>
<br>
Sorry for the noise.<br>
<span class=""><br>
src/compiler/spirv/nir_spirv.h | 4 ++--<br>
src/compiler/spirv/spirv.h | 15 +++++++++++++++<br>
</span> src/mesa/main/mtypes.h | 13 -------------<br>
3 files changed, 17 insertions(+), 15 deletions(-)<br>
<div><div class="h5"><br>
diff --git a/src/compiler/spirv/nir_<wbr>spirv.h b/src/compiler/spirv/nir_<wbr>spirv.h<br>
index 113bd710a00..71f44e07dba 100644<br>
--- a/src/compiler/spirv/nir_<wbr>spirv.h<br>
+++ b/src/compiler/spirv/nir_<wbr>spirv.h<br>
@@ -29,7 +29,7 @@<br>
#define _NIR_SPIRV_H_<br>
<br>
#include "compiler/nir/nir.h"<br>
-#include "main/mtypes.h"<br>
+#include "compiler/spirv/spirv.h"<br>
<br>
#ifdef __cplusplus<br>
extern "C" {<br>
@@ -58,7 +58,7 @@ struct spirv_to_nir_options {<br>
*/<br>
bool lower_workgroup_access_to_<wbr>offsets;<br>
<br>
- struct nir_spirv_supported_<wbr>capabilities caps;<br>
+ struct spirv_supported_capabilities caps;<br>
<br>
struct {<br>
void (*func)(void *private_data,<br>
diff --git a/src/compiler/spirv/spirv.h b/src/compiler/spirv/spirv.h<br>
index 61559a1c9ca..ce2dcf7657f 100644<br>
--- a/src/compiler/spirv/spirv.h<br>
+++ b/src/compiler/spirv/spirv.h<br>
@@ -48,6 +48,8 @@<br>
#ifndef spirv_H<br>
#define spirv_H<br>
<br>
+#include <stdbool.h><br>
+<br>
typedef unsigned int SpvId;<br>
<br>
#define SPV_VERSION 0x10200<br>
@@ -994,5 +996,18 @@ typedef enum SpvOp_ {<br>
SpvOpMax = 0x7fffffff,<br>
} SpvOp;<br>
<br>
+struct spirv_supported_capabilities {<br>
+ bool float64;<br>
+ bool image_ms_array;<br>
+ bool tessellation;<br>
+ bool draw_parameters;<br>
+ bool image_read_without_format;<br>
+ bool image_write_without_format;<br>
+ bool int64;<br>
+ bool multiview;<br>
+ bool variable_pointers;<br>
+ bool storage_16bit;<br>
+};<br>
+<br></div></div></blockquote><div><br></div><div>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:</div><div><br></div><div> 1) compiler/shader_info.h</div><div> 2) A new spirv/spirv_capabilities.h header</div><div> 3) Add a couple of predeclarations to spirv/nir_spirv.h, drop the nir.h include, and put it there.</div><div><br></div><div>I think option 1 is probably the most sane. It's not really shader_info but it's kind-of like that.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
#endif // #ifndef spirv_H<br>
<br>
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h<br>
</div></div>index 7b7137624c7..397b113dfbc 100644<br>
--- a/src/mesa/main/mtypes.h<br>
+++ b/src/mesa/main/mtypes.h<br>
@@ -3578,19 +3578,6 @@ struct gl_program_constants<br>
<div class="HOEnZb"><div class="h5"> GLuint MaxShaderStorageBlocks;<br>
};<br>
<br>
-struct nir_spirv_supported_<wbr>capabilities {<br>
- bool float64;<br>
- bool image_ms_array;<br>
- bool tessellation;<br>
- bool draw_parameters;<br>
- bool image_read_without_format;<br>
- bool image_write_without_format;<br>
- bool int64;<br>
- bool multiview;<br>
- bool variable_pointers;<br>
- bool storage_16bit;<br>
-};<br>
-<br>
/**<br>
* Constants which may be overridden by device driver during context creation<br>
* but are never changed after that.<br>
--<br>
2.11.0<br>
<br>
</div></div></blockquote></div><br></div></div>