blob: 0d9ef28d4317122c7157134f46142fcf3671b185 [file] [log] [blame]
Dejan Mircevskib6fe02f2016-01-07 13:44:22 -05001// Copyright (c) 2015-2016 The Khronos Group Inc.
Kenneth Benzie (Benie)83e5a292015-05-22 18:26:19 +01002//
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
David Neto9f79d782015-10-27 16:27:05 -040027#ifndef LIBSPIRV_BINARY_H_
28#define LIBSPIRV_BINARY_H_
Kenneth Benzie (Benie)83e5a292015-05-22 18:26:19 +010029
David Neto5a703352016-02-17 14:44:00 -050030#include "spirv-tools/libspirv.h"
Umar Arshadfd965c92016-08-06 13:25:02 -040031#include "spirv/1.1/spirv.h"
32#include "spirv_definition.h"
David Neto0ca6b592015-10-30 16:06:15 -040033
Kenneth Benzie (Benie)83e5a292015-05-22 18:26:19 +010034// Functions
35
Lei Zhangaf9906e2015-11-16 10:48:43 -050036// Grabs the header from the SPIR-V module given in the binary parameter. The
37// endian parameter specifies the endianness of the binary module. On success,
38// returns SPV_SUCCESS and writes the parsed header into *header.
Andrew Woloszyn55ecc2e2015-11-11 11:05:07 -050039spv_result_t spvBinaryHeaderGet(const spv_const_binary binary,
Kenneth Benzie (Benie)83e5a292015-05-22 18:26:19 +010040 const spv_endianness_t endian,
Lei Zhangaf9906e2015-11-16 10:48:43 -050041 spv_header_t* header);
Kenneth Benzie (Benie)83e5a292015-05-22 18:26:19 +010042
Lei Zhang1a0334e2015-11-02 09:41:20 -050043#endif // LIBSPIRV_BINARY_H_