Vulkan graphics driver and layer enumeration

Vulkan graphics driver and layer enumeration — Get information about the system's Vulkan drivers

Functions

Properties

char * api-version Read / Write / Construct Only
char * library-arch Read / Write / Construct Only
gboolean portability-driver Read / Write / Construct Only
char * api-version Read / Write / Construct Only
GStrv component-layers Read / Write / Construct Only
char * description Read / Write / Construct Only
char * implementation-version Read / Write / Construct Only
char * library-arch Read / Write / Construct Only
char * name Read / Write / Construct Only
char * type Read / Write / Construct Only

Object Hierarchy

    GObject
    ╰── SrtBaseGraphicsModule
        ╰── SrtBaseJsonGraphicsModule
            ├── SrtVulkanIcd
            ╰── SrtVulkanLayer

Includes

#include <steam-runtime-tools/steam-runtime-tools.h>

Description

SrtVulkanIcd is an opaque object representing the metadata describing a Vulkan ICD. This is a reference-counted object: use g_object_ref() and g_object_unref() to manage its lifecycle.

Functions

srt_vulkan_icd_check_error ()

gboolean
srt_vulkan_icd_check_error (SrtVulkanIcd *self,
                            GError **error);

Check whether we failed to load the JSON describing this Vulkan ICD. Note that this does not actually dlopen() the ICD itself.

Parameters

self

The ICD

 

error

Used to return details if the ICD description could not be loaded

 

Returns

TRUE if the JSON was loaded successfully


srt_vulkan_icd_get_api_version ()

const gchar *
srt_vulkan_icd_get_api_version (SrtVulkanIcd *self);

Return the Vulkan API version of this ICD.

If the JSON description for this ICD could not be loaded, return NULL instead.

Parameters

self

The ICD

 

Returns

The API version as a string.

[type utf8][transfer none][nullable]


srt_vulkan_icd_get_json_path ()

const gchar *
srt_vulkan_icd_get_json_path (SrtVulkanIcd *self);

Return the absolute path to the JSON file representing this ICD.

Parameters

self

The ICD

 

Returns

“json-path”.

[type filename][transfer none]


srt_vulkan_icd_get_library_path ()

const gchar *
srt_vulkan_icd_get_library_path (SrtVulkanIcd *self);

Return the library path for this ICD. It is either an absolute path, a path relative to srt_vulkan_icd_get_json_path() containing at least one directory separator (slash), or a basename to be loaded from the shared library search path.

If the JSON description for this ICD could not be loaded, return NULL instead.

Parameters

self

The ICD

 

Returns

“library-path”.

[type filename][transfer none][nullable]


srt_vulkan_icd_get_library_arch ()

const gchar *
srt_vulkan_icd_get_library_arch (SrtVulkanIcd *self);

Return a string that describes the architecture of this ICD. The values allowed by the Vulkan specification are 32 and 64, indicating the size of a pointer, but the reference Vulkan-Loader accepts any value (and therefore so does steam-runtime-tools).

This is an optional field, so if it was not available in the JSON, or if the ICD could not be loaded, NULL will be returned.

Parameters

self

The ICD

 

Returns

“library-arch”.

[type filename][transfer none][nullable]


srt_vulkan_icd_get_issues ()

SrtLoadableIssues
srt_vulkan_icd_get_issues (SrtVulkanIcd *self);

Return the problems found when parsing and loading self .

Parameters

self

The ICD

 

Returns

A bitfield containing problems, or SRT_LOADABLE_ISSUES_NONE if no problems were found


srt_vulkan_icd_resolve_library_path ()

gchar *
srt_vulkan_icd_resolve_library_path (SrtVulkanIcd *self);

Return the path that can be passed to dlopen() for this ICD.

If srt_vulkan_icd_get_library_path() is a relative path, return the absolute path that is the result of interpreting it relative to srt_vulkan_icd_get_json_path(). Otherwise return a copy of srt_vulkan_icd_get_library_path().

The result is either the basename of a shared library (to be found relative to some directory listed in $LD_LIBRARY_PATH, /etc/ld.so.conf, /etc/ld.so.conf.d or the hard-coded library search path), or an absolute path.

Parameters

self

An ICD

 

Returns

A copy of “resolved-library-path”. Free with g_free().

[transfer full][type filename][nullable]


srt_vulkan_icd_new_replace_library_path ()

SrtVulkanIcd *
srt_vulkan_icd_new_replace_library_path
                               (SrtVulkanIcd *self,
                                const char *path);

Return a copy of self with the srt_vulkan_icd_get_library_path() changed to path . For example, this is useful when setting up a container where the underlying shared object will be made available at a different absolute path.

If self is in an error state, this returns a new reference to self .

Note that self issues are copied to the new SrtVulkanIcd copy, including the eventual SRT_LOADABLE_ISSUES_DUPLICATED.

Parameters

self

An ICD

 

path

A path.

[type filename][transfer none]

Returns

A new reference to a SrtVulkanIcd. Free with g_object_unref().

[transfer full]


srt_vulkan_icd_write_to_file ()

gboolean
srt_vulkan_icd_write_to_file (SrtVulkanIcd *self,
                              const char *path,
                              GError **error);

Serialize self to the given JSON file.

Parameters

self

An ICD

 

path

A filename.

[type filename]

error

Used to describe the error on failure

 

Returns

TRUE on success


srt_vulkan_layer_check_error ()

gboolean
srt_vulkan_layer_check_error (const SrtVulkanLayer *self,
                              GError **error);

Check whether we failed to load the JSON describing this Vulkan layer. Note that this does not actually dlopen() the layer itself.

Parameters

self

The layer

 

error

Used to return details if the layer description could not be loaded

 

Returns

TRUE if the JSON was loaded successfully


srt_vulkan_layer_get_json_path ()

const gchar *
srt_vulkan_layer_get_json_path (SrtVulkanLayer *self);

Return the absolute path to the JSON file representing this layer.

Parameters

self

The Vulkan layer

 

Returns

“json-path”.

[type filename][transfer none][not nullable]


srt_vulkan_layer_get_library_path ()

const gchar *
srt_vulkan_layer_get_library_path (SrtVulkanLayer *self);

Return the library path for this layer. It is either an absolute path, a path relative to srt_vulkan_layer_get_json_path() containing at least one directory separator (slash), or a basename to be loaded from the shared library search path.

If the JSON description for this layer could not be loaded, or if “component_layers” is used, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“library-path”.

[type filename][transfer none][nullable]


srt_vulkan_layer_get_library_arch ()

const gchar *
srt_vulkan_layer_get_library_arch (SrtVulkanLayer *self);

Return a string that describes the architecture of the binary associated with “library-path”. The meaning is the same as for srt_vulkan_icd_get_library_arch().

This is an optional field, so if it was not available in the JSON, or if the layer description could not be loaded, NULL will be returned.

Parameters

self

The Vulkan layer

 

Returns

“library-arch”.

[type filename][transfer none][nullable]


srt_vulkan_layer_get_name ()

const gchar *
srt_vulkan_layer_get_name (SrtVulkanLayer *self);

Return the name that uniquely identify this layer.

If the JSON description for this layer could not be loaded, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“name”.

[type utf8][transfer none][nullable]


srt_vulkan_layer_get_description ()

const gchar *
srt_vulkan_layer_get_description (SrtVulkanLayer *self);

Return the description of this layer.

If the JSON description for this layer could not be loaded, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“description”.

[type utf8][transfer none][nullable]


srt_vulkan_layer_get_api_version ()

const gchar *
srt_vulkan_layer_get_api_version (SrtVulkanLayer *self);

Return the Vulkan API version of this layer.

If the JSON description for this layer could not be loaded, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“api_version”.

[type utf8][transfer none][nullable]


srt_vulkan_layer_resolve_library_path ()

gchar *
srt_vulkan_layer_resolve_library_path (SrtVulkanLayer *self);

Return the path that can be passed to dlopen() for this layer.

If srt_vulkan_layer_get_library_path() is a relative path, return the absolute path that is the result of interpreting it relative to srt_vulkan_layer_get_json_path(). Otherwise return a copy of srt_vulkan_layer_get_library_path().

The result is either the basename of a shared library (to be found relative to some directory listed in $LD_LIBRARY_PATH, /etc/ld.so.conf, /etc/ld.so.conf.d or the hard-coded library search path), or an absolute path.

Parameters

self

A Vulkan layer

 

Returns

The basename of a shared library or an absolute path. Free with g_free().

[transfer full][type filename][nullable]


srt_vulkan_layer_get_type_value ()

const gchar *
srt_vulkan_layer_get_type_value (SrtVulkanLayer *self);

Return the type of this layer. The expected values should be either "GLOBAL" or "INSTANCE".

If the JSON description for this layer could not be loaded, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“type”.

[type utf8][transfer none][nullable]


srt_vulkan_layer_get_implementation_version ()

const gchar *
srt_vulkan_layer_get_implementation_version
                               (SrtVulkanLayer *self);

Return the version of the implemented layer.

If the JSON description for this layer could not be loaded, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“implementation_version”.

[type utf8][transfer none][nullable]


srt_vulkan_layer_get_component_layers ()

const char * const *
srt_vulkan_layer_get_component_layers (SrtVulkanLayer *self);

Return the component layer names that are part of a meta-layer.

If the JSON description for this layer could not be loaded, or if “library-path” is used, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“component_layers”.

[array zero-terminated=1][transfer none][element-type utf8][nullable]


srt_vulkan_layer_get_issues ()

SrtLoadableIssues
srt_vulkan_layer_get_issues (SrtVulkanLayer *self);

Return the problems found when parsing and loading self .

Parameters

self

The Vulkan layer

 

Returns

A bitfield containing problems, or SRT_LOADABLE_ISSUES_NONE if no problems were found


srt_vulkan_layer_new_replace_library_path ()

SrtVulkanLayer *
srt_vulkan_layer_new_replace_library_path
                               (SrtVulkanLayer *self,
                                const char *path);

Return a copy of self with the srt_vulkan_layer_get_library_path() changed to path . For example, this is useful when setting up a container where the underlying shared object will be made available at a different absolute path.

If self does not have “library-path” set, or if it is in an error state, this returns a new reference to self .

Parameters

self

A Vulkan layer

 

path

A path.

[type filename][transfer none]

Returns

A new reference to a SrtVulkanLayer. Free with g_object_unref().

[transfer full]


srt_vulkan_layer_write_to_file ()

gboolean
srt_vulkan_layer_write_to_file (SrtVulkanLayer *self,
                                const char *path,
                                GError **error);

Serialize self to the given JSON file.

Parameters

self

The Vulkan layer

 

path

A filename.

[type filename]

error

Used to describe the error on failure

 

Returns

TRUE on success

Property Details

The “api-version” property

  “api-version”              char *

Vulkan API version implemented by this ICD.

Owner: SrtVulkanIcd

Flags: Read / Write / Construct Only

Default value: NULL


The “library-arch” property

  “library-arch”             char *

Architecture of the library implementing this ICD. The values allowed by the specification are "32" and "64", but other values are possible.

Owner: SrtVulkanIcd

Flags: Read / Write / Construct Only

Default value: NULL


The “portability-driver” property

  “portability-driver”       gboolean

TRUE if the ICD is for a portability driver.

Owner: SrtVulkanIcd

Flags: Read / Write / Construct Only

Default value: FALSE


The “api-version” property

  “api-version”              char *

The version number of the Vulkan API that the shared library was built against.

Owner: SrtVulkanLayer

Flags: Read / Write / Construct Only

Default value: NULL


The “component-layers” property

  “component-layers”         GStrv

Component layer names that are part of a meta-layer.

Owner: SrtVulkanLayer

Flags: Read / Write / Construct Only


The “description” property

  “description”              char *

Brief description of the layer.

Owner: SrtVulkanLayer

Flags: Read / Write / Construct Only

Default value: NULL


The “implementation-version” property

  “implementation-version”   char *

Version of the implemented layer.

Owner: SrtVulkanLayer

Flags: Read / Write / Construct Only

Default value: NULL


The “library-arch” property

  “library-arch”             char *

Architecture of the library binary that implements this layer. The values allowed by the specification are "32" and "64", but other values are possible.

Owner: SrtVulkanLayer

Flags: Read / Write / Construct Only

Default value: NULL


The “name” property

  “name”                     char *

The name that uniquely identify this layer to applications.

Owner: SrtVulkanLayer

Flags: Read / Write / Construct Only

Default value: NULL


The “type” property

  “type”                     char *

The type of this layer. It is expected to be either GLOBAL or INSTANCE.

Owner: SrtVulkanLayer

Flags: Read / Write / Construct Only

Default value: NULL