Skip to content

Proposal for layer options (settings file) #5

@MathiasMagnus

Description

@MathiasMagnus

In the spirit of "not invented here", because OpenCL Layers are following the success of Vulkan layers, it makes sense to follow the same format and locations for setting settings on how layers should behave when loaded.

File structure example

# Comments start with #
# settings (by convention) are prefixed by layer name
layer.setting1 = 10
# Empty lines are ignored, trailing and leading whitespace is trimmed

layer.setting2 = true # Line comments

In general this is a direct translation of vk_layer_settings.txt

$VARIABLE is used for environment variables.

Search locations for the file

The order of precedence through which config files are found are as follows:

  1. If $OPENCL_LAYERS_SETTINGS_PATH is set to a path to a directory, use the file cl_layer_settings.txt file from it. Otherwise if set it should be set to the file name to read the settings from.
  2. If $OPENCL_LAYERS_SETTINGS_PATH is not set search for platform specific directories listed below.
  3. If no settings are found in any of the platform specific locations, then fall back to cl_layer_settings.txt in the current working directory.

Platform specific locations

Linux and MacOS

  • $XDG_DATA_HOME/settings.d/opencl/cl_layer_settings.txt
    • if $XDG_DATA_HOME is not set try with $HOME/.local/share

Windows

  • If {HKEY_LOCAL_MACHINE}\Software\Khronos\OpenCL\Settings has key with zero value, the the name of
    the key is used as filename.
  • Non admin only: HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE

Android

The vulkan validation layers use the same locations as in linux, but environment variables are
replaced by properties.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions