mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 05:00:09 +01:00
clover/spirv: Use cl_version for SPIR-V versions (v2)
v2: Explicitly construct the cl_name_version object. Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Pierre Moreau <dev@pmoreau.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2078>
This commit is contained in:
parent
42fe80896b
commit
c0d4d21ff5
3 changed files with 6 additions and 11 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 {};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue