[Mesa-dev] [PATCH v2] mesa/spirv: move and rename nir_spirv_supported_capabilities
Jason Ekstrand
jason at jlekstrand.net
Thu Dec 7 15:56:49 UTC 2017
On Thu, Dec 7, 2017 at 12:38 AM, Alejandro PiƱeiro <apinheiro at igalia.com>
wrote:
> 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.
> #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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171207/60745fe0/attachment-0001.html>
More information about the mesa-dev
mailing list