diff options
-rw-r--r-- | src/gallium/frontends/clover/llvm/invocation.cpp | 3 | ||||
-rw-r--r-- | src/gallium/frontends/clover/spirv/invocation.cpp | 12 | ||||
-rw-r--r-- | src/gallium/frontends/clover/spirv/invocation.hpp | 2 |
3 files changed, 6 insertions, 11 deletions
diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp index 85af8b7c6a1..be0f3976b92 100644 --- a/src/gallium/frontends/clover/llvm/invocation.cpp +++ b/src/gallium/frontends/clover/llvm/invocation.cpp @@ -352,8 +352,9 @@ namespace { SPIRV::TranslatorOpts get_spirv_translator_options(const device &dev) { const auto supported_versions = clover::spirv::supported_versions(); + const auto max_supported = clover::spirv::to_spirv_version_encoding(supported_versions.back().version); const auto maximum_spirv_version = - std::min(static_cast<SPIRV::VersionNumber>(supported_versions.back()), + std::min(static_cast<SPIRV::VersionNumber>(max_supported), SPIRV::VersionNumber::MaximumVersion); SPIRV::TranslatorOpts::ExtensionsStatusMap spirv_extensions; diff --git a/src/gallium/frontends/clover/spirv/invocation.cpp b/src/gallium/frontends/clover/spirv/invocation.cpp index 5763c351698..5dfdeb0bd39 100644 --- a/src/gallium/frontends/clover/spirv/invocation.cpp +++ b/src/gallium/frontends/clover/spirv/invocation.cpp @@ -49,12 +49,6 @@ using namespace clover; #ifdef HAVE_CLOVER_SPIRV namespace { - uint32_t - make_spirv_version(uint8_t major, uint8_t minor) { - return (static_cast<uint32_t>(major) << 16u) | - (static_cast<uint32_t>(minor) << 8u); - } - template<typename T> T get(const char *source, size_t index) { const uint32_t *word_ptr = reinterpret_cast<const uint32_t *>(source); @@ -886,9 +880,9 @@ clover::spirv::supported_extensions() { }; } -std::vector<uint32_t> +std::vector<cl_name_version> clover::spirv::supported_versions() { - return { make_spirv_version(1u, 0u) }; + return { cl_name_version { CL_MAKE_VERSION(1u, 0u, 0u), "SPIR-V" } }; } cl_version @@ -949,7 +943,7 @@ clover::spirv::supported_extensions() { return {}; } -std::vector<uint32_t> +std::vector<cl_name_version> clover::spirv::supported_versions() { return {}; } diff --git a/src/gallium/frontends/clover/spirv/invocation.hpp b/src/gallium/frontends/clover/spirv/invocation.hpp index 3d13bdecef9..ab79c5c388e 100644 --- a/src/gallium/frontends/clover/spirv/invocation.hpp +++ b/src/gallium/frontends/clover/spirv/invocation.hpp @@ -68,7 +68,7 @@ namespace clover { // Returns a vector (sorted in increasing order) of supported SPIR-V // versions. - std::vector<uint32_t> supported_versions(); + std::vector<cl_name_version> supported_versions(); // Converts a version number from SPIR-V's encoding to OpenCL's one. cl_version to_opencl_version_encoding(uint32_t version); |