Home | History | Annotate | Download | only in source
      1 // Copyright (c) 2015-2016 The Khronos Group Inc.
      2 //
      3 // Permission is hereby granted, free of charge, to any person obtaining a
      4 // copy of this software and/or associated documentation files (the
      5 // "Materials"), to deal in the Materials without restriction, including
      6 // without limitation the rights to use, copy, modify, merge, publish,
      7 // distribute, sublicense, and/or sell copies of the Materials, and to
      8 // permit persons to whom the Materials are furnished to do so, subject to
      9 // the following conditions:
     10 //
     11 // The above copyright notice and this permission notice shall be included
     12 // in all copies or substantial portions of the Materials.
     13 //
     14 // MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
     15 // KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
     16 // SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
     17 //    https://www.khronos.org/registry/
     18 //
     19 // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     20 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     21 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     22 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
     23 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
     24 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
     25 // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
     26 
     27 #ifndef LIBSPIRV_EXT_INST_H_
     28 #define LIBSPIRV_EXT_INST_H_
     29 
     30 #include "spirv-tools/libspirv.h"
     31 #include "table.h"
     32 
     33 // Gets the type of the extended instruction set with the specified name.
     34 spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name);
     35 
     36 // Finds the named extented instruction of the given type in the given extended
     37 // instruction table. On success, returns SPV_SUCCESS and writes a handle of
     38 // the instruction entry into *entry.
     39 spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table,
     40                                        const spv_ext_inst_type_t type,
     41                                        const char* name,
     42                                        spv_ext_inst_desc* entry);
     43 
     44 // Finds the extented instruction of the given type in the given extended
     45 // instruction table by value. On success, returns SPV_SUCCESS and writes a
     46 // handle of the instruction entry into *entry.
     47 spv_result_t spvExtInstTableValueLookup(const spv_ext_inst_table table,
     48                                         const spv_ext_inst_type_t type,
     49                                         const uint32_t value,
     50                                         spv_ext_inst_desc* pEntry);
     51 
     52 #endif  // LIBSPIRV_EXT_INST_H_
     53