early-access version 1866

This commit is contained in:
pineappleEA 2021-07-09 23:54:15 +02:00
parent 335eeff822
commit 7d21887d40
469 changed files with 201995 additions and 78488 deletions

View File

@ -51,61 +51,7 @@ endif()
# The variable SRC_DIR must be passed into the script (since it uses the current build directory for all values of CMAKE_*_DIR)
set(VIDEO_CORE "${SRC_DIR}/src/video_core")
set(HASH_FILES
"${VIDEO_CORE}/renderer_opengl/gl_arb_decompiler.cpp"
"${VIDEO_CORE}/renderer_opengl/gl_arb_decompiler.h"
"${VIDEO_CORE}/renderer_opengl/gl_shader_cache.cpp"
"${VIDEO_CORE}/renderer_opengl/gl_shader_cache.h"
"${VIDEO_CORE}/renderer_opengl/gl_shader_decompiler.cpp"
"${VIDEO_CORE}/renderer_opengl/gl_shader_decompiler.h"
"${VIDEO_CORE}/renderer_opengl/gl_shader_disk_cache.cpp"
"${VIDEO_CORE}/renderer_opengl/gl_shader_disk_cache.h"
"${VIDEO_CORE}/shader/decode/arithmetic.cpp"
"${VIDEO_CORE}/shader/decode/arithmetic_half.cpp"
"${VIDEO_CORE}/shader/decode/arithmetic_half_immediate.cpp"
"${VIDEO_CORE}/shader/decode/arithmetic_immediate.cpp"
"${VIDEO_CORE}/shader/decode/arithmetic_integer.cpp"
"${VIDEO_CORE}/shader/decode/arithmetic_integer_immediate.cpp"
"${VIDEO_CORE}/shader/decode/bfe.cpp"
"${VIDEO_CORE}/shader/decode/bfi.cpp"
"${VIDEO_CORE}/shader/decode/conversion.cpp"
"${VIDEO_CORE}/shader/decode/ffma.cpp"
"${VIDEO_CORE}/shader/decode/float_set.cpp"
"${VIDEO_CORE}/shader/decode/float_set_predicate.cpp"
"${VIDEO_CORE}/shader/decode/half_set.cpp"
"${VIDEO_CORE}/shader/decode/half_set_predicate.cpp"
"${VIDEO_CORE}/shader/decode/hfma2.cpp"
"${VIDEO_CORE}/shader/decode/image.cpp"
"${VIDEO_CORE}/shader/decode/integer_set.cpp"
"${VIDEO_CORE}/shader/decode/integer_set_predicate.cpp"
"${VIDEO_CORE}/shader/decode/memory.cpp"
"${VIDEO_CORE}/shader/decode/texture.cpp"
"${VIDEO_CORE}/shader/decode/other.cpp"
"${VIDEO_CORE}/shader/decode/predicate_set_predicate.cpp"
"${VIDEO_CORE}/shader/decode/predicate_set_register.cpp"
"${VIDEO_CORE}/shader/decode/register_set_predicate.cpp"
"${VIDEO_CORE}/shader/decode/shift.cpp"
"${VIDEO_CORE}/shader/decode/video.cpp"
"${VIDEO_CORE}/shader/decode/warp.cpp"
"${VIDEO_CORE}/shader/decode/xmad.cpp"
"${VIDEO_CORE}/shader/ast.cpp"
"${VIDEO_CORE}/shader/ast.h"
"${VIDEO_CORE}/shader/compiler_settings.cpp"
"${VIDEO_CORE}/shader/compiler_settings.h"
"${VIDEO_CORE}/shader/control_flow.cpp"
"${VIDEO_CORE}/shader/control_flow.h"
"${VIDEO_CORE}/shader/decode.cpp"
"${VIDEO_CORE}/shader/expr.cpp"
"${VIDEO_CORE}/shader/expr.h"
"${VIDEO_CORE}/shader/node.h"
"${VIDEO_CORE}/shader/node_helper.cpp"
"${VIDEO_CORE}/shader/node_helper.h"
"${VIDEO_CORE}/shader/registry.cpp"
"${VIDEO_CORE}/shader/registry.h"
"${VIDEO_CORE}/shader/shader_ir.cpp"
"${VIDEO_CORE}/shader/shader_ir.h"
"${VIDEO_CORE}/shader/track.cpp"
"${VIDEO_CORE}/shader/transform_feedback.cpp"
"${VIDEO_CORE}/shader/transform_feedback.h"
# ...
)
set(COMBINED "")
foreach (F IN LISTS HASH_FILES)

View File

@ -1,7 +1,7 @@
yuzu emulator early access
=============
This is the source code for early-access 1865.
This is the source code for early-access 1866.
## Legal Notice

View File

@ -48,6 +48,7 @@ source_set("vulkan_headers") {
"include/vulkan/vulkan.h",
"include/vulkan/vulkan.hpp",
"include/vulkan/vulkan_core.h",
"include/vulkan/vulkan_screen.h",
]
public_configs = [ ":vulkan_headers_config" ]
}

View File

@ -46,6 +46,7 @@ target_include_directories(Vulkan-Registry INTERFACE "${CMAKE_CURRENT_SOURCE_DIR
add_library(Vulkan::Registry ALIAS Vulkan-Registry)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/vk_video" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/registry" DESTINATION ${CMAKE_INSTALL_DATADIR}/vulkan)
# uninstall target

View File

@ -4,23 +4,45 @@ Vulkan header files and API registry
## Repository Content
The contents of this repository are largely obtained from other repositories and are
collected, coordinated, and curated here.
The contents of this repository are largely obtained from other repositories
and are collected, coordinated, and curated here.
Do not propose pull requests to this repository which modify any files under
include/vulkan/ or registry/. All such files are generated from the
Vulkan-Docs repository and, in the case of include/vulkan/vulkan.hpp, the
Vulkan-Hpp repository. Any changes must be made in those repositories.
If proposing changes to any file originating from a different repository,
please propose such changes in that repository, rather than Vulkan-Headers.
Files in this repository originate from:
The projects for these repositories are:
### Specification repository (https://github.com/KhronosGroup/Vulkan-Docs)
- [KhronosGroup/Vulkan-Docs](https://github.com/KhronosGroup/Vulkan-Docs)
- Core Vulkan headers and Registry
- [KhronosGroup/Vulkan-Hpp](https://github.com/KhronosGroup/Vulkan-Hpp)
- C++ Bindings for Vulkan
* registry/cgenerator.py
* registry/conventions.py
* registry/generator.py
* registry/genvk.py
* registry/reg.py
* registry/spec_tools/util.py
* registry/validusage.json
* registry/vk.xml
* registry/vkconventions.py
* All files under include/vulkan/ which are *not* listed explicitly as originating from another repository.
Please visit the appropriate project in the above list for obtaining additional information,
asking questions, or opening issues.
### This repository (https://github.com/KhronosGroup/Vulkan-Headers)
* .cmake-format.py
* BUILD.gn
* BUILD.md
* CMakeLists.txt
* CODE_OF_CONDUCT.md
* LICENSE.txt
* README.md
* cmake/Copyright_cmake.txt
* cmake/cmake_uninstall.cmake.in
* Non-API headers (report issues against @lenny-lunarg)
* include/vulkan/vk_icd.h
* include/vulkan/vk_layer.h
* include/vulkan/vk_sdk_platform.h
### Vulkan C++ Binding Repository (https://github.com/KhronosGroup/Vulkan-Hpp)
* include/vulkan/vulkan.hpp
## Version Tagging Scheme

View File

@ -0,0 +1,299 @@
/*
** Copyright (c) 2019-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
#ifndef VULKAN_VIDEO_CODEC_H264STD_H_
#define VULKAN_VIDEO_CODEC_H264STD_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
#include "vk_video/vulkan_video_codecs_common.h"
// Vulkan 0.9 provisional Vulkan video H.264 encode and decode std specification version number
#define VK_STD_VULKAN_VIDEO_CODEC_H264_API_VERSION_0_9 VK_MAKE_VIDEO_STD_VERSION(0, 9, 0) // Patch version should always be set to 0
// Format must be in the form XX.XX where the first two digits are the major and the second two, the minor.
#define VK_STD_VULKAN_VIDEO_CODEC_H264_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_API_VERSION_0_9
#define VK_STD_VULKAN_VIDEO_CODEC_H264_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264"
// *************************************************
// Video H.264 common definitions:
// *************************************************
typedef enum StdVideoH264ChromaFormatIdc {
std_video_h264_chroma_format_idc_monochrome = 0,
std_video_h264_chroma_format_idc_420 = 1,
std_video_h264_chroma_format_idc_422 = 2,
std_video_h264_chroma_format_idc_444 = 3,
} StdVideoH264ChromaFormatIdc;
typedef enum StdVideoH264ProfileIdc {
std_video_h264_profile_idc_baseline = 66, /* Only constrained baseline is supported */
std_video_h264_profile_idc_main = 77,
std_video_h264_profile_idc_high = 100,
std_video_h264_profile_idc_high_444_predictive = 244,
std_video_h264_profile_idc_invalid = 0x7FFFFFFF
} StdVideoH264ProfileIdc;
typedef enum StdVideoH264Level {
std_video_h264_level_1_0 = 0,
std_video_h264_level_1_1 = 1,
std_video_h264_level_1_2 = 2,
std_video_h264_level_1_3 = 3,
std_video_h264_level_2_0 = 4,
std_video_h264_level_2_1 = 5,
std_video_h264_level_2_2 = 6,
std_video_h264_level_3_0 = 7,
std_video_h264_level_3_1 = 8,
std_video_h264_level_3_2 = 9,
std_video_h264_level_4_0 = 10,
std_video_h264_level_4_1 = 11,
std_video_h264_level_4_2 = 12,
std_video_h264_level_5_0 = 13,
std_video_h264_level_5_1 = 14,
std_video_h264_level_5_2 = 15,
std_video_h264_level_6_0 = 16,
std_video_h264_level_6_1 = 17,
std_video_h264_level_6_2 = 18,
std_video_h264_level_invalid = 0x7FFFFFFF
} StdVideoH264Level;
typedef enum StdVideoH264PocType {
std_video_h264_poc_type_0 = 0,
std_video_h264_poc_type_1 = 1,
std_video_h264_poc_type_2 = 2,
std_video_h264_poc_type_invalid = 0x7FFFFFFF
} StdVideoH264PocType;
typedef enum StdVideoH264AspectRatioIdc {
std_video_h264_aspect_ratio_idc_unspecified = 0,
std_video_h264_aspect_ratio_idc_square = 1,
std_video_h264_aspect_ratio_idc_12_11 = 2,
std_video_h264_aspect_ratio_idc_10_11 = 3,
std_video_h264_aspect_ratio_idc_16_11 = 4,
std_video_h264_aspect_ratio_idc_40_33 = 5,
std_video_h264_aspect_ratio_idc_24_11 = 6,
std_video_h264_aspect_ratio_idc_20_11 = 7,
std_video_h264_aspect_ratio_idc_32_11 = 8,
std_video_h264_aspect_ratio_idc_80_33 = 9,
std_video_h264_aspect_ratio_idc_18_11 = 10,
std_video_h264_aspect_ratio_idc_15_11 = 11,
std_video_h264_aspect_ratio_idc_64_33 = 12,
std_video_h264_aspect_ratio_idc_160_99 = 13,
std_video_h264_aspect_ratio_idc_4_3 = 14,
std_video_h264_aspect_ratio_idc_3_2 = 15,
std_video_h264_aspect_ratio_idc_2_1 = 16,
std_video_h264_aspect_ratio_idc_extended_sar = 255,
std_video_h264_aspect_ratio_idc_invalid = 0x7FFFFFFF
} StdVideoH264AspectRatioIdc;
typedef enum StdVideoH264WeightedBiPredIdc {
std_video_h264_default_weighted_b_slices_prediction_idc = 0,
std_video_h264_explicit_weighted_b_slices_prediction_idc = 1,
std_video_h264_implicit_weighted_b_slices_prediction_idc = 2,
std_video_h264_invalid_weighted_b_slices_prediction_idc = 0x7FFFFFFF
} StdVideoH264WeightedBiPredIdc;
typedef enum StdVideoH264ModificationOfPicNumsIdc {
std_video_h264_modification_of_pic_nums_idc_short_term_subtract = 0,
std_video_h264_modification_of_pic_nums_idc_short_term_add = 1,
std_video_h264_modification_of_pic_nums_idc_long_term = 2,
std_video_h264_modification_of_pic_nums_idc_end = 3,
std_video_h264_modification_of_pic_nums_idc_invalid = 0x7FFFFFFF
} StdVideoH264ModificationOfPicNumsIdc;
typedef enum StdVideoH264MemMgmtControlOp {
std_video_h264_mem_mgmt_control_op_end = 0,
std_video_h264_mem_mgmt_control_op_unmark_short_term = 1,
std_video_h264_mem_mgmt_control_op_unmark_long_term = 2,
std_video_h264_mem_mgmt_control_op_mark_long_term = 3,
std_video_h264_mem_mgmt_control_op_set_max_long_term_index = 4,
std_video_h264_mem_mgmt_control_op_unmark_all = 5,
std_video_h264_mem_mgmt_control_op_mark_current_as_long_term = 6,
std_video_h264_mem_mgmt_control_op_invalid = 0x7FFFFFFF
} StdVideoH264MemMgmtControlOp;
typedef enum StdVideoH264CabacInitIdc {
std_video_h264_cabac_init_idc_0 = 0,
std_video_h264_cabac_init_idc_1 = 1,
std_video_h264_cabac_init_idc_2 = 2,
std_video_h264_cabac_init_idc_invalid = 0x7FFFFFFF
} StdVideoH264CabacInitIdc;
typedef enum StdVideoH264DisableDeblockingFilterIdc {
std_video_h264_disable_deblocking_filter_idc_disabled = 0,
std_video_h264_disable_deblocking_filter_idc_enabled = 1,
std_video_h264_disable_deblocking_filter_idc_partial = 2,
std_video_h264_disable_deblocking_filter_idc_invalid = 0x7FFFFFFF
} StdVideoH264DisableDeblockingFilterIdc;
typedef enum StdVideoH264PictureType {
std_video_h264_picture_type_i = 0,
std_video_h264_picture_type_p = 1,
std_video_h264_picture_type_b = 2,
std_video_h264_picture_type_invalid = 0x7FFFFFFF
} StdVideoH264PictureType;
typedef enum StdVideoH264SliceType {
std_video_h264_slice_type_i = 0,
std_video_h264_slice_type_p = 1,
std_video_h264_slice_type_b = 2,
std_video_h264_slice_type_invalid = 0x7FFFFFFF
} StdVideoH264SliceType;
typedef enum StdVideoH264NonVclNaluType {
std_video_h264_non_vcl_nalu_type_sps = 0,
std_video_h264_non_vcl_nalu_type_pps = 1,
std_video_h264_non_vcl_nalu_type_aud = 2,
std_video_h264_non_vcl_nalu_type_prefix = 3,
std_video_h264_non_vcl_nalu_type_end_of_sequence = 4,
std_video_h264_non_vcl_nalu_type_end_of_stream = 5,
std_video_h264_non_vcl_nalu_type_precoded = 6,
std_video_h264_non_vcl_nalu_type_invalid = 0x7FFFFFFF
} StdVideoH264NonVclNaluType;
typedef struct StdVideoH264SpsVuiFlags {
uint32_t aspect_ratio_info_present_flag:1;
uint32_t overscan_info_present_flag:1;
uint32_t overscan_appropriate_flag:1;
uint32_t video_signal_type_present_flag:1;
uint32_t video_full_range_flag:1;
uint32_t color_description_present_flag:1;
uint32_t chroma_loc_info_present_flag:1;
uint32_t timing_info_present_flag:1;
uint32_t fixed_frame_rate_flag:1;
uint32_t bitstream_restriction_flag:1;
uint32_t nal_hrd_parameters_present_flag:1;
uint32_t vcl_hrd_parameters_present_flag:1;
} StdVideoH264SpsVuiFlags;
typedef struct StdVideoH264HrdParameters {
uint8_t cpb_cnt_minus1;
uint8_t bit_rate_scale;
uint8_t cpb_size_scale;
uint32_t bit_rate_value_minus1[32];
uint32_t cpb_size_value_minus1[32];
uint8_t cbr_flag[32];
uint32_t initial_cpb_removal_delay_length_minus1;
uint32_t cpb_removal_delay_length_minus1;
uint32_t dpb_output_delay_length_minus1;
uint32_t time_offset_length;
} StdVideoH264HrdParameters;
typedef struct StdVideoH264SequenceParameterSetVui {
StdVideoH264AspectRatioIdc aspect_ratio_idc;
uint16_t sar_width;
uint16_t sar_height;
uint8_t video_format;
uint8_t color_primaries;
uint8_t transfer_characteristics;
uint8_t matrix_coefficients;
uint32_t num_units_in_tick;
uint32_t time_scale;
StdVideoH264HrdParameters hrd_parameters;
uint8_t num_reorder_frames;
uint8_t max_dec_frame_buffering;
StdVideoH264SpsVuiFlags flags;
} StdVideoH264SequenceParameterSetVui;
typedef struct StdVideoH264SpsFlags {
uint32_t constraint_set0_flag:1;
uint32_t constraint_set1_flag:1;
uint32_t constraint_set2_flag:1;
uint32_t constraint_set3_flag:1;
uint32_t constraint_set4_flag:1;
uint32_t constraint_set5_flag:1;
uint32_t direct_8x8_inference_flag:1;
uint32_t mb_adaptive_frame_field_flag:1;
uint32_t frame_mbs_only_flag:1;
uint32_t delta_pic_order_always_zero_flag:1;
uint32_t residual_colour_transform_flag:1;
uint32_t gaps_in_frame_num_value_allowed_flag:1;
uint32_t first_picture_after_seek_flag:1; // where is this being documented?
uint32_t qpprime_y_zero_transform_bypass_flag:1;
uint32_t frame_cropping_flag:1;
uint32_t scaling_matrix_present_flag:1;
uint32_t vui_parameters_present_flag:1;
} StdVideoH264SpsFlags;
typedef struct StdVideoH264ScalingLists
{
// scaling_list_present_mask has one bit for each
// seq_scaling_list_present_flag[i] for SPS OR
// pic_scaling_list_present_flag[i] for PPS,
// bit 0 - 5 are for each entry of ScalingList4x4
// bit 6 - 7 are for each entry plus 6 for ScalingList8x8
uint8_t scaling_list_present_mask;
// use_default_scaling_matrix_mask has one bit for each
// UseDefaultScalingMatrix4x4Flag[ i ] and
// UseDefaultScalingMatrix8x8Flag[ i - 6 ] for SPS OR PPS
// bit 0 - 5 are for each entry of ScalingList4x4
// bit 6 - 7 are for each entry plus 6 for ScalingList8x8
uint8_t use_default_scaling_matrix_mask;
uint8_t ScalingList4x4[6][16];
uint8_t ScalingList8x8[2][64];
} StdVideoH264ScalingLists;
typedef struct StdVideoH264SequenceParameterSet
{
StdVideoH264ProfileIdc profile_idc;
StdVideoH264Level level_idc;
uint8_t seq_parameter_set_id;
StdVideoH264ChromaFormatIdc chroma_format_idc;
uint8_t bit_depth_luma_minus8;
uint8_t bit_depth_chroma_minus8;
uint8_t log2_max_frame_num_minus4;
StdVideoH264PocType pic_order_cnt_type;
uint8_t log2_max_pic_order_cnt_lsb_minus4;
int32_t offset_for_non_ref_pic;
int32_t offset_for_top_to_bottom_field;
uint8_t num_ref_frames_in_pic_order_cnt_cycle;
uint8_t max_num_ref_frames;
uint32_t pic_width_in_mbs_minus1;
uint32_t pic_height_in_map_units_minus1;
uint32_t frame_crop_left_offset;
uint32_t frame_crop_right_offset;
uint32_t frame_crop_top_offset;
uint32_t frame_crop_bottom_offset;
StdVideoH264SpsFlags flags;
int32_t offset_for_ref_frame[255]; // The number of valid values are defined by the num_ref_frames_in_pic_order_cnt_cycle
StdVideoH264ScalingLists* pScalingLists; // Must be a valid pointer if scaling_matrix_present_flag is set
StdVideoH264SequenceParameterSetVui* pSequenceParameterSetVui; // Must be a valid pointer if StdVideoH264SpsFlags:vui_parameters_present_flag is set
} StdVideoH264SequenceParameterSet;
typedef struct StdVideoH264PpsFlags {
uint32_t transform_8x8_mode_flag:1;
uint32_t redundant_pic_cnt_present_flag:1;
uint32_t constrained_intra_pred_flag:1;
uint32_t deblocking_filter_control_present_flag:1;
uint32_t weighted_bipred_idc_flag:1;
uint32_t weighted_pred_flag:1;
uint32_t pic_order_present_flag:1;
uint32_t entropy_coding_mode_flag:1;
uint32_t scaling_matrix_present_flag:1;
} StdVideoH264PpsFlags;
typedef struct StdVideoH264PictureParameterSet
{
uint8_t seq_parameter_set_id;
uint8_t pic_parameter_set_id;
uint8_t num_ref_idx_l0_default_active_minus1;
uint8_t num_ref_idx_l1_default_active_minus1;
StdVideoH264WeightedBiPredIdc weighted_bipred_idc;
int8_t pic_init_qp_minus26;
int8_t pic_init_qs_minus26;
int8_t chroma_qp_index_offset;
int8_t second_chroma_qp_index_offset;
StdVideoH264PpsFlags flags;
StdVideoH264ScalingLists* pScalingLists; // Must be a valid pointer if StdVideoH264PpsFlags::scaling_matrix_present_flag is set.
} StdVideoH264PictureParameterSet;
#ifdef __cplusplus
}
#endif
#endif // VULKAN_VIDEO_CODEC_H264STD_H_

View File

@ -0,0 +1,87 @@
/*
** Copyright (c) 2019-2020 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
#ifndef VULKAN_VIDEO_CODEC_H264STD_DECODE_H_
#define VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
#include "vk_video/vulkan_video_codec_h264std.h"
// *************************************************
// Video H.264 Decode related parameters:
// *************************************************
typedef struct StdVideoDecodeH264PictureInfoFlags {
uint32_t field_pic_flag:1; // Is field picture
uint32_t is_intra:1; // Is intra picture
uint32_t bottom_field_flag:1; // bottom (true) or top (false) field if field_pic_flag is set.
uint32_t is_reference:1; // This only applies to picture info, and not to the DPB lists.
uint32_t complementary_field_pair:1; // complementary field pair, complementary non-reference field pair, complementary reference field pair
} StdVideoDecodeH264PictureInfoFlags;
typedef struct StdVideoDecodeH264PictureInfo {
uint8_t seq_parameter_set_id; // Selecting SPS from the Picture Parameters
uint8_t pic_parameter_set_id; // Selecting PPS from the Picture Parameters and the SPS
uint16_t reserved; // for structure members 32-bit packing/alignment
uint16_t frame_num; // 7.4.3 Slice header semantics
uint16_t idr_pic_id; // 7.4.3 Slice header semantics
// PicOrderCnt is based on TopFieldOrderCnt and BottomFieldOrderCnt. See 8.2.1 Decoding process for picture order count type 0 - 2
int32_t PicOrderCnt[2]; // TopFieldOrderCnt and BottomFieldOrderCnt fields.
StdVideoDecodeH264PictureInfoFlags flags;
} StdVideoDecodeH264PictureInfo;
typedef struct StdVideoDecodeH264ReferenceInfoFlags {
uint32_t top_field_flag:1; // Reference is used for top field reference.
uint32_t bottom_field_flag:1; // Reference is used for bottom field reference.
uint32_t is_long_term:1; // this is a long term reference
uint32_t is_non_existing:1; // Must be handled in accordance with 8.2.5.2: Decoding process for gaps in frame_num
} StdVideoDecodeH264ReferenceInfoFlags;
typedef struct StdVideoDecodeH264ReferenceInfo {
// FrameNum = is_long_term ? long_term_frame_idx : frame_num
uint16_t FrameNum; // 7.4.3.3 Decoded reference picture marking semantics
uint16_t reserved; // for structure members 32-bit packing/alignment
int32_t PicOrderCnt[2]; // TopFieldOrderCnt and BottomFieldOrderCnt fields.
StdVideoDecodeH264ReferenceInfoFlags flags;
} StdVideoDecodeH264ReferenceInfo;
typedef struct StdVideoDecodeH264MvcElementFlags {
uint32_t non_idr:1;
uint32_t anchor_pic:1;
uint32_t inter_view:1;
} StdVideoDecodeH264MvcElementFlags;
typedef struct StdVideoDecodeH264MvcElement {
StdVideoDecodeH264MvcElementFlags flags;
uint16_t viewOrderIndex;
uint16_t viewId;
uint16_t temporalId; // move out?
uint16_t priorityId; // move out?
uint16_t numOfAnchorRefsInL0;
uint16_t viewIdOfAnchorRefsInL0[15];
uint16_t numOfAnchorRefsInL1;
uint16_t viewIdOfAnchorRefsInL1[15];
uint16_t numOfNonAnchorRefsInL0;
uint16_t viewIdOfNonAnchorRefsInL0[15];
uint16_t numOfNonAnchorRefsInL1;
uint16_t viewIdOfNonAnchorRefsInL1[15];
} StdVideoDecodeH264MvcElement;
typedef struct StdVideoDecodeH264Mvc {
uint32_t viewId0;
uint32_t mvcElementCount;
StdVideoDecodeH264MvcElement* pMvcElements;
} StdVideoDecodeH264Mvc;
#ifdef __cplusplus
}
#endif
#endif // VULKAN_VIDEO_CODEC_H264STD_DECODE_H_

View File

@ -0,0 +1,94 @@
/*
** Copyright (c) 2019-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
#ifndef VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_
#define VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
#include "vk_video/vulkan_video_codec_h264std.h"
// *************************************************
// Video H.264 Encode related parameters:
// *************************************************
typedef struct StdVideoEncodeH264SliceHeaderFlags {
uint32_t idr_flag:1;
uint32_t is_reference_flag:1;
uint32_t num_ref_idx_active_override_flag:1;
uint32_t no_output_of_prior_pics_flag:1;
uint32_t long_term_reference_flag:1;
uint32_t adaptive_ref_pic_marking_mode_flag:1;
uint32_t no_prior_references_available_flag:1;
} StdVideoEncodeH264SliceHeaderFlags;
typedef struct StdVideoEncodeH264PictureInfoFlags {
uint32_t idr_flag:1;
uint32_t is_reference_flag:1;
uint32_t long_term_reference_flag:1;
} StdVideoEncodeH264PictureInfoFlags;
typedef struct StdVideoEncodeH264RefMgmtFlags {
uint32_t ref_pic_list_modification_l0_flag:1;
uint32_t ref_pic_list_modification_l1_flag:1;
} StdVideoEncodeH264RefMgmtFlags;
typedef struct StdVideoEncodeH264RefListModEntry {
StdVideoH264ModificationOfPicNumsIdc modification_of_pic_nums_idc;
uint16_t abs_diff_pic_num_minus1;
uint16_t long_term_pic_num;
} StdVideoEncodeH264RefListModEntry;
typedef struct StdVideoEncodeH264RefPicMarkingEntry {
StdVideoH264MemMgmtControlOp operation;
uint16_t difference_of_pic_nums_minus1;
uint16_t long_term_pic_num;
uint16_t long_term_frame_idx;
uint16_t max_long_term_frame_idx_plus1;
} StdVideoEncodeH264RefPicMarkingEntry;
typedef struct StdVideoEncodeH264RefMemMgmtCtrlOperations {
StdVideoEncodeH264RefMgmtFlags flags;
uint8_t refList0ModOpCount;
StdVideoEncodeH264RefListModEntry* pRefList0ModOperations;
uint8_t refList1ModOpCount;
StdVideoEncodeH264RefListModEntry* pRefList1ModOperations;
uint8_t refPicMarkingOpCount;
StdVideoEncodeH264RefPicMarkingEntry* pRefPicMarkingOperations;
} StdVideoEncodeH264RefMemMgmtCtrlOperations;
typedef struct StdVideoEncodeH264PictureInfo {
StdVideoEncodeH264PictureInfoFlags flags;
StdVideoH264PictureType pictureType;
uint32_t frameNum;
uint32_t pictureOrderCount;
uint16_t long_term_pic_num;
uint16_t long_term_frame_idx;
} StdVideoEncodeH264PictureInfo;
typedef struct StdVideoEncodeH264SliceHeader {
StdVideoEncodeH264SliceHeaderFlags flags;
StdVideoH264SliceType slice_type;
uint8_t seq_parameter_set_id;
uint8_t pic_parameter_set_id;
uint16_t idr_pic_id;
uint8_t num_ref_idx_l0_active_minus1;
uint8_t num_ref_idx_l1_active_minus1;
StdVideoH264CabacInitIdc cabac_init_idc;
StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc;
int8_t slice_alpha_c0_offset_div2;
int8_t slice_beta_offset_div2;
StdVideoEncodeH264RefMemMgmtCtrlOperations* pMemMgmtCtrlOperations;
} StdVideoEncodeH264SliceHeader;
#ifdef __cplusplus
}
#endif
#endif // VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_

View File

@ -0,0 +1,341 @@
/*
** Copyright (c) 2019-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
#ifndef VULKAN_VIDEO_CODEC_H265STD_H_
#define VULKAN_VIDEO_CODEC_H265STD_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
#include "vk_video/vulkan_video_codecs_common.h"
// Vulkan 0.5 version number WIP
#define VK_STD_VULKAN_VIDEO_CODEC_H265_API_VERSION_0_5 VK_MAKE_VIDEO_STD_VERSION(0, 5, 0) // Patch version should always be set to 0
// Format must be in the form XX.XX where the first two digits are the major and the second two, the minor.
#define VK_STD_VULKAN_VIDEO_CODEC_H265_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_API_VERSION_0_5
#define VK_STD_VULKAN_VIDEO_CODEC_H265_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265"
typedef enum StdVideoH265ChromaFormatIdc {
std_video_h265_chroma_format_idc_monochrome = 0,
std_video_h265_chroma_format_idc_420 = 1,
std_video_h265_chroma_format_idc_422 = 2,
std_video_h265_chroma_format_idc_444 = 3,
} StdVideoH265ChromaFormatIdc;
typedef enum StdVideoH265ProfileIdc {
std_video_h265_profile_idc_main = 1,
std_video_h265_profile_idc_main_10 = 2,
std_video_h265_profile_idc_main_still_picture = 3,
std_video_h265_profile_idc_format_range_extensions = 4,
std_video_h265_profile_idc_scc_extensions = 9,
std_video_h265_profile_idc_invalid = 0x7FFFFFFF
} StdVideoH265ProfileIdc;
typedef enum StdVideoH265Level {
std_video_h265_level_1_0 = 0,
std_video_h265_level_2_0 = 1,
std_video_h265_level_2_1 = 2,
std_video_h265_level_3_0 = 3,
std_video_h265_level_3_1 = 4,
std_video_h265_level_4_0 = 5,
std_video_h265_level_4_1 = 6,
std_video_h265_level_5_0 = 7,
std_video_h265_level_5_1 = 8,
std_video_h265_level_5_2 = 9,
std_video_h265_level_6_0 = 10,
std_video_h265_level_6_1 = 11,
std_video_h265_level_6_2 = 12,
std_video_h265_level_invalid = 0x7FFFFFFF
} StdVideoH265Level;
typedef struct StdVideoH265DecPicBufMgr
{
uint32_t max_latency_increase_plus1[7];
uint8_t max_dec_pic_buffering_minus1[7];
uint8_t max_num_reorder_pics[7];
} StdVideoH265DecPicBufMgr;
typedef struct StdVideoH265SubLayerHrdParameters {
uint32_t bit_rate_value_minus1[32];
uint32_t cpb_size_value_minus1[32];
uint32_t cpb_size_du_value_minus1[32];
uint32_t bit_rate_du_value_minus1[32];
uint32_t cbr_flag; // each bit represents a range of CpbCounts (bit 0 - cpb_cnt_minus1) per sub-layer
} StdVideoH265SubLayerHrdParameters;
typedef struct StdVideoH265HrdFlags {
uint32_t nal_hrd_parameters_present_flag : 1;
uint32_t vcl_hrd_parameters_present_flag : 1;
uint32_t sub_pic_hrd_params_present_flag : 1;
uint32_t sub_pic_cpb_params_in_pic_timing_sei_flag : 1;
uint8_t fixed_pic_rate_general_flag; // each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1
uint8_t fixed_pic_rate_within_cvs_flag; // each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1
uint8_t low_delay_hrd_flag; // each bit represents a sublayer, bit 0 - vps_max_sub_layers_minus1
} StdVideoH265HrdFlags;
typedef struct StdVideoH265HrdParameters {
uint8_t tick_divisor_minus2;
uint8_t du_cpb_removal_delay_increment_length_minus1;
uint8_t dpb_output_delay_du_length_minus1;
uint8_t bit_rate_scale;
uint8_t cpb_size_scale;
uint8_t cpb_size_du_scale;
uint8_t initial_cpb_removal_delay_length_minus1;
uint8_t au_cpb_removal_delay_length_minus1;
uint8_t dpb_output_delay_length_minus1;
uint8_t cpb_cnt_minus1[7];
uint16_t elemental_duration_in_tc_minus1[7];
StdVideoH265SubLayerHrdParameters* SubLayerHrdParametersNal[7];
StdVideoH265SubLayerHrdParameters* SubLayerHrdParametersVcl[7];
StdVideoH265HrdFlags flags;
} StdVideoH265HrdParameters;
typedef struct StdVideoH265VpsFlags {
uint32_t vps_temporal_id_nesting_flag : 1;
uint32_t vps_sub_layer_ordering_info_present_flag : 1;
uint32_t vps_timing_info_present_flag : 1;
uint32_t vps_poc_proportional_to_timing_flag : 1;
} StdVideoH265VpsFlags;
typedef struct StdVideoH265VideoParameterSet
{
uint8_t vps_video_parameter_set_id;
uint8_t vps_max_sub_layers_minus1;
uint32_t vps_num_units_in_tick;
uint32_t vps_time_scale;
uint32_t vps_num_ticks_poc_diff_one_minus1;
StdVideoH265DecPicBufMgr* pDecPicBufMgr;
StdVideoH265HrdParameters* hrd_parameters;
StdVideoH265VpsFlags flags;
} StdVideoH265VideoParameterSet;
typedef struct StdVideoH265ScalingLists
{
uint8_t ScalingList4x4[6][16]; // ScalingList[ 0 ][ MatrixID ][ i ] (sizeID = 0)
uint8_t ScalingList8x8[6][64]; // ScalingList[ 1 ][ MatrixID ][ i ] (sizeID = 1)
uint8_t ScalingList16x16[6][64]; // ScalingList[ 2 ][ MatrixID ][ i ] (sizeID = 2)
uint8_t ScalingList32x32[2][64]; // ScalingList[ 3 ][ MatrixID ][ i ] (sizeID = 3)
uint8_t ScalingListDCCoef16x16[6]; // scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8, sizeID = 2
uint8_t ScalingListDCCoef32x32[2]; // scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8. sizeID = 3
} StdVideoH265ScalingLists;
typedef struct StdVideoH265SpsVuiFlags {
uint32_t aspect_ratio_info_present_flag : 1;
uint32_t overscan_info_present_flag : 1;
uint32_t overscan_appropriate_flag : 1;
uint32_t video_signal_type_present_flag : 1;
uint32_t video_full_range_flag : 1;
uint32_t colour_description_present_flag : 1;
uint32_t chroma_loc_info_present_flag : 1;
uint32_t neutral_chroma_indication_flag : 1;
uint32_t field_seq_flag : 1;
uint32_t frame_field_info_present_flag : 1;
uint32_t default_display_window_flag : 1;
uint32_t vui_timing_info_present_flag : 1;
uint32_t vui_poc_proportional_to_timing_flag : 1;
uint32_t vui_hrd_parameters_present_flag : 1;
uint32_t bitstream_restriction_flag : 1;
uint32_t tiles_fixed_structure_flag : 1;
uint32_t motion_vectors_over_pic_boundaries_flag : 1;
uint32_t restricted_ref_pic_lists_flag : 1;
} StdVideoH265SpsVuiFlags;
typedef struct StdVideoH265SequenceParameterSetVui {
uint8_t aspect_ratio_idc;
uint16_t sar_width;
uint16_t sar_height;
uint8_t video_format;
uint8_t colour_primaries;
uint8_t transfer_characteristics;
uint8_t matrix_coeffs;
uint8_t chroma_sample_loc_type_top_field;
uint8_t chroma_sample_loc_type_bottom_field;
uint16_t def_disp_win_left_offset;
uint16_t def_disp_win_right_offset;
uint16_t def_disp_win_top_offset;
uint16_t def_disp_win_bottom_offset;
uint32_t vui_num_units_in_tick;
uint32_t vui_time_scale;
uint32_t vui_num_ticks_poc_diff_one_minus1;
StdVideoH265HrdParameters* hrd_parameters;
uint16_t min_spatial_segmentation_idc;
uint8_t max_bytes_per_pic_denom;
uint8_t max_bits_per_min_cu_denom;
uint8_t log2_max_mv_length_horizontal;
uint8_t log2_max_mv_length_vertical;
StdVideoH265SpsVuiFlags flags;
} StdVideoH265SequenceParameterSetVui;
typedef struct StdVideoH265PredictorPaletteEntries
{
uint16_t PredictorPaletteEntries[3][128];
} StdVideoH265PredictorPaletteEntries;
typedef struct StdVideoH265SpsFlags {
uint32_t sps_temporal_id_nesting_flag : 1;
uint32_t separate_colour_plane_flag : 1;
uint32_t scaling_list_enabled_flag : 1;
uint32_t sps_scaling_list_data_present_flag : 1;
uint32_t amp_enabled_flag : 1;
uint32_t sample_adaptive_offset_enabled_flag : 1;
uint32_t pcm_enabled_flag : 1;
uint32_t pcm_loop_filter_disabled_flag : 1;
uint32_t long_term_ref_pics_present_flag : 1;
uint32_t sps_temporal_mvp_enabled_flag : 1;
uint32_t strong_intra_smoothing_enabled_flag : 1;
uint32_t vui_parameters_present_flag : 1;
uint32_t sps_extension_present_flag : 1;
uint32_t sps_range_extension_flag : 1;
// extension SPS flags, valid when std_video_h265_profile_idc_format_range_extensions is set
uint32_t transform_skip_rotation_enabled_flag : 1;
uint32_t transform_skip_context_enabled_flag : 1;
uint32_t implicit_rdpcm_enabled_flag : 1;
uint32_t explicit_rdpcm_enabled_flag : 1;
uint32_t extended_precision_processing_flag : 1;
uint32_t intra_smoothing_disabled_flag : 1;
uint32_t high_precision_offsets_enabled_flag : 1;
uint32_t persistent_rice_adaptation_enabled_flag : 1;
uint32_t cabac_bypass_alignment_enabled_flag : 1;
// extension SPS flags, valid when std_video_h265_profile_idc_scc_extensions is set
uint32_t sps_curr_pic_ref_enabled_flag : 1;
uint32_t palette_mode_enabled_flag : 1;
uint32_t sps_palette_predictor_initializer_present_flag : 1;
uint32_t intra_boundary_filtering_disabled_flag : 1;
} StdVideoH265SpsFlags;
typedef struct StdVideoH265SequenceParameterSet
{
StdVideoH265ProfileIdc profile_idc;
StdVideoH265Level level_idc;
uint32_t pic_width_in_luma_samples;
uint32_t pic_height_in_luma_samples;
uint8_t sps_video_parameter_set_id;
uint8_t sps_max_sub_layers_minus1;
uint8_t sps_seq_parameter_set_id;
uint8_t chroma_format_idc;
uint8_t bit_depth_luma_minus8;
uint8_t bit_depth_chroma_minus8;
uint8_t log2_max_pic_order_cnt_lsb_minus4;
uint8_t sps_max_dec_pic_buffering_minus1;
uint8_t log2_min_luma_coding_block_size_minus3;
uint8_t log2_diff_max_min_luma_coding_block_size;
uint8_t log2_min_luma_transform_block_size_minus2;
uint8_t log2_diff_max_min_luma_transform_block_size;
uint8_t max_transform_hierarchy_depth_inter;
uint8_t max_transform_hierarchy_depth_intra;
uint8_t num_short_term_ref_pic_sets;
uint8_t num_long_term_ref_pics_sps;
uint8_t pcm_sample_bit_depth_luma_minus1;
uint8_t pcm_sample_bit_depth_chroma_minus1;
uint8_t log2_min_pcm_luma_coding_block_size_minus3;
uint8_t log2_diff_max_min_pcm_luma_coding_block_size;
uint32_t conf_win_left_offset;
uint32_t conf_win_right_offset;
uint32_t conf_win_top_offset;
uint32_t conf_win_bottom_offset;
StdVideoH265DecPicBufMgr* pDecPicBufMgr;
StdVideoH265SpsFlags flags;
StdVideoH265ScalingLists* pScalingLists; // Must be a valid pointer if sps_scaling_list_data_present_flag is set
StdVideoH265SequenceParameterSetVui* pSequenceParameterSetVui; // Must be a valid pointer if StdVideoH265SpsFlags:vui_parameters_present_flag is set palette_max_size;
// extension SPS flags, valid when std_video_h265_profile_idc_scc_extensions is set
uint8_t palette_max_size;
uint8_t delta_palette_max_predictor_size;
uint8_t motion_vector_resolution_control_idc;
uint8_t sps_num_palette_predictor_initializer_minus1;
StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries; // Must be a valid pointer if sps_palette_predictor_initializer_present_flag is set
} StdVideoH265SequenceParameterSet;
typedef struct StdVideoH265PpsFlags {
uint32_t dependent_slice_segments_enabled_flag : 1;
uint32_t output_flag_present_flag : 1;
uint32_t sign_data_hiding_enabled_flag : 1;
uint32_t cabac_init_present_flag : 1;
uint32_t constrained_intra_pred_flag : 1;
uint32_t transform_skip_enabled_flag : 1;
uint32_t cu_qp_delta_enabled_flag : 1;
uint32_t pps_slice_chroma_qp_offsets_present_flag : 1;
uint32_t weighted_pred_flag : 1;
uint32_t weighted_bipred_flag : 1;
uint32_t transquant_bypass_enabled_flag : 1;
uint32_t tiles_enabled_flag : 1;
uint32_t entropy_coding_sync_enabled_flag : 1;
uint32_t uniform_spacing_flag : 1;
uint32_t loop_filter_across_tiles_enabled_flag : 1;
uint32_t pps_loop_filter_across_slices_enabled_flag : 1;
uint32_t deblocking_filter_control_present_flag : 1;
uint32_t deblocking_filter_override_enabled_flag : 1;
uint32_t pps_deblocking_filter_disabled_flag : 1;
uint32_t pps_scaling_list_data_present_flag : 1;
uint32_t lists_modification_present_flag : 1;
uint32_t slice_segment_header_extension_present_flag : 1;
uint32_t pps_extension_present_flag : 1;
// extension PPS flags, valid when std_video_h265_profile_idc_format_range_extensions is set
uint32_t cross_component_prediction_enabled_flag : 1;
uint32_t chroma_qp_offset_list_enabled_flag : 1;
// extension PPS flags, valid when std_video_h265_profile_idc_scc_extensions is set
uint32_t pps_curr_pic_ref_enabled_flag : 1;
uint32_t residual_adaptive_colour_transform_enabled_flag : 1;
uint32_t pps_slice_act_qp_offsets_present_flag : 1;
uint32_t pps_palette_predictor_initializer_present_flag : 1;
uint32_t monochrome_palette_flag : 1;
uint32_t pps_range_extension_flag : 1;
} StdVideoH265PpsFlags;
typedef struct StdVideoH265PictureParameterSet
{
uint8_t pps_pic_parameter_set_id;
uint8_t pps_seq_parameter_set_id;
uint8_t num_extra_slice_header_bits;
uint8_t num_ref_idx_l0_default_active_minus1;
uint8_t num_ref_idx_l1_default_active_minus1;
int8_t init_qp_minus26;
uint8_t diff_cu_qp_delta_depth;
int8_t pps_cb_qp_offset;
int8_t pps_cr_qp_offset;
uint8_t num_tile_columns_minus1;
uint8_t num_tile_rows_minus1;
uint16_t column_width_minus1[19];
uint16_t row_height_minus1[21];
int8_t pps_beta_offset_div2;
int8_t pps_tc_offset_div2;
uint8_t log2_parallel_merge_level_minus2;
StdVideoH265PpsFlags flags;
StdVideoH265ScalingLists* pScalingLists; // Must be a valid pointer if pps_scaling_list_data_present_flag is set
// extension PPS, valid when std_video_h265_profile_idc_format_range_extensions is set
uint8_t log2_max_transform_skip_block_size_minus2;
uint8_t diff_cu_chroma_qp_offset_depth;
uint8_t chroma_qp_offset_list_len_minus1;
int8_t cb_qp_offset_list[6];
int8_t cr_qp_offset_list[6];
uint8_t log2_sao_offset_scale_luma;
uint8_t log2_sao_offset_scale_chroma;
// extension PPS, valid when std_video_h265_profile_idc_scc_extensions is set
int8_t pps_act_y_qp_offset_plus5;
int8_t pps_act_cb_qp_offset_plus5;
int8_t pps_act_cr_qp_offset_plus5;
uint8_t pps_num_palette_predictor_initializer;
uint8_t luma_bit_depth_entry_minus8;
uint8_t chroma_bit_depth_entry_minus8;
StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries; // Must be a valid pointer if pps_palette_predictor_initializer_present_flag is set
} StdVideoH265PictureParameterSet;
#ifdef __cplusplus
}
#endif
#endif // VULKAN_VIDEO_CODEC_H265STD_H_

View File

@ -0,0 +1,59 @@
/*
** Copyright (c) 2019-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
#ifndef VULKAN_VIDEO_CODEC_H265STD_DECODE_H_
#define VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
#include "vk_video/vulkan_video_codec_h265std.h"
// *************************************************
// Video h265 Decode related parameters:
// *************************************************
typedef struct StdVideoDecodeH265PictureInfoFlags {
uint32_t IrapPicFlag : 1;
uint32_t IdrPicFlag : 1;
uint32_t IsReference : 1;
uint32_t short_term_ref_pic_set_sps_flag : 1;
} StdVideoDecodeH265PictureInfoFlags;
typedef struct StdVideoDecodeH265PictureInfo {
uint8_t vps_video_parameter_set_id;
uint8_t sps_seq_parameter_set_id;
uint8_t pps_pic_parameter_set_id;
uint8_t num_short_term_ref_pic_sets;
int32_t PicOrderCntVal;
uint16_t NumBitsForSTRefPicSetInSlice; // number of bits used in st_ref_pic_set()
//when short_term_ref_pic_set_sps_flag is 0; otherwise set to 0.
uint8_t NumDeltaPocsOfRefRpsIdx; // NumDeltaPocs[ RefRpsIdx ] when short_term_ref_pic_set_sps_flag = 1, otherwise 0
uint8_t RefPicSetStCurrBefore[8]; // slotIndex as used in VkVideoReferenceSlotKHR structures representing
//pReferenceSlots in VkVideoDecodeInfoKHR, 0xff for invalid slotIndex
uint8_t RefPicSetStCurrAfter[8]; // slotIndex as used in VkVideoReferenceSlotKHR structures representing
//pReferenceSlots in VkVideoDecodeInfoKHR, 0xff for invalid slotIndex
uint8_t RefPicSetLtCurr[8]; // slotIndex as used in VkVideoReferenceSlotKHR structures representing
//pReferenceSlots in VkVideoDecodeInfoKHR, 0xff for invalid slotIndex
StdVideoDecodeH265PictureInfoFlags flags;
} StdVideoDecodeH265PictureInfo;
typedef struct StdVideoDecodeH265ReferenceInfoFlags {
uint32_t is_long_term : 1;
uint32_t is_non_existing : 1;
} StdVideoDecodeH265ReferenceInfoFlags;
typedef struct StdVideoDecodeH265ReferenceInfo {
int32_t PicOrderCntVal;
StdVideoDecodeH265ReferenceInfoFlags flags;
} StdVideoDecodeH265ReferenceInfo;
#ifdef __cplusplus
}
#endif
#endif // VULKAN_VIDEO_CODEC_H265STD_DECODE_H_

View File

@ -0,0 +1,21 @@
/*
** Copyright (c) 2019-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
#ifndef VULKAN_VIDEO_CODEC_COMMON_H_
#define VULKAN_VIDEO_CODEC_COMMON_H_ 1
#ifdef __cplusplus
extern "C" {
#endif
#define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \
((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch)))
#ifdef __cplusplus
}
#endif
#endif // VULKAN_VIDEO_CODEC_COMMON_H_

View File

@ -41,17 +41,45 @@
// that if the loader is older, it should automatically fail a
// call for any API version > 1.0. Otherwise, the loader will
// manually determine if it can support the expected version.
#define CURRENT_LOADER_ICD_INTERFACE_VERSION 5
// Version 6 - Add support for vk_icdEnumerateAdapterPhysicalDevices.
#define CURRENT_LOADER_ICD_INTERFACE_VERSION 6
#define MIN_SUPPORTED_LOADER_ICD_INTERFACE_VERSION 0
#define MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION 4
typedef VkResult(VKAPI_PTR *PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t *pVersion);
// Old typedefs that don't follow a proper naming convention but are preserved for compatibility
typedef VkResult(VKAPI_PTR *PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t *pVersion);
// This is defined in vk_layer.h which will be found by the loader, but if an ICD is building against this
// file directly, it won't be found.
#ifndef PFN_GetPhysicalDeviceProcAddr
typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName);
#endif
// Typedefs for loader/ICD interface
typedef VkResult (VKAPI_PTR *PFN_vk_icdNegotiateLoaderICDInterfaceVersion)(uint32_t* pVersion);
typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vk_icdGetInstanceProcAddr)(VkInstance instance, const char* pName);
typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vk_icdGetPhysicalDeviceProcAddr)(VkInstance instance, const char* pName);
#if defined(VK_USE_PLATFORM_WIN32_KHR)
typedef VkResult (VKAPI_PTR *PFN_vk_icdEnumerateAdapterPhysicalDevices)(VkInstance instance, LUID adapterLUID,
uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
#endif
// Prototypes for loader/ICD interface
#if !defined(VK_NO_PROTOTYPES)
#ifdef __cplusplus
extern "C" {
#endif
VKAPI_ATTR VkResult VKAPI_CALL vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pVersion);
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(VkInstance instance, const char* pName);
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetPhysicalDeviceProcAddr(VkInstance isntance, const char* pName);
#if defined(VK_USE_PLATFORM_WIN32_KHR)
VKAPI_ATTR VkResult VKAPI_CALL vk_icdEnumerateAdapterPhysicalDevices(VkInstance instance, LUID adapterLUID,
uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
#endif
#ifdef __cplusplus
}
#endif
#endif
/*
* The ICD must reserve space for a pointer for the loader's dispatch
* table, at the start of <each object>.
@ -91,6 +119,10 @@ typedef enum {
VK_ICD_WSI_PLATFORM_DISPLAY,
VK_ICD_WSI_PLATFORM_HEADLESS,
VK_ICD_WSI_PLATFORM_METAL,
VK_ICD_WSI_PLATFORM_DIRECTFB,
VK_ICD_WSI_PLATFORM_VI,
VK_ICD_WSI_PLATFORM_GGP,
VK_ICD_WSI_PLATFORM_SCREEN,
} VkIcdWsiPlatform;
typedef struct {
@ -137,6 +169,14 @@ typedef struct {
} VkIcdSurfaceXlib;
#endif // VK_USE_PLATFORM_XLIB_KHR
#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
typedef struct {
VkIcdSurfaceBase base;
IDirectFB *dfb;
IDirectFBSurface *surface;
} VkIcdSurfaceDirectFB;
#endif // VK_USE_PLATFORM_DIRECTFB_EXT
#ifdef VK_USE_PLATFORM_ANDROID_KHR
typedef struct {
VkIcdSurfaceBase base;
@ -158,6 +198,13 @@ typedef struct {
} VkIcdSurfaceIOS;
#endif // VK_USE_PLATFORM_IOS_MVK
#ifdef VK_USE_PLATFORM_GGP
typedef struct {
VkIcdSurfaceBase base;
GgpStreamDescriptor streamDescriptor;
} VkIcdSurfaceGgp;
#endif // VK_USE_PLATFORM_GGP
typedef struct {
VkIcdSurfaceBase base;
VkDisplayModeKHR displayMode;
@ -180,4 +227,19 @@ typedef struct {
} VkIcdSurfaceMetal;
#endif // VK_USE_PLATFORM_METAL_EXT
#ifdef VK_USE_PLATFORM_VI_NN
typedef struct {
VkIcdSurfaceBase base;
void *window;
} VkIcdSurfaceVi;
#endif // VK_USE_PLATFORM_VI_NN
#ifdef VK_USE_PLATFORM_SCREEN_QNX
typedef struct {
VkIcdSurfaceBase base;
struct _screen_context *context;
struct _screen_window *window;
} VkIcdSurfaceScreen;
#endif // VK_USE_PLATFORM_SCREEN_QNX
#endif // VKICD_H

View File

@ -83,7 +83,8 @@ typedef VkResult(VKAPI_PTR *PFN_PhysDevExt)(VkPhysicalDevice phys_device);
typedef enum VkLayerFunction_ {
VK_LAYER_LINK_INFO = 0,
VK_LOADER_DATA_CALLBACK = 1,
VK_LOADER_LAYER_CREATE_DEVICE_CALLBACK = 2
VK_LOADER_LAYER_CREATE_DEVICE_CALLBACK = 2,
VK_LOADER_FEATURES = 3,
} VkLayerFunction;
typedef struct VkLayerInstanceLink_ {
@ -111,6 +112,12 @@ typedef VkResult (VKAPI_PTR *PFN_vkSetDeviceLoaderData)(VkDevice device,
typedef VkResult (VKAPI_PTR *PFN_vkLayerCreateDevice)(VkInstance instance, VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, PFN_vkGetInstanceProcAddr layerGIPA, PFN_vkGetDeviceProcAddr *nextGDPA);
typedef void (VKAPI_PTR *PFN_vkLayerDestroyDevice)(VkDevice physicalDevice, const VkAllocationCallbacks *pAllocator, PFN_vkDestroyDevice destroyFunction);
typedef enum VkLoaderFeastureFlagBits {
VK_LOADER_FEATURE_PHYSICAL_DEVICE_SORTING = 0x00000001,
} VkLoaderFlagBits;
typedef VkFlags VkLoaderFeatureFlags;
typedef struct {
VkStructureType sType; // VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO
const void *pNext;
@ -122,6 +129,7 @@ typedef struct {
PFN_vkLayerCreateDevice pfnLayerCreateDevice;
PFN_vkLayerDestroyDevice pfnLayerDestroyDevice;
} layerDevice;
VkLoaderFeatureFlags loaderFeatures;
} u;
} VkLayerInstanceCreateInfo;

View File

@ -2,7 +2,7 @@
// File: vk_platform.h
//
/*
** Copyright (c) 2014-2020 The Khronos Group Inc.
** Copyright 2014-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -58,7 +58,9 @@ extern "C"
#define VKAPI_PTR
#endif
#include <stddef.h>
#if !defined(VK_NO_STDDEF_H)
#include <stddef.h>
#endif // !defined(VK_NO_STDDEF_H)
#if !defined(VK_NO_STDINT_H)
#if defined(_MSC_VER) && (_MSC_VER < 1600)

View File

@ -2,7 +2,7 @@
#define VULKAN_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -61,6 +61,12 @@
#endif
#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
#include <directfb.h>
#include "vulkan_directfb.h"
#endif
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
@ -74,6 +80,12 @@
#endif
#ifdef VK_USE_PLATFORM_SCREEN_QNX
#include <screen/screen.h>
#include "vulkan_screen.h"
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
#include "vulkan_beta.h"
#endif

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
#define VULKAN_ANDROID_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,54 @@
#ifndef VULKAN_DIRECTFB_H_
#define VULKAN_DIRECTFB_H_ 1
/*
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
#define VK_EXT_directfb_surface 1
#define VK_EXT_DIRECTFB_SURFACE_SPEC_VERSION 1
#define VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME "VK_EXT_directfb_surface"
typedef VkFlags VkDirectFBSurfaceCreateFlagsEXT;
typedef struct VkDirectFBSurfaceCreateInfoEXT {
VkStructureType sType;
const void* pNext;
VkDirectFBSurfaceCreateFlagsEXT flags;
IDirectFB* dfb;
IDirectFBSurface* surface;
} VkDirectFBSurfaceCreateInfoEXT;
typedef VkResult (VKAPI_PTR *PFN_vkCreateDirectFBSurfaceEXT)(VkInstance instance, const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateDirectFBSurfaceEXT(
VkInstance instance,
const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceDirectFBPresentationSupportEXT(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
IDirectFB* dfb);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -2,7 +2,7 @@
#define VULKAN_FUCHSIA_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -40,6 +40,80 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA(
VkSurfaceKHR* pSurface);
#endif
#define VK_FUCHSIA_external_memory 1
#define VK_FUCHSIA_EXTERNAL_MEMORY_SPEC_VERSION 1
#define VK_FUCHSIA_EXTERNAL_MEMORY_EXTENSION_NAME "VK_FUCHSIA_external_memory"
typedef struct VkImportMemoryZirconHandleInfoFUCHSIA {
VkStructureType sType;
const void* pNext;
VkExternalMemoryHandleTypeFlagBits handleType;
zx_handle_t handle;
} VkImportMemoryZirconHandleInfoFUCHSIA;
typedef struct VkMemoryZirconHandlePropertiesFUCHSIA {
VkStructureType sType;
void* pNext;
uint32_t memoryTypeBits;
} VkMemoryZirconHandlePropertiesFUCHSIA;
typedef struct VkMemoryGetZirconHandleInfoFUCHSIA {
VkStructureType sType;
const void* pNext;
VkDeviceMemory memory;
VkExternalMemoryHandleTypeFlagBits handleType;
} VkMemoryGetZirconHandleInfoFUCHSIA;
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryZirconHandleFUCHSIA)(VkDevice device, const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle, VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandleFUCHSIA(
VkDevice device,
const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
zx_handle_t* pZirconHandle);
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandlePropertiesFUCHSIA(
VkDevice device,
VkExternalMemoryHandleTypeFlagBits handleType,
zx_handle_t zirconHandle,
VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties);
#endif
#define VK_FUCHSIA_external_semaphore 1
#define VK_FUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION 1
#define VK_FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_FUCHSIA_external_semaphore"
typedef struct VkImportSemaphoreZirconHandleInfoFUCHSIA {
VkStructureType sType;
const void* pNext;
VkSemaphore semaphore;
VkSemaphoreImportFlags flags;
VkExternalSemaphoreHandleTypeFlagBits handleType;
zx_handle_t zirconHandle;
} VkImportSemaphoreZirconHandleInfoFUCHSIA;
typedef struct VkSemaphoreGetZirconHandleInfoFUCHSIA {
VkStructureType sType;
const void* pNext;
VkSemaphore semaphore;
VkExternalSemaphoreHandleTypeFlagBits handleType;
} VkSemaphoreGetZirconHandleInfoFUCHSIA;
typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreZirconHandleFUCHSIA)(VkDevice device, const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo);
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreZirconHandleFUCHSIA)(VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreZirconHandleFUCHSIA(
VkDevice device,
const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo);
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreZirconHandleFUCHSIA(
VkDevice device,
const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
zx_handle_t* pZirconHandle);
#endif
#ifdef __cplusplus
}
#endif

View File

@ -2,7 +2,7 @@
#define VULKAN_GGP_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@ -2,7 +2,7 @@
#define VULKAN_IOS_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -20,7 +20,7 @@ extern "C" {
#define VK_MVK_ios_surface 1
#define VK_MVK_IOS_SURFACE_SPEC_VERSION 2
#define VK_MVK_IOS_SURFACE_SPEC_VERSION 3
#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface"
typedef VkFlags VkIOSSurfaceCreateFlagsMVK;
typedef struct VkIOSSurfaceCreateInfoMVK {

View File

@ -2,7 +2,7 @@
#define VULKAN_MACOS_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@ -20,7 +20,7 @@ extern "C" {
#define VK_MVK_macos_surface 1
#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2
#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 3
#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface"
typedef VkFlags VkMacOSSurfaceCreateFlagsMVK;
typedef struct VkMacOSSurfaceCreateInfoMVK {

View File

@ -2,7 +2,7 @@
#define VULKAN_METAL_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@ -0,0 +1,54 @@
#ifndef VULKAN_SCREEN_H_
#define VULKAN_SCREEN_H_ 1
/*
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
#define VK_QNX_screen_surface 1
#define VK_QNX_SCREEN_SURFACE_SPEC_VERSION 1
#define VK_QNX_SCREEN_SURFACE_EXTENSION_NAME "VK_QNX_screen_surface"
typedef VkFlags VkScreenSurfaceCreateFlagsQNX;
typedef struct VkScreenSurfaceCreateInfoQNX {
VkStructureType sType;
const void* pNext;
VkScreenSurfaceCreateFlagsQNX flags;
struct _screen_context* context;
struct _screen_window* window;
} VkScreenSurfaceCreateInfoQNX;
typedef VkResult (VKAPI_PTR *PFN_vkCreateScreenSurfaceQNX)(VkInstance instance, const VkScreenSurfaceCreateInfoQNX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct _screen_window* window);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateScreenSurfaceQNX(
VkInstance instance,
const VkScreenSurfaceCreateInfoQNX* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceScreenPresentationSupportQNX(
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
struct _screen_window* window);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -2,7 +2,7 @@
#define VULKAN_VI_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@ -2,7 +2,7 @@
#define VULKAN_WAYLAND_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@ -2,7 +2,7 @@
#define VULKAN_WIN32_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@ -2,7 +2,7 @@
#define VULKAN_XCB_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@ -2,7 +2,7 @@
#define VULKAN_XLIB_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@ -2,7 +2,7 @@
#define VULKAN_XLIB_XRANDR_H_ 1
/*
** Copyright (c) 2015-2020 The Khronos Group Inc.
** Copyright 2015-2021 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#
# Copyright (c) 2013-2020 The Khronos Group Inc.
# Copyright 2013-2021 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
@ -32,6 +32,8 @@ class CGeneratorOptions(GeneratorOptions):
genEnumBeginEndRange=False,
genAliasMacro=False,
aliasMacro='',
misracstyle=False,
misracppstyle=False,
**kwargs
):
"""Constructor.
@ -68,7 +70,10 @@ class CGeneratorOptions(GeneratorOptions):
be generated for enumerated types
- genAliasMacro - True if the OpenXR alias macro should be generated
for aliased types (unclear what other circumstances this is useful)
- aliasMacro - alias macro to inject when genAliasMacro is True"""
- aliasMacro - alias macro to inject when genAliasMacro is True
- misracstyle - generate MISRA C-friendly headers
- misracppstyle - generate MISRA C++-friendly headers"""
GeneratorOptions.__init__(self, **kwargs)
self.prefixText = prefixText
@ -116,6 +121,12 @@ class CGeneratorOptions(GeneratorOptions):
self.aliasMacro = aliasMacro
"""alias macro to inject when genAliasMacro is True"""
self.misracstyle = misracstyle
"""generate MISRA C-friendly headers"""
self.misracppstyle = misracppstyle
"""generate MISRA C++-friendly headers"""
self.codeGenerator = True
"""True if this generator makes compilable code"""
@ -380,13 +391,11 @@ class COutputGenerator(OutputGenerator):
self.appendSection(section, "\n" + body)
def genEnum(self, enuminfo, name, alias):
"""Generate enumerants.
"""Generate the C declaration for a constant (a single <enum> value)."""
<enum> tags may specify their values in several ways, but are usually
just integers."""
OutputGenerator.genEnum(self, enuminfo, name, alias)
(_, strVal) = self.enumToValue(enuminfo.elem, False)
body = '#define ' + name.ljust(33) + ' ' + strVal
body = self.buildConstantCDecl(enuminfo, name, alias)
self.appendSection('enum', body)
def genCmd(self, cmdinfo, name, alias):
@ -403,3 +412,9 @@ class COutputGenerator(OutputGenerator):
self.appendSection('command', prefix + decls[0] + '\n')
if self.genOpts.genFuncPointers:
self.appendSection('commandPointer', decls[1])
def misracstyle(self):
return self.genOpts.misracstyle;
def misracppstyle(self):
return self.genOpts.misracppstyle;

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#
# Copyright (c) 2013-2020 The Khronos Group Inc.
# Copyright 2013-2021 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#
# Copyright (c) 2013-2020 The Khronos Group Inc.
# Copyright 2013-2021 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
"""Base class for source/header/doc generators, as well as some utility functions."""
@ -118,6 +118,7 @@ class GeneratorOptions:
addExtensions=None,
removeExtensions=None,
emitExtensions=None,
emitSpirv=None,
reparentEnums=True,
sortProcedure=regSortFeatures):
"""Constructor.
@ -148,6 +149,9 @@ class GeneratorOptions:
- emitExtensions - regex matching names of extensions to actually emit
interfaces for (though all requested versions are considered when
deciding which interfaces to generate).
to None.
- emitSpirv - regex matching names of extensions and capabilities
to actually emit interfaces for.
- reparentEnums - move <enum> elements which extend an enumerated
type from <feature> or <extension> elements to the target <enums>
element. This is required for almost all purposes, but the
@ -209,6 +213,10 @@ class GeneratorOptions:
interfaces for (though all requested versions are considered when
deciding which interfaces to generate)."""
self.emitSpirv = self.emptyRegex(emitSpirv)
"""regex matching names of extensions and capabilities
to actually emit interfaces for."""
self.reparentEnums = reparentEnums
"""boolean specifying whether to remove <enum> elements from
<feature> or <extension> when extending an <enums> type."""
@ -298,7 +306,7 @@ class OutputGenerator:
raise UserWarning(
'*** FATAL ERROR in Generator.logMsg: unknown level:' + level)
def enumToValue(self, elem, needsNum):
def enumToValue(self, elem, needsNum, bitwidth = 32, forceSuffix = False):
"""Parse and convert an `<enum>` tag into a value.
Returns a list:
@ -334,6 +342,11 @@ class OutputGenerator:
# t = enuminfo.elem.get('type')
# if t is not None and t != '' and t != 'i' and t != 's':
# value += enuminfo.type
if forceSuffix:
if bitwidth == 64:
value = value + 'ULL'
else:
value = value + 'U'
self.logMsg('diag', 'Enum', name, '-> value [', numVal, ',', value, ']')
return [numVal, value]
if 'bitpos' in elem.keys():
@ -341,8 +354,10 @@ class OutputGenerator:
bitpos = int(value, 0)
numVal = 1 << bitpos
value = '0x%08x' % numVal
if bitpos >= 32:
if bitwidth == 64:
value = value + 'ULL'
elif forceSuffix:
value = value + 'U'
self.logMsg('diag', 'Enum', name, '-> bitpos [', numVal, ',', value, ']')
return [numVal, value]
if 'offset' in elem.keys():
@ -370,7 +385,7 @@ class OutputGenerator:
return [None, None]
def checkDuplicateEnums(self, enums):
"""Sanity check enumerated values.
"""Check enumerated values for duplicates.
- enums - list of `<enum>` Elements
@ -425,6 +440,12 @@ class OutputGenerator:
# Return the list
return stripped
def misracstyle(self):
return False;
def misracppstyle(self):
return False;
def buildEnumCDecl(self, expand, groupinfo, groupName):
"""Generate the C declaration for an enum"""
groupElem = groupinfo.elem
@ -445,47 +466,69 @@ class OutputGenerator:
self.logMsg('error', 'Invalid value for bitwidth attribute (', groupElem.get('bitwidth'), ') for ', groupName, ' - must be an integer value\n')
exit(1)
# Bitmask types support 64-bit flags, so have different handling
if groupElem.get('type') == 'bitmask':
usebitmask = False
usedefine = False
# Bitmask flags can be generated as either "static const uint{32,64}_t" values,
# or as 32-bit C enums. 64-bit types must use uint64_t values.
if groupElem.get('type') == 'bitmask':
if bitwidth > 32 or self.misracppstyle():
usebitmask = True
if self.misracstyle():
usedefine = True
if usedefine or usebitmask:
# Validate the bitwidth and generate values appropriately
# Bitmask flags up to 64-bit are generated as static const uint64_t values
# Bitmask flags up to 32-bit are generated as C enum values
if bitwidth > 64:
self.logMsg('error', 'Invalid value for bitwidth attribute (', groupElem.get('bitwidth'), ') for bitmask type ', groupName, ' - must be less than or equal to 64\n')
exit(1)
elif bitwidth > 32:
return self.buildEnumCDecl_Bitmask(groupinfo, groupName)
else:
return self.buildEnumCDecl_Enum(expand, groupinfo, groupName)
return self.buildEnumCDecl_BitmaskOrDefine(groupinfo, groupName, bitwidth, usedefine)
else:
# Validate the bitwidth and generate values appropriately
# Enum group types up to 32-bit are generated as C enum values
if bitwidth > 32:
self.logMsg('error', 'Invalid value for bitwidth attribute (', groupElem.get('bitwidth'), ') for enum type ', groupName, ' - must be less than or equal to 32\n')
exit(1)
else:
return self.buildEnumCDecl_Enum(expand, groupinfo, groupName)
def buildEnumCDecl_Bitmask(self, groupinfo, groupName):
def buildEnumCDecl_BitmaskOrDefine(self, groupinfo, groupName, bitwidth, usedefine):
"""Generate the C declaration for an "enum" that is actually a
set of flag bits"""
groupElem = groupinfo.elem
flagTypeName = groupinfo.flagType.elem.get('name')
flagTypeName = groupElem.get('name')
# Prefix
body = "// Flag bits for " + flagTypeName + "\n"
if bitwidth == 64:
body += "typedef VkFlags64 %s;\n" % flagTypeName;
else:
body += "typedef VkFlags %s;\n" % flagTypeName;
# Maximum allowable value for a flag (unsigned 64-bit integer)
maxValidValue = 2**(64) - 1
minValidValue = 0
# Get a list of nested 'enum' tags.
enums = groupElem.findall('enum')
# Check for and report duplicates, and return a list with them
# removed.
enums = self.checkDuplicateEnums(enums)
# Accumulate non-numeric enumerant values separately and append
# them following the numeric values, to allow for aliases.
# NOTE: this doesn't do a topological sort yet, so aliases of
# aliases can still get in the wrong order.
aliasText = ''
# Loop over the nested 'enum' tags.
for elem in groupElem.findall('enum'):
for elem in enums:
# Convert the value to an integer and use that to track min/max.
# Values of form -(number) are accepted but nothing more complex.
# Should catch exceptions here for more complex constructs. Not yet.
(numVal, strVal) = self.enumToValue(elem, True)
(numVal, strVal) = self.enumToValue(elem, True, bitwidth, True)
name = elem.get('name')
# Range check for the enum value
@ -493,7 +536,36 @@ class OutputGenerator:
self.logMsg('error', 'Allowable range for flag types in C is [', minValidValue, ',', maxValidValue, '], but', name, 'flag has a value outside of this (', strVal, ')\n')
exit(1)
body += "static const {} {} = {};\n".format(flagTypeName, name, strVal)
decl = self.genRequirements(name, mustBeFound = False)
if self.isEnumRequired(elem):
protect = elem.get('protect')
if protect is not None:
body += '#ifdef {}\n'.format(protect)
if usedefine:
decl += "#define {} {}\n".format(name, strVal)
elif self.misracppstyle():
decl += "static constexpr {} {} {{{}}};\n".format(flagTypeName, name, strVal)
else:
# Some C compilers only allow initializing a 'static const' variable with a literal value.
# So initializing an alias from another 'static const' value would fail to compile.
# Work around this by chasing the aliases to get the actual value.
while numVal is None:
alias = self.registry.tree.find("enums/enum[@name='" + strVal + "']")
(numVal, strVal) = self.enumToValue(alias, True)
decl += "static const {} {} = {};\n".format(flagTypeName, name, strVal)
if numVal is not None:
body += decl
else:
aliasText += decl
if protect is not None:
body += '#endif\n'
# Now append the non-numeric enumerant values
body += aliasText
# Postfix
@ -505,7 +577,7 @@ class OutputGenerator:
# Break the group name into prefix and suffix portions for range
# enum generation
expandName = re.sub(r'([0-9a-z_])([A-Z0-9])', r'\1_\2', groupName).upper()
expandName = re.sub(r'([0-9]+|[a-z_])([A-Z0-9])', r'\1_\2', groupName).upper()
expandPrefix = expandName
expandSuffix = ''
expandSuffixMatch = re.search(r'[A-Z][A-Z]+$', groupName)
@ -553,7 +625,22 @@ class OutputGenerator:
# Extension enumerants are only included if they are required
if self.isEnumRequired(elem):
decl = " {} = {},".format(name, strVal)
decl = ''
protect = elem.get('protect')
if protect is not None:
decl += '#ifdef {}\n'.format(protect)
# Indent requirements comment, if there is one
requirements = self.genRequirements(name, mustBeFound = False)
if requirements != '':
requirements = ' ' + requirements
decl += requirements
decl += ' {} = {},'.format(name, strVal)
if protect is not None:
decl += '\n#endif'
if numVal is not None:
body.append(decl)
else:
@ -564,7 +651,6 @@ class OutputGenerator:
self.logMsg('error', 'Allowable range for C enum types is [', minValidValue, ',', maxValidValue, '], but', name, 'has a value outside of this (', strVal, ')\n')
exit(1)
# Don't track min/max for non-numbers (numVal is None)
if isEnum and numVal is not None and elem.get('extends') is None:
if minName is None:
@ -605,6 +691,47 @@ class OutputGenerator:
return (section, '\n'.join(body))
def buildConstantCDecl(self, enuminfo, name, alias):
"""Generate the C declaration for a constant (a single <enum>
value).
<enum> tags may specify their values in several ways, but are
usually just integers or floating-point numbers."""
(_, strVal) = self.enumToValue(enuminfo.elem, False)
if self.misracppstyle() and enuminfo.elem.get('type') and not alias:
# Generate e.g.: static constexpr uint32_t x = ~static_cast<uint32_t>(1U);
# This appeases MISRA "underlying type" rules.
typeStr = enuminfo.elem.get('type');
invert = '~' in strVal
number = strVal.strip("()~UL")
if typeStr != "float":
number += 'U'
strVal = "~" if invert else ""
strVal += "static_cast<" + typeStr + ">(" + number + ")"
body = 'static constexpr ' + typeStr.ljust(9) + name.ljust(33) + ' {' + strVal + '};'
elif enuminfo.elem.get('type') and not alias:
# Generate e.g.: #define x (~0ULL)
typeStr = enuminfo.elem.get('type');
invert = '~' in strVal
paren = '(' in strVal
number = strVal.strip("()~UL")
if typeStr != "float":
if typeStr == "uint64_t":
number += 'ULL'
else:
number += 'U'
strVal = "~" if invert else ""
strVal += number
if paren:
strVal = "(" + strVal + ")";
body = '#define ' + name.ljust(33) + ' ' + strVal;
else:
body = '#define ' + name.ljust(33) + ' ' + strVal
return body
def makeDir(self, path):
"""Create a directory, if not already done.
@ -683,6 +810,20 @@ class OutputGenerator:
self.featureName = None
self.featureExtraProtect = None
def genRequirements(self, name, mustBeFound = True):
"""Generate text showing what core versions and extensions introduce
an API. This exists in the base Generator class because it's used by
the shared enumerant-generating interfaces (buildEnumCDecl, etc.).
Here it returns an empty string for most generators, but can be
overridden by e.g. DocGenerator.
- name - name of the API
- mustBeFound - If True, when requirements for 'name' cannot be
determined, a warning comment is generated.
"""
return ''
def validateFeature(self, featureType, featureName):
"""Validate we're generating something only inside a `<feature>` tag"""
if self.featureName is None:
@ -738,6 +879,14 @@ class OutputGenerator:
Extend to generate as desired in your derived class."""
self.validateFeature('command', cmdinfo)
def genSpirv(self, spirv, spirvinfo, alias):
"""Generate interface for a spirv element.
- spirvinfo - SpirvInfo for a command
Extend to generate as desired in your derived class."""
return
def makeProtoName(self, name, tail):
"""Turn a `<proto>` `<name>` into C-language prototype
and typedef declarations for that name.
@ -759,7 +908,9 @@ class OutputGenerator:
- aligncol - if non-zero, attempt to align the nested `<name>` element
at this column"""
indent = ' '
paramdecl = indent + noneStr(param.text)
paramdecl = indent
prefix = noneStr(param.text)
for elem in param:
text = noneStr(elem.text)
tail = noneStr(elem.tail)
@ -778,7 +929,16 @@ class OutputGenerator:
paramdecl = paramdecl.ljust(aligncol - 1) + ' '
newLen = len(paramdecl)
self.logMsg('diag', 'Adjust length of parameter decl from', oldLen, 'to', newLen, ':', paramdecl)
paramdecl += text + tail
if (self.misracppstyle() and prefix.find('const ') != -1):
# Change pointer type order from e.g. "const void *" to "void const *".
# If the string starts with 'const', reorder it to be after the first type.
paramdecl += prefix.replace('const ', '') + text + ' const' + tail
else:
paramdecl += prefix + text + tail
# Clear prefix for subsequent iterations
prefix = ''
if aligncol == 0:
# Squeeze out multiple spaces other than the indentation
paramdecl = indent + ' '.join(paramdecl.split())
@ -985,6 +1145,26 @@ class OutputGenerator:
# Non-indented parameters
paramdecl = '('
if n > 0:
paramnames = []
if self.misracppstyle():
for p in params:
param = ''
firstIter = True;
for t in p.itertext():
if (firstIter):
prefix = t
firstIter = False
else:
# Change pointer type order from e.g. "const void *" to "void const *".
# If the string starts with 'const', reorder it to be after the first type.
if (prefix.find('const ') != -1):
param += prefix.replace('const ', '') + t + ' const '
else:
param += prefix + t
# Clear prefix for subsequent iterations
prefix = ''
paramnames.append(param);
else:
paramnames = (''.join(t for t in p.itertext())
for p in params)
paramdecl += ', '.join(paramnames)

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3
#
# Copyright (c) 2013-2020 The Khronos Group Inc.
# Copyright 2013-2021 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
@ -17,6 +17,7 @@ from extensionmetadocgenerator import (ExtensionMetaDocGeneratorOptions,
ExtensionMetaDocOutputGenerator)
from interfacedocgenerator import InterfaceDocGenerator
from generator import write
from spirvcapgenerator import SpirvCapabilityOutputGenerator
from hostsyncgenerator import HostSynchronizationOutputGenerator
from pygenerator import PyOutputGenerator
from reflib import logDiag, logWarn, setLogFile
@ -73,6 +74,9 @@ def makeGenOpts(args):
# Extensions to emit (list of extensions)
emitExtensions = args.emitExtensions
# SPIR-V capabilities / features to emit (list of extensions & capabilities)
emitSpirv = args.emitSpirv
# Features to include (list of features)
features = args.feature
@ -85,21 +89,28 @@ def makeGenOpts(args):
# Path to generated files, particularly api.py
genpath = args.genpath
# Generate MISRA C-friendly headers
misracstyle = args.misracstyle;
# Generate MISRA C++-friendly headers
misracppstyle = args.misracppstyle;
# Descriptive names for various regexp patterns used to select
# versions and extensions
allFeatures = allExtensions = r'.*'
allSpirv = allFeatures = allExtensions = r'.*'
# Turn lists of names/patterns into matching regular expressions
addExtensionsPat = makeREstring(extensions, None)
removeExtensionsPat = makeREstring(removeExtensions, None)
emitExtensionsPat = makeREstring(emitExtensions, allExtensions)
emitSpirvPat = makeREstring(emitSpirv, allSpirv)
featuresPat = makeREstring(features, allFeatures)
# Copyright text prefixing all headers (list of strings).
# The SPDX formatting below works around constraints of the 'reuse' tool
prefixStrings = [
'/*',
'** Copyright (c) 2015-2020 The Khronos Group Inc.',
'** Copyright 2015-2021 The Khronos Group Inc.',
'**',
'** SPDX' + '-License-Identifier: Apache-2.0',
'*/',
@ -249,6 +260,25 @@ def makeGenOpts(args):
reparentEnums = False)
]
genOpts['spirvcapinc'] = [
SpirvCapabilityOutputGenerator,
DocGeneratorOptions(
conventions = conventions,
filename = 'timeMarker',
directory = directory,
genpath = None,
apiname = 'vulkan',
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = None,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
emitSpirv = emitSpirvPat,
reparentEnums = False)
]
# Platform extensions, in their own header files
# Each element of the platforms[] array defines information for
# generating a single platform:
@ -269,14 +299,25 @@ def makeGenOpts(args):
# Extensions required and suppressed for beta "platform". This can
# probably eventually be derived from the requires= attributes of
# the extension blocks.
betaRequireExtensions = [ 'VK_KHR_ray_tracing', 'VK_KHR_deferred_host_operations', 'VK_KHR_pipeline_library' ]
betaSuppressExtensions = [ 'VK_NV_ray_tracing' ]
betaRequireExtensions = [
'VK_KHR_portability_subset',
'VK_KHR_video_queue',
'VK_KHR_video_decode_queue',
'VK_KHR_video_encode_queue',
'VK_EXT_video_decode_h264',
'VK_EXT_video_decode_h265',
'VK_EXT_video_encode_h264',
]
betaSuppressExtensions = []
platforms = [
[ 'vulkan_android.h', [ 'VK_KHR_android_surface',
'VK_ANDROID_external_memory_android_hardware_buffer'
], commonSuppressExtensions ],
[ 'vulkan_fuchsia.h', [ 'VK_FUCHSIA_imagepipe_surface'], commonSuppressExtensions ],
[ 'vulkan_fuchsia.h', [ 'VK_FUCHSIA_imagepipe_surface',
'VK_FUCHSIA_external_memory',
'VK_FUCHSIA_external_semaphore' ], commonSuppressExtensions ],
[ 'vulkan_ggp.h', [ 'VK_GGP_stream_descriptor_surface',
'VK_GGP_frame_token' ], commonSuppressExtensions ],
[ 'vulkan_ios.h', [ 'VK_MVK_ios_surface' ], commonSuppressExtensions ],
@ -294,8 +335,10 @@ def makeGenOpts(args):
] ],
[ 'vulkan_xcb.h', [ 'VK_KHR_xcb_surface' ], commonSuppressExtensions ],
[ 'vulkan_xlib.h', [ 'VK_KHR_xlib_surface' ], commonSuppressExtensions ],
[ 'vulkan_directfb.h', [ 'VK_EXT_directfb_surface' ], commonSuppressExtensions ],
[ 'vulkan_xlib_xrandr.h', [ 'VK_EXT_acquire_xlib_display' ], commonSuppressExtensions ],
[ 'vulkan_metal.h', [ 'VK_EXT_metal_surface' ], commonSuppressExtensions ],
[ 'vulkan_screen.h', [ 'VK_QNX_screen_surface' ], commonSuppressExtensions ],
[ 'vulkan_beta.h', betaRequireExtensions, betaSuppressExtensions ],
]
@ -331,7 +374,9 @@ def makeGenOpts(args):
apicall = 'VKAPI_ATTR ',
apientry = 'VKAPI_CALL ',
apientryp = 'VKAPI_PTR *',
alignFuncParam = 48)
alignFuncParam = 48,
misracstyle = misracstyle,
misracppstyle = misracppstyle)
genOpts[headername] = [ COutputGenerator, opts ]
@ -370,7 +415,9 @@ def makeGenOpts(args):
apicall = 'VKAPI_ATTR ',
apientry = 'VKAPI_CALL ',
apientryp = 'VKAPI_PTR *',
alignFuncParam = 48)
alignFuncParam = 48,
misracstyle = misracstyle,
misracppstyle = misracppstyle)
]
# Unused - vulkan10.h target.
@ -402,7 +449,9 @@ def makeGenOpts(args):
apicall = 'VKAPI_ATTR ',
apientry = 'VKAPI_CALL ',
apientryp = 'VKAPI_PTR *',
alignFuncParam = 48)
alignFuncParam = 48,
misracstyle = misracstyle,
misracppstyle = misracppstyle)
]
# Unused - vulkan11.h target.
@ -434,7 +483,9 @@ def makeGenOpts(args):
apicall = 'VKAPI_ATTR ',
apientry = 'VKAPI_CALL ',
apientryp = 'VKAPI_PTR *',
alignFuncParam = 48)
alignFuncParam = 48,
misracstyle = misracstyle,
misracppstyle = misracppstyle)
]
genOpts['alias.h'] = [
@ -481,6 +532,8 @@ def genTarget(args):
# Create generator options with parameters specified on command line
makeGenOpts(args)
# pdb.set_trace()
# Select a generator matching the requested target
if args.target in genOpts:
createGenerator = genOpts[args.target][0]
@ -522,6 +575,9 @@ if __name__ == '__main__':
parser.add_argument('-emitExtensions', action='append',
default=[],
help='Specify an extension or extensions to emit in targets')
parser.add_argument('-emitSpirv', action='append',
default=[],
help='Specify a SPIR-V extension or capability to emit in targets')
parser.add_argument('-feature', action='append',
default=[],
help='Specify a core API feature name or names to add to targets')
@ -557,6 +613,10 @@ if __name__ == '__main__':
help='Suppress script output during normal execution.')
parser.add_argument('-verbose', action='store_false', dest='quiet', default=True,
help='Enable script output during normal execution.')
parser.add_argument('-misracstyle', dest='misracstyle', action='store_true',
help='generate MISRA C-friendly headers')
parser.add_argument('-misracppstyle', dest='misracppstyle', action='store_true',
help='generate MISRA C++-friendly headers')
args = parser.parse_args()

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#
# Copyright 2013-2020 The Khronos Group Inc.
# Copyright 2013-2021 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
@ -12,7 +12,7 @@ import sys
import xml.etree.ElementTree as etree
from collections import defaultdict, namedtuple
from generator import OutputGenerator, GeneratorOptions, write
import pdb
def apiNameMatch(str, supported):
"""Return whether a required api name matches a pattern specified for an
@ -253,6 +253,12 @@ class FeatureInfo(BaseInfo):
self.number = 0
self.supported = elem.get('supported')
class SpirvInfo(BaseInfo):
"""Registry information about an API <spirvextensions>
or <spirvcapability>."""
def __init__(self, elem):
BaseInfo.__init__(self, elem)
class Registry:
"""Object representing an API registry, loaded from an XML file."""
@ -299,6 +305,12 @@ class Registry:
self.extdict = {}
"dictionary of FeatureInfo objects for `<extension>` elements keyed by extension name"
self.spirvextdict = {}
"dictionary of FeatureInfo objects for `<spirvextension>` elements keyed by spirv extension name"
self.spirvcapdict = {}
"dictionary of FeatureInfo objects for `<spirvcapability>` elements keyed by spirv capability name"
self.emitFeatures = False
"""True to actually emit features for a version / extension,
or False to just treat them as emitted"""
@ -344,10 +356,10 @@ class Registry:
Intended for internal use only.
- elem - `<type>`/`<enums>`/`<enum>`/`<command>`/`<feature>`/`<extension>` Element
- info - corresponding {Type|Group|Enum|Cmd|Feature}Info object
- infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' / 'extension'
- dictionary - self.{type|group|enum|cmd|api|ext}dict
- elem - `<type>`/`<enums>`/`<enum>`/`<command>`/`<feature>`/`<extension>`/`<spirvextension>`/`<spirvcapability>` Element
- info - corresponding {Type|Group|Enum|Cmd|Feature|Spirv}Info object
- infoName - 'type' / 'group' / 'enum' / 'command' / 'feature' / 'extension' / 'spirvextension' / 'spirvcapability'
- dictionary - self.{type|group|enum|cmd|api|ext|spirvext|spirvcap}dict
If the Element has an 'api' attribute, the dictionary key is the
tuple (name,api). If not, the key is the name. 'name' is an
@ -591,6 +603,15 @@ class Registry:
for parent in self.validextensionstructs:
self.validextensionstructs[parent].sort()
# Parse out all spirv tags in dictionaries
# Use addElementInfo to catch duplicates
for spirv in self.reg.findall('spirvextensions/spirvextension'):
spirvInfo = SpirvInfo(spirv)
self.addElementInfo(spirv, spirvInfo, 'spirvextension', self.spirvextdict)
for spirv in self.reg.findall('spirvcapabilities/spirvcapability'):
spirvInfo = SpirvInfo(spirv)
self.addElementInfo(spirv, spirvInfo, 'spirvcapability', self.spirvcapdict)
def dumpReg(self, maxlen=120, filehandle=sys.stdout):
"""Dump all the dictionaries constructed from the Registry object.
@ -623,6 +644,13 @@ class Registry:
for key in self.extdict:
write(' Extension', key, '->',
etree.tostring(self.extdict[key].elem)[0:maxlen], file=filehandle)
write('// SPIR-V', file=filehandle)
for key in self.spirvextdict:
write(' SPIR-V Extension', key, '->',
etree.tostring(self.spirvextdict[key].elem)[0:maxlen], file=filehandle)
for key in self.spirvcapdict:
write(' SPIR-V Capability', key, '->',
etree.tostring(self.spirvcapdict[key].elem)[0:maxlen], file=filehandle)
def markTypeRequired(self, typename, required):
"""Require (along with its dependencies) or remove (but not its dependencies) a type.
@ -1126,6 +1154,19 @@ class Registry:
for c in features.findall('command'):
self.generateFeature(c.get('name'), 'command', self.cmddict)
def generateSpirv(self, spirv, dictionary):
if spirv is None:
self.gen.logMsg('diag', 'No entry found for element', name,
'returning!')
return
name = spirv.elem.get('name')
# No known alias for spirv elements
alias = None
if spirv.emit:
genProc = self.gen.genSpirv
genProc(spirv, name, alias)
def apiGen(self):
"""Generate interface for specified versions using the current
generator and generator options"""
@ -1145,6 +1186,7 @@ class Registry:
regAddExtensions = re.compile(self.genOpts.addExtensions)
regRemoveExtensions = re.compile(self.genOpts.removeExtensions)
regEmitExtensions = re.compile(self.genOpts.emitExtensions)
regEmitSpirv = re.compile(self.genOpts.emitSpirv)
# Get all matching API feature names & add to list of FeatureInfo
# Note we used to select on feature version attributes, not names.
@ -1202,7 +1244,13 @@ class Registry:
# the regexp specified in the generator options. This allows
# forcing extensions into an interface even if they're not
# tagged appropriately in the registry.
# However we still respect the 'supported' attribute.
if regAddExtensions.match(extName) is not None:
if not apiNameMatch(self.genOpts.apiname, ei.elem.get('supported')):
self.gen.logMsg('diag', 'NOT including extension',
extName, '(matches explicitly requested, but does not match the \'supported\' attribute)')
include = False
else:
self.gen.logMsg('diag', 'Including extension',
extName, '(matches explicitly requested extensions to add)')
include = True
@ -1233,6 +1281,20 @@ class Registry:
self.gen.logMsg('diag', 'NOT including extension',
extName, '(does not match api attribute or explicitly requested extensions)')
# Add all spirv elements to list
# generators decide to emit them all or not
# Currently no filtering as no client of these elements needs filtering
spirvexts = []
for key in self.spirvextdict:
si = self.spirvextdict[key]
si.emit = (regEmitSpirv.match(key) is not None)
spirvexts.append(si)
spirvcaps = []
for key in self.spirvcapdict:
si = self.spirvcapdict[key]
si.emit = (regEmitSpirv.match(key) is not None)
spirvcaps.append(si)
# Sort the features list, if a sort procedure is defined
if self.genOpts.sortProcedure:
self.genOpts.sortProcedure(features)
@ -1271,6 +1333,11 @@ class Registry:
self.gen.beginFeature(f.elem, emit)
self.generateRequiredInterface(f.elem)
self.gen.endFeature()
# Generate spirv elements
for s in spirvexts:
self.generateSpirv(s, self.spirvextdict)
for s in spirvcaps:
self.generateSpirv(s, self.spirvcapdict)
self.gen.endFile()
def apiReset(self):

View File

@ -1,6 +1,6 @@
"""Utility functions not closely tied to other spec_tools types."""
# Copyright (c) 2018-2019 Collabora, Ltd.
# Copyright (c) 2013-2020 The Khronos Group Inc.
# Copyright 2018-2019 Collabora, Ltd.
# Copyright 2013-2021 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 -i
#
# Copyright (c) 2013-2020 The Khronos Group Inc.
# Copyright 2013-2021 The Khronos Group Inc.
#
# SPDX-License-Identifier: Apache-2.0
@ -87,6 +87,7 @@ class VulkanConventions(ConventionsBase):
def generate_structure_type_from_name(self, structname):
"""Generate a structure type name, like VK_STRUCTURE_TYPE_CREATE_INSTANCE_INFO"""
structure_type_parts = []
# Tokenize into "words"
for elem in MAIN_RE.findall(structname):
@ -95,7 +96,18 @@ class VulkanConventions(ConventionsBase):
structure_type_parts.append('VK_STRUCTURE_TYPE')
else:
structure_type_parts.append(word.upper())
return '_'.join(structure_type_parts)
name = '_'.join(structure_type_parts)
# The simple-minded rules need modification for some structure names
subpats = [
[ r'_H_(26[45])_', r'_H\1_' ],
[ r'_VULKAN_([0-9])([0-9])_', r'_VULKAN_\1_\2_' ],
[ r'_DIRECT_FB_', r'_DIRECTFB_' ],
]
for subpat in subpats:
name = re.sub(subpat[0], subpat[1], name)
return name
@property
def warning_comment(self):

View File

@ -17,7 +17,7 @@ if (NOT CMAKE_BUILD_TYPE)
endif()
# Set hard requirements for C++
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

View File

@ -1,2 +1,3 @@
build
out
.DS_Store

View File

@ -0,0 +1,166 @@
package(
default_visibility = ["//visibility:public"],
)
licenses(["notice"])
exports_files(["LICENSE"])
filegroup(
name = "spirv_core_grammar_1.0",
srcs = ["include/spirv/1.0/spirv.core.grammar.json"],
)
filegroup(
name = "spirv_glsl_grammar_1.0",
srcs = ["include/spirv/1.0/extinst.glsl.std.450.grammar.json"],
)
filegroup(
name = "spirv_opencl_grammar_1.0",
srcs = ["include/spirv/1.0/extinst.opencl.std.100.grammar.json"],
)
filegroup(
name = "spirv_core_grammar_1.1",
srcs = ["include/spirv/1.1/spirv.core.grammar.json"],
)
filegroup(
name = "spirv_glsl_grammar_1.1",
srcs = ["include/spirv/1.1/extinst.glsl.std.450.grammar.json"],
)
filegroup(
name = "spirv_opencl_grammar_1.1",
srcs = ["include/spirv/1.1/extinst.opencl.std.100.grammar.json"],
)
filegroup(
name = "spirv_core_grammar_1.2",
srcs = ["include/spirv/1.2/spirv.core.grammar.json"],
)
filegroup(
name = "spirv_glsl_grammar_1.2",
srcs = ["include/spirv/1.2/extinst.glsl.std.450.grammar.json"],
)
filegroup(
name = "spirv_opencl_grammar_1.2",
srcs = ["include/spirv/1.2/extinst.opencl.std.100.grammar.json"],
)
filegroup(
name = "spirv_core_grammar_unified1",
srcs = ["include/spirv/unified1/spirv.core.grammar.json"],
)
filegroup(
name = "spirv_glsl_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.glsl.std.450.grammar.json"],
)
filegroup(
name = "spirv_opencl_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.opencl.std.100.grammar.json"],
)
filegroup(
name = "spirv_xml_registry",
srcs = ["include/spirv/spir-v.xml"],
)
filegroup(
name = "spirv_ext_inst_debuginfo_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.debuginfo.grammar.json"],
)
filegroup(
name = "spirv_ext_inst_nonsemantic_clspvreflection_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json"],
)
filegroup(
name = "spirv_ext_inst_nonsemantic_debugprintf_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.nonsemantic.debugprintf.grammar.json"],
)
filegroup(
name = "spirv_ext_inst_opencl_debuginfo_100_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"],
)
filegroup(
name = "spirv_ext_inst_spv_amd_gcn_shader_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.spv-amd-gcn-shader.grammar.json"],
)
filegroup(
name = "spirv_ext_inst_spv_amd_shader_ballot_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.spv-amd-shader-ballot.grammar.json"],
)
filegroup(
name = "spirv_ext_inst_spv_amd_shader_explicit_vertex_parameter_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json"],
)
filegroup(
name = "spirv_ext_inst_spv_amd_shader_trinary_minmax_grammar_unified1",
srcs = ["include/spirv/unified1/extinst.spv-amd-shader-trinary-minmax.grammar.json"],
)
cc_library(
name = "spirv_common_headers",
hdrs = [
"include/spirv/1.0/GLSL.std.450.h",
"include/spirv/1.0/OpenCL.std.h",
"include/spirv/1.1/GLSL.std.450.h",
"include/spirv/1.1/OpenCL.std.h",
"include/spirv/1.2/GLSL.std.450.h",
"include/spirv/1.2/OpenCL.std.h",
"include/spirv/unified1/GLSL.std.450.h",
"include/spirv/unified1/NonSemanticClspvReflection.h",
"include/spirv/unified1/NonSemanticDebugPrintf.h",
"include/spirv/unified1/OpenCL.std.h",
],
includes = ["include"],
)
cc_library(
name = "spirv_c_headers",
hdrs = [
"include/spirv/1.0/spirv.h",
"include/spirv/1.1/spirv.h",
"include/spirv/1.2/spirv.h",
"include/spirv/unified1/spirv.h",
],
includes = ["include"],
deps = [":spirv_common_headers"],
)
cc_library(
name = "spirv_cpp_headers",
hdrs = [
"include/spirv/1.0/spirv.hpp",
"include/spirv/1.1/spirv.hpp",
"include/spirv/1.2/spirv.hpp",
"include/spirv/unified1/spirv.hpp",
],
includes = ["include"],
deps = [":spirv_common_headers"],
)
cc_library(
name = "spirv_cpp11_headers",
hdrs = [
"include/spirv/1.0/spirv.hpp11",
"include/spirv/1.1/spirv.hpp11",
"include/spirv/1.2/spirv.hpp11",
"include/spirv/unified1/spirv.hpp11",
],
includes = ["include"],
deps = [":spirv_common_headers"],
)

View File

@ -0,0 +1,44 @@
# Copyright (c) 2020 Google LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and/or associated documentation files (the "Materials"),
# to deal in the Materials without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Materials, and to permit persons to whom the
# Materials are furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Materials.
#
# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
# STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
# HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
#
# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
# IN THE MATERIALS.
config("spv_headers_public_config") {
include_dirs = [ "include" ]
}
source_set("spv_headers") {
sources = [
"include/spirv/1.2/GLSL.std.450.h",
"include/spirv/1.2/OpenCL.std.h",
"include/spirv/1.2/spirv.h",
"include/spirv/1.2/spirv.hpp",
"include/spirv/unified1/GLSL.std.450.h",
"include/spirv/unified1/NonSemanticClspvReflection.h",
"include/spirv/unified1/NonSemanticDebugPrintf.h",
"include/spirv/unified1/OpenCL.std.h",
"include/spirv/unified1/spirv.h",
"include/spirv/unified1/spirv.hpp",
]
public_configs = [ ":spv_headers_public_config" ]
}

View File

@ -28,8 +28,8 @@
# The SPIR-V headers from the SPIR-V Registry
# https://www.khronos.org/registry/spir-v/
#
cmake_minimum_required(VERSION 2.8.11)
project(SPIRV-Headers)
cmake_minimum_required(VERSION 3.0)
project(SPIRV-Headers VERSION 1.5.1)
# There are two ways to use this project.
#
@ -44,17 +44,84 @@ project(SPIRV-Headers)
# 2. cmake ..
# 3. cmake --build . --target install
file(GLOB_RECURSE HEADER_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
include/spirv/*)
foreach(HEADER_FILE ${HEADER_FILES})
get_filename_component(HEADER_INSTALL_DIR ${HEADER_FILE} PATH)
install(FILES ${HEADER_FILE} DESTINATION ${HEADER_INSTALL_DIR})
endforeach()
# legacy
add_custom_target(install-headers
COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv
$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/include/spirv)
add_subdirectory(example)
option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples"
${SPIRV_HEADERS_SKIP_EXAMPLES})
option(SPIRV_HEADERS_SKIP_INSTALL "Skip install"
${SPIRV_HEADERS_SKIP_INSTALL})
if(NOT ${SPIRV_HEADERS_SKIP_EXAMPLES})
set(SPIRV_HEADERS_ENABLE_EXAMPLES ON)
endif()
if(NOT ${SPIRV_HEADERS_SKIP_INSTALL})
set(SPIRV_HEADERS_ENABLE_INSTALL ON)
endif()
if (SPIRV_HEADERS_ENABLE_EXAMPLES)
message(STATUS "Building SPIRV-Header examples")
add_subdirectory(example)
endif()
include(GNUInstallDirs)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
# Installation
if (SPIRV_HEADERS_ENABLE_INSTALL)
message(STATUS "Installing SPIRV-Header")
set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
set(namespace "${PROJECT_NAME}::")
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${version_config}"
COMPATIBILITY SameMajorVersion
)
configure_package_config_file(
"cmake/Config.cmake.in"
"${project_config}"
INSTALL_DESTINATION "${config_install_dir}"
)
install(
TARGETS ${PROJECT_NAME}
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
DIRECTORY include/spirv
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
FILES "${project_config}" "${version_config}"
DESTINATION "${config_install_dir}"
)
install(
EXPORT "${TARGETS_EXPORT_NAME}"
NAMESPACE "${namespace}"
DESTINATION "${config_install_dir}"
)
endif()

View File

@ -0,0 +1 @@
A reminder that this issue tracker is managed by the Khronos Group. Interactions here should follow the Khronos Code of Conduct (https://www.khronos.org/developers/code-of-conduct), which prohibits aggressive or derogatory language. Please keep the discussion friendly and civil.

View File

@ -23,12 +23,33 @@ When a new version or revision of the SPIR-V specification is published,
the SPIR-V Working Group will push new commits onto master, updating
the files under [include](include).
The SPIR-V XML registry file is updated by Khronos whenever a new enum range is allocated.
[The SPIR-V XML registry file](include/spirv/spir-v.xml)
is updated by Khronos whenever a new enum range is allocated.
Pull requests can be made to
- request allocation of new enum ranges in the XML registry file
- register a new magic number for a SPIR-V generator
- reserve specific tokens in the JSON grammar
### Registering a SPIR-V Generator Magic Number
Tools that generate SPIR-V should use a magic number in the SPIR-V to help identify the
generator.
Care should be taken to follow existing precedent in populating the details of reserved tokens.
This includes:
- keeping generator numbers in numeric order
- filling out all the existing fields
### Reserving tokens in the JSON grammar
Care should be taken to follow existing precedent in populating the details of reserved tokens.
This includes:
- pointing to what extension has more information, when possible
- keeping enumerants in numeric order
- when there are aliases, listing the preferred spelling first
- adding the statement `"version" : "None"`
## How to install the headers
```
@ -45,6 +66,7 @@ If you want to install them somewhere else, then use
## Using the headers without installing
### Using CMake
A CMake-based project can use the headers without installing, as follows:
1. Add an `add_subdirectory` directive to include this source tree.
@ -61,7 +83,56 @@ A CMake-based project can use the headers without installing, as follows:
See also the [example](example/) subdirectory. But since that example is
*inside* this repostory, it doesn't use and `add_subdirectory` directive.
## Generating the headers from the JSON grammar
### Using Bazel
A Bazel-based project can use the headers without installing, as follows:
1. Add SPIRV-Headers as a submodule of your project, and add a
`local_repository` to your `WORKSPACE` file. For example, if you place
SPIRV-Headers under `external/spirv-headers`, then add the following to your
`WORKSPACE` file:
```
local_repository(
name = "spirv_headers",
path = "external/spirv-headers",
)
```
2. Add one of the following to the `deps` attribute of your build target based
on your needs:
```
@spirv_headers//:spirv_c_headers
@spirv_headers//:spirv_cpp_headers
@spirv_headers//:spirv_cpp11_headers
```
For example:
```
cc_library(
name = "project",
srcs = [
# Path to project sources
],
hdrs = [
# Path to project headers
],
deps = [
"@spirv_tools//:spirv_c_headers",
# Other dependencies,
],
)
```
3. In your C or C++ source code use `#include` directives that explicitly mention
the `spirv` path component.
```
#include "spirv/unified1/GLSL.std.450.h"
#include "spirv/unified1/OpenCL.std.h"
#include "spirv/unified1/spirv.hpp"
```
## Generating headers from the JSON grammar for the SPIR-V core instruction set
This will generally be done by Khronos, for a change to the JSON grammar.
However, the project for the tool to do this is included in this repository,
@ -79,6 +150,26 @@ Notes:
and that influences the languages used, for legacy reasons
- the C++ structures built may similarly include more than strictly necessary, for the same reason
## Generating C headers for extended instruction sets
The [GLSL.std.450.h](include/spirv/unified1/GLSL.std.450.h)
and [OpenCL.std.h](include/spirv/unified1/OpenCL.std.h) extended instruction set headers
are maintained manually.
The C/C++ header for each of the other extended instruction sets
is generated from the corresponding JSON grammar file. For example, the
[OpenCLDebugInfo100.h](include/spirv/unified1/OpenCLDebugInfo100.h) header
is generated from the
[extinst.opencl.debuginfo.100.grammar.json](include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json)
grammar file.
To generate these C/C++ headers, first make sure `python3` is in your PATH, then
invoke the build script as follows:
```
cd tools/buildHeaders
python3 bin/makeExtinstHeaders.py
```
## FAQ
* *How are different versions published?*

View File

View File

@ -0,0 +1,4 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
check_required_components("@PROJECT_NAME@")

View File

@ -2,8 +2,3 @@ add_library(SPIRV-Headers-example
${CMAKE_CURRENT_SOURCE_DIR}/example.cpp)
target_include_directories(SPIRV-Headers-example
PRIVATE ${SPIRV-Headers_SOURCE_DIR}/include)
add_library(SPIRV-Headers-example-1.1
${CMAKE_CURRENT_SOURCE_DIR}/example-1.1.cpp)
target_include_directories(SPIRV-Headers-example-1.1
PRIVATE ${SPIRV-Headers_SOURCE_DIR}/include)

View File

@ -24,9 +24,9 @@
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
#include <spirv/1.0/GLSL.std.450.h>
#include <spirv/1.0/OpenCL.std.h>
#include <spirv/1.0/spirv.hpp>
#include <spirv/unified1/GLSL.std.450.h>
#include <spirv/unified1/OpenCL.std.h>
#include <spirv/unified1/spirv.hpp>
namespace {

View File

@ -0,0 +1,993 @@
// Copyright (c) 2014-2018 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
// to deal in the Materials without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Materials, and to permit persons to whom the
// Materials are furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
// IN THE MATERIALS.
// This header is automatically generated by the same tool that creates
// the Binary Section of the SPIR-V specification.
// Enumeration tokens for SPIR-V, in various styles:
// C, C++, C++11, JSON, Lua, Python, C#
//
// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
// - C# will use enum classes in the Specification class located in the "Spv" namespace, e.g.: Spv.Specification.SourceLanguage.GLSL
//
// Some tokens act like mask values, which can be OR'd together,
// while others are mutually exclusive. The mask-like ones have
// "Mask" in their name, and a parallel enum that has the shift
// amount (1 << x) for each corresponding enumerant.
namespace Spv
{
public static class Specification
{
public const uint MagicNumber = 0x07230203;
public const uint Version = 0x00010000;
public const uint Revision = 12;
public const uint OpCodeMask = 0xffff;
public const uint WordCountShift = 16;
public enum SourceLanguage
{
Unknown = 0,
ESSL = 1,
GLSL = 2,
OpenCL_C = 3,
OpenCL_CPP = 4,
HLSL = 5,
}
public enum ExecutionModel
{
Vertex = 0,
TessellationControl = 1,
TessellationEvaluation = 2,
Geometry = 3,
Fragment = 4,
GLCompute = 5,
Kernel = 6,
}
public enum AddressingModel
{
Logical = 0,
Physical32 = 1,
Physical64 = 2,
}
public enum MemoryModel
{
Simple = 0,
GLSL450 = 1,
OpenCL = 2,
}
public enum ExecutionMode
{
Invocations = 0,
SpacingEqual = 1,
SpacingFractionalEven = 2,
SpacingFractionalOdd = 3,
VertexOrderCw = 4,
VertexOrderCcw = 5,
PixelCenterInteger = 6,
OriginUpperLeft = 7,
OriginLowerLeft = 8,
EarlyFragmentTests = 9,
PointMode = 10,
Xfb = 11,
DepthReplacing = 12,
DepthGreater = 14,
DepthLess = 15,
DepthUnchanged = 16,
LocalSize = 17,
LocalSizeHint = 18,
InputPoints = 19,
InputLines = 20,
InputLinesAdjacency = 21,
Triangles = 22,
InputTrianglesAdjacency = 23,
Quads = 24,
Isolines = 25,
OutputVertices = 26,
OutputPoints = 27,
OutputLineStrip = 28,
OutputTriangleStrip = 29,
VecTypeHint = 30,
ContractionOff = 31,
PostDepthCoverage = 4446,
StencilRefReplacingEXT = 5027,
}
public enum StorageClass
{
UniformConstant = 0,
Input = 1,
Uniform = 2,
Output = 3,
Workgroup = 4,
CrossWorkgroup = 5,
Private = 6,
Function = 7,
Generic = 8,
PushConstant = 9,
AtomicCounter = 10,
Image = 11,
StorageBuffer = 12,
}
public enum Dim
{
Dim1D = 0,
Dim2D = 1,
Dim3D = 2,
Cube = 3,
Rect = 4,
Buffer = 5,
SubpassData = 6,
}
public enum SamplerAddressingMode
{
None = 0,
ClampToEdge = 1,
Clamp = 2,
Repeat = 3,
RepeatMirrored = 4,
}
public enum SamplerFilterMode
{
Nearest = 0,
Linear = 1,
}
public enum ImageFormat
{
Unknown = 0,
Rgba32f = 1,
Rgba16f = 2,
R32f = 3,
Rgba8 = 4,
Rgba8Snorm = 5,
Rg32f = 6,
Rg16f = 7,
R11fG11fB10f = 8,
R16f = 9,
Rgba16 = 10,
Rgb10A2 = 11,
Rg16 = 12,
Rg8 = 13,
R16 = 14,
R8 = 15,
Rgba16Snorm = 16,
Rg16Snorm = 17,
Rg8Snorm = 18,
R16Snorm = 19,
R8Snorm = 20,
Rgba32i = 21,
Rgba16i = 22,
Rgba8i = 23,
R32i = 24,
Rg32i = 25,
Rg16i = 26,
Rg8i = 27,
R16i = 28,
R8i = 29,
Rgba32ui = 30,
Rgba16ui = 31,
Rgba8ui = 32,
R32ui = 33,
Rgb10a2ui = 34,
Rg32ui = 35,
Rg16ui = 36,
Rg8ui = 37,
R16ui = 38,
R8ui = 39,
}
public enum ImageChannelOrder
{
R = 0,
A = 1,
RG = 2,
RA = 3,
RGB = 4,
RGBA = 5,
BGRA = 6,
ARGB = 7,
Intensity = 8,
Luminance = 9,
Rx = 10,
RGx = 11,
RGBx = 12,
Depth = 13,
DepthStencil = 14,
sRGB = 15,
sRGBx = 16,
sRGBA = 17,
sBGRA = 18,
ABGR = 19,
}
public enum ImageChannelDataType
{
SnormInt8 = 0,
SnormInt16 = 1,
UnormInt8 = 2,
UnormInt16 = 3,
UnormShort565 = 4,
UnormShort555 = 5,
UnormInt101010 = 6,
SignedInt8 = 7,
SignedInt16 = 8,
SignedInt32 = 9,
UnsignedInt8 = 10,
UnsignedInt16 = 11,
UnsignedInt32 = 12,
HalfFloat = 13,
Float = 14,
UnormInt24 = 15,
UnormInt101010_2 = 16,
}
public enum ImageOperandsShift
{
Bias = 0,
Lod = 1,
Grad = 2,
ConstOffset = 3,
Offset = 4,
ConstOffsets = 5,
Sample = 6,
MinLod = 7,
}
public enum ImageOperandsMask
{
MaskNone = 0,
Bias = 0x00000001,
Lod = 0x00000002,
Grad = 0x00000004,
ConstOffset = 0x00000008,
Offset = 0x00000010,
ConstOffsets = 0x00000020,
Sample = 0x00000040,
MinLod = 0x00000080,
}
public enum FPFastMathModeShift
{
NotNaN = 0,
NotInf = 1,
NSZ = 2,
AllowRecip = 3,
Fast = 4,
}
public enum FPFastMathModeMask
{
MaskNone = 0,
NotNaN = 0x00000001,
NotInf = 0x00000002,
NSZ = 0x00000004,
AllowRecip = 0x00000008,
Fast = 0x00000010,
}
public enum FPRoundingMode
{
RTE = 0,
RTZ = 1,
RTP = 2,
RTN = 3,
}
public enum LinkageType
{
Export = 0,
Import = 1,
}
public enum AccessQualifier
{
ReadOnly = 0,
WriteOnly = 1,
ReadWrite = 2,
}
public enum FunctionParameterAttribute
{
Zext = 0,
Sext = 1,
ByVal = 2,
Sret = 3,
NoAlias = 4,
NoCapture = 5,
NoWrite = 6,
NoReadWrite = 7,
}
public enum Decoration
{
RelaxedPrecision = 0,
SpecId = 1,
Block = 2,
BufferBlock = 3,
RowMajor = 4,
ColMajor = 5,
ArrayStride = 6,
MatrixStride = 7,
GLSLShared = 8,
GLSLPacked = 9,
CPacked = 10,
BuiltIn = 11,
NoPerspective = 13,
Flat = 14,
Patch = 15,
Centroid = 16,
Sample = 17,
Invariant = 18,
Restrict = 19,
Aliased = 20,
Volatile = 21,
Constant = 22,
Coherent = 23,
NonWritable = 24,
NonReadable = 25,
Uniform = 26,
SaturatedConversion = 28,
Stream = 29,
Location = 30,
Component = 31,
Index = 32,
Binding = 33,
DescriptorSet = 34,
Offset = 35,
XfbBuffer = 36,
XfbStride = 37,
FuncParamAttr = 38,
FPRoundingMode = 39,
FPFastMathMode = 40,
LinkageAttributes = 41,
NoContraction = 42,
InputAttachmentIndex = 43,
Alignment = 44,
ExplicitInterpAMD = 4999,
OverrideCoverageNV = 5248,
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
SecondaryViewportRelativeNV = 5256,
HlslCounterBufferGOOGLE = 5634,
HlslSemanticGOOGLE = 5635,
}
public enum BuiltIn
{
Position = 0,
PointSize = 1,
ClipDistance = 3,
CullDistance = 4,
VertexId = 5,
InstanceId = 6,
PrimitiveId = 7,
InvocationId = 8,
Layer = 9,
ViewportIndex = 10,
TessLevelOuter = 11,
TessLevelInner = 12,
TessCoord = 13,
PatchVertices = 14,
FragCoord = 15,
PointCoord = 16,
FrontFacing = 17,
SampleId = 18,
SamplePosition = 19,
SampleMask = 20,
FragDepth = 22,
HelperInvocation = 23,
NumWorkgroups = 24,
WorkgroupSize = 25,
WorkgroupId = 26,
LocalInvocationId = 27,
GlobalInvocationId = 28,
LocalInvocationIndex = 29,
WorkDim = 30,
GlobalSize = 31,
EnqueuedWorkgroupSize = 32,
GlobalOffset = 33,
GlobalLinearId = 34,
SubgroupSize = 36,
SubgroupMaxSize = 37,
NumSubgroups = 38,
NumEnqueuedSubgroups = 39,
SubgroupId = 40,
SubgroupLocalInvocationId = 41,
VertexIndex = 42,
InstanceIndex = 43,
SubgroupEqMaskKHR = 4416,
SubgroupGeMaskKHR = 4417,
SubgroupGtMaskKHR = 4418,
SubgroupLeMaskKHR = 4419,
SubgroupLtMaskKHR = 4420,
BaseVertex = 4424,
BaseInstance = 4425,
DrawIndex = 4426,
DeviceIndex = 4438,
ViewIndex = 4440,
BaryCoordNoPerspAMD = 4992,
BaryCoordNoPerspCentroidAMD = 4993,
BaryCoordNoPerspSampleAMD = 4994,
BaryCoordSmoothAMD = 4995,
BaryCoordSmoothCentroidAMD = 4996,
BaryCoordSmoothSampleAMD = 4997,
BaryCoordPullModelAMD = 4998,
FragStencilRefEXT = 5014,
ViewportMaskNV = 5253,
SecondaryPositionNV = 5257,
SecondaryViewportMaskNV = 5258,
PositionPerViewNV = 5261,
ViewportMaskPerViewNV = 5262,
}
public enum SelectionControlShift
{
Flatten = 0,
DontFlatten = 1,
}
public enum SelectionControlMask
{
MaskNone = 0,
Flatten = 0x00000001,
DontFlatten = 0x00000002,
}
public enum LoopControlShift
{
Unroll = 0,
DontUnroll = 1,
}
public enum LoopControlMask
{
MaskNone = 0,
Unroll = 0x00000001,
DontUnroll = 0x00000002,
}
public enum FunctionControlShift
{
Inline = 0,
DontInline = 1,
Pure = 2,
Const = 3,
}
public enum FunctionControlMask
{
MaskNone = 0,
Inline = 0x00000001,
DontInline = 0x00000002,
Pure = 0x00000004,
Const = 0x00000008,
}
public enum MemorySemanticsShift
{
Acquire = 1,
Release = 2,
AcquireRelease = 3,
SequentiallyConsistent = 4,
UniformMemory = 6,
SubgroupMemory = 7,
WorkgroupMemory = 8,
CrossWorkgroupMemory = 9,
AtomicCounterMemory = 10,
ImageMemory = 11,
}
public enum MemorySemanticsMask
{
MaskNone = 0,
Acquire = 0x00000002,
Release = 0x00000004,
AcquireRelease = 0x00000008,
SequentiallyConsistent = 0x00000010,
UniformMemory = 0x00000040,
SubgroupMemory = 0x00000080,
WorkgroupMemory = 0x00000100,
CrossWorkgroupMemory = 0x00000200,
AtomicCounterMemory = 0x00000400,
ImageMemory = 0x00000800,
}
public enum MemoryAccessShift
{
Volatile = 0,
Aligned = 1,
Nontemporal = 2,
}
public enum MemoryAccessMask
{
MaskNone = 0,
Volatile = 0x00000001,
Aligned = 0x00000002,
Nontemporal = 0x00000004,
}
public enum Scope
{
CrossDevice = 0,
Device = 1,
Workgroup = 2,
Subgroup = 3,
Invocation = 4,
}
public enum GroupOperation
{
Reduce = 0,
InclusiveScan = 1,
ExclusiveScan = 2,
}
public enum KernelEnqueueFlags
{
NoWait = 0,
WaitKernel = 1,
WaitWorkGroup = 2,
}
public enum KernelProfilingInfoShift
{
CmdExecTime = 0,
}
public enum KernelProfilingInfoMask
{
MaskNone = 0,
CmdExecTime = 0x00000001,
}
public enum Capability
{
Matrix = 0,
Shader = 1,
Geometry = 2,
Tessellation = 3,
Addresses = 4,
Linkage = 5,
Kernel = 6,
Vector16 = 7,
Float16Buffer = 8,
Float16 = 9,
Float64 = 10,
Int64 = 11,
Int64Atomics = 12,
ImageBasic = 13,
ImageReadWrite = 14,
ImageMipmap = 15,
Pipes = 17,
Groups = 18,
DeviceEnqueue = 19,
LiteralSampler = 20,
AtomicStorage = 21,
Int16 = 22,
TessellationPointSize = 23,
GeometryPointSize = 24,
ImageGatherExtended = 25,
StorageImageMultisample = 27,
UniformBufferArrayDynamicIndexing = 28,
SampledImageArrayDynamicIndexing = 29,
StorageBufferArrayDynamicIndexing = 30,
StorageImageArrayDynamicIndexing = 31,
ClipDistance = 32,
CullDistance = 33,
ImageCubeArray = 34,
SampleRateShading = 35,
ImageRect = 36,
SampledRect = 37,
GenericPointer = 38,
Int8 = 39,
InputAttachment = 40,
SparseResidency = 41,
MinLod = 42,
Sampled1D = 43,
Image1D = 44,
SampledCubeArray = 45,
SampledBuffer = 46,
ImageBuffer = 47,
ImageMSArray = 48,
StorageImageExtendedFormats = 49,
ImageQuery = 50,
DerivativeControl = 51,
InterpolationFunction = 52,
TransformFeedback = 53,
GeometryStreams = 54,
StorageImageReadWithoutFormat = 55,
StorageImageWriteWithoutFormat = 56,
MultiViewport = 57,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
SubgroupVoteKHR = 4431,
StorageBuffer16BitAccess = 4433,
StorageUniformBufferBlock16 = 4433,
StorageUniform16 = 4434,
UniformAndStorageBuffer16BitAccess = 4434,
StoragePushConstant16 = 4435,
StorageInputOutput16 = 4436,
DeviceGroup = 4437,
MultiView = 4439,
VariablePointersStorageBuffer = 4441,
VariablePointers = 4442,
AtomicStorageOps = 4445,
SampleMaskPostDepthCoverage = 4447,
ImageGatherBiasLodAMD = 5009,
FragmentMaskAMD = 5010,
StencilExportEXT = 5013,
ImageReadWriteLodAMD = 5015,
SampleMaskOverrideCoverageNV = 5249,
GeometryShaderPassthroughNV = 5251,
ShaderViewportIndexLayerEXT = 5254,
ShaderViewportIndexLayerNV = 5254,
ShaderViewportMaskNV = 5255,
ShaderStereoViewNV = 5259,
PerViewAttributesNV = 5260,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
SubgroupImageBlockIOINTEL = 5570,
}
public enum Op
{
OpNop = 0,
OpUndef = 1,
OpSourceContinued = 2,
OpSource = 3,
OpSourceExtension = 4,
OpName = 5,
OpMemberName = 6,
OpString = 7,
OpLine = 8,
OpExtension = 10,
OpExtInstImport = 11,
OpExtInst = 12,
OpMemoryModel = 14,
OpEntryPoint = 15,
OpExecutionMode = 16,
OpCapability = 17,
OpTypeVoid = 19,
OpTypeBool = 20,
OpTypeInt = 21,
OpTypeFloat = 22,
OpTypeVector = 23,
OpTypeMatrix = 24,
OpTypeImage = 25,
OpTypeSampler = 26,
OpTypeSampledImage = 27,
OpTypeArray = 28,
OpTypeRuntimeArray = 29,
OpTypeStruct = 30,
OpTypeOpaque = 31,
OpTypePointer = 32,
OpTypeFunction = 33,
OpTypeEvent = 34,
OpTypeDeviceEvent = 35,
OpTypeReserveId = 36,
OpTypeQueue = 37,
OpTypePipe = 38,
OpTypeForwardPointer = 39,
OpConstantTrue = 41,
OpConstantFalse = 42,
OpConstant = 43,
OpConstantComposite = 44,
OpConstantSampler = 45,
OpConstantNull = 46,
OpSpecConstantTrue = 48,
OpSpecConstantFalse = 49,
OpSpecConstant = 50,
OpSpecConstantComposite = 51,
OpSpecConstantOp = 52,
OpFunction = 54,
OpFunctionParameter = 55,
OpFunctionEnd = 56,
OpFunctionCall = 57,
OpVariable = 59,
OpImageTexelPointer = 60,
OpLoad = 61,
OpStore = 62,
OpCopyMemory = 63,
OpCopyMemorySized = 64,
OpAccessChain = 65,
OpInBoundsAccessChain = 66,
OpPtrAccessChain = 67,
OpArrayLength = 68,
OpGenericPtrMemSemantics = 69,
OpInBoundsPtrAccessChain = 70,
OpDecorate = 71,
OpMemberDecorate = 72,
OpDecorationGroup = 73,
OpGroupDecorate = 74,
OpGroupMemberDecorate = 75,
OpVectorExtractDynamic = 77,
OpVectorInsertDynamic = 78,
OpVectorShuffle = 79,
OpCompositeConstruct = 80,
OpCompositeExtract = 81,
OpCompositeInsert = 82,
OpCopyObject = 83,
OpTranspose = 84,
OpSampledImage = 86,
OpImageSampleImplicitLod = 87,
OpImageSampleExplicitLod = 88,
OpImageSampleDrefImplicitLod = 89,
OpImageSampleDrefExplicitLod = 90,
OpImageSampleProjImplicitLod = 91,
OpImageSampleProjExplicitLod = 92,
OpImageSampleProjDrefImplicitLod = 93,
OpImageSampleProjDrefExplicitLod = 94,
OpImageFetch = 95,
OpImageGather = 96,
OpImageDrefGather = 97,
OpImageRead = 98,
OpImageWrite = 99,
OpImage = 100,
OpImageQueryFormat = 101,
OpImageQueryOrder = 102,
OpImageQuerySizeLod = 103,
OpImageQuerySize = 104,
OpImageQueryLod = 105,
OpImageQueryLevels = 106,
OpImageQuerySamples = 107,
OpConvertFToU = 109,
OpConvertFToS = 110,
OpConvertSToF = 111,
OpConvertUToF = 112,
OpUConvert = 113,
OpSConvert = 114,
OpFConvert = 115,
OpQuantizeToF16 = 116,
OpConvertPtrToU = 117,
OpSatConvertSToU = 118,
OpSatConvertUToS = 119,
OpConvertUToPtr = 120,
OpPtrCastToGeneric = 121,
OpGenericCastToPtr = 122,
OpGenericCastToPtrExplicit = 123,
OpBitcast = 124,
OpSNegate = 126,
OpFNegate = 127,
OpIAdd = 128,
OpFAdd = 129,
OpISub = 130,
OpFSub = 131,
OpIMul = 132,
OpFMul = 133,
OpUDiv = 134,
OpSDiv = 135,
OpFDiv = 136,
OpUMod = 137,
OpSRem = 138,
OpSMod = 139,
OpFRem = 140,
OpFMod = 141,
OpVectorTimesScalar = 142,
OpMatrixTimesScalar = 143,
OpVectorTimesMatrix = 144,
OpMatrixTimesVector = 145,
OpMatrixTimesMatrix = 146,
OpOuterProduct = 147,
OpDot = 148,
OpIAddCarry = 149,
OpISubBorrow = 150,
OpUMulExtended = 151,
OpSMulExtended = 152,
OpAny = 154,
OpAll = 155,
OpIsNan = 156,
OpIsInf = 157,
OpIsFinite = 158,
OpIsNormal = 159,
OpSignBitSet = 160,
OpLessOrGreater = 161,
OpOrdered = 162,
OpUnordered = 163,
OpLogicalEqual = 164,
OpLogicalNotEqual = 165,
OpLogicalOr = 166,
OpLogicalAnd = 167,
OpLogicalNot = 168,
OpSelect = 169,
OpIEqual = 170,
OpINotEqual = 171,
OpUGreaterThan = 172,
OpSGreaterThan = 173,
OpUGreaterThanEqual = 174,
OpSGreaterThanEqual = 175,
OpULessThan = 176,
OpSLessThan = 177,
OpULessThanEqual = 178,
OpSLessThanEqual = 179,
OpFOrdEqual = 180,
OpFUnordEqual = 181,
OpFOrdNotEqual = 182,
OpFUnordNotEqual = 183,
OpFOrdLessThan = 184,
OpFUnordLessThan = 185,
OpFOrdGreaterThan = 186,
OpFUnordGreaterThan = 187,
OpFOrdLessThanEqual = 188,
OpFUnordLessThanEqual = 189,
OpFOrdGreaterThanEqual = 190,
OpFUnordGreaterThanEqual = 191,
OpShiftRightLogical = 194,
OpShiftRightArithmetic = 195,
OpShiftLeftLogical = 196,
OpBitwiseOr = 197,
OpBitwiseXor = 198,
OpBitwiseAnd = 199,
OpNot = 200,
OpBitFieldInsert = 201,
OpBitFieldSExtract = 202,
OpBitFieldUExtract = 203,
OpBitReverse = 204,
OpBitCount = 205,
OpDPdx = 207,
OpDPdy = 208,
OpFwidth = 209,
OpDPdxFine = 210,
OpDPdyFine = 211,
OpFwidthFine = 212,
OpDPdxCoarse = 213,
OpDPdyCoarse = 214,
OpFwidthCoarse = 215,
OpEmitVertex = 218,
OpEndPrimitive = 219,
OpEmitStreamVertex = 220,
OpEndStreamPrimitive = 221,
OpControlBarrier = 224,
OpMemoryBarrier = 225,
OpAtomicLoad = 227,
OpAtomicStore = 228,
OpAtomicExchange = 229,
OpAtomicCompareExchange = 230,
OpAtomicCompareExchangeWeak = 231,
OpAtomicIIncrement = 232,
OpAtomicIDecrement = 233,
OpAtomicIAdd = 234,
OpAtomicISub = 235,
OpAtomicSMin = 236,
OpAtomicUMin = 237,
OpAtomicSMax = 238,
OpAtomicUMax = 239,
OpAtomicAnd = 240,
OpAtomicOr = 241,
OpAtomicXor = 242,
OpPhi = 245,
OpLoopMerge = 246,
OpSelectionMerge = 247,
OpLabel = 248,
OpBranch = 249,
OpBranchConditional = 250,
OpSwitch = 251,
OpKill = 252,
OpReturn = 253,
OpReturnValue = 254,
OpUnreachable = 255,
OpLifetimeStart = 256,
OpLifetimeStop = 257,
OpGroupAsyncCopy = 259,
OpGroupWaitEvents = 260,
OpGroupAll = 261,
OpGroupAny = 262,
OpGroupBroadcast = 263,
OpGroupIAdd = 264,
OpGroupFAdd = 265,
OpGroupFMin = 266,
OpGroupUMin = 267,
OpGroupSMin = 268,
OpGroupFMax = 269,
OpGroupUMax = 270,
OpGroupSMax = 271,
OpReadPipe = 274,
OpWritePipe = 275,
OpReservedReadPipe = 276,
OpReservedWritePipe = 277,
OpReserveReadPipePackets = 278,
OpReserveWritePipePackets = 279,
OpCommitReadPipe = 280,
OpCommitWritePipe = 281,
OpIsValidReserveId = 282,
OpGetNumPipePackets = 283,
OpGetMaxPipePackets = 284,
OpGroupReserveReadPipePackets = 285,
OpGroupReserveWritePipePackets = 286,
OpGroupCommitReadPipe = 287,
OpGroupCommitWritePipe = 288,
OpEnqueueMarker = 291,
OpEnqueueKernel = 292,
OpGetKernelNDrangeSubGroupCount = 293,
OpGetKernelNDrangeMaxSubGroupSize = 294,
OpGetKernelWorkGroupSize = 295,
OpGetKernelPreferredWorkGroupSizeMultiple = 296,
OpRetainEvent = 297,
OpReleaseEvent = 298,
OpCreateUserEvent = 299,
OpIsValidEvent = 300,
OpSetUserEventStatus = 301,
OpCaptureEventProfilingInfo = 302,
OpGetDefaultQueue = 303,
OpBuildNDRange = 304,
OpImageSparseSampleImplicitLod = 305,
OpImageSparseSampleExplicitLod = 306,
OpImageSparseSampleDrefImplicitLod = 307,
OpImageSparseSampleDrefExplicitLod = 308,
OpImageSparseSampleProjImplicitLod = 309,
OpImageSparseSampleProjExplicitLod = 310,
OpImageSparseSampleProjDrefImplicitLod = 311,
OpImageSparseSampleProjDrefExplicitLod = 312,
OpImageSparseFetch = 313,
OpImageSparseGather = 314,
OpImageSparseDrefGather = 315,
OpImageSparseTexelsResident = 316,
OpNoLine = 317,
OpAtomicFlagTestAndSet = 318,
OpAtomicFlagClear = 319,
OpImageSparseRead = 320,
OpDecorateId = 332,
OpSubgroupBallotKHR = 4421,
OpSubgroupFirstInvocationKHR = 4422,
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpSubgroupReadInvocationKHR = 4432,
OpGroupIAddNonUniformAMD = 5000,
OpGroupFAddNonUniformAMD = 5001,
OpGroupFMinNonUniformAMD = 5002,
OpGroupUMinNonUniformAMD = 5003,
OpGroupSMinNonUniformAMD = 5004,
OpGroupFMaxNonUniformAMD = 5005,
OpGroupUMaxNonUniformAMD = 5006,
OpGroupSMaxNonUniformAMD = 5007,
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpSubgroupShuffleINTEL = 5571,
OpSubgroupShuffleDownINTEL = 5572,
OpSubgroupShuffleUpINTEL = 5573,
OpSubgroupShuffleXorINTEL = 5574,
OpSubgroupBlockReadINTEL = 5575,
OpSubgroupBlockWriteINTEL = 5576,
OpSubgroupImageBlockReadINTEL = 5577,
OpSubgroupImageBlockWriteINTEL = 5578,
OpDecorateStringGOOGLE = 5632,
OpMemberDecorateStringGOOGLE = 5633,
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -23,10 +23,11 @@
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-->
<!--
This file, spir-v.xml, is the SPIR-V Tool ID and Opcode registry. The
canonical version of the registry, together with related schema and
This file, spir-v.xml, is the SPIR-V Tool ID, opcode and enumerant registry.
The canonical version of the registry, together with related schema and
documentation, can be found in the Khronos Registry at
http://www.khronos.org/registry/spir-v/
include/spirv/spir-v.xml in the master branch at
https://github.com/KhronosGroup/SPIRV-Headers
-->
<!-- SECTION: SPIR-V Tool ID Definitions -->
@ -52,7 +53,7 @@
<id value="0" vendor="Khronos" comment="Reserved by Khronos"/>
<id value="1" vendor="LunarG" comment="Contact TBD"/>
<id value="2" vendor="Valve" comment="Contact TBD"/>
<id value="3" vendor="Codeplay" comment="Contact Neil Henning, neil@codeplay.com"/>
<id value="3" vendor="Codeplay" comment="Contact Victor Lomuller, victor@codeplay.com"/>
<id value="4" vendor="NVIDIA" comment="Contact Kerch Holt, kholt@nvidia.com"/>
<id value="5" vendor="ARM" comment="Contact Alexander Galazin, alexander.galazin@arm.com"/>
<id value="6" vendor="Khronos" tool="LLVM/SPIR-V Translator" comment="Contact Yaxun (Sam) Liu, yaxun.liu@amd.com"/>
@ -69,13 +70,102 @@
<id value="17" vendor="Khronos" tool="SPIR-V Tools Linker" comment="Contact David Neto, dneto@google.com"/>
<id value="18" vendor="Wine" tool="VKD3D Shader Compiler" comment="Contact wine-devel@winehq.org"/>
<id value="19" vendor="Clay" tool="Clay Shader Compiler" comment="Contact info@clayengine.com"/>
<unused start="20" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
<id value="20" vendor="W3C WebGPU Group" tool="WHLSL Shader Translator" comment="https://github.com/gpuweb/WHLSL"/>
<id value="21" vendor="Google" tool="Clspv" comment="Contact David Neto, dneto@google.com"/>
<id value="22" vendor="Google" tool="MLIR SPIR-V Serializer" comment="Contact Lei Zhang, antiagainst@google.com"/>
<id value="23" vendor="Google" tool="Tint Compiler" comment="Contact David Neto, dneto@google.com"/>
<id value="24" vendor="Google" tool="ANGLE Shader Compiler" comment="Contact Shahbaz Youssefi, syoussefi@google.com"/>
<id value="25" vendor="Netease Games" tool="Messiah Shader Compiler" comment="Contact Yuwen Wu, atyuwen@gmail.com"/>
<id value="26" vendor="Xenia" tool="Xenia Emulator Microcode Translator" comment="Contact Vitaliy Kuzmin, triang3l@yandex.ru, https://github.com/xenia-project/xenia"/>
<id value="27" vendor="Embark Studios" tool="Rust GPU Compiler Backend" comment="https://github.com/embarkstudios/rust-gpu"/>
<unused start="28" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
</ids>
<!-- SECTION: SPIR-V Opcodes and Enumerants -->
<!-- Reserve new ranges for vendors in contiguous blocks of 64
preceding the "Future use" block below, and modify that block
accordingly.
<!-- Vendors reserve new ranges of:
- opcode enumerants in the "opcode" list below, and
- non-opcode enumerants in the non-opcodes "enumerant" list below.
Both are reserved by contiguous blocks of 64, preceding the given
"Future use" blocks.
SPIR-V background:
- SPIR-V currently has well over 30 enums, including the opcode enum
- each enum has its own name space, allowing reuse of enumerants
- SPIR-V restricts opcode enumerants to 16 bits
- all other enums use 32-bit enumerants
Reservation rules:
- opcode reservations ("opcode") are only valid for opcodes
- non-opcode reservations ("enumerant") are not valid for opcodes
- reservations in the enumerant list are valid for all non-opcode enums
- it is simpler to use each non-opcode enumerant for only one purpose
but this is left to the discretion of the vendor
- all enumerants in a range should be used before allocating a new range
(several extensions can use enumerants from the same range)
Each vendor determines the use of enumerants in the ranges they
reserve. Vendors are not required to disclose those uses. If the use
of an enumerant is included in an extension that is adopted by a Khronos
extension or specification, then that enumerant's use may be permanently
fixed as if originally reserved in a Khronos range.
-->
<!-- Begin reservations of opcode enumerants -->
<ids type="opcode" start="0" end="4095" vendor="Khronos" comment="Reserved opcodes, not available to vendors - see the SPIR-V Specification"/>
<ids type="opcode" start="4096" end="4159" vendor="Mesa" comment="Contact TBD"/>
<ids type="opcode" start="4160" end="4415" vendor="ARM"/>
<ids type="opcode" start="4416" end="4479" vendor="Khronos" comment="SPV_ARB_shader_ballot - contact Neil Henning, neil.henning@amd.com"/>
<ids type="opcode" start="4480" end="4991" vendor="Qualcomm" comment="Contact weifengz@qti.qualcomm.com"/>
<ids type="opcode" start="4992" end="5247" vendor="AMD"/>
<ids type="opcode" start="5248" end="5503" vendor="NVIDIA"/>
<ids type="opcode" start="5504" end="5567" vendor="Imagination"/>
<ids type="opcode" start="5568" end="5631" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
<ids type="opcode" start="5632" end="5695" vendor="Google" comment="Contact dneto@google.com"/>
<ids type="opcode" start="5696" end="5823" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
<ids type="opcode" start="5824" end="5951" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
<ids type="opcode" start="5952" end="6015" vendor="Codeplay" comment="Contact victor@codeplay.com"/>
<ids type="opcode" start="6016" end="6079" vendor="Khronos" comment="Contact @tobski"/>
<ids type="opcode" start="6080" end="6143" vendor="Intel" comment="Contact mariusz.merecki@intel.com"/>
<!-- Opcode enumerants to reserve for future use. To get a block, allocate
multiples of 64 starting at the lowest available point in this
block and add a corresponding <ids> tag immediately above. Make
sure to fill in the vendor attribute, and preferably add a contact
person/address in a comment attribute. -->
<!-- Example new block: <ids type="opcode" start="XXXX" end="XXXX+64n-1" vendor="Add vendor" comment="Contact TBD"/> -->
<ids type="opcode" start="6144" end="65535" comment="Opcode range reservable for future use by vendors"/>
<!-- End reservations of opcodes -->
<!-- Begin reservations of non-opcode enumerants -->
<ids type="enumerant" start="0" end="4095" vendor="Khronos" comment="Reserved enumerants, not available to vendors - see the SPIR-V Specification"/>
<ids type="enumerant" start="4096" end="4159" vendor="Mesa" comment="Contact TBD"/>
<ids type="enumerant" start="4160" end="4415" vendor="ARM"/>
<ids type="enumerant" start="4416" end="4479" vendor="Khronos" comment="SPV_ARB_shader_ballot - contact Neil Henning, neil.henning@amd.com"/>
<ids type="enumerant" start="4480" end="4991" vendor="Qualcomm" comment="Contact weifengz@qti.qualcomm.com"/>
<ids type="enumerant" start="4992" end="5247" vendor="AMD"/>
<ids type="enumerant" start="5248" end="5503" vendor="NVIDIA"/>
<ids type="enumerant" start="5504" end="5567" vendor="Imagination"/>
<ids type="enumerant" start="5568" end="5631" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
<ids type="enumerant" start="5632" end="5695" vendor="Google" comment="Contact dneto@google.com"/>
<ids type="enumerant" start="5696" end="5823" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
<ids type="enumerant" start="5824" end="5951" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
<ids type="enumerant" start="5952" end="6015" vendor="Codeplay" comment="Contact victor@codeplay.com"/>
<ids type="enumerant" start="6016" end="6079" vendor="Khronos" comment="Contact @tobski"/>
<ids type="enumerant" start="6080" end="6143" vendor="Intel" comment="Contact mariusz.merecki@intel.com"/>
<!-- Enumerants to reserve for future use. To get a block, allocate
multiples of 64 starting at the lowest available point in this
block and add a corresponding <ids> tag immediately above. Make
sure to fill in the vendor attribute, and preferably add a contact
person/address in a comment attribute. -->
<!-- Example new block: <ids type="enumerant" start="XXXX" end="XXXX+64n-1" vendor="Add vendor" comment="Contact TBD"/> -->
<ids type="enumerant" start="6144" end="4294967295" comment="Enumerant range reservable for future use by vendors"/>
<!-- End reservations of enumerants -->
<!-- SECTION: SPIR-V Loop Control Bit Reservations -->
<!-- Reserve ranges of bits in the loop control bitfield.
Each vendor determines the use of values in their own ranges.
Vendors are not required to disclose those uses. If the use of a
@ -86,34 +176,51 @@
The SPIR Working Group strongly recommends:
- Each value is used for only one purpose.
- All values in a range should be used before allocating a new range.
For example, to avoid unused gaps in ranges, it is customary for
several extensions to use values from the same range.
The Id type "enum" is a synonym for "opcode".
Note that SPIR-V restricts opcode values to 16 bits.
-->
<!-- Reserved opcode & enumerant blocks -->
<ids type="opcode" start="0" end="4095" vendor="Khronos" comment="Reserved opcodes, not available to vendors - see the SPIR-V Specification"/>
<ids type="opcode" start="4096" end="4159" vendor="Mesa" comment="Contact TBD"/>
<ids type="opcode" start="4160" end="4415" vendor="ARM"/>
<ids type="opcode" start="4416" end="4479" vendor="Khronos" comment="SPV_ARB_shader_ballot - contact Neil Henning, neil@codeplay.com"/>
<ids type="opcode" start="4480" end="4991" vendor="Qualcomm" comment="Contact weifengz@qti.qualcomm.com"/>
<ids type="opcode" start="4992" end="5247" vendor="AMD"/>
<ids type="opcode" start="5248" end="5503" vendor="NVIDIA"/>
<ids type="opcode" start="5504" end="5567" vendor="Imagination"/>
<ids type="opcode" start="5568" end="5631" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
<ids type="opcode" start="5632" end="5695" vendor="Google" comment="Contact dneto@google.com"/>
<ids type="opcode" start="5696" end="5823" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
<!-- Opcodes & enumerants reservable for future use. To get a block, allocate
multiples of 64 starting at the lowest available point in this
block and add a corresponding <ids> tag immediately above. Make
sure to fill in the vendor attribute, and preferably add a contact
person/address in a comment attribute. -->
<!-- Reserved loop control bits -->
<ids type="LoopControl" start="0" end="15" vendor="Khronos" comment="Reserved LoopControl bits, not available to vendors - see the SPIR-V Specification"/>
<ids type="LoopControl" start="16" end="23" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
<ids type="LoopControl" start="24" end="30" comment="Unreserved bits reservable for use by vendors"/>
<ids type="LoopControl" start="31" end="31" vendor="Khronos" comment="Reserved LoopControl bit, not available to vendors"/>
<!-- Example new block: <ids type="opcode" start="XXXX" end="XXXX+64n-1" vendor="Add vendor" comment="Contact TBD"/> -->
<ids type="opcode" start="5824" end="4294967295" comment="Opcode range reservable for future use by vendors"/>
<!-- SECTION: SPIR-V Function Control Bit Reservations -->
<!-- Reserve ranges of bits in the function control bitfield.
Each vendor determines the use of values in their own ranges.
Vendors are not required to disclose those uses. If the use of a
value is included in an extension that is adopted by a Khronos
extension or specification, then that value's use may be permanently
fixed as if originally reserved in a Khronos range.
The SPIR Working Group strongly recommends:
- Each value is used for only one purpose.
- All values in a range should be used before allocating a new range.
-->
<!-- Reserved function control bits -->
<ids type="FunctionControl" start="0" end="15" vendor="Khronos" comment="Reserved FunctionControl bits, not available to vendors - see the SPIR-V Specification"/>
<ids type="FunctionControl" start="16" end="16" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
<ids type="FunctionControl" start="17" end="30" comment="Unreserved bits reservable for use by vendors"/>
<ids type="FunctionControl" start="31" end="31" vendor="Khronos" comment="Reserved FunctionControl bit, not available to vendors"/>
<!-- SECTION: SPIR-V FP Fast Math Mode Bit Reservations -->
<!-- Reserve ranges of bits in the "FP Fast Math Mode" bitfield.
Each vendor determines the use of values in their own ranges.
Vendors are not required to disclose those uses. If the use of a
value is included in an extension that is adopted by a Khronos
extension or specification, then that value's use may be permanently
fixed as if originally reserved in a Khronos range.
The SPIR Working Group strongly recommends:
- Each value is used for only one purpose.
- All values in a range should be used before allocating a new range.
-->
<!-- Reserved FP fast math mode bits -->
<ids type="FPFastMathMode" start="0" end="15" vendor="Khronos" comment="Reserved FPFastMathMode bits, not available to vendors - see the SPIR-V Specification"/>
<ids type="FPFastMathMode" start="16" end="17" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
<ids type="FPFastMathMode" start="18" end="31" comment="Unreserved bits reservable for use by vendors"/>
</registry>

View File

@ -0,0 +1,52 @@
// Copyright (c) 2020 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the
// "Materials"), to deal in the Materials without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Materials, and to
// permit persons to whom the Materials are furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
// https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
//
#ifndef SPIRV_UNIFIED1_AMD_gcn_shader_H_
#define SPIRV_UNIFIED1_AMD_gcn_shader_H_
#ifdef __cplusplus
extern "C" {
#endif
enum {
AMD_gcn_shaderRevision = 2,
AMD_gcn_shaderRevision_BitWidthPadding = 0x7fffffff
};
enum AMD_gcn_shaderInstructions {
AMD_gcn_shaderCubeFaceIndexAMD = 1,
AMD_gcn_shaderCubeFaceCoordAMD = 2,
AMD_gcn_shaderTimeAMD = 3,
AMD_gcn_shaderInstructionsMax = 0x7fffffff
};
#ifdef __cplusplus
}
#endif
#endif // SPIRV_UNIFIED1_AMD_gcn_shader_H_

View File

@ -0,0 +1,53 @@
// Copyright (c) 2020 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the
// "Materials"), to deal in the Materials without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Materials, and to
// permit persons to whom the Materials are furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
// https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
//
#ifndef SPIRV_UNIFIED1_AMD_shader_ballot_H_
#define SPIRV_UNIFIED1_AMD_shader_ballot_H_
#ifdef __cplusplus
extern "C" {
#endif
enum {
AMD_shader_ballotRevision = 5,
AMD_shader_ballotRevision_BitWidthPadding = 0x7fffffff
};
enum AMD_shader_ballotInstructions {
AMD_shader_ballotSwizzleInvocationsAMD = 1,
AMD_shader_ballotSwizzleInvocationsMaskedAMD = 2,
AMD_shader_ballotWriteInvocationAMD = 3,
AMD_shader_ballotMbcntAMD = 4,
AMD_shader_ballotInstructionsMax = 0x7fffffff
};
#ifdef __cplusplus
}
#endif
#endif // SPIRV_UNIFIED1_AMD_shader_ballot_H_

View File

@ -0,0 +1,50 @@
// Copyright (c) 2020 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the
// "Materials"), to deal in the Materials without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Materials, and to
// permit persons to whom the Materials are furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
// https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
//
#ifndef SPIRV_UNIFIED1_AMD_shader_explicit_vertex_parameter_H_
#define SPIRV_UNIFIED1_AMD_shader_explicit_vertex_parameter_H_
#ifdef __cplusplus
extern "C" {
#endif
enum {
AMD_shader_explicit_vertex_parameterRevision = 4,
AMD_shader_explicit_vertex_parameterRevision_BitWidthPadding = 0x7fffffff
};
enum AMD_shader_explicit_vertex_parameterInstructions {
AMD_shader_explicit_vertex_parameterInterpolateAtVertexAMD = 1,
AMD_shader_explicit_vertex_parameterInstructionsMax = 0x7fffffff
};
#ifdef __cplusplus
}
#endif
#endif // SPIRV_UNIFIED1_AMD_shader_explicit_vertex_parameter_H_

View File

@ -0,0 +1,58 @@
// Copyright (c) 2020 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the
// "Materials"), to deal in the Materials without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Materials, and to
// permit persons to whom the Materials are furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
// https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
//
#ifndef SPIRV_UNIFIED1_AMD_shader_trinary_minmax_H_
#define SPIRV_UNIFIED1_AMD_shader_trinary_minmax_H_
#ifdef __cplusplus
extern "C" {
#endif
enum {
AMD_shader_trinary_minmaxRevision = 4,
AMD_shader_trinary_minmaxRevision_BitWidthPadding = 0x7fffffff
};
enum AMD_shader_trinary_minmaxInstructions {
AMD_shader_trinary_minmaxFMin3AMD = 1,
AMD_shader_trinary_minmaxUMin3AMD = 2,
AMD_shader_trinary_minmaxSMin3AMD = 3,
AMD_shader_trinary_minmaxFMax3AMD = 4,
AMD_shader_trinary_minmaxUMax3AMD = 5,
AMD_shader_trinary_minmaxSMax3AMD = 6,
AMD_shader_trinary_minmaxFMid3AMD = 7,
AMD_shader_trinary_minmaxUMid3AMD = 8,
AMD_shader_trinary_minmaxSMid3AMD = 9,
AMD_shader_trinary_minmaxInstructionsMax = 0x7fffffff
};
#ifdef __cplusplus
}
#endif
#endif // SPIRV_UNIFIED1_AMD_shader_trinary_minmax_H_

View File

@ -0,0 +1,144 @@
// Copyright (c) 2017 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
// to deal in the Materials without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Materials, and to permit persons to whom the
// Materials are furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
// IN THE MATERIALS.
#ifndef SPIRV_UNIFIED1_DebugInfo_H_
#define SPIRV_UNIFIED1_DebugInfo_H_
#ifdef __cplusplus
extern "C" {
#endif
enum {
DebugInfoVersion = 100,
DebugInfoVersion_BitWidthPadding = 0x7fffffff
};
enum {
DebugInfoRevision = 1,
DebugInfoRevision_BitWidthPadding = 0x7fffffff
};
enum DebugInfoInstructions {
DebugInfoDebugInfoNone = 0,
DebugInfoDebugCompilationUnit = 1,
DebugInfoDebugTypeBasic = 2,
DebugInfoDebugTypePointer = 3,
DebugInfoDebugTypeQualifier = 4,
DebugInfoDebugTypeArray = 5,
DebugInfoDebugTypeVector = 6,
DebugInfoDebugTypedef = 7,
DebugInfoDebugTypeFunction = 8,
DebugInfoDebugTypeEnum = 9,
DebugInfoDebugTypeComposite = 10,
DebugInfoDebugTypeMember = 11,
DebugInfoDebugTypeInheritance = 12,
DebugInfoDebugTypePtrToMember = 13,
DebugInfoDebugTypeTemplate = 14,
DebugInfoDebugTypeTemplateParameter = 15,
DebugInfoDebugTypeTemplateTemplateParameter = 16,
DebugInfoDebugTypeTemplateParameterPack = 17,
DebugInfoDebugGlobalVariable = 18,
DebugInfoDebugFunctionDeclaration = 19,
DebugInfoDebugFunction = 20,
DebugInfoDebugLexicalBlock = 21,
DebugInfoDebugLexicalBlockDiscriminator = 22,
DebugInfoDebugScope = 23,
DebugInfoDebugNoScope = 24,
DebugInfoDebugInlinedAt = 25,
DebugInfoDebugLocalVariable = 26,
DebugInfoDebugInlinedVariable = 27,
DebugInfoDebugDeclare = 28,
DebugInfoDebugValue = 29,
DebugInfoDebugOperation = 30,
DebugInfoDebugExpression = 31,
DebugInfoDebugMacroDef = 32,
DebugInfoDebugMacroUndef = 33,
DebugInfoInstructionsMax = 0x7fffffff
};
enum DebugInfoDebugInfoFlags {
DebugInfoNone = 0x0000,
DebugInfoFlagIsProtected = 0x01,
DebugInfoFlagIsPrivate = 0x02,
DebugInfoFlagIsPublic = 0x03,
DebugInfoFlagIsLocal = 0x04,
DebugInfoFlagIsDefinition = 0x08,
DebugInfoFlagFwdDecl = 0x10,
DebugInfoFlagArtificial = 0x20,
DebugInfoFlagExplicit = 0x40,
DebugInfoFlagPrototyped = 0x80,
DebugInfoFlagObjectPointer = 0x100,
DebugInfoFlagStaticMember = 0x200,
DebugInfoFlagIndirectVariable = 0x400,
DebugInfoFlagLValueReference = 0x800,
DebugInfoFlagRValueReference = 0x1000,
DebugInfoFlagIsOptimized = 0x2000,
DebugInfoDebugInfoFlagsMax = 0x7fffffff
};
enum DebugInfoDebugBaseTypeAttributeEncoding {
DebugInfoUnspecified = 0,
DebugInfoAddress = 1,
DebugInfoBoolean = 2,
DebugInfoFloat = 4,
DebugInfoSigned = 5,
DebugInfoSignedChar = 6,
DebugInfoUnsigned = 7,
DebugInfoUnsignedChar = 8,
DebugInfoDebugBaseTypeAttributeEncodingMax = 0x7fffffff
};
enum DebugInfoDebugCompositeType {
DebugInfoClass = 0,
DebugInfoStructure = 1,
DebugInfoUnion = 2,
DebugInfoDebugCompositeTypeMax = 0x7fffffff
};
enum DebugInfoDebugTypeQualifier {
DebugInfoConstType = 0,
DebugInfoVolatileType = 1,
DebugInfoRestrictType = 2,
DebugInfoDebugTypeQualifierMax = 0x7fffffff
};
enum DebugInfoDebugOperation {
DebugInfoDeref = 0,
DebugInfoPlus = 1,
DebugInfoMinus = 2,
DebugInfoPlusUconst = 3,
DebugInfoBitPiece = 4,
DebugInfoSwap = 5,
DebugInfoXderef = 6,
DebugInfoStackValue = 7,
DebugInfoConstu = 8,
DebugInfoDebugOperationMax = 0x7fffffff
};
#ifdef __cplusplus
}
#endif
#endif // SPIRV_UNIFIED1_DebugInfo_H_

View File

@ -0,0 +1,73 @@
// Copyright (c) 2020 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the
// "Materials"), to deal in the Materials without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Materials, and to
// permit persons to whom the Materials are furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
// https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
//
#ifndef SPIRV_UNIFIED1_NonSemanticClspvReflection_H_
#define SPIRV_UNIFIED1_NonSemanticClspvReflection_H_
#ifdef __cplusplus
extern "C" {
#endif
enum {
NonSemanticClspvReflectionRevision = 1,
NonSemanticClspvReflectionRevision_BitWidthPadding = 0x7fffffff
};
enum NonSemanticClspvReflectionInstructions {
NonSemanticClspvReflectionKernel = 1,
NonSemanticClspvReflectionArgumentInfo = 2,
NonSemanticClspvReflectionArgumentStorageBuffer = 3,
NonSemanticClspvReflectionArgumentUniform = 4,
NonSemanticClspvReflectionArgumentPodStorageBuffer = 5,
NonSemanticClspvReflectionArgumentPodUniform = 6,
NonSemanticClspvReflectionArgumentPodPushConstant = 7,
NonSemanticClspvReflectionArgumentSampledImage = 8,
NonSemanticClspvReflectionArgumentStorageImage = 9,
NonSemanticClspvReflectionArgumentSampler = 10,
NonSemanticClspvReflectionArgumentWorkgroup = 11,
NonSemanticClspvReflectionSpecConstantWorkgroupSize = 12,
NonSemanticClspvReflectionSpecConstantGlobalOffset = 13,
NonSemanticClspvReflectionSpecConstantWorkDim = 14,
NonSemanticClspvReflectionPushConstantGlobalOffset = 15,
NonSemanticClspvReflectionPushConstantEnqueuedLocalSize = 16,
NonSemanticClspvReflectionPushConstantGlobalSize = 17,
NonSemanticClspvReflectionPushConstantRegionOffset = 18,
NonSemanticClspvReflectionPushConstantNumWorkgroups = 19,
NonSemanticClspvReflectionPushConstantRegionGroupOffset = 20,
NonSemanticClspvReflectionConstantDataStorageBuffer = 21,
NonSemanticClspvReflectionConstantDataUniform = 22,
NonSemanticClspvReflectionLiteralSampler = 23,
NonSemanticClspvReflectionPropertyRequiredWorkgroupSize = 24,
NonSemanticClspvReflectionInstructionsMax = 0x7fffffff
};
#ifdef __cplusplus
}
#endif
#endif // SPIRV_UNIFIED1_NonSemanticClspvReflection_H_

View File

@ -0,0 +1,50 @@
// Copyright (c) 2020 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the
// "Materials"), to deal in the Materials without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Materials, and to
// permit persons to whom the Materials are furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
// https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
//
#ifndef SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_
#define SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_
#ifdef __cplusplus
extern "C" {
#endif
enum {
NonSemanticDebugPrintfRevision = 1,
NonSemanticDebugPrintfRevision_BitWidthPadding = 0x7fffffff
};
enum NonSemanticDebugPrintfInstructions {
NonSemanticDebugPrintfDebugPrintf = 1,
NonSemanticDebugPrintfInstructionsMax = 0x7fffffff
};
#ifdef __cplusplus
}
#endif
#endif // SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_

View File

@ -1,5 +1,5 @@
/*
** Copyright (c) 2015-2017 The Khronos Group Inc.
** Copyright (c) 2015-2019 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and/or associated documentation files (the "Materials"),
@ -27,6 +27,7 @@
#ifndef OPENCLstd_H
#define OPENCLstd_H
#ifdef __cplusplus
namespace OpenCLLIB {
enum Entrypoints {
@ -212,4 +213,189 @@ enum Entrypoints {
} // end namespace OpenCLLIB
#else
enum OpenCLstd_Entrypoints {
// Section 2.1: Math extended instructions
OpenCLstd_Acos = 0,
OpenCLstd_Acosh = 1,
OpenCLstd_Acospi = 2,
OpenCLstd_Asin = 3,
OpenCLstd_Asinh = 4,
OpenCLstd_Asinpi = 5,
OpenCLstd_Atan = 6,
OpenCLstd_Atan2 = 7,
OpenCLstd_Atanh = 8,
OpenCLstd_Atanpi = 9,
OpenCLstd_Atan2pi = 10,
OpenCLstd_Cbrt = 11,
OpenCLstd_Ceil = 12,
OpenCLstd_Copysign = 13,
OpenCLstd_Cos = 14,
OpenCLstd_Cosh = 15,
OpenCLstd_Cospi = 16,
OpenCLstd_Erfc = 17,
OpenCLstd_Erf = 18,
OpenCLstd_Exp = 19,
OpenCLstd_Exp2 = 20,
OpenCLstd_Exp10 = 21,
OpenCLstd_Expm1 = 22,
OpenCLstd_Fabs = 23,
OpenCLstd_Fdim = 24,
OpenCLstd_Floor = 25,
OpenCLstd_Fma = 26,
OpenCLstd_Fmax = 27,
OpenCLstd_Fmin = 28,
OpenCLstd_Fmod = 29,
OpenCLstd_Fract = 30,
OpenCLstd_Frexp = 31,
OpenCLstd_Hypot = 32,
OpenCLstd_Ilogb = 33,
OpenCLstd_Ldexp = 34,
OpenCLstd_Lgamma = 35,
OpenCLstd_Lgamma_r = 36,
OpenCLstd_Log = 37,
OpenCLstd_Log2 = 38,
OpenCLstd_Log10 = 39,
OpenCLstd_Log1p = 40,
OpenCLstd_Logb = 41,
OpenCLstd_Mad = 42,
OpenCLstd_Maxmag = 43,
OpenCLstd_Minmag = 44,
OpenCLstd_Modf = 45,
OpenCLstd_Nan = 46,
OpenCLstd_Nextafter = 47,
OpenCLstd_Pow = 48,
OpenCLstd_Pown = 49,
OpenCLstd_Powr = 50,
OpenCLstd_Remainder = 51,
OpenCLstd_Remquo = 52,
OpenCLstd_Rint = 53,
OpenCLstd_Rootn = 54,
OpenCLstd_Round = 55,
OpenCLstd_Rsqrt = 56,
OpenCLstd_Sin = 57,
OpenCLstd_Sincos = 58,
OpenCLstd_Sinh = 59,
OpenCLstd_Sinpi = 60,
OpenCLstd_Sqrt = 61,
OpenCLstd_Tan = 62,
OpenCLstd_Tanh = 63,
OpenCLstd_Tanpi = 64,
OpenCLstd_Tgamma = 65,
OpenCLstd_Trunc = 66,
OpenCLstd_Half_cos = 67,
OpenCLstd_Half_divide = 68,
OpenCLstd_Half_exp = 69,
OpenCLstd_Half_exp2 = 70,
OpenCLstd_Half_exp10 = 71,
OpenCLstd_Half_log = 72,
OpenCLstd_Half_log2 = 73,
OpenCLstd_Half_log10 = 74,
OpenCLstd_Half_powr = 75,
OpenCLstd_Half_recip = 76,
OpenCLstd_Half_rsqrt = 77,
OpenCLstd_Half_sin = 78,
OpenCLstd_Half_sqrt = 79,
OpenCLstd_Half_tan = 80,
OpenCLstd_Native_cos = 81,
OpenCLstd_Native_divide = 82,
OpenCLstd_Native_exp = 83,
OpenCLstd_Native_exp2 = 84,
OpenCLstd_Native_exp10 = 85,
OpenCLstd_Native_log = 86,
OpenCLstd_Native_log2 = 87,
OpenCLstd_Native_log10 = 88,
OpenCLstd_Native_powr = 89,
OpenCLstd_Native_recip = 90,
OpenCLstd_Native_rsqrt = 91,
OpenCLstd_Native_sin = 92,
OpenCLstd_Native_sqrt = 93,
OpenCLstd_Native_tan = 94,
// Section 2.2: Integer instructions
OpenCLstd_SAbs = 141,
OpenCLstd_SAbs_diff = 142,
OpenCLstd_SAdd_sat = 143,
OpenCLstd_UAdd_sat = 144,
OpenCLstd_SHadd = 145,
OpenCLstd_UHadd = 146,
OpenCLstd_SRhadd = 147,
OpenCLstd_URhadd = 148,
OpenCLstd_SClamp = 149,
OpenCLstd_UClamp = 150,
OpenCLstd_Clz = 151,
OpenCLstd_Ctz = 152,
OpenCLstd_SMad_hi = 153,
OpenCLstd_UMad_sat = 154,
OpenCLstd_SMad_sat = 155,
OpenCLstd_SMax = 156,
OpenCLstd_UMax = 157,
OpenCLstd_SMin = 158,
OpenCLstd_UMin = 159,
OpenCLstd_SMul_hi = 160,
OpenCLstd_Rotate = 161,
OpenCLstd_SSub_sat = 162,
OpenCLstd_USub_sat = 163,
OpenCLstd_U_Upsample = 164,
OpenCLstd_S_Upsample = 165,
OpenCLstd_Popcount = 166,
OpenCLstd_SMad24 = 167,
OpenCLstd_UMad24 = 168,
OpenCLstd_SMul24 = 169,
OpenCLstd_UMul24 = 170,
OpenCLstd_UAbs = 201,
OpenCLstd_UAbs_diff = 202,
OpenCLstd_UMul_hi = 203,
OpenCLstd_UMad_hi = 204,
// Section 2.3: Common instructions
OpenCLstd_FClamp = 95,
OpenCLstd_Degrees = 96,
OpenCLstd_FMax_common = 97,
OpenCLstd_FMin_common = 98,
OpenCLstd_Mix = 99,
OpenCLstd_Radians = 100,
OpenCLstd_Step = 101,
OpenCLstd_Smoothstep = 102,
OpenCLstd_Sign = 103,
// Section 2.4: Geometric instructions
OpenCLstd_Cross = 104,
OpenCLstd_Distance = 105,
OpenCLstd_Length = 106,
OpenCLstd_Normalize = 107,
OpenCLstd_Fast_distance = 108,
OpenCLstd_Fast_length = 109,
OpenCLstd_Fast_normalize = 110,
// Section 2.5: Relational instructions
OpenCLstd_Bitselect = 186,
OpenCLstd_Select = 187,
// Section 2.6: Vector Data Load and Store instructions
OpenCLstd_Vloadn = 171,
OpenCLstd_Vstoren = 172,
OpenCLstd_Vload_half = 173,
OpenCLstd_Vload_halfn = 174,
OpenCLstd_Vstore_half = 175,
OpenCLstd_Vstore_half_r = 176,
OpenCLstd_Vstore_halfn = 177,
OpenCLstd_Vstore_halfn_r = 178,
OpenCLstd_Vloada_halfn = 179,
OpenCLstd_Vstorea_halfn = 180,
OpenCLstd_Vstorea_halfn_r = 181,
// Section 2.7: Miscellaneous Vector instructions
OpenCLstd_Shuffle = 182,
OpenCLstd_Shuffle2 = 183,
// Section 2.8: Misc instructions
OpenCLstd_Printf = 184,
OpenCLstd_Prefetch = 185,
};
#endif
#endif // #ifndef OPENCLstd_H

View File

@ -0,0 +1,157 @@
// Copyright (c) 2018 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
// to deal in the Materials without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Materials, and to permit persons to whom the
// Materials are furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
// IN THE MATERIALS.
#ifndef SPIRV_UNIFIED1_OpenCLDebugInfo100_H_
#define SPIRV_UNIFIED1_OpenCLDebugInfo100_H_
#ifdef __cplusplus
extern "C" {
#endif
enum {
OpenCLDebugInfo100Version = 200,
OpenCLDebugInfo100Version_BitWidthPadding = 0x7fffffff
};
enum {
OpenCLDebugInfo100Revision = 2,
OpenCLDebugInfo100Revision_BitWidthPadding = 0x7fffffff
};
enum OpenCLDebugInfo100Instructions {
OpenCLDebugInfo100DebugInfoNone = 0,
OpenCLDebugInfo100DebugCompilationUnit = 1,
OpenCLDebugInfo100DebugTypeBasic = 2,
OpenCLDebugInfo100DebugTypePointer = 3,
OpenCLDebugInfo100DebugTypeQualifier = 4,
OpenCLDebugInfo100DebugTypeArray = 5,
OpenCLDebugInfo100DebugTypeVector = 6,
OpenCLDebugInfo100DebugTypedef = 7,
OpenCLDebugInfo100DebugTypeFunction = 8,
OpenCLDebugInfo100DebugTypeEnum = 9,
OpenCLDebugInfo100DebugTypeComposite = 10,
OpenCLDebugInfo100DebugTypeMember = 11,
OpenCLDebugInfo100DebugTypeInheritance = 12,
OpenCLDebugInfo100DebugTypePtrToMember = 13,
OpenCLDebugInfo100DebugTypeTemplate = 14,
OpenCLDebugInfo100DebugTypeTemplateParameter = 15,
OpenCLDebugInfo100DebugTypeTemplateTemplateParameter = 16,
OpenCLDebugInfo100DebugTypeTemplateParameterPack = 17,
OpenCLDebugInfo100DebugGlobalVariable = 18,
OpenCLDebugInfo100DebugFunctionDeclaration = 19,
OpenCLDebugInfo100DebugFunction = 20,
OpenCLDebugInfo100DebugLexicalBlock = 21,
OpenCLDebugInfo100DebugLexicalBlockDiscriminator = 22,
OpenCLDebugInfo100DebugScope = 23,
OpenCLDebugInfo100DebugNoScope = 24,
OpenCLDebugInfo100DebugInlinedAt = 25,
OpenCLDebugInfo100DebugLocalVariable = 26,
OpenCLDebugInfo100DebugInlinedVariable = 27,
OpenCLDebugInfo100DebugDeclare = 28,
OpenCLDebugInfo100DebugValue = 29,
OpenCLDebugInfo100DebugOperation = 30,
OpenCLDebugInfo100DebugExpression = 31,
OpenCLDebugInfo100DebugMacroDef = 32,
OpenCLDebugInfo100DebugMacroUndef = 33,
OpenCLDebugInfo100DebugImportedEntity = 34,
OpenCLDebugInfo100DebugSource = 35,
OpenCLDebugInfo100InstructionsMax = 0x7fffffff
};
enum OpenCLDebugInfo100DebugInfoFlags {
OpenCLDebugInfo100None = 0x0000,
OpenCLDebugInfo100FlagIsProtected = 0x01,
OpenCLDebugInfo100FlagIsPrivate = 0x02,
OpenCLDebugInfo100FlagIsPublic = 0x03,
OpenCLDebugInfo100FlagIsLocal = 0x04,
OpenCLDebugInfo100FlagIsDefinition = 0x08,
OpenCLDebugInfo100FlagFwdDecl = 0x10,
OpenCLDebugInfo100FlagArtificial = 0x20,
OpenCLDebugInfo100FlagExplicit = 0x40,
OpenCLDebugInfo100FlagPrototyped = 0x80,
OpenCLDebugInfo100FlagObjectPointer = 0x100,
OpenCLDebugInfo100FlagStaticMember = 0x200,
OpenCLDebugInfo100FlagIndirectVariable = 0x400,
OpenCLDebugInfo100FlagLValueReference = 0x800,
OpenCLDebugInfo100FlagRValueReference = 0x1000,
OpenCLDebugInfo100FlagIsOptimized = 0x2000,
OpenCLDebugInfo100FlagIsEnumClass = 0x4000,
OpenCLDebugInfo100FlagTypePassByValue = 0x8000,
OpenCLDebugInfo100FlagTypePassByReference = 0x10000,
OpenCLDebugInfo100DebugInfoFlagsMax = 0x7fffffff
};
enum OpenCLDebugInfo100DebugBaseTypeAttributeEncoding {
OpenCLDebugInfo100Unspecified = 0,
OpenCLDebugInfo100Address = 1,
OpenCLDebugInfo100Boolean = 2,
OpenCLDebugInfo100Float = 3,
OpenCLDebugInfo100Signed = 4,
OpenCLDebugInfo100SignedChar = 5,
OpenCLDebugInfo100Unsigned = 6,
OpenCLDebugInfo100UnsignedChar = 7,
OpenCLDebugInfo100DebugBaseTypeAttributeEncodingMax = 0x7fffffff
};
enum OpenCLDebugInfo100DebugCompositeType {
OpenCLDebugInfo100Class = 0,
OpenCLDebugInfo100Structure = 1,
OpenCLDebugInfo100Union = 2,
OpenCLDebugInfo100DebugCompositeTypeMax = 0x7fffffff
};
enum OpenCLDebugInfo100DebugTypeQualifier {
OpenCLDebugInfo100ConstType = 0,
OpenCLDebugInfo100VolatileType = 1,
OpenCLDebugInfo100RestrictType = 2,
OpenCLDebugInfo100AtomicType = 3,
OpenCLDebugInfo100DebugTypeQualifierMax = 0x7fffffff
};
enum OpenCLDebugInfo100DebugOperation {
OpenCLDebugInfo100Deref = 0,
OpenCLDebugInfo100Plus = 1,
OpenCLDebugInfo100Minus = 2,
OpenCLDebugInfo100PlusUconst = 3,
OpenCLDebugInfo100BitPiece = 4,
OpenCLDebugInfo100Swap = 5,
OpenCLDebugInfo100Xderef = 6,
OpenCLDebugInfo100StackValue = 7,
OpenCLDebugInfo100Constu = 8,
OpenCLDebugInfo100Fragment = 9,
OpenCLDebugInfo100DebugOperationMax = 0x7fffffff
};
enum OpenCLDebugInfo100DebugImportedEntity {
OpenCLDebugInfo100ImportedModule = 0,
OpenCLDebugInfo100ImportedDeclaration = 1,
OpenCLDebugInfo100DebugImportedEntityMax = 0x7fffffff
};
#ifdef __cplusplus
}
#endif
#endif // SPIRV_UNIFIED1_OpenCLDebugInfo100_H_

View File

@ -0,0 +1,572 @@
{
"copyright" : [
"Copyright (c) 2017 The Khronos Group Inc.",
"",
"Permission is hereby granted, free of charge, to any person obtaining a copy",
"of this software and/or associated documentation files (the \"Materials\"),",
"to deal in the Materials without restriction, including without limitation",
"the rights to use, copy, modify, merge, publish, distribute, sublicense,",
"and/or sell copies of the Materials, and to permit persons to whom the",
"Materials are furnished to do so, subject to the following conditions:",
"",
"The above copyright notice and this permission notice shall be included in",
"all copies or substantial portions of the Materials.",
"",
"MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS",
"STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND",
"HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ",
"",
"THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS",
"OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL",
"THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING",
"FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS",
"IN THE MATERIALS."
],
"version" : 100,
"revision" : 1,
"instructions" : [
{
"opname" : "DebugInfoNone",
"opcode" : 0
},
{
"opname" : "DebugCompilationUnit",
"opcode" : 1,
"operands" : [
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Version'" },
{ "kind" : "LiteralInteger", "name" : "'DWARF Version'" }
]
},
{
"opname" : "DebugTypeBasic",
"opcode" : 2,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Size'" },
{ "kind" : "DebugBaseTypeAttributeEncoding", "name" : "'Encoding'" }
]
},
{
"opname" : "DebugTypePointer",
"opcode" : 3,
"operands" : [
{ "kind" : "IdRef", "name" : "'Base Type'" },
{ "kind" : "StorageClass", "name" : "'Storage Class'" },
{ "kind" : "DebugInfoFlags", "name" : "'Literal Flags'" }
]
},
{
"opname" : "DebugTypeQualifier",
"opcode" : 4,
"operands" : [
{ "kind" : "IdRef", "name" : "'Base Type'" },
{ "kind" : "DebugTypeQualifier", "name" : "'Type Qualifier'" }
]
},
{
"opname" : "DebugTypeArray",
"opcode" : 5,
"operands" : [
{ "kind" : "IdRef", "name" : "'Base Type'" },
{ "kind" : "IdRef", "name" : "'Component Counts'", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeVector",
"opcode" : 6,
"operands" : [
{ "kind" : "IdRef", "name" : "'Base Type'" },
{ "kind" : "LiteralInteger", "name" : "'Component Count'" }
]
},
{
"opname" : "DebugTypedef",
"opcode" : 7,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Base Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" }
]
},
{
"opname" : "DebugTypeFunction",
"opcode" : 8,
"operands" : [
{ "kind" : "IdRef", "name" : "'Return Type'" },
{ "kind" : "IdRef", "name" : "'Paramter Types'", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeEnum",
"opcode" : 9,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Underlying Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Size'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "PairIdRefIdRef", "name" : "'Value, Name, Value, Name, ...'", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeComposite",
"opcode" : 10,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "DebugCompositeType", "name" : "'Tag'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Size'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "IdRef", "name" : "'Members'", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeMember",
"opcode" : 11,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Offset'" },
{ "kind" : "IdRef", "name" : "'Size'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" }
]
},
{
"opname" : "DebugTypeInheritance",
"opcode" : 12,
"operands" : [
{ "kind" : "IdRef", "name" : "'Child'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Offset'" },
{ "kind" : "IdRef", "name" : "'Size'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" }
]
},
{
"opname" : "DebugTypePtrToMember",
"opcode" : 13,
"operands" : [
{ "kind" : "IdRef", "name" : "'Member Type'" },
{ "kind" : "IdRef", "name" : "'Parent'" }
]
},
{
"opname" : "DebugTypeTemplate",
"opcode" : 14,
"operands" : [
{ "kind" : "IdRef", "name" : "'Target'" },
{ "kind" : "IdRef", "name" : "'Parameters'", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeTemplateParameter",
"opcode" : 15,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Actual Type'" },
{ "kind" : "IdRef", "name" : "'Value'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" }
]
},
{
"opname" : "DebugTypeTemplateTemplateParameter",
"opcode" : 16,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Template Name'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" }
]
},
{
"opname" : "DebugTypeTemplateParameterPack",
"opcode" : 17,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Template Parameters'", "quantifier" : "*" }
]
},
{
"opname" : "DebugGlobalVariable",
"opcode" : 18,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Linkage Name'" },
{ "kind" : "IdRef", "name" : "'Variable'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "IdRef", "name" : "'Static Member Declaration'", "quantifier" : "?" }
]
},
{
"opname" : "DebugFunctionDeclaration",
"opcode" : 19,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Linkage Name'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" }
]
},
{
"opname" : "DebugFunction",
"opcode" : 20,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Linkage Name'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "LiteralInteger", "name" : "'Scope Line'" },
{ "kind" : "IdRef", "name" : "'Function'" },
{ "kind" : "IdRef", "name" : "'Declaration'", "quantifier" : "?" }
]
},
{
"opname" : "DebugLexicalBlock",
"opcode" : 21,
"operands" : [
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Name'", "quantifier" : "?" }
]
},
{
"opname" : "DebugLexicalBlockDiscriminator",
"opcode" : 22,
"operands" : [
{ "kind" : "IdRef", "name" : "'Scope'" },
{ "kind" : "LiteralInteger", "name" : "'Discriminator'" },
{ "kind" : "IdRef", "name" : "'Parent'" }
]
},
{
"opname" : "DebugScope",
"opcode" : 23,
"operands" : [
{ "kind" : "IdRef", "name" : "'Scope'" },
{ "kind" : "IdRef", "name" : "'Inlined At'", "quantifier" : "?" }
]
},
{
"opname" : "DebugNoScope",
"opcode" : 24
},
{
"opname" : "DebugInlinedAt",
"opcode" : 25,
"operands" : [
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "IdRef", "name" : "'Scope'" },
{ "kind" : "IdRef", "name" : "'Inlined'", "quantifier" : "?" }
]
},
{
"opname" : "DebugLocalVariable",
"opcode" : 26,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "LiteralInteger", "name" : "'Arg Number'", "quantifier" : "?" }
]
},
{
"opname" : "DebugInlinedVariable",
"opcode" : 27,
"operands" : [
{ "kind" : "IdRef", "name" : "'Variable'" },
{ "kind" : "IdRef", "name" : "'Inlined'" }
]
},
{
"opname" : "DebugDeclare",
"opcode" : 28,
"operands" : [
{ "kind" : "IdRef", "name" : "'Local Variable'" },
{ "kind" : "IdRef", "name" : "'Variable'" },
{ "kind" : "IdRef", "name" : "'Expression'" }
]
},
{
"opname" : "DebugValue",
"opcode" : 29,
"operands" : [
{ "kind" : "IdRef", "name" : "'Value'" },
{ "kind" : "IdRef", "name" : "'Expression'" },
{ "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" }
]
},
{
"opname" : "DebugOperation",
"opcode" : 30,
"operands" : [
{ "kind" : "DebugOperation", "name" : "'OpCode'" },
{ "kind" : "LiteralInteger", "name" : "'Operands ...'", "quantifier" : "*" }
]
},
{
"opname" : "DebugExpression",
"opcode" : 31,
"operands" : [
{ "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" }
]
},
{
"opname" : "DebugMacroDef",
"opcode" : 32,
"operands" : [
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" }
]
},
{
"opname" : "DebugMacroUndef",
"opcode" : 33,
"operands" : [
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "IdRef", "name" : "'Macro'" }
]
}
],
"operand_kinds" : [
{
"category" : "BitEnum",
"kind" : "DebugInfoFlags",
"enumerants" : [
{
"enumerant" : "None",
"value" : "0x0000"
},
{
"enumerant" : "FlagIsProtected",
"value" : "0x01"
},
{
"enumerant" : "FlagIsPrivate",
"value" : "0x02"
},
{
"enumerant" : "FlagIsPublic",
"value" : "0x03"
},
{
"enumerant" : "FlagIsLocal",
"value" : "0x04"
},
{
"enumerant" : "FlagIsDefinition",
"value" : "0x08"
},
{
"enumerant" : "FlagFwdDecl",
"value" : "0x10"
},
{
"enumerant" : "FlagArtificial",
"value" : "0x20"
},
{
"enumerant" : "FlagExplicit",
"value" : "0x40"
},
{
"enumerant" : "FlagPrototyped",
"value" : "0x80"
},
{
"enumerant" : "FlagObjectPointer",
"value" : "0x100"
},
{
"enumerant" : "FlagStaticMember",
"value" : "0x200"
},
{
"enumerant" : "FlagIndirectVariable",
"value" : "0x400"
},
{
"enumerant" : "FlagLValueReference",
"value" : "0x800"
},
{
"enumerant" : "FlagRValueReference",
"value" : "0x1000"
},
{
"enumerant" : "FlagIsOptimized",
"value" : "0x2000"
}
]
},
{
"category" : "ValueEnum",
"kind" : "DebugBaseTypeAttributeEncoding",
"enumerants" : [
{
"enumerant" : "Unspecified",
"value" : "0"
},
{
"enumerant" : "Address",
"value" : "1"
},
{
"enumerant" : "Boolean",
"value" : "2"
},
{
"enumerant" : "Float",
"value" : "4"
},
{
"enumerant" : "Signed",
"value" : "5"
},
{
"enumerant" : "SignedChar",
"value" : "6"
},
{
"enumerant" : "Unsigned",
"value" : "7"
},
{
"enumerant" : "UnsignedChar",
"value" : "8"
}
]
},
{
"category" : "ValueEnum",
"kind" : "DebugCompositeType",
"enumerants" : [
{
"enumerant" : "Class",
"value" : "0"
},
{
"enumerant" : "Structure",
"value" : "1"
},
{
"enumerant" : "Union",
"value" : "2"
}
]
},
{
"category" : "ValueEnum",
"kind" : "DebugTypeQualifier",
"enumerants" : [
{
"enumerant" : "ConstType",
"value" : "0"
},
{
"enumerant" : "VolatileType",
"value" : "1"
},
{
"enumerant" : "RestrictType",
"value" : "2"
}
]
},
{
"category" : "ValueEnum",
"kind" : "DebugOperation",
"enumerants" : [
{
"enumerant" : "Deref",
"value" : "0"
},
{
"enumerant" : "Plus",
"value" : "1"
},
{
"enumerant" : "Minus",
"value" : "2"
},
{
"enumerant" : "PlusUconst",
"value" : "3",
"parameters" : [
{ "kind" : "LiteralInteger" }
]
},
{
"enumerant" : "BitPiece",
"value" : "4",
"parameters" : [
{ "kind" : "LiteralInteger" },
{ "kind" : "LiteralInteger" }
]
},
{
"enumerant" : "Swap",
"value" : "5"
},
{
"enumerant" : "Xderef",
"value" : "6"
},
{
"enumerant" : "StackValue",
"value" : "7"
},
{
"enumerant" : "Constu",
"value" : "8",
"parameters" : [
{ "kind" : "LiteralInteger" }
]
}
]
}
]
}

View File

@ -0,0 +1,237 @@
{
"revision" : 1,
"instructions" : [
{
"opname" : "Kernel",
"opcode" : 1,
"operands" : [
{ "kind" : "IdRef", "name" : "Kernel" },
{ "kind" : "IdRef", "name" : "Name" }
]
},
{
"opname" : "ArgumentInfo",
"opcode" : 2,
"operands" : [
{ "kind" : "IdRef", "name" : "Name" },
{ "kind" : "IdRef", "name" : "Type Name", "quantifier" : "?" },
{ "kind" : "IdRef", "name" : "Address Qualifier", "quantifier" : "?" },
{ "kind" : "IdRef", "name" : "Access Qualifier", "quantifier" : "?" },
{ "kind" : "IdRef", "name" : "Type Qualifier", "quantifier" : "?" }
]
},
{
"opname" : "ArgumentStorageBuffer",
"opcode" : 3,
"operands" : [
{ "kind" : "IdRef", "name" : "Decl" },
{ "kind" : "IdRef", "name" : "Ordinal" },
{ "kind" : "IdRef", "name" : "DescriptorSet" },
{ "kind" : "IdRef", "name" : "Binding" },
{ "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
]
},
{
"opname" : "ArgumentUniform",
"opcode" : 4,
"operands" : [
{ "kind" : "IdRef", "name" : "Decl" },
{ "kind" : "IdRef", "name" : "Ordinal" },
{ "kind" : "IdRef", "name" : "DescriptorSet" },
{ "kind" : "IdRef", "name" : "Binding" },
{ "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
]
},
{
"opname" : "ArgumentPodStorageBuffer",
"opcode" : 5,
"operands" : [
{ "kind" : "IdRef", "name" : "Decl" },
{ "kind" : "IdRef", "name" : "Ordinal" },
{ "kind" : "IdRef", "name" : "DescriptorSet" },
{ "kind" : "IdRef", "name" : "Binding" },
{ "kind" : "IdRef", "name" : "Offset" },
{ "kind" : "IdRef", "name" : "Size" },
{ "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
]
},
{
"opname" : "ArgumentPodUniform",
"opcode" : 6,
"operands" : [
{ "kind" : "IdRef", "name" : "Decl" },
{ "kind" : "IdRef", "name" : "Ordinal" },
{ "kind" : "IdRef", "name" : "DescriptorSet" },
{ "kind" : "IdRef", "name" : "Binding" },
{ "kind" : "IdRef", "name" : "Offset" },
{ "kind" : "IdRef", "name" : "Size" },
{ "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
]
},
{
"opname" : "ArgumentPodPushConstant",
"opcode" : 7,
"operands" : [
{ "kind" : "IdRef", "name" : "Decl" },
{ "kind" : "IdRef", "name" : "Ordinal" },
{ "kind" : "IdRef", "name" : "Offset" },
{ "kind" : "IdRef", "name" : "Size" },
{ "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
]
},
{
"opname" : "ArgumentSampledImage",
"opcode" : 8,
"operands" : [
{ "kind" : "IdRef", "name" : "Decl" },
{ "kind" : "IdRef", "name" : "Ordinal" },
{ "kind" : "IdRef", "name" : "DescriptorSet" },
{ "kind" : "IdRef", "name" : "Binding" },
{ "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
]
},
{
"opname" : "ArgumentStorageImage",
"opcode" : 9,
"operands" : [
{ "kind" : "IdRef", "name" : "Decl" },
{ "kind" : "IdRef", "name" : "Ordinal" },
{ "kind" : "IdRef", "name" : "DescriptorSet" },
{ "kind" : "IdRef", "name" : "Binding" },
{ "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
]
},
{
"opname" : "ArgumentSampler",
"opcode" : 10,
"operands" : [
{ "kind" : "IdRef", "name" : "Decl" },
{ "kind" : "IdRef", "name" : "Ordinal" },
{ "kind" : "IdRef", "name" : "DescriptorSet" },
{ "kind" : "IdRef", "name" : "Binding" },
{ "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
]
},
{
"opname" : "ArgumentWorkgroup",
"opcode" : 11,
"operands" : [
{ "kind" : "IdRef", "name" : "Decl" },
{ "kind" : "IdRef", "name" : "Ordinal" },
{ "kind" : "IdRef", "name" : "SpecId" },
{ "kind" : "IdRef", "name" : "ElemSize" },
{ "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
]
},
{
"opname" : "SpecConstantWorkgroupSize",
"opcode" : 12,
"operands" : [
{ "kind" : "IdRef", "name" : "X" },
{ "kind" : "IdRef", "name" : "Y" },
{ "kind" : "IdRef", "name" : "Z" }
]
},
{
"opname" : "SpecConstantGlobalOffset",
"opcode" : 13,
"operands" : [
{ "kind" : "IdRef", "name" : "X" },
{ "kind" : "IdRef", "name" : "Y" },
{ "kind" : "IdRef", "name" : "Z" }
]
},
{
"opname" : "SpecConstantWorkDim",
"opcode" : 14,
"operands" : [
{ "kind" : "IdRef", "name" : "Dim" }
]
},
{
"opname" : "PushConstantGlobalOffset",
"opcode" : 15,
"operands" : [
{ "kind" : "IdRef", "name" : "Offset" },
{ "kind" : "IdRef", "name" : "Size" }
]
},
{
"opname" : "PushConstantEnqueuedLocalSize",
"opcode" : 16,
"operands" : [
{ "kind" : "IdRef", "name" : "Offset" },
{ "kind" : "IdRef", "name" : "Size" }
]
},
{
"opname" : "PushConstantGlobalSize",
"opcode" : 17,
"operands" : [
{ "kind" : "IdRef", "name" : "Offset" },
{ "kind" : "IdRef", "name" : "Size" }
]
},
{
"opname" : "PushConstantRegionOffset",
"opcode" : 18,
"operands" : [
{ "kind" : "IdRef", "name" : "Offset" },
{ "kind" : "IdRef", "name" : "Size" }
]
},
{
"opname" : "PushConstantNumWorkgroups",
"opcode" : 19,
"operands" : [
{ "kind" : "IdRef", "name" : "Offset" },
{ "kind" : "IdRef", "name" : "Size" }
]
},
{
"opname" : "PushConstantRegionGroupOffset",
"opcode" : 20,
"operands" : [
{ "kind" : "IdRef", "name" : "Offset" },
{ "kind" : "IdRef", "name" : "Size" }
]
},
{
"opname" : "ConstantDataStorageBuffer",
"opcode" : 21,
"operands" : [
{ "kind" : "IdRef", "name" : "DescriptorSet" },
{ "kind" : "IdRef", "name" : "Binding" },
{ "kind" : "IdRef", "name" : "Data" }
]
},
{
"opname" : "ConstantDataUniform",
"opcode" : 22,
"operands" : [
{ "kind" : "IdRef", "name" : "DescriptorSet" },
{ "kind" : "IdRef", "name" : "Binding" },
{ "kind" : "IdRef", "name" : "Data" }
]
},
{
"opname" : "LiteralSampler",
"opcode" : 23,
"operands" : [
{ "kind" : "IdRef", "name" : "DescriptorSet" },
{ "kind" : "IdRef", "name" : "Binding" },
{ "kind" : "IdRef", "name" : "Mask" }
]
},
{
"opname" : "PropertyRequiredWorkgroupSize",
"opcode" : 24,
"operands" : [
{ "kind" : "IdRef", "name" : "Kernel" },
{ "kind" : "IdRef", "name" : "X" },
{ "kind" : "IdRef", "name" : "Y" },
{ "kind" : "IdRef", "name" : "Z" }
]
}
]
}

View File

@ -0,0 +1,13 @@
{
"revision" : 1,
"instructions" : [
{
"opname" : "DebugPrintf",
"opcode" : 1,
"operands" : [
{ "kind" : "IdRef", "name" : "'Format'" },
{ "kind" : "IdRef", "quantifier" : "*" }
]
}
]
}

View File

@ -0,0 +1,636 @@
{
"copyright" : [
"Copyright (c) 2018 The Khronos Group Inc.",
"",
"Permission is hereby granted, free of charge, to any person obtaining a copy",
"of this software and/or associated documentation files (the \"Materials\"),",
"to deal in the Materials without restriction, including without limitation",
"the rights to use, copy, modify, merge, publish, distribute, sublicense,",
"and/or sell copies of the Materials, and to permit persons to whom the",
"Materials are furnished to do so, subject to the following conditions:",
"",
"The above copyright notice and this permission notice shall be included in",
"all copies or substantial portions of the Materials.",
"",
"MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS",
"STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND",
"HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ ",
"",
"THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS",
"OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL",
"THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING",
"FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS",
"IN THE MATERIALS."
],
"version" : 200,
"revision" : 2,
"instructions" : [
{
"opname" : "DebugInfoNone",
"opcode" : 0
},
{
"opname" : "DebugCompilationUnit",
"opcode" : 1,
"operands" : [
{ "kind" : "LiteralInteger", "name" : "'Version'" },
{ "kind" : "LiteralInteger", "name" : "'DWARF Version'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "SourceLanguage", "name" : "'Language'" }
]
},
{
"opname" : "DebugTypeBasic",
"opcode" : 2,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Size'" },
{ "kind" : "DebugBaseTypeAttributeEncoding", "name" : "'Encoding'" }
]
},
{
"opname" : "DebugTypePointer",
"opcode" : 3,
"operands" : [
{ "kind" : "IdRef", "name" : "'Base Type'" },
{ "kind" : "StorageClass", "name" : "'Storage Class'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" }
]
},
{
"opname" : "DebugTypeQualifier",
"opcode" : 4,
"operands" : [
{ "kind" : "IdRef", "name" : "'Base Type'" },
{ "kind" : "DebugTypeQualifier", "name" : "'Type Qualifier'" }
]
},
{
"opname" : "DebugTypeArray",
"opcode" : 5,
"operands" : [
{ "kind" : "IdRef", "name" : "'Base Type'" },
{ "kind" : "IdRef", "name" : "'Component Counts'", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeVector",
"opcode" : 6,
"operands" : [
{ "kind" : "IdRef", "name" : "'Base Type'" },
{ "kind" : "LiteralInteger", "name" : "'Component Count'" }
]
},
{
"opname" : "DebugTypedef",
"opcode" : 7,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Base Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" }
]
},
{
"opname" : "DebugTypeFunction",
"opcode" : 8,
"operands" : [
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "IdRef", "name" : "'Return Type'" },
{ "kind" : "IdRef", "name" : "'Parameter Types'", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeEnum",
"opcode" : 9,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Underlying Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Size'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "PairIdRefIdRef", "name" : "'Value, Name, Value, Name, ...'", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeComposite",
"opcode" : 10,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "DebugCompositeType", "name" : "'Tag'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Linkage Name'" },
{ "kind" : "IdRef", "name" : "'Size'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "IdRef", "name" : "'Members'", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeMember",
"opcode" : 11,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Offset'" },
{ "kind" : "IdRef", "name" : "'Size'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" }
]
},
{
"opname" : "DebugTypeInheritance",
"opcode" : 12,
"operands" : [
{ "kind" : "IdRef", "name" : "'Child'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Offset'" },
{ "kind" : "IdRef", "name" : "'Size'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" }
]
},
{
"opname" : "DebugTypePtrToMember",
"opcode" : 13,
"operands" : [
{ "kind" : "IdRef", "name" : "'Member Type'" },
{ "kind" : "IdRef", "name" : "'Parent'" }
]
},
{
"opname" : "DebugTypeTemplate",
"opcode" : 14,
"operands" : [
{ "kind" : "IdRef", "name" : "'Target'" },
{ "kind" : "IdRef", "name" : "'Parameters'", "quantifier" : "*" }
]
},
{
"opname" : "DebugTypeTemplateParameter",
"opcode" : 15,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Actual Type'" },
{ "kind" : "IdRef", "name" : "'Value'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" }
]
},
{
"opname" : "DebugTypeTemplateTemplateParameter",
"opcode" : 16,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Template Name'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" }
]
},
{
"opname" : "DebugTypeTemplateParameterPack",
"opcode" : 17,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Template Parameters'", "quantifier" : "*" }
]
},
{
"opname" : "DebugGlobalVariable",
"opcode" : 18,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Linkage Name'" },
{ "kind" : "IdRef", "name" : "'Variable'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "IdRef", "name" : "'Static Member Declaration'", "quantifier" : "?" }
]
},
{
"opname" : "DebugFunctionDeclaration",
"opcode" : 19,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Linkage Name'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" }
]
},
{
"opname" : "DebugFunction",
"opcode" : 20,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Linkage Name'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "LiteralInteger", "name" : "'Scope Line'" },
{ "kind" : "IdRef", "name" : "'Function'" },
{ "kind" : "IdRef", "name" : "'Declaration'", "quantifier" : "?" }
]
},
{
"opname" : "DebugLexicalBlock",
"opcode" : 21,
"operands" : [
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "IdRef", "name" : "'Name'", "quantifier" : "?" }
]
},
{
"opname" : "DebugLexicalBlockDiscriminator",
"opcode" : 22,
"operands" : [
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Discriminator'" },
{ "kind" : "IdRef", "name" : "'Parent'" }
]
},
{
"opname" : "DebugScope",
"opcode" : 23,
"operands" : [
{ "kind" : "IdRef", "name" : "'Scope'" },
{ "kind" : "IdRef", "name" : "'Inlined At'", "quantifier" : "?" }
]
},
{
"opname" : "DebugNoScope",
"opcode" : 24
},
{
"opname" : "DebugInlinedAt",
"opcode" : 25,
"operands" : [
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "IdRef", "name" : "'Scope'" },
{ "kind" : "IdRef", "name" : "'Inlined'", "quantifier" : "?" }
]
},
{
"opname" : "DebugLocalVariable",
"opcode" : 26,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Type'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" },
{ "kind" : "DebugInfoFlags", "name" : "'Flags'" },
{ "kind" : "LiteralInteger", "name" : "'Arg Number'", "quantifier" : "?" }
]
},
{
"opname" : "DebugInlinedVariable",
"opcode" : 27,
"operands" : [
{ "kind" : "IdRef", "name" : "'Variable'" },
{ "kind" : "IdRef", "name" : "'Inlined'" }
]
},
{
"opname" : "DebugDeclare",
"opcode" : 28,
"operands" : [
{ "kind" : "IdRef", "name" : "'Local Variable'" },
{ "kind" : "IdRef", "name" : "'Variable'" },
{ "kind" : "IdRef", "name" : "'Expression'" }
]
},
{
"opname" : "DebugValue",
"opcode" : 29,
"operands" : [
{ "kind" : "IdRef", "name" : "'Local Variable'" },
{ "kind" : "IdRef", "name" : "'Value'" },
{ "kind" : "IdRef", "name" : "'Expression'" },
{ "kind" : "IdRef", "name" : "'Indexes'", "quantifier" : "*" }
]
},
{
"opname" : "DebugOperation",
"opcode" : 30,
"operands" : [
{ "kind" : "DebugOperation", "name" : "'OpCode'" },
{ "kind" : "LiteralInteger", "name" : "'Operands ...'", "quantifier" : "*" }
]
},
{
"opname" : "DebugExpression",
"opcode" : 31,
"operands" : [
{ "kind" : "IdRef", "name" : "'Operands ...'", "quantifier" : "*" }
]
},
{
"opname" : "DebugMacroDef",
"opcode" : 32,
"operands" : [
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "IdRef", "name" : "'Value'", "quantifier" : "?" }
]
},
{
"opname" : "DebugMacroUndef",
"opcode" : 33,
"operands" : [
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "IdRef", "name" : "'Macro'" }
]
},
{
"opname" : "DebugImportedEntity",
"opcode" : 34,
"operands" : [
{ "kind" : "IdRef", "name" : "'Name'" },
{ "kind" : "DebugImportedEntity", "name" : "'Tag'" },
{ "kind" : "IdRef", "name" : "'Source'" },
{ "kind" : "IdRef", "name" : "'Entity'" },
{ "kind" : "LiteralInteger", "name" : "'Line'" },
{ "kind" : "LiteralInteger", "name" : "'Column'" },
{ "kind" : "IdRef", "name" : "'Parent'" }
]
},
{
"opname" : "DebugSource",
"opcode" : 35,
"operands" : [
{ "kind" : "IdRef", "name" : "'File'" },
{ "kind" : "IdRef", "name" : "'Text'", "quantifier" : "?" }
]
}
],
"operand_kinds" : [
{
"category" : "BitEnum",
"kind" : "DebugInfoFlags",
"enumerants" : [
{
"enumerant" : "None",
"value" : "0x0000"
},
{
"enumerant" : "FlagIsProtected",
"value" : "0x01"
},
{
"enumerant" : "FlagIsPrivate",
"value" : "0x02"
},
{
"enumerant" : "FlagIsPublic",
"value" : "0x03"
},
{
"enumerant" : "FlagIsLocal",
"value" : "0x04"
},
{
"enumerant" : "FlagIsDefinition",
"value" : "0x08"
},
{
"enumerant" : "FlagFwdDecl",
"value" : "0x10"
},
{
"enumerant" : "FlagArtificial",
"value" : "0x20"
},
{
"enumerant" : "FlagExplicit",
"value" : "0x40"
},
{
"enumerant" : "FlagPrototyped",
"value" : "0x80"
},
{
"enumerant" : "FlagObjectPointer",
"value" : "0x100"
},
{
"enumerant" : "FlagStaticMember",
"value" : "0x200"
},
{
"enumerant" : "FlagIndirectVariable",
"value" : "0x400"
},
{
"enumerant" : "FlagLValueReference",
"value" : "0x800"
},
{
"enumerant" : "FlagRValueReference",
"value" : "0x1000"
},
{
"enumerant" : "FlagIsOptimized",
"value" : "0x2000"
},
{
"enumerant" : "FlagIsEnumClass",
"value" : "0x4000"
},
{
"enumerant" : "FlagTypePassByValue",
"value" : "0x8000"
},
{
"enumerant" : "FlagTypePassByReference",
"value" : "0x10000"
}
]
},
{
"category" : "ValueEnum",
"kind" : "DebugBaseTypeAttributeEncoding",
"enumerants" : [
{
"enumerant" : "Unspecified",
"value" : "0"
},
{
"enumerant" : "Address",
"value" : "1"
},
{
"enumerant" : "Boolean",
"value" : "2"
},
{
"enumerant" : "Float",
"value" : "3"
},
{
"enumerant" : "Signed",
"value" : "4"
},
{
"enumerant" : "SignedChar",
"value" : "5"
},
{
"enumerant" : "Unsigned",
"value" : "6"
},
{
"enumerant" : "UnsignedChar",
"value" : "7"
}
]
},
{
"category" : "ValueEnum",
"kind" : "DebugCompositeType",
"enumerants" : [
{
"enumerant" : "Class",
"value" : "0"
},
{
"enumerant" : "Structure",
"value" : "1"
},
{
"enumerant" : "Union",
"value" : "2"
}
]
},
{
"category" : "ValueEnum",
"kind" : "DebugTypeQualifier",
"enumerants" : [
{
"enumerant" : "ConstType",
"value" : "0"
},
{
"enumerant" : "VolatileType",
"value" : "1"
},
{
"enumerant" : "RestrictType",
"value" : "2"
},
{
"enumerant" : "AtomicType",
"value" : "3"
}
]
},
{
"category" : "ValueEnum",
"kind" : "DebugOperation",
"enumerants" : [
{
"enumerant" : "Deref",
"value" : "0"
},
{
"enumerant" : "Plus",
"value" : "1"
},
{
"enumerant" : "Minus",
"value" : "2"
},
{
"enumerant" : "PlusUconst",
"value" : "3",
"parameters" : [
{ "kind" : "LiteralInteger" }
]
},
{
"enumerant" : "BitPiece",
"value" : "4",
"parameters" : [
{ "kind" : "LiteralInteger" },
{ "kind" : "LiteralInteger" }
]
},
{
"enumerant" : "Swap",
"value" : "5"
},
{
"enumerant" : "Xderef",
"value" : "6"
},
{
"enumerant" : "StackValue",
"value" : "7"
},
{
"enumerant" : "Constu",
"value" : "8",
"parameters" : [
{ "kind" : "LiteralInteger" }
]
},
{
"enumerant" : "Fragment",
"value" : "9",
"parameters" : [
{ "kind" : "LiteralInteger" },
{ "kind" : "LiteralInteger" }
]
}
]
},
{
"category" : "ValueEnum",
"kind" : "DebugImportedEntity",
"enumerants" : [
{
"enumerant" : "ImportedModule",
"value" : "0"
},
{
"enumerant" : "ImportedDeclaration",
"value" : "1"
}
]
}
]
}

View File

@ -0,0 +1,26 @@
{
"revision" : 2,
"instructions" : [
{
"opname" : "CubeFaceIndexAMD",
"opcode" : 1,
"operands" : [
{ "kind" : "IdRef", "name" : "'P'" }
],
"extensions" : [ "SPV_AMD_gcn_shader" ]
},
{
"opname" : "CubeFaceCoordAMD",
"opcode" : 2,
"operands" : [
{ "kind" : "IdRef", "name" : "'P'" }
],
"extensions" : [ "SPV_AMD_gcn_shader" ]
},
{
"opname" : "TimeAMD",
"opcode" : 3,
"extensions" : [ "SPV_AMD_gcn_shader" ]
}
]
}

View File

@ -0,0 +1,41 @@
{
"revision" : 5,
"instructions" : [
{
"opname" : "SwizzleInvocationsAMD",
"opcode" : 1,
"operands" : [
{ "kind" : "IdRef", "name" : "'data'" },
{ "kind" : "IdRef", "name" : "'offset'" }
],
"extensions" : [ "SPV_AMD_shader_ballot" ]
},
{
"opname" : "SwizzleInvocationsMaskedAMD",
"opcode" : 2,
"operands" : [
{ "kind" : "IdRef", "name" : "'data'" },
{ "kind" : "IdRef", "name" : "'mask'" }
],
"extensions" : [ "SPV_AMD_shader_ballot" ]
},
{
"opname" : "WriteInvocationAMD",
"opcode" : 3,
"operands" : [
{ "kind" : "IdRef", "name" : "'inputValue'" },
{ "kind" : "IdRef", "name" : "'writeValue'" },
{ "kind" : "IdRef", "name" : "'invocationIndex'" }
],
"extensions" : [ "SPV_AMD_shader_ballot" ]
},
{
"opname" : "MbcntAMD",
"opcode" : 4,
"operands" : [
{ "kind" : "IdRef", "name" : "'mask'" }
],
"extensions" : [ "SPV_AMD_shader_ballot" ]
}
]
}

View File

@ -0,0 +1,14 @@
{
"revision" : 4,
"instructions" : [
{
"opname" : "InterpolateAtVertexAMD",
"opcode" : 1,
"operands" : [
{ "kind" : "IdRef", "name" : "'interpolant'" },
{ "kind" : "IdRef", "name" : "'vertexIdx'" }
],
"extensions" : [ "SPV_AMD_shader_explicit_vertex_parameter" ]
}
]
}

View File

@ -0,0 +1,95 @@
{
"revision" : 4,
"instructions" : [
{
"opname" : "FMin3AMD",
"opcode" : 1,
"operands" : [
{ "kind" : "IdRef", "name" : "'x'" },
{ "kind" : "IdRef", "name" : "'y'" },
{ "kind" : "IdRef", "name" : "'z'" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
{
"opname" : "UMin3AMD",
"opcode" : 2,
"operands" : [
{ "kind" : "IdRef", "name" : "'x'" },
{ "kind" : "IdRef", "name" : "'y'" },
{ "kind" : "IdRef", "name" : "'z'" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
{
"opname" : "SMin3AMD",
"opcode" : 3,
"operands" : [
{ "kind" : "IdRef", "name" : "'x'" },
{ "kind" : "IdRef", "name" : "'y'" },
{ "kind" : "IdRef", "name" : "'z'" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
{
"opname" : "FMax3AMD",
"opcode" : 4,
"operands" : [
{ "kind" : "IdRef", "name" : "'x'" },
{ "kind" : "IdRef", "name" : "'y'" },
{ "kind" : "IdRef", "name" : "'z'" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
{
"opname" : "UMax3AMD",
"opcode" : 5,
"operands" : [
{ "kind" : "IdRef", "name" : "'x'" },
{ "kind" : "IdRef", "name" : "'y'" },
{ "kind" : "IdRef", "name" : "'z'" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
{
"opname" : "SMax3AMD",
"opcode" : 6,
"operands" : [
{ "kind" : "IdRef", "name" : "'x'" },
{ "kind" : "IdRef", "name" : "'y'" },
{ "kind" : "IdRef", "name" : "'z'" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
{
"opname" : "FMid3AMD",
"opcode" : 7,
"operands" : [
{ "kind" : "IdRef", "name" : "'x'" },
{ "kind" : "IdRef", "name" : "'y'" },
{ "kind" : "IdRef", "name" : "'z'" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
{
"opname" : "UMid3AMD",
"opcode" : 8,
"operands" : [
{ "kind" : "IdRef", "name" : "'x'" },
{ "kind" : "IdRef", "name" : "'y'" },
{ "kind" : "IdRef", "name" : "'z'" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
},
{
"opname" : "SMid3AMD",
"opcode" : 9,
"operands" : [
{ "kind" : "IdRef", "name" : "'x'" },
{ "kind" : "IdRef", "name" : "'y'" },
{ "kind" : "IdRef", "name" : "'z'" }
],
"extensions" : [ "SPV_AMD_shader_trinary_minmax" ]
}
]
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
"Comment":
[
[
"Copyright (c) 2014-2018 The Khronos Group Inc.",
"Copyright (c) 2014-2020 The Khronos Group Inc.",
"",
"Permission is hereby granted, free of charge, to any person obtaining a copy",
"of this software and/or associated documentation files (the \"Materials\"),",
@ -36,13 +36,16 @@
],
[
"Enumeration tokens for SPIR-V, in various styles:",
" C, C++, C++11, JSON, Lua, Python",
" C, C++, C++11, JSON, Lua, Python, C#, D",
"",
"- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL",
"- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL",
"- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL",
"- Lua will use tables, e.g.: spv.SourceLanguage.GLSL",
"- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']",
"- C# will use enum classes in the Specification class located in the \"Spv\" namespace,",
" e.g.: Spv.Specification.SourceLanguage.GLSL",
"- D will have tokens under the \"spv\" module, e.g: spv.SourceLanguage.GLSL",
"",
"Some tokens act like mask values, which can be OR'd together,",
"while others are mutually exclusive. The mask-like ones have",
@ -51,8 +54,8 @@
]
],
"MagicNumber": 119734787,
"Version": 66304,
"Revision": 1,
"Version": 66816,
"Revision": 4,
"OpCodeMask": 65535,
"WordCountShift": 16
},
@ -82,7 +85,21 @@
"Geometry": 3,
"Fragment": 4,
"GLCompute": 5,
"Kernel": 6
"Kernel": 6,
"TaskNV": 5267,
"MeshNV": 5268,
"RayGenerationKHR": 5313,
"RayGenerationNV": 5313,
"IntersectionKHR": 5314,
"IntersectionNV": 5314,
"AnyHitKHR": 5315,
"AnyHitNV": 5315,
"ClosestHitKHR": 5316,
"ClosestHitNV": 5316,
"MissKHR": 5317,
"MissNV": 5317,
"CallableKHR": 5318,
"CallableNV": 5318
}
},
{
@ -92,7 +109,9 @@
{
"Logical": 0,
"Physical32": 1,
"Physical64": 2
"Physical64": 2,
"PhysicalStorageBuffer64": 5348,
"PhysicalStorageBuffer64EXT": 5348
}
},
{
@ -102,7 +121,9 @@
{
"Simple": 0,
"GLSL450": 1,
"OpenCL": 2
"OpenCL": 2,
"Vulkan": 3,
"VulkanKHR": 3
}
},
{
@ -149,7 +170,33 @@
"LocalSizeId": 38,
"LocalSizeHintId": 39,
"PostDepthCoverage": 4446,
"StencilRefReplacingEXT": 5027
"DenormPreserve": 4459,
"DenormFlushToZero": 4460,
"SignedZeroInfNanPreserve": 4461,
"RoundingModeRTE": 4462,
"RoundingModeRTZ": 4463,
"StencilRefReplacingEXT": 5027,
"OutputLinesNV": 5269,
"OutputPrimitivesNV": 5270,
"DerivativeGroupQuadsNV": 5289,
"DerivativeGroupLinearNV": 5290,
"OutputTrianglesNV": 5298,
"PixelInterlockOrderedEXT": 5366,
"PixelInterlockUnorderedEXT": 5367,
"SampleInterlockOrderedEXT": 5368,
"SampleInterlockUnorderedEXT": 5369,
"ShadingRateInterlockOrderedEXT": 5370,
"ShadingRateInterlockUnorderedEXT": 5371,
"SharedLocalMemorySizeINTEL": 5618,
"RoundingModeRTPINTEL": 5620,
"RoundingModeRTNINTEL": 5621,
"FloatingPointModeALTINTEL": 5622,
"FloatingPointModeIEEEINTEL": 5623,
"MaxWorkgroupSizeINTEL": 5893,
"MaxWorkDimINTEL": 5894,
"NoGlobalOffsetINTEL": 5895,
"NumSIMDWorkitemsINTEL": 5896,
"SchedulerTargetFmaxMhzINTEL": 5903
}
},
{
@ -169,7 +216,24 @@
"PushConstant": 9,
"AtomicCounter": 10,
"Image": 11,
"StorageBuffer": 12
"StorageBuffer": 12,
"CallableDataKHR": 5328,
"CallableDataNV": 5328,
"IncomingCallableDataKHR": 5329,
"IncomingCallableDataNV": 5329,
"RayPayloadKHR": 5338,
"RayPayloadNV": 5338,
"HitAttributeKHR": 5339,
"HitAttributeNV": 5339,
"IncomingRayPayloadKHR": 5342,
"IncomingRayPayloadNV": 5342,
"ShaderRecordBufferKHR": 5343,
"ShaderRecordBufferNV": 5343,
"PhysicalStorageBuffer": 5349,
"PhysicalStorageBufferEXT": 5349,
"CodeSectionINTEL": 5605,
"DeviceOnlyINTEL": 5936,
"HostOnlyINTEL": 5937
}
},
{
@ -251,7 +315,9 @@
"Rg16ui": 36,
"Rg8ui": 37,
"R16ui": 38,
"R8ui": 39
"R8ui": 39,
"R64ui": 40,
"R64i": 41
}
},
{
@ -317,7 +383,17 @@
"Offset": 4,
"ConstOffsets": 5,
"Sample": 6,
"MinLod": 7
"MinLod": 7,
"MakeTexelAvailable": 8,
"MakeTexelAvailableKHR": 8,
"MakeTexelVisible": 9,
"MakeTexelVisibleKHR": 9,
"NonPrivateTexel": 10,
"NonPrivateTexelKHR": 10,
"VolatileTexel": 11,
"VolatileTexelKHR": 11,
"SignExtend": 12,
"ZeroExtend": 13
}
},
{
@ -329,7 +405,9 @@
"NotInf": 1,
"NSZ": 2,
"AllowRecip": 3,
"Fast": 4
"Fast": 4,
"AllowContractFastINTEL": 16,
"AllowReassocINTEL": 17
}
},
{
@ -408,6 +486,7 @@
"NonWritable": 24,
"NonReadable": 25,
"Uniform": 26,
"UniformId": 27,
"SaturatedConversion": 28,
"Stream": 29,
"Location": 30,
@ -428,14 +507,62 @@
"MaxByteOffset": 45,
"AlignmentId": 46,
"MaxByteOffsetId": 47,
"NoSignedWrap": 4469,
"NoUnsignedWrap": 4470,
"ExplicitInterpAMD": 4999,
"OverrideCoverageNV": 5248,
"PassthroughNV": 5250,
"ViewportRelativeNV": 5252,
"SecondaryViewportRelativeNV": 5256,
"PerPrimitiveNV": 5271,
"PerViewNV": 5272,
"PerTaskNV": 5273,
"PerVertexNV": 5285,
"NonUniform": 5300,
"NonUniformEXT": 5300,
"RestrictPointer": 5355,
"RestrictPointerEXT": 5355,
"AliasedPointer": 5356,
"AliasedPointerEXT": 5356,
"SIMTCallINTEL": 5599,
"ReferencedIndirectlyINTEL": 5602,
"ClobberINTEL": 5607,
"SideEffectsINTEL": 5608,
"VectorComputeVariableINTEL": 5624,
"FuncParamIOKindINTEL": 5625,
"VectorComputeFunctionINTEL": 5626,
"StackCallINTEL": 5627,
"GlobalVariableOffsetINTEL": 5628,
"CounterBuffer": 5634,
"HlslCounterBufferGOOGLE": 5634,
"HlslSemanticGOOGLE": 5635
"HlslSemanticGOOGLE": 5635,
"UserSemantic": 5635,
"UserTypeGOOGLE": 5636,
"FunctionRoundingModeINTEL": 5822,
"FunctionDenormModeINTEL": 5823,
"RegisterINTEL": 5825,
"MemoryINTEL": 5826,
"NumbanksINTEL": 5827,
"BankwidthINTEL": 5828,
"MaxPrivateCopiesINTEL": 5829,
"SinglepumpINTEL": 5830,
"DoublepumpINTEL": 5831,
"MaxReplicatesINTEL": 5832,
"SimpleDualPortINTEL": 5833,
"MergeINTEL": 5834,
"BankBitsINTEL": 5835,
"ForcePow2DepthINTEL": 5836,
"BurstCoalesceINTEL": 5899,
"CacheSizeINTEL": 5900,
"DontStaticallyCoalesceINTEL": 5901,
"PrefetchINTEL": 5902,
"StallEnableINTEL": 5905,
"FuseLoopsInFunctionINTEL": 5907,
"BufferLocationINTEL": 5921,
"IOPipeStorageINTEL": 5944,
"FunctionFloatingPointModeINTEL": 6080,
"SingleElementVectorINTEL": 6085,
"VectorComputeCallableFunctionINTEL": 6087
}
},
{
@ -497,8 +624,10 @@
"BaseVertex": 4424,
"BaseInstance": 4425,
"DrawIndex": 4426,
"PrimitiveShadingRateKHR": 4432,
"DeviceIndex": 4438,
"ViewIndex": 4440,
"ShadingRateKHR": 4444,
"BaryCoordNoPerspAMD": 4992,
"BaryCoordNoPerspCentroidAMD": 4993,
"BaryCoordNoPerspSampleAMD": 4994,
@ -512,7 +641,53 @@
"SecondaryViewportMaskNV": 5258,
"PositionPerViewNV": 5261,
"ViewportMaskPerViewNV": 5262,
"FullyCoveredEXT": 5264
"FullyCoveredEXT": 5264,
"TaskCountNV": 5274,
"PrimitiveCountNV": 5275,
"PrimitiveIndicesNV": 5276,
"ClipDistancePerViewNV": 5277,
"CullDistancePerViewNV": 5278,
"LayerPerViewNV": 5279,
"MeshViewCountNV": 5280,
"MeshViewIndicesNV": 5281,
"BaryCoordNV": 5286,
"BaryCoordNoPerspNV": 5287,
"FragSizeEXT": 5292,
"FragmentSizeNV": 5292,
"FragInvocationCountEXT": 5293,
"InvocationsPerPixelNV": 5293,
"LaunchIdKHR": 5319,
"LaunchIdNV": 5319,
"LaunchSizeKHR": 5320,
"LaunchSizeNV": 5320,
"WorldRayOriginKHR": 5321,
"WorldRayOriginNV": 5321,
"WorldRayDirectionKHR": 5322,
"WorldRayDirectionNV": 5322,
"ObjectRayOriginKHR": 5323,
"ObjectRayOriginNV": 5323,
"ObjectRayDirectionKHR": 5324,
"ObjectRayDirectionNV": 5324,
"RayTminKHR": 5325,
"RayTminNV": 5325,
"RayTmaxKHR": 5326,
"RayTmaxNV": 5326,
"InstanceCustomIndexKHR": 5327,
"InstanceCustomIndexNV": 5327,
"ObjectToWorldKHR": 5330,
"ObjectToWorldNV": 5330,
"WorldToObjectKHR": 5331,
"WorldToObjectNV": 5331,
"HitTNV": 5332,
"HitKindKHR": 5333,
"HitKindNV": 5333,
"IncomingRayFlagsKHR": 5351,
"IncomingRayFlagsNV": 5351,
"RayGeometryIndexKHR": 5352,
"WarpsPerSMNV": 5374,
"SMCountNV": 5375,
"WarpIDNV": 5376,
"SMIDNV": 5377
}
},
{
@ -532,7 +707,20 @@
"Unroll": 0,
"DontUnroll": 1,
"DependencyInfinite": 2,
"DependencyLength": 3
"DependencyLength": 3,
"MinIterations": 4,
"MaxIterations": 5,
"IterationMultiple": 6,
"PeelCount": 7,
"PartialCount": 8,
"InitiationIntervalINTEL": 16,
"MaxConcurrencyINTEL": 17,
"DependencyArrayINTEL": 18,
"PipelineEnableINTEL": 19,
"LoopCoalesceINTEL": 20,
"MaxInterleavingINTEL": 21,
"SpeculatedIterationsINTEL": 22,
"NoFusionINTEL": 23
}
},
{
@ -560,7 +748,14 @@
"WorkgroupMemory": 8,
"CrossWorkgroupMemory": 9,
"AtomicCounterMemory": 10,
"ImageMemory": 11
"ImageMemory": 11,
"OutputMemory": 12,
"OutputMemoryKHR": 12,
"MakeAvailable": 13,
"MakeAvailableKHR": 13,
"MakeVisible": 14,
"MakeVisibleKHR": 14,
"Volatile": 15
}
},
{
@ -570,7 +765,13 @@
{
"Volatile": 0,
"Aligned": 1,
"Nontemporal": 2
"Nontemporal": 2,
"MakePointerAvailable": 3,
"MakePointerAvailableKHR": 3,
"MakePointerVisible": 4,
"MakePointerVisibleKHR": 4,
"NonPrivatePointer": 5,
"NonPrivatePointerKHR": 5
}
},
{
@ -582,7 +783,10 @@
"Device": 1,
"Workgroup": 2,
"Subgroup": 3,
"Invocation": 4
"Invocation": 4,
"QueueFamily": 5,
"QueueFamilyKHR": 5,
"ShaderCallKHR": 6
}
},
{
@ -689,8 +893,14 @@
"GroupNonUniformShuffleRelative": 66,
"GroupNonUniformClustered": 67,
"GroupNonUniformQuad": 68,
"ShaderLayer": 69,
"ShaderViewportIndex": 70,
"FragmentShadingRateKHR": 4422,
"SubgroupBallotKHR": 4423,
"DrawParameters": 4427,
"WorkgroupMemoryExplicitLayoutKHR": 4428,
"WorkgroupMemoryExplicitLayout8BitAccessKHR": 4429,
"WorkgroupMemoryExplicitLayout16BitAccessKHR": 4430,
"SubgroupVoteKHR": 4431,
"StorageBuffer16BitAccess": 4433,
"StorageUniformBufferBlock16": 4433,
@ -707,11 +917,22 @@
"StorageBuffer8BitAccess": 4448,
"UniformAndStorageBuffer8BitAccess": 4449,
"StoragePushConstant8": 4450,
"DenormPreserve": 4464,
"DenormFlushToZero": 4465,
"SignedZeroInfNanPreserve": 4466,
"RoundingModeRTE": 4467,
"RoundingModeRTZ": 4468,
"RayQueryProvisionalKHR": 4471,
"RayQueryKHR": 4472,
"RayTraversalPrimitiveCullingKHR": 4478,
"RayTracingKHR": 4479,
"Float16ImageAMD": 5008,
"ImageGatherBiasLodAMD": 5009,
"FragmentMaskAMD": 5010,
"StencilExportEXT": 5013,
"ImageReadWriteLodAMD": 5015,
"Int64ImageEXT": 5016,
"ShaderClockKHR": 5055,
"SampleMaskOverrideCoverageNV": 5249,
"GeometryShaderPassthroughNV": 5251,
"ShaderViewportIndexLayerEXT": 5254,
@ -720,22 +941,164 @@
"ShaderStereoViewNV": 5259,
"PerViewAttributesNV": 5260,
"FragmentFullyCoveredEXT": 5265,
"MeshShadingNV": 5266,
"ImageFootprintNV": 5282,
"FragmentBarycentricNV": 5284,
"ComputeDerivativeGroupQuadsNV": 5288,
"FragmentDensityEXT": 5291,
"ShadingRateNV": 5291,
"GroupNonUniformPartitionedNV": 5297,
"ShaderNonUniform": 5301,
"ShaderNonUniformEXT": 5301,
"RuntimeDescriptorArray": 5302,
"RuntimeDescriptorArrayEXT": 5302,
"InputAttachmentArrayDynamicIndexing": 5303,
"InputAttachmentArrayDynamicIndexingEXT": 5303,
"UniformTexelBufferArrayDynamicIndexing": 5304,
"UniformTexelBufferArrayDynamicIndexingEXT": 5304,
"StorageTexelBufferArrayDynamicIndexing": 5305,
"StorageTexelBufferArrayDynamicIndexingEXT": 5305,
"UniformBufferArrayNonUniformIndexing": 5306,
"UniformBufferArrayNonUniformIndexingEXT": 5306,
"SampledImageArrayNonUniformIndexing": 5307,
"SampledImageArrayNonUniformIndexingEXT": 5307,
"StorageBufferArrayNonUniformIndexing": 5308,
"StorageBufferArrayNonUniformIndexingEXT": 5308,
"StorageImageArrayNonUniformIndexing": 5309,
"StorageImageArrayNonUniformIndexingEXT": 5309,
"InputAttachmentArrayNonUniformIndexing": 5310,
"InputAttachmentArrayNonUniformIndexingEXT": 5310,
"UniformTexelBufferArrayNonUniformIndexing": 5311,
"UniformTexelBufferArrayNonUniformIndexingEXT": 5311,
"StorageTexelBufferArrayNonUniformIndexing": 5312,
"StorageTexelBufferArrayNonUniformIndexingEXT": 5312,
"RayTracingNV": 5340,
"VulkanMemoryModel": 5345,
"VulkanMemoryModelKHR": 5345,
"VulkanMemoryModelDeviceScope": 5346,
"VulkanMemoryModelDeviceScopeKHR": 5346,
"PhysicalStorageBufferAddresses": 5347,
"PhysicalStorageBufferAddressesEXT": 5347,
"ComputeDerivativeGroupLinearNV": 5350,
"RayTracingProvisionalKHR": 5353,
"CooperativeMatrixNV": 5357,
"FragmentShaderSampleInterlockEXT": 5363,
"FragmentShaderShadingRateInterlockEXT": 5372,
"ShaderSMBuiltinsNV": 5373,
"FragmentShaderPixelInterlockEXT": 5378,
"DemoteToHelperInvocationEXT": 5379,
"SubgroupShuffleINTEL": 5568,
"SubgroupBufferBlockIOINTEL": 5569,
"SubgroupImageBlockIOINTEL": 5570
"SubgroupImageBlockIOINTEL": 5570,
"SubgroupImageMediaBlockIOINTEL": 5579,
"RoundToInfinityINTEL": 5582,
"FloatingPointModeINTEL": 5583,
"IntegerFunctions2INTEL": 5584,
"FunctionPointersINTEL": 5603,
"IndirectReferencesINTEL": 5604,
"AsmINTEL": 5606,
"AtomicFloat32MinMaxEXT": 5612,
"AtomicFloat64MinMaxEXT": 5613,
"AtomicFloat16MinMaxEXT": 5616,
"VectorComputeINTEL": 5617,
"VectorAnyINTEL": 5619,
"SubgroupAvcMotionEstimationINTEL": 5696,
"SubgroupAvcMotionEstimationIntraINTEL": 5697,
"SubgroupAvcMotionEstimationChromaINTEL": 5698,
"VariableLengthArrayINTEL": 5817,
"FunctionFloatControlINTEL": 5821,
"FPGAMemoryAttributesINTEL": 5824,
"FPFastMathModeINTEL": 5837,
"ArbitraryPrecisionIntegersINTEL": 5844,
"UnstructuredLoopControlsINTEL": 5886,
"FPGALoopControlsINTEL": 5888,
"KernelAttributesINTEL": 5892,
"FPGAKernelAttributesINTEL": 5897,
"FPGAMemoryAccessesINTEL": 5898,
"FPGAClusterAttributesINTEL": 5904,
"LoopFuseINTEL": 5906,
"FPGABufferLocationINTEL": 5920,
"USMStorageClassesINTEL": 5935,
"IOPipesINTEL": 5943,
"BlockingPipesINTEL": 5945,
"FPGARegINTEL": 5948,
"AtomicFloat32AddEXT": 6033,
"AtomicFloat64AddEXT": 6034,
"LongConstantCompositeINTEL": 6089
}
},
{
"Name": "RayFlags",
"Type": "Bit",
"Values":
{
"OpaqueKHR": 0,
"NoOpaqueKHR": 1,
"TerminateOnFirstHitKHR": 2,
"SkipClosestHitShaderKHR": 3,
"CullBackFacingTrianglesKHR": 4,
"CullFrontFacingTrianglesKHR": 5,
"CullOpaqueKHR": 6,
"CullNoOpaqueKHR": 7,
"SkipTrianglesKHR": 8,
"SkipAABBsKHR": 9
}
},
{
"Name": "RayQueryIntersection",
"Type": "Value",
"Values":
{
"RayQueryCandidateIntersectionKHR": 0,
"RayQueryCommittedIntersectionKHR": 1
}
},
{
"Name": "RayQueryCommittedIntersectionType",
"Type": "Value",
"Values":
{
"RayQueryCommittedIntersectionNoneKHR": 0,
"RayQueryCommittedIntersectionTriangleKHR": 1,
"RayQueryCommittedIntersectionGeneratedKHR": 2
}
},
{
"Name": "RayQueryCandidateIntersectionType",
"Type": "Value",
"Values":
{
"RayQueryCandidateIntersectionTriangleKHR": 0,
"RayQueryCandidateIntersectionAABBKHR": 1
}
},
{
"Name": "FragmentShadingRate",
"Type": "Bit",
"Values":
{
"Vertical2Pixels": 0,
"Vertical4Pixels": 1,
"Horizontal2Pixels": 2,
"Horizontal4Pixels": 3
}
},
{
"Name": "FPDenormMode",
"Type": "Value",
"Values":
{
"Preserve": 0,
"FlushToZero": 1
}
},
{
"Name": "FPOperationMode",
"Type": "Value",
"Values":
{
"IEEE": 0,
"ALT": 1
}
},
{
@ -1083,12 +1446,29 @@
"OpGroupNonUniformLogicalXor": 364,
"OpGroupNonUniformQuadBroadcast": 365,
"OpGroupNonUniformQuadSwap": 366,
"OpCopyLogical": 400,
"OpPtrEqual": 401,
"OpPtrNotEqual": 402,
"OpPtrDiff": 403,
"OpTerminateInvocation": 4416,
"OpSubgroupBallotKHR": 4421,
"OpSubgroupFirstInvocationKHR": 4422,
"OpSubgroupAllKHR": 4428,
"OpSubgroupAnyKHR": 4429,
"OpSubgroupAllEqualKHR": 4430,
"OpSubgroupReadInvocationKHR": 4432,
"OpTraceRayKHR": 4445,
"OpExecuteCallableKHR": 4446,
"OpConvertUToAccelerationStructureKHR": 4447,
"OpIgnoreIntersectionKHR": 4448,
"OpTerminateRayKHR": 4449,
"OpTypeRayQueryKHR": 4472,
"OpRayQueryInitializeKHR": 4473,
"OpRayQueryTerminateKHR": 4474,
"OpRayQueryGenerateIntersectionKHR": 4475,
"OpRayQueryConfirmIntersectionKHR": 4476,
"OpRayQueryProceedKHR": 4477,
"OpRayQueryGetIntersectionTypeKHR": 4479,
"OpGroupIAddNonUniformAMD": 5000,
"OpGroupFAddNonUniformAMD": 5001,
"OpGroupFMinNonUniformAMD": 5002,
@ -1099,7 +1479,27 @@
"OpGroupSMaxNonUniformAMD": 5007,
"OpFragmentMaskFetchAMD": 5011,
"OpFragmentFetchAMD": 5012,
"OpReadClockKHR": 5056,
"OpImageSampleFootprintNV": 5283,
"OpGroupNonUniformPartitionNV": 5296,
"OpWritePackedPrimitiveIndices4x8NV": 5299,
"OpReportIntersectionKHR": 5334,
"OpReportIntersectionNV": 5334,
"OpIgnoreIntersectionNV": 5335,
"OpTerminateRayNV": 5336,
"OpTraceNV": 5337,
"OpTypeAccelerationStructureKHR": 5341,
"OpTypeAccelerationStructureNV": 5341,
"OpExecuteCallableNV": 5344,
"OpTypeCooperativeMatrixNV": 5358,
"OpCooperativeMatrixLoadNV": 5359,
"OpCooperativeMatrixStoreNV": 5360,
"OpCooperativeMatrixMulAddNV": 5361,
"OpCooperativeMatrixLengthNV": 5362,
"OpBeginInvocationInterlockEXT": 5364,
"OpEndInvocationInterlockEXT": 5365,
"OpDemoteToHelperInvocationEXT": 5380,
"OpIsHelperInvocationEXT": 5381,
"OpSubgroupShuffleINTEL": 5571,
"OpSubgroupShuffleDownINTEL": 5572,
"OpSubgroupShuffleUpINTEL": 5573,
@ -1108,8 +1508,182 @@
"OpSubgroupBlockWriteINTEL": 5576,
"OpSubgroupImageBlockReadINTEL": 5577,
"OpSubgroupImageBlockWriteINTEL": 5578,
"OpSubgroupImageMediaBlockReadINTEL": 5580,
"OpSubgroupImageMediaBlockWriteINTEL": 5581,
"OpUCountLeadingZerosINTEL": 5585,
"OpUCountTrailingZerosINTEL": 5586,
"OpAbsISubINTEL": 5587,
"OpAbsUSubINTEL": 5588,
"OpIAddSatINTEL": 5589,
"OpUAddSatINTEL": 5590,
"OpIAverageINTEL": 5591,
"OpUAverageINTEL": 5592,
"OpIAverageRoundedINTEL": 5593,
"OpUAverageRoundedINTEL": 5594,
"OpISubSatINTEL": 5595,
"OpUSubSatINTEL": 5596,
"OpIMul32x16INTEL": 5597,
"OpUMul32x16INTEL": 5598,
"OpConstFunctionPointerINTEL": 5600,
"OpFunctionPointerCallINTEL": 5601,
"OpAsmTargetINTEL": 5609,
"OpAsmINTEL": 5610,
"OpAsmCallINTEL": 5611,
"OpAtomicFMinEXT": 5614,
"OpAtomicFMaxEXT": 5615,
"OpDecorateString": 5632,
"OpDecorateStringGOOGLE": 5632,
"OpMemberDecorateStringGOOGLE": 5633
"OpMemberDecorateString": 5633,
"OpMemberDecorateStringGOOGLE": 5633,
"OpVmeImageINTEL": 5699,
"OpTypeVmeImageINTEL": 5700,
"OpTypeAvcImePayloadINTEL": 5701,
"OpTypeAvcRefPayloadINTEL": 5702,
"OpTypeAvcSicPayloadINTEL": 5703,
"OpTypeAvcMcePayloadINTEL": 5704,
"OpTypeAvcMceResultINTEL": 5705,
"OpTypeAvcImeResultINTEL": 5706,
"OpTypeAvcImeResultSingleReferenceStreamoutINTEL": 5707,
"OpTypeAvcImeResultDualReferenceStreamoutINTEL": 5708,
"OpTypeAvcImeSingleReferenceStreaminINTEL": 5709,
"OpTypeAvcImeDualReferenceStreaminINTEL": 5710,
"OpTypeAvcRefResultINTEL": 5711,
"OpTypeAvcSicResultINTEL": 5712,
"OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL": 5713,
"OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL": 5714,
"OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL": 5715,
"OpSubgroupAvcMceSetInterShapePenaltyINTEL": 5716,
"OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL": 5717,
"OpSubgroupAvcMceSetInterDirectionPenaltyINTEL": 5718,
"OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL": 5719,
"OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL": 5720,
"OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL": 5721,
"OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL": 5722,
"OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL": 5723,
"OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL": 5724,
"OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL": 5725,
"OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL": 5726,
"OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL": 5727,
"OpSubgroupAvcMceSetAcOnlyHaarINTEL": 5728,
"OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL": 5729,
"OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL": 5730,
"OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL": 5731,
"OpSubgroupAvcMceConvertToImePayloadINTEL": 5732,
"OpSubgroupAvcMceConvertToImeResultINTEL": 5733,
"OpSubgroupAvcMceConvertToRefPayloadINTEL": 5734,
"OpSubgroupAvcMceConvertToRefResultINTEL": 5735,
"OpSubgroupAvcMceConvertToSicPayloadINTEL": 5736,
"OpSubgroupAvcMceConvertToSicResultINTEL": 5737,
"OpSubgroupAvcMceGetMotionVectorsINTEL": 5738,
"OpSubgroupAvcMceGetInterDistortionsINTEL": 5739,
"OpSubgroupAvcMceGetBestInterDistortionsINTEL": 5740,
"OpSubgroupAvcMceGetInterMajorShapeINTEL": 5741,
"OpSubgroupAvcMceGetInterMinorShapeINTEL": 5742,
"OpSubgroupAvcMceGetInterDirectionsINTEL": 5743,
"OpSubgroupAvcMceGetInterMotionVectorCountINTEL": 5744,
"OpSubgroupAvcMceGetInterReferenceIdsINTEL": 5745,
"OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL": 5746,
"OpSubgroupAvcImeInitializeINTEL": 5747,
"OpSubgroupAvcImeSetSingleReferenceINTEL": 5748,
"OpSubgroupAvcImeSetDualReferenceINTEL": 5749,
"OpSubgroupAvcImeRefWindowSizeINTEL": 5750,
"OpSubgroupAvcImeAdjustRefOffsetINTEL": 5751,
"OpSubgroupAvcImeConvertToMcePayloadINTEL": 5752,
"OpSubgroupAvcImeSetMaxMotionVectorCountINTEL": 5753,
"OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL": 5754,
"OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL": 5755,
"OpSubgroupAvcImeSetWeightedSadINTEL": 5756,
"OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL": 5757,
"OpSubgroupAvcImeEvaluateWithDualReferenceINTEL": 5758,
"OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL": 5759,
"OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL": 5760,
"OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL": 5761,
"OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL": 5762,
"OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL": 5763,
"OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL": 5764,
"OpSubgroupAvcImeConvertToMceResultINTEL": 5765,
"OpSubgroupAvcImeGetSingleReferenceStreaminINTEL": 5766,
"OpSubgroupAvcImeGetDualReferenceStreaminINTEL": 5767,
"OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL": 5768,
"OpSubgroupAvcImeStripDualReferenceStreamoutINTEL": 5769,
"OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL": 5770,
"OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL": 5771,
"OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL": 5772,
"OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL": 5773,
"OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL": 5774,
"OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL": 5775,
"OpSubgroupAvcImeGetBorderReachedINTEL": 5776,
"OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL": 5777,
"OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL": 5778,
"OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL": 5779,
"OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL": 5780,
"OpSubgroupAvcFmeInitializeINTEL": 5781,
"OpSubgroupAvcBmeInitializeINTEL": 5782,
"OpSubgroupAvcRefConvertToMcePayloadINTEL": 5783,
"OpSubgroupAvcRefSetBidirectionalMixDisableINTEL": 5784,
"OpSubgroupAvcRefSetBilinearFilterEnableINTEL": 5785,
"OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL": 5786,
"OpSubgroupAvcRefEvaluateWithDualReferenceINTEL": 5787,
"OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL": 5788,
"OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL": 5789,
"OpSubgroupAvcRefConvertToMceResultINTEL": 5790,
"OpSubgroupAvcSicInitializeINTEL": 5791,
"OpSubgroupAvcSicConfigureSkcINTEL": 5792,
"OpSubgroupAvcSicConfigureIpeLumaINTEL": 5793,
"OpSubgroupAvcSicConfigureIpeLumaChromaINTEL": 5794,
"OpSubgroupAvcSicGetMotionVectorMaskINTEL": 5795,
"OpSubgroupAvcSicConvertToMcePayloadINTEL": 5796,
"OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL": 5797,
"OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL": 5798,
"OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL": 5799,
"OpSubgroupAvcSicSetBilinearFilterEnableINTEL": 5800,
"OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL": 5801,
"OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL": 5802,
"OpSubgroupAvcSicEvaluateIpeINTEL": 5803,
"OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL": 5804,
"OpSubgroupAvcSicEvaluateWithDualReferenceINTEL": 5805,
"OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL": 5806,
"OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL": 5807,
"OpSubgroupAvcSicConvertToMceResultINTEL": 5808,
"OpSubgroupAvcSicGetIpeLumaShapeINTEL": 5809,
"OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL": 5810,
"OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL": 5811,
"OpSubgroupAvcSicGetPackedIpeLumaModesINTEL": 5812,
"OpSubgroupAvcSicGetIpeChromaModeINTEL": 5813,
"OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL": 5814,
"OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL": 5815,
"OpSubgroupAvcSicGetInterRawSadsINTEL": 5816,
"OpVariableLengthArrayINTEL": 5818,
"OpSaveMemoryINTEL": 5819,
"OpRestoreMemoryINTEL": 5820,
"OpLoopControlINTEL": 5887,
"OpPtrCastToCrossWorkgroupINTEL": 5934,
"OpCrossWorkgroupCastToPtrINTEL": 5938,
"OpReadPipeBlockingINTEL": 5946,
"OpWritePipeBlockingINTEL": 5947,
"OpFPGARegINTEL": 5949,
"OpRayQueryGetRayTMinKHR": 6016,
"OpRayQueryGetRayFlagsKHR": 6017,
"OpRayQueryGetIntersectionTKHR": 6018,
"OpRayQueryGetIntersectionInstanceCustomIndexKHR": 6019,
"OpRayQueryGetIntersectionInstanceIdKHR": 6020,
"OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR": 6021,
"OpRayQueryGetIntersectionGeometryIndexKHR": 6022,
"OpRayQueryGetIntersectionPrimitiveIndexKHR": 6023,
"OpRayQueryGetIntersectionBarycentricsKHR": 6024,
"OpRayQueryGetIntersectionFrontFaceKHR": 6025,
"OpRayQueryGetIntersectionCandidateAABBOpaqueKHR": 6026,
"OpRayQueryGetIntersectionObjectRayDirectionKHR": 6027,
"OpRayQueryGetIntersectionObjectRayOriginKHR": 6028,
"OpRayQueryGetWorldRayDirectionKHR": 6029,
"OpRayQueryGetWorldRayOriginKHR": 6030,
"OpRayQueryGetIntersectionObjectToWorldKHR": 6031,
"OpRayQueryGetIntersectionWorldToObjectKHR": 6032,
"OpAtomicFAddEXT": 6035,
"OpTypeBufferSurfaceINTEL": 6086,
"OpTypeStructContinuedINTEL": 6090,
"OpConstantCompositeContinuedINTEL": 6091,
"OpSpecConstantCompositeContinuedINTEL": 6092
}
}
]

View File

@ -1,4 +1,4 @@
-- Copyright (c) 2014-2018 The Khronos Group Inc.
-- Copyright (c) 2014-2020 The Khronos Group Inc.
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and/or associated documentation files (the "Materials"),
@ -26,13 +26,16 @@
-- the Binary Section of the SPIR-V specification.
-- Enumeration tokens for SPIR-V, in various styles:
-- C, C++, C++11, JSON, Lua, Python
-- C, C++, C++11, JSON, Lua, Python, C#, D
--
-- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
-- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
-- - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
-- - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
-- - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
-- - C# will use enum classes in the Specification class located in the "Spv" namespace,
-- e.g.: Spv.Specification.SourceLanguage.GLSL
-- - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
--
-- Some tokens act like mask values, which can be OR'd together,
-- while others are mutually exclusive. The mask-like ones have
@ -41,8 +44,8 @@
spv = {
MagicNumber = 0x07230203,
Version = 0x00010300,
Revision = 1,
Version = 0x00010500,
Revision = 4,
OpCodeMask = 0xffff,
WordCountShift = 16,
@ -63,18 +66,36 @@ spv = {
Fragment = 4,
GLCompute = 5,
Kernel = 6,
TaskNV = 5267,
MeshNV = 5268,
RayGenerationKHR = 5313,
RayGenerationNV = 5313,
IntersectionKHR = 5314,
IntersectionNV = 5314,
AnyHitKHR = 5315,
AnyHitNV = 5315,
ClosestHitKHR = 5316,
ClosestHitNV = 5316,
MissKHR = 5317,
MissNV = 5317,
CallableKHR = 5318,
CallableNV = 5318,
},
AddressingModel = {
Logical = 0,
Physical32 = 1,
Physical64 = 2,
PhysicalStorageBuffer64 = 5348,
PhysicalStorageBuffer64EXT = 5348,
},
MemoryModel = {
Simple = 0,
GLSL450 = 1,
OpenCL = 2,
Vulkan = 3,
VulkanKHR = 3,
},
ExecutionMode = {
@ -117,7 +138,33 @@ spv = {
LocalSizeId = 38,
LocalSizeHintId = 39,
PostDepthCoverage = 4446,
DenormPreserve = 4459,
DenormFlushToZero = 4460,
SignedZeroInfNanPreserve = 4461,
RoundingModeRTE = 4462,
RoundingModeRTZ = 4463,
StencilRefReplacingEXT = 5027,
OutputLinesNV = 5269,
OutputPrimitivesNV = 5270,
DerivativeGroupQuadsNV = 5289,
DerivativeGroupLinearNV = 5290,
OutputTrianglesNV = 5298,
PixelInterlockOrderedEXT = 5366,
PixelInterlockUnorderedEXT = 5367,
SampleInterlockOrderedEXT = 5368,
SampleInterlockUnorderedEXT = 5369,
ShadingRateInterlockOrderedEXT = 5370,
ShadingRateInterlockUnorderedEXT = 5371,
SharedLocalMemorySizeINTEL = 5618,
RoundingModeRTPINTEL = 5620,
RoundingModeRTNINTEL = 5621,
FloatingPointModeALTINTEL = 5622,
FloatingPointModeIEEEINTEL = 5623,
MaxWorkgroupSizeINTEL = 5893,
MaxWorkDimINTEL = 5894,
NoGlobalOffsetINTEL = 5895,
NumSIMDWorkitemsINTEL = 5896,
SchedulerTargetFmaxMhzINTEL = 5903,
},
StorageClass = {
@ -134,6 +181,23 @@ spv = {
AtomicCounter = 10,
Image = 11,
StorageBuffer = 12,
CallableDataKHR = 5328,
CallableDataNV = 5328,
IncomingCallableDataKHR = 5329,
IncomingCallableDataNV = 5329,
RayPayloadKHR = 5338,
RayPayloadNV = 5338,
HitAttributeKHR = 5339,
HitAttributeNV = 5339,
IncomingRayPayloadKHR = 5342,
IncomingRayPayloadNV = 5342,
ShaderRecordBufferKHR = 5343,
ShaderRecordBufferNV = 5343,
PhysicalStorageBuffer = 5349,
PhysicalStorageBufferEXT = 5349,
CodeSectionINTEL = 5605,
DeviceOnlyINTEL = 5936,
HostOnlyINTEL = 5937,
},
Dim = {
@ -200,6 +264,8 @@ spv = {
Rg8ui = 37,
R16ui = 38,
R8ui = 39,
R64ui = 40,
R64i = 41,
},
ImageChannelOrder = {
@ -254,6 +320,16 @@ spv = {
ConstOffsets = 5,
Sample = 6,
MinLod = 7,
MakeTexelAvailable = 8,
MakeTexelAvailableKHR = 8,
MakeTexelVisible = 9,
MakeTexelVisibleKHR = 9,
NonPrivateTexel = 10,
NonPrivateTexelKHR = 10,
VolatileTexel = 11,
VolatileTexelKHR = 11,
SignExtend = 12,
ZeroExtend = 13,
},
ImageOperandsMask = {
@ -266,6 +342,16 @@ spv = {
ConstOffsets = 0x00000020,
Sample = 0x00000040,
MinLod = 0x00000080,
MakeTexelAvailable = 0x00000100,
MakeTexelAvailableKHR = 0x00000100,
MakeTexelVisible = 0x00000200,
MakeTexelVisibleKHR = 0x00000200,
NonPrivateTexel = 0x00000400,
NonPrivateTexelKHR = 0x00000400,
VolatileTexel = 0x00000800,
VolatileTexelKHR = 0x00000800,
SignExtend = 0x00001000,
ZeroExtend = 0x00002000,
},
FPFastMathModeShift = {
@ -274,6 +360,8 @@ spv = {
NSZ = 2,
AllowRecip = 3,
Fast = 4,
AllowContractFastINTEL = 16,
AllowReassocINTEL = 17,
},
FPFastMathModeMask = {
@ -283,6 +371,8 @@ spv = {
NSZ = 0x00000004,
AllowRecip = 0x00000008,
Fast = 0x00000010,
AllowContractFastINTEL = 0x00010000,
AllowReassocINTEL = 0x00020000,
},
FPRoundingMode = {
@ -341,6 +431,7 @@ spv = {
NonWritable = 24,
NonReadable = 25,
Uniform = 26,
UniformId = 27,
SaturatedConversion = 28,
Stream = 29,
Location = 30,
@ -361,14 +452,62 @@ spv = {
MaxByteOffset = 45,
AlignmentId = 46,
MaxByteOffsetId = 47,
NoSignedWrap = 4469,
NoUnsignedWrap = 4470,
ExplicitInterpAMD = 4999,
OverrideCoverageNV = 5248,
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
SecondaryViewportRelativeNV = 5256,
PerPrimitiveNV = 5271,
PerViewNV = 5272,
PerTaskNV = 5273,
PerVertexNV = 5285,
NonUniform = 5300,
NonUniformEXT = 5300,
RestrictPointer = 5355,
RestrictPointerEXT = 5355,
AliasedPointer = 5356,
AliasedPointerEXT = 5356,
SIMTCallINTEL = 5599,
ReferencedIndirectlyINTEL = 5602,
ClobberINTEL = 5607,
SideEffectsINTEL = 5608,
VectorComputeVariableINTEL = 5624,
FuncParamIOKindINTEL = 5625,
VectorComputeFunctionINTEL = 5626,
StackCallINTEL = 5627,
GlobalVariableOffsetINTEL = 5628,
CounterBuffer = 5634,
HlslCounterBufferGOOGLE = 5634,
HlslSemanticGOOGLE = 5635,
UserSemantic = 5635,
UserTypeGOOGLE = 5636,
FunctionRoundingModeINTEL = 5822,
FunctionDenormModeINTEL = 5823,
RegisterINTEL = 5825,
MemoryINTEL = 5826,
NumbanksINTEL = 5827,
BankwidthINTEL = 5828,
MaxPrivateCopiesINTEL = 5829,
SinglepumpINTEL = 5830,
DoublepumpINTEL = 5831,
MaxReplicatesINTEL = 5832,
SimpleDualPortINTEL = 5833,
MergeINTEL = 5834,
BankBitsINTEL = 5835,
ForcePow2DepthINTEL = 5836,
BurstCoalesceINTEL = 5899,
CacheSizeINTEL = 5900,
DontStaticallyCoalesceINTEL = 5901,
PrefetchINTEL = 5902,
StallEnableINTEL = 5905,
FuseLoopsInFunctionINTEL = 5907,
BufferLocationINTEL = 5921,
IOPipeStorageINTEL = 5944,
FunctionFloatingPointModeINTEL = 6080,
SingleElementVectorINTEL = 6085,
VectorComputeCallableFunctionINTEL = 6087,
},
BuiltIn = {
@ -426,8 +565,10 @@ spv = {
BaseVertex = 4424,
BaseInstance = 4425,
DrawIndex = 4426,
PrimitiveShadingRateKHR = 4432,
DeviceIndex = 4438,
ViewIndex = 4440,
ShadingRateKHR = 4444,
BaryCoordNoPerspAMD = 4992,
BaryCoordNoPerspCentroidAMD = 4993,
BaryCoordNoPerspSampleAMD = 4994,
@ -442,6 +583,52 @@ spv = {
PositionPerViewNV = 5261,
ViewportMaskPerViewNV = 5262,
FullyCoveredEXT = 5264,
TaskCountNV = 5274,
PrimitiveCountNV = 5275,
PrimitiveIndicesNV = 5276,
ClipDistancePerViewNV = 5277,
CullDistancePerViewNV = 5278,
LayerPerViewNV = 5279,
MeshViewCountNV = 5280,
MeshViewIndicesNV = 5281,
BaryCoordNV = 5286,
BaryCoordNoPerspNV = 5287,
FragSizeEXT = 5292,
FragmentSizeNV = 5292,
FragInvocationCountEXT = 5293,
InvocationsPerPixelNV = 5293,
LaunchIdKHR = 5319,
LaunchIdNV = 5319,
LaunchSizeKHR = 5320,
LaunchSizeNV = 5320,
WorldRayOriginKHR = 5321,
WorldRayOriginNV = 5321,
WorldRayDirectionKHR = 5322,
WorldRayDirectionNV = 5322,
ObjectRayOriginKHR = 5323,
ObjectRayOriginNV = 5323,
ObjectRayDirectionKHR = 5324,
ObjectRayDirectionNV = 5324,
RayTminKHR = 5325,
RayTminNV = 5325,
RayTmaxKHR = 5326,
RayTmaxNV = 5326,
InstanceCustomIndexKHR = 5327,
InstanceCustomIndexNV = 5327,
ObjectToWorldKHR = 5330,
ObjectToWorldNV = 5330,
WorldToObjectKHR = 5331,
WorldToObjectNV = 5331,
HitTNV = 5332,
HitKindKHR = 5333,
HitKindNV = 5333,
IncomingRayFlagsKHR = 5351,
IncomingRayFlagsNV = 5351,
RayGeometryIndexKHR = 5352,
WarpsPerSMNV = 5374,
SMCountNV = 5375,
WarpIDNV = 5376,
SMIDNV = 5377,
},
SelectionControlShift = {
@ -460,6 +647,19 @@ spv = {
DontUnroll = 1,
DependencyInfinite = 2,
DependencyLength = 3,
MinIterations = 4,
MaxIterations = 5,
IterationMultiple = 6,
PeelCount = 7,
PartialCount = 8,
InitiationIntervalINTEL = 16,
MaxConcurrencyINTEL = 17,
DependencyArrayINTEL = 18,
PipelineEnableINTEL = 19,
LoopCoalesceINTEL = 20,
MaxInterleavingINTEL = 21,
SpeculatedIterationsINTEL = 22,
NoFusionINTEL = 23,
},
LoopControlMask = {
@ -468,6 +668,19 @@ spv = {
DontUnroll = 0x00000002,
DependencyInfinite = 0x00000004,
DependencyLength = 0x00000008,
MinIterations = 0x00000010,
MaxIterations = 0x00000020,
IterationMultiple = 0x00000040,
PeelCount = 0x00000080,
PartialCount = 0x00000100,
InitiationIntervalINTEL = 0x00010000,
MaxConcurrencyINTEL = 0x00020000,
DependencyArrayINTEL = 0x00040000,
PipelineEnableINTEL = 0x00080000,
LoopCoalesceINTEL = 0x00100000,
MaxInterleavingINTEL = 0x00200000,
SpeculatedIterationsINTEL = 0x00400000,
NoFusionINTEL = 0x00800000,
},
FunctionControlShift = {
@ -496,6 +709,13 @@ spv = {
CrossWorkgroupMemory = 9,
AtomicCounterMemory = 10,
ImageMemory = 11,
OutputMemory = 12,
OutputMemoryKHR = 12,
MakeAvailable = 13,
MakeAvailableKHR = 13,
MakeVisible = 14,
MakeVisibleKHR = 14,
Volatile = 15,
},
MemorySemanticsMask = {
@ -510,12 +730,25 @@ spv = {
CrossWorkgroupMemory = 0x00000200,
AtomicCounterMemory = 0x00000400,
ImageMemory = 0x00000800,
OutputMemory = 0x00001000,
OutputMemoryKHR = 0x00001000,
MakeAvailable = 0x00002000,
MakeAvailableKHR = 0x00002000,
MakeVisible = 0x00004000,
MakeVisibleKHR = 0x00004000,
Volatile = 0x00008000,
},
MemoryAccessShift = {
Volatile = 0,
Aligned = 1,
Nontemporal = 2,
MakePointerAvailable = 3,
MakePointerAvailableKHR = 3,
MakePointerVisible = 4,
MakePointerVisibleKHR = 4,
NonPrivatePointer = 5,
NonPrivatePointerKHR = 5,
},
MemoryAccessMask = {
@ -523,6 +756,12 @@ spv = {
Volatile = 0x00000001,
Aligned = 0x00000002,
Nontemporal = 0x00000004,
MakePointerAvailable = 0x00000008,
MakePointerAvailableKHR = 0x00000008,
MakePointerVisible = 0x00000010,
MakePointerVisibleKHR = 0x00000010,
NonPrivatePointer = 0x00000020,
NonPrivatePointerKHR = 0x00000020,
},
Scope = {
@ -531,6 +770,9 @@ spv = {
Workgroup = 2,
Subgroup = 3,
Invocation = 4,
QueueFamily = 5,
QueueFamilyKHR = 5,
ShaderCallKHR = 6,
},
GroupOperation = {
@ -626,8 +868,14 @@ spv = {
GroupNonUniformShuffleRelative = 66,
GroupNonUniformClustered = 67,
GroupNonUniformQuad = 68,
ShaderLayer = 69,
ShaderViewportIndex = 70,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
WorkgroupMemoryExplicitLayoutKHR = 4428,
WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429,
WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430,
SubgroupVoteKHR = 4431,
StorageBuffer16BitAccess = 4433,
StorageUniformBufferBlock16 = 4433,
@ -644,11 +892,22 @@ spv = {
StorageBuffer8BitAccess = 4448,
UniformAndStorageBuffer8BitAccess = 4449,
StoragePushConstant8 = 4450,
DenormPreserve = 4464,
DenormFlushToZero = 4465,
SignedZeroInfNanPreserve = 4466,
RoundingModeRTE = 4467,
RoundingModeRTZ = 4468,
RayQueryProvisionalKHR = 4471,
RayQueryKHR = 4472,
RayTraversalPrimitiveCullingKHR = 4478,
RayTracingKHR = 4479,
Float16ImageAMD = 5008,
ImageGatherBiasLodAMD = 5009,
FragmentMaskAMD = 5010,
StencilExportEXT = 5013,
ImageReadWriteLodAMD = 5015,
Int64ImageEXT = 5016,
ShaderClockKHR = 5055,
SampleMaskOverrideCoverageNV = 5249,
GeometryShaderPassthroughNV = 5251,
ShaderViewportIndexLayerEXT = 5254,
@ -657,22 +916,158 @@ spv = {
ShaderStereoViewNV = 5259,
PerViewAttributesNV = 5260,
FragmentFullyCoveredEXT = 5265,
MeshShadingNV = 5266,
ImageFootprintNV = 5282,
FragmentBarycentricNV = 5284,
ComputeDerivativeGroupQuadsNV = 5288,
FragmentDensityEXT = 5291,
ShadingRateNV = 5291,
GroupNonUniformPartitionedNV = 5297,
ShaderNonUniform = 5301,
ShaderNonUniformEXT = 5301,
RuntimeDescriptorArray = 5302,
RuntimeDescriptorArrayEXT = 5302,
InputAttachmentArrayDynamicIndexing = 5303,
InputAttachmentArrayDynamicIndexingEXT = 5303,
UniformTexelBufferArrayDynamicIndexing = 5304,
UniformTexelBufferArrayDynamicIndexingEXT = 5304,
StorageTexelBufferArrayDynamicIndexing = 5305,
StorageTexelBufferArrayDynamicIndexingEXT = 5305,
UniformBufferArrayNonUniformIndexing = 5306,
UniformBufferArrayNonUniformIndexingEXT = 5306,
SampledImageArrayNonUniformIndexing = 5307,
SampledImageArrayNonUniformIndexingEXT = 5307,
StorageBufferArrayNonUniformIndexing = 5308,
StorageBufferArrayNonUniformIndexingEXT = 5308,
StorageImageArrayNonUniformIndexing = 5309,
StorageImageArrayNonUniformIndexingEXT = 5309,
InputAttachmentArrayNonUniformIndexing = 5310,
InputAttachmentArrayNonUniformIndexingEXT = 5310,
UniformTexelBufferArrayNonUniformIndexing = 5311,
UniformTexelBufferArrayNonUniformIndexingEXT = 5311,
StorageTexelBufferArrayNonUniformIndexing = 5312,
StorageTexelBufferArrayNonUniformIndexingEXT = 5312,
RayTracingNV = 5340,
VulkanMemoryModel = 5345,
VulkanMemoryModelKHR = 5345,
VulkanMemoryModelDeviceScope = 5346,
VulkanMemoryModelDeviceScopeKHR = 5346,
PhysicalStorageBufferAddresses = 5347,
PhysicalStorageBufferAddressesEXT = 5347,
ComputeDerivativeGroupLinearNV = 5350,
RayTracingProvisionalKHR = 5353,
CooperativeMatrixNV = 5357,
FragmentShaderSampleInterlockEXT = 5363,
FragmentShaderShadingRateInterlockEXT = 5372,
ShaderSMBuiltinsNV = 5373,
FragmentShaderPixelInterlockEXT = 5378,
DemoteToHelperInvocationEXT = 5379,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
SubgroupImageBlockIOINTEL = 5570,
SubgroupImageMediaBlockIOINTEL = 5579,
RoundToInfinityINTEL = 5582,
FloatingPointModeINTEL = 5583,
IntegerFunctions2INTEL = 5584,
FunctionPointersINTEL = 5603,
IndirectReferencesINTEL = 5604,
AsmINTEL = 5606,
AtomicFloat32MinMaxEXT = 5612,
AtomicFloat64MinMaxEXT = 5613,
AtomicFloat16MinMaxEXT = 5616,
VectorComputeINTEL = 5617,
VectorAnyINTEL = 5619,
SubgroupAvcMotionEstimationINTEL = 5696,
SubgroupAvcMotionEstimationIntraINTEL = 5697,
SubgroupAvcMotionEstimationChromaINTEL = 5698,
VariableLengthArrayINTEL = 5817,
FunctionFloatControlINTEL = 5821,
FPGAMemoryAttributesINTEL = 5824,
FPFastMathModeINTEL = 5837,
ArbitraryPrecisionIntegersINTEL = 5844,
UnstructuredLoopControlsINTEL = 5886,
FPGALoopControlsINTEL = 5888,
KernelAttributesINTEL = 5892,
FPGAKernelAttributesINTEL = 5897,
FPGAMemoryAccessesINTEL = 5898,
FPGAClusterAttributesINTEL = 5904,
LoopFuseINTEL = 5906,
FPGABufferLocationINTEL = 5920,
USMStorageClassesINTEL = 5935,
IOPipesINTEL = 5943,
BlockingPipesINTEL = 5945,
FPGARegINTEL = 5948,
AtomicFloat32AddEXT = 6033,
AtomicFloat64AddEXT = 6034,
LongConstantCompositeINTEL = 6089,
},
RayFlagsShift = {
OpaqueKHR = 0,
NoOpaqueKHR = 1,
TerminateOnFirstHitKHR = 2,
SkipClosestHitShaderKHR = 3,
CullBackFacingTrianglesKHR = 4,
CullFrontFacingTrianglesKHR = 5,
CullOpaqueKHR = 6,
CullNoOpaqueKHR = 7,
SkipTrianglesKHR = 8,
SkipAABBsKHR = 9,
},
RayFlagsMask = {
MaskNone = 0,
OpaqueKHR = 0x00000001,
NoOpaqueKHR = 0x00000002,
TerminateOnFirstHitKHR = 0x00000004,
SkipClosestHitShaderKHR = 0x00000008,
CullBackFacingTrianglesKHR = 0x00000010,
CullFrontFacingTrianglesKHR = 0x00000020,
CullOpaqueKHR = 0x00000040,
CullNoOpaqueKHR = 0x00000080,
SkipTrianglesKHR = 0x00000100,
SkipAABBsKHR = 0x00000200,
},
RayQueryIntersection = {
RayQueryCandidateIntersectionKHR = 0,
RayQueryCommittedIntersectionKHR = 1,
},
RayQueryCommittedIntersectionType = {
RayQueryCommittedIntersectionNoneKHR = 0,
RayQueryCommittedIntersectionTriangleKHR = 1,
RayQueryCommittedIntersectionGeneratedKHR = 2,
},
RayQueryCandidateIntersectionType = {
RayQueryCandidateIntersectionTriangleKHR = 0,
RayQueryCandidateIntersectionAABBKHR = 1,
},
FragmentShadingRateShift = {
Vertical2Pixels = 0,
Vertical4Pixels = 1,
Horizontal2Pixels = 2,
Horizontal4Pixels = 3,
},
FragmentShadingRateMask = {
MaskNone = 0,
Vertical2Pixels = 0x00000001,
Vertical4Pixels = 0x00000002,
Horizontal2Pixels = 0x00000004,
Horizontal4Pixels = 0x00000008,
},
FPDenormMode = {
Preserve = 0,
FlushToZero = 1,
},
FPOperationMode = {
IEEE = 0,
ALT = 1,
},
Op = {
@ -1016,12 +1411,29 @@ spv = {
OpGroupNonUniformLogicalXor = 364,
OpGroupNonUniformQuadBroadcast = 365,
OpGroupNonUniformQuadSwap = 366,
OpCopyLogical = 400,
OpPtrEqual = 401,
OpPtrNotEqual = 402,
OpPtrDiff = 403,
OpTerminateInvocation = 4416,
OpSubgroupBallotKHR = 4421,
OpSubgroupFirstInvocationKHR = 4422,
OpSubgroupAllKHR = 4428,
OpSubgroupAnyKHR = 4429,
OpSubgroupAllEqualKHR = 4430,
OpSubgroupReadInvocationKHR = 4432,
OpTraceRayKHR = 4445,
OpExecuteCallableKHR = 4446,
OpConvertUToAccelerationStructureKHR = 4447,
OpIgnoreIntersectionKHR = 4448,
OpTerminateRayKHR = 4449,
OpTypeRayQueryKHR = 4472,
OpRayQueryInitializeKHR = 4473,
OpRayQueryTerminateKHR = 4474,
OpRayQueryGenerateIntersectionKHR = 4475,
OpRayQueryConfirmIntersectionKHR = 4476,
OpRayQueryProceedKHR = 4477,
OpRayQueryGetIntersectionTypeKHR = 4479,
OpGroupIAddNonUniformAMD = 5000,
OpGroupFAddNonUniformAMD = 5001,
OpGroupFMinNonUniformAMD = 5002,
@ -1032,7 +1444,27 @@ spv = {
OpGroupSMaxNonUniformAMD = 5007,
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
OpImageSampleFootprintNV = 5283,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpReportIntersectionKHR = 5334,
OpReportIntersectionNV = 5334,
OpIgnoreIntersectionNV = 5335,
OpTerminateRayNV = 5336,
OpTraceNV = 5337,
OpTypeAccelerationStructureKHR = 5341,
OpTypeAccelerationStructureNV = 5341,
OpExecuteCallableNV = 5344,
OpTypeCooperativeMatrixNV = 5358,
OpCooperativeMatrixLoadNV = 5359,
OpCooperativeMatrixStoreNV = 5360,
OpCooperativeMatrixMulAddNV = 5361,
OpCooperativeMatrixLengthNV = 5362,
OpBeginInvocationInterlockEXT = 5364,
OpEndInvocationInterlockEXT = 5365,
OpDemoteToHelperInvocationEXT = 5380,
OpIsHelperInvocationEXT = 5381,
OpSubgroupShuffleINTEL = 5571,
OpSubgroupShuffleDownINTEL = 5572,
OpSubgroupShuffleUpINTEL = 5573,
@ -1041,8 +1473,182 @@ spv = {
OpSubgroupBlockWriteINTEL = 5576,
OpSubgroupImageBlockReadINTEL = 5577,
OpSubgroupImageBlockWriteINTEL = 5578,
OpSubgroupImageMediaBlockReadINTEL = 5580,
OpSubgroupImageMediaBlockWriteINTEL = 5581,
OpUCountLeadingZerosINTEL = 5585,
OpUCountTrailingZerosINTEL = 5586,
OpAbsISubINTEL = 5587,
OpAbsUSubINTEL = 5588,
OpIAddSatINTEL = 5589,
OpUAddSatINTEL = 5590,
OpIAverageINTEL = 5591,
OpUAverageINTEL = 5592,
OpIAverageRoundedINTEL = 5593,
OpUAverageRoundedINTEL = 5594,
OpISubSatINTEL = 5595,
OpUSubSatINTEL = 5596,
OpIMul32x16INTEL = 5597,
OpUMul32x16INTEL = 5598,
OpConstFunctionPointerINTEL = 5600,
OpFunctionPointerCallINTEL = 5601,
OpAsmTargetINTEL = 5609,
OpAsmINTEL = 5610,
OpAsmCallINTEL = 5611,
OpAtomicFMinEXT = 5614,
OpAtomicFMaxEXT = 5615,
OpDecorateString = 5632,
OpDecorateStringGOOGLE = 5632,
OpMemberDecorateString = 5633,
OpMemberDecorateStringGOOGLE = 5633,
OpVmeImageINTEL = 5699,
OpTypeVmeImageINTEL = 5700,
OpTypeAvcImePayloadINTEL = 5701,
OpTypeAvcRefPayloadINTEL = 5702,
OpTypeAvcSicPayloadINTEL = 5703,
OpTypeAvcMcePayloadINTEL = 5704,
OpTypeAvcMceResultINTEL = 5705,
OpTypeAvcImeResultINTEL = 5706,
OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707,
OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708,
OpTypeAvcImeSingleReferenceStreaminINTEL = 5709,
OpTypeAvcImeDualReferenceStreaminINTEL = 5710,
OpTypeAvcRefResultINTEL = 5711,
OpTypeAvcSicResultINTEL = 5712,
OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713,
OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714,
OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715,
OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716,
OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717,
OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718,
OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719,
OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720,
OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721,
OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722,
OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723,
OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724,
OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725,
OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726,
OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727,
OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728,
OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729,
OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730,
OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731,
OpSubgroupAvcMceConvertToImePayloadINTEL = 5732,
OpSubgroupAvcMceConvertToImeResultINTEL = 5733,
OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734,
OpSubgroupAvcMceConvertToRefResultINTEL = 5735,
OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736,
OpSubgroupAvcMceConvertToSicResultINTEL = 5737,
OpSubgroupAvcMceGetMotionVectorsINTEL = 5738,
OpSubgroupAvcMceGetInterDistortionsINTEL = 5739,
OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740,
OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741,
OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742,
OpSubgroupAvcMceGetInterDirectionsINTEL = 5743,
OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744,
OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745,
OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746,
OpSubgroupAvcImeInitializeINTEL = 5747,
OpSubgroupAvcImeSetSingleReferenceINTEL = 5748,
OpSubgroupAvcImeSetDualReferenceINTEL = 5749,
OpSubgroupAvcImeRefWindowSizeINTEL = 5750,
OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751,
OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752,
OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753,
OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754,
OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755,
OpSubgroupAvcImeSetWeightedSadINTEL = 5756,
OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757,
OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758,
OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759,
OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760,
OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761,
OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762,
OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763,
OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764,
OpSubgroupAvcImeConvertToMceResultINTEL = 5765,
OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766,
OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767,
OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768,
OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769,
OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770,
OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771,
OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772,
OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773,
OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774,
OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775,
OpSubgroupAvcImeGetBorderReachedINTEL = 5776,
OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777,
OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778,
OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779,
OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780,
OpSubgroupAvcFmeInitializeINTEL = 5781,
OpSubgroupAvcBmeInitializeINTEL = 5782,
OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783,
OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784,
OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785,
OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786,
OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787,
OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788,
OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789,
OpSubgroupAvcRefConvertToMceResultINTEL = 5790,
OpSubgroupAvcSicInitializeINTEL = 5791,
OpSubgroupAvcSicConfigureSkcINTEL = 5792,
OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793,
OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794,
OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795,
OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796,
OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797,
OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798,
OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799,
OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800,
OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801,
OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802,
OpSubgroupAvcSicEvaluateIpeINTEL = 5803,
OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804,
OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805,
OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806,
OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807,
OpSubgroupAvcSicConvertToMceResultINTEL = 5808,
OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809,
OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810,
OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811,
OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812,
OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813,
OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814,
OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815,
OpSubgroupAvcSicGetInterRawSadsINTEL = 5816,
OpVariableLengthArrayINTEL = 5818,
OpSaveMemoryINTEL = 5819,
OpRestoreMemoryINTEL = 5820,
OpLoopControlINTEL = 5887,
OpPtrCastToCrossWorkgroupINTEL = 5934,
OpCrossWorkgroupCastToPtrINTEL = 5938,
OpReadPipeBlockingINTEL = 5946,
OpWritePipeBlockingINTEL = 5947,
OpFPGARegINTEL = 5949,
OpRayQueryGetRayTMinKHR = 6016,
OpRayQueryGetRayFlagsKHR = 6017,
OpRayQueryGetIntersectionTKHR = 6018,
OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019,
OpRayQueryGetIntersectionInstanceIdKHR = 6020,
OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021,
OpRayQueryGetIntersectionGeometryIndexKHR = 6022,
OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023,
OpRayQueryGetIntersectionBarycentricsKHR = 6024,
OpRayQueryGetIntersectionFrontFaceKHR = 6025,
OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026,
OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027,
OpRayQueryGetIntersectionObjectRayOriginKHR = 6028,
OpRayQueryGetWorldRayDirectionKHR = 6029,
OpRayQueryGetWorldRayOriginKHR = 6030,
OpRayQueryGetIntersectionObjectToWorldKHR = 6031,
OpRayQueryGetIntersectionWorldToObjectKHR = 6032,
OpAtomicFAddEXT = 6035,
OpTypeBufferSurfaceINTEL = 6086,
OpTypeStructContinuedINTEL = 6090,
OpConstantCompositeContinuedINTEL = 6091,
OpSpecConstantCompositeContinuedINTEL = 6092,
},
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2014-2018 The Khronos Group Inc.
# Copyright (c) 2014-2020 The Khronos Group Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and/or associated documentation files (the "Materials"),
@ -26,13 +26,16 @@
# the Binary Section of the SPIR-V specification.
# Enumeration tokens for SPIR-V, in various styles:
# C, C++, C++11, JSON, Lua, Python
# C, C++, C++11, JSON, Lua, Python, C#, D
#
# - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
# - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
# - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
# - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
# - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
# - C# will use enum classes in the Specification class located in the "Spv" namespace,
# e.g.: Spv.Specification.SourceLanguage.GLSL
# - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
#
# Some tokens act like mask values, which can be OR'd together,
# while others are mutually exclusive. The mask-like ones have
@ -41,8 +44,8 @@
spv = {
'MagicNumber' : 0x07230203,
'Version' : 0x00010300,
'Revision' : 1,
'Version' : 0x00010500,
'Revision' : 4,
'OpCodeMask' : 0xffff,
'WordCountShift' : 16,
@ -63,18 +66,36 @@ spv = {
'Fragment' : 4,
'GLCompute' : 5,
'Kernel' : 6,
'TaskNV' : 5267,
'MeshNV' : 5268,
'RayGenerationKHR' : 5313,
'RayGenerationNV' : 5313,
'IntersectionKHR' : 5314,
'IntersectionNV' : 5314,
'AnyHitKHR' : 5315,
'AnyHitNV' : 5315,
'ClosestHitKHR' : 5316,
'ClosestHitNV' : 5316,
'MissKHR' : 5317,
'MissNV' : 5317,
'CallableKHR' : 5318,
'CallableNV' : 5318,
},
'AddressingModel' : {
'Logical' : 0,
'Physical32' : 1,
'Physical64' : 2,
'PhysicalStorageBuffer64' : 5348,
'PhysicalStorageBuffer64EXT' : 5348,
},
'MemoryModel' : {
'Simple' : 0,
'GLSL450' : 1,
'OpenCL' : 2,
'Vulkan' : 3,
'VulkanKHR' : 3,
},
'ExecutionMode' : {
@ -117,7 +138,33 @@ spv = {
'LocalSizeId' : 38,
'LocalSizeHintId' : 39,
'PostDepthCoverage' : 4446,
'DenormPreserve' : 4459,
'DenormFlushToZero' : 4460,
'SignedZeroInfNanPreserve' : 4461,
'RoundingModeRTE' : 4462,
'RoundingModeRTZ' : 4463,
'StencilRefReplacingEXT' : 5027,
'OutputLinesNV' : 5269,
'OutputPrimitivesNV' : 5270,
'DerivativeGroupQuadsNV' : 5289,
'DerivativeGroupLinearNV' : 5290,
'OutputTrianglesNV' : 5298,
'PixelInterlockOrderedEXT' : 5366,
'PixelInterlockUnorderedEXT' : 5367,
'SampleInterlockOrderedEXT' : 5368,
'SampleInterlockUnorderedEXT' : 5369,
'ShadingRateInterlockOrderedEXT' : 5370,
'ShadingRateInterlockUnorderedEXT' : 5371,
'SharedLocalMemorySizeINTEL' : 5618,
'RoundingModeRTPINTEL' : 5620,
'RoundingModeRTNINTEL' : 5621,
'FloatingPointModeALTINTEL' : 5622,
'FloatingPointModeIEEEINTEL' : 5623,
'MaxWorkgroupSizeINTEL' : 5893,
'MaxWorkDimINTEL' : 5894,
'NoGlobalOffsetINTEL' : 5895,
'NumSIMDWorkitemsINTEL' : 5896,
'SchedulerTargetFmaxMhzINTEL' : 5903,
},
'StorageClass' : {
@ -134,6 +181,23 @@ spv = {
'AtomicCounter' : 10,
'Image' : 11,
'StorageBuffer' : 12,
'CallableDataKHR' : 5328,
'CallableDataNV' : 5328,
'IncomingCallableDataKHR' : 5329,
'IncomingCallableDataNV' : 5329,
'RayPayloadKHR' : 5338,
'RayPayloadNV' : 5338,
'HitAttributeKHR' : 5339,
'HitAttributeNV' : 5339,
'IncomingRayPayloadKHR' : 5342,
'IncomingRayPayloadNV' : 5342,
'ShaderRecordBufferKHR' : 5343,
'ShaderRecordBufferNV' : 5343,
'PhysicalStorageBuffer' : 5349,
'PhysicalStorageBufferEXT' : 5349,
'CodeSectionINTEL' : 5605,
'DeviceOnlyINTEL' : 5936,
'HostOnlyINTEL' : 5937,
},
'Dim' : {
@ -200,6 +264,8 @@ spv = {
'Rg8ui' : 37,
'R16ui' : 38,
'R8ui' : 39,
'R64ui' : 40,
'R64i' : 41,
},
'ImageChannelOrder' : {
@ -254,6 +320,16 @@ spv = {
'ConstOffsets' : 5,
'Sample' : 6,
'MinLod' : 7,
'MakeTexelAvailable' : 8,
'MakeTexelAvailableKHR' : 8,
'MakeTexelVisible' : 9,
'MakeTexelVisibleKHR' : 9,
'NonPrivateTexel' : 10,
'NonPrivateTexelKHR' : 10,
'VolatileTexel' : 11,
'VolatileTexelKHR' : 11,
'SignExtend' : 12,
'ZeroExtend' : 13,
},
'ImageOperandsMask' : {
@ -266,6 +342,16 @@ spv = {
'ConstOffsets' : 0x00000020,
'Sample' : 0x00000040,
'MinLod' : 0x00000080,
'MakeTexelAvailable' : 0x00000100,
'MakeTexelAvailableKHR' : 0x00000100,
'MakeTexelVisible' : 0x00000200,
'MakeTexelVisibleKHR' : 0x00000200,
'NonPrivateTexel' : 0x00000400,
'NonPrivateTexelKHR' : 0x00000400,
'VolatileTexel' : 0x00000800,
'VolatileTexelKHR' : 0x00000800,
'SignExtend' : 0x00001000,
'ZeroExtend' : 0x00002000,
},
'FPFastMathModeShift' : {
@ -274,6 +360,8 @@ spv = {
'NSZ' : 2,
'AllowRecip' : 3,
'Fast' : 4,
'AllowContractFastINTEL' : 16,
'AllowReassocINTEL' : 17,
},
'FPFastMathModeMask' : {
@ -283,6 +371,8 @@ spv = {
'NSZ' : 0x00000004,
'AllowRecip' : 0x00000008,
'Fast' : 0x00000010,
'AllowContractFastINTEL' : 0x00010000,
'AllowReassocINTEL' : 0x00020000,
},
'FPRoundingMode' : {
@ -341,6 +431,7 @@ spv = {
'NonWritable' : 24,
'NonReadable' : 25,
'Uniform' : 26,
'UniformId' : 27,
'SaturatedConversion' : 28,
'Stream' : 29,
'Location' : 30,
@ -361,14 +452,62 @@ spv = {
'MaxByteOffset' : 45,
'AlignmentId' : 46,
'MaxByteOffsetId' : 47,
'NoSignedWrap' : 4469,
'NoUnsignedWrap' : 4470,
'ExplicitInterpAMD' : 4999,
'OverrideCoverageNV' : 5248,
'PassthroughNV' : 5250,
'ViewportRelativeNV' : 5252,
'SecondaryViewportRelativeNV' : 5256,
'PerPrimitiveNV' : 5271,
'PerViewNV' : 5272,
'PerTaskNV' : 5273,
'PerVertexNV' : 5285,
'NonUniform' : 5300,
'NonUniformEXT' : 5300,
'RestrictPointer' : 5355,
'RestrictPointerEXT' : 5355,
'AliasedPointer' : 5356,
'AliasedPointerEXT' : 5356,
'SIMTCallINTEL' : 5599,
'ReferencedIndirectlyINTEL' : 5602,
'ClobberINTEL' : 5607,
'SideEffectsINTEL' : 5608,
'VectorComputeVariableINTEL' : 5624,
'FuncParamIOKindINTEL' : 5625,
'VectorComputeFunctionINTEL' : 5626,
'StackCallINTEL' : 5627,
'GlobalVariableOffsetINTEL' : 5628,
'CounterBuffer' : 5634,
'HlslCounterBufferGOOGLE' : 5634,
'HlslSemanticGOOGLE' : 5635,
'UserSemantic' : 5635,
'UserTypeGOOGLE' : 5636,
'FunctionRoundingModeINTEL' : 5822,
'FunctionDenormModeINTEL' : 5823,
'RegisterINTEL' : 5825,
'MemoryINTEL' : 5826,
'NumbanksINTEL' : 5827,
'BankwidthINTEL' : 5828,
'MaxPrivateCopiesINTEL' : 5829,
'SinglepumpINTEL' : 5830,
'DoublepumpINTEL' : 5831,
'MaxReplicatesINTEL' : 5832,
'SimpleDualPortINTEL' : 5833,
'MergeINTEL' : 5834,
'BankBitsINTEL' : 5835,
'ForcePow2DepthINTEL' : 5836,
'BurstCoalesceINTEL' : 5899,
'CacheSizeINTEL' : 5900,
'DontStaticallyCoalesceINTEL' : 5901,
'PrefetchINTEL' : 5902,
'StallEnableINTEL' : 5905,
'FuseLoopsInFunctionINTEL' : 5907,
'BufferLocationINTEL' : 5921,
'IOPipeStorageINTEL' : 5944,
'FunctionFloatingPointModeINTEL' : 6080,
'SingleElementVectorINTEL' : 6085,
'VectorComputeCallableFunctionINTEL' : 6087,
},
'BuiltIn' : {
@ -426,8 +565,10 @@ spv = {
'BaseVertex' : 4424,
'BaseInstance' : 4425,
'DrawIndex' : 4426,
'PrimitiveShadingRateKHR' : 4432,
'DeviceIndex' : 4438,
'ViewIndex' : 4440,
'ShadingRateKHR' : 4444,
'BaryCoordNoPerspAMD' : 4992,
'BaryCoordNoPerspCentroidAMD' : 4993,
'BaryCoordNoPerspSampleAMD' : 4994,
@ -442,6 +583,52 @@ spv = {
'PositionPerViewNV' : 5261,
'ViewportMaskPerViewNV' : 5262,
'FullyCoveredEXT' : 5264,
'TaskCountNV' : 5274,
'PrimitiveCountNV' : 5275,
'PrimitiveIndicesNV' : 5276,
'ClipDistancePerViewNV' : 5277,
'CullDistancePerViewNV' : 5278,
'LayerPerViewNV' : 5279,
'MeshViewCountNV' : 5280,
'MeshViewIndicesNV' : 5281,
'BaryCoordNV' : 5286,
'BaryCoordNoPerspNV' : 5287,
'FragSizeEXT' : 5292,
'FragmentSizeNV' : 5292,
'FragInvocationCountEXT' : 5293,
'InvocationsPerPixelNV' : 5293,
'LaunchIdKHR' : 5319,
'LaunchIdNV' : 5319,
'LaunchSizeKHR' : 5320,
'LaunchSizeNV' : 5320,
'WorldRayOriginKHR' : 5321,
'WorldRayOriginNV' : 5321,
'WorldRayDirectionKHR' : 5322,
'WorldRayDirectionNV' : 5322,
'ObjectRayOriginKHR' : 5323,
'ObjectRayOriginNV' : 5323,
'ObjectRayDirectionKHR' : 5324,
'ObjectRayDirectionNV' : 5324,
'RayTminKHR' : 5325,
'RayTminNV' : 5325,
'RayTmaxKHR' : 5326,
'RayTmaxNV' : 5326,
'InstanceCustomIndexKHR' : 5327,
'InstanceCustomIndexNV' : 5327,
'ObjectToWorldKHR' : 5330,
'ObjectToWorldNV' : 5330,
'WorldToObjectKHR' : 5331,
'WorldToObjectNV' : 5331,
'HitTNV' : 5332,
'HitKindKHR' : 5333,
'HitKindNV' : 5333,
'IncomingRayFlagsKHR' : 5351,
'IncomingRayFlagsNV' : 5351,
'RayGeometryIndexKHR' : 5352,
'WarpsPerSMNV' : 5374,
'SMCountNV' : 5375,
'WarpIDNV' : 5376,
'SMIDNV' : 5377,
},
'SelectionControlShift' : {
@ -460,6 +647,19 @@ spv = {
'DontUnroll' : 1,
'DependencyInfinite' : 2,
'DependencyLength' : 3,
'MinIterations' : 4,
'MaxIterations' : 5,
'IterationMultiple' : 6,
'PeelCount' : 7,
'PartialCount' : 8,
'InitiationIntervalINTEL' : 16,
'MaxConcurrencyINTEL' : 17,
'DependencyArrayINTEL' : 18,
'PipelineEnableINTEL' : 19,
'LoopCoalesceINTEL' : 20,
'MaxInterleavingINTEL' : 21,
'SpeculatedIterationsINTEL' : 22,
'NoFusionINTEL' : 23,
},
'LoopControlMask' : {
@ -468,6 +668,19 @@ spv = {
'DontUnroll' : 0x00000002,
'DependencyInfinite' : 0x00000004,
'DependencyLength' : 0x00000008,
'MinIterations' : 0x00000010,
'MaxIterations' : 0x00000020,
'IterationMultiple' : 0x00000040,
'PeelCount' : 0x00000080,
'PartialCount' : 0x00000100,
'InitiationIntervalINTEL' : 0x00010000,
'MaxConcurrencyINTEL' : 0x00020000,
'DependencyArrayINTEL' : 0x00040000,
'PipelineEnableINTEL' : 0x00080000,
'LoopCoalesceINTEL' : 0x00100000,
'MaxInterleavingINTEL' : 0x00200000,
'SpeculatedIterationsINTEL' : 0x00400000,
'NoFusionINTEL' : 0x00800000,
},
'FunctionControlShift' : {
@ -496,6 +709,13 @@ spv = {
'CrossWorkgroupMemory' : 9,
'AtomicCounterMemory' : 10,
'ImageMemory' : 11,
'OutputMemory' : 12,
'OutputMemoryKHR' : 12,
'MakeAvailable' : 13,
'MakeAvailableKHR' : 13,
'MakeVisible' : 14,
'MakeVisibleKHR' : 14,
'Volatile' : 15,
},
'MemorySemanticsMask' : {
@ -510,12 +730,25 @@ spv = {
'CrossWorkgroupMemory' : 0x00000200,
'AtomicCounterMemory' : 0x00000400,
'ImageMemory' : 0x00000800,
'OutputMemory' : 0x00001000,
'OutputMemoryKHR' : 0x00001000,
'MakeAvailable' : 0x00002000,
'MakeAvailableKHR' : 0x00002000,
'MakeVisible' : 0x00004000,
'MakeVisibleKHR' : 0x00004000,
'Volatile' : 0x00008000,
},
'MemoryAccessShift' : {
'Volatile' : 0,
'Aligned' : 1,
'Nontemporal' : 2,
'MakePointerAvailable' : 3,
'MakePointerAvailableKHR' : 3,
'MakePointerVisible' : 4,
'MakePointerVisibleKHR' : 4,
'NonPrivatePointer' : 5,
'NonPrivatePointerKHR' : 5,
},
'MemoryAccessMask' : {
@ -523,6 +756,12 @@ spv = {
'Volatile' : 0x00000001,
'Aligned' : 0x00000002,
'Nontemporal' : 0x00000004,
'MakePointerAvailable' : 0x00000008,
'MakePointerAvailableKHR' : 0x00000008,
'MakePointerVisible' : 0x00000010,
'MakePointerVisibleKHR' : 0x00000010,
'NonPrivatePointer' : 0x00000020,
'NonPrivatePointerKHR' : 0x00000020,
},
'Scope' : {
@ -531,6 +770,9 @@ spv = {
'Workgroup' : 2,
'Subgroup' : 3,
'Invocation' : 4,
'QueueFamily' : 5,
'QueueFamilyKHR' : 5,
'ShaderCallKHR' : 6,
},
'GroupOperation' : {
@ -626,8 +868,14 @@ spv = {
'GroupNonUniformShuffleRelative' : 66,
'GroupNonUniformClustered' : 67,
'GroupNonUniformQuad' : 68,
'ShaderLayer' : 69,
'ShaderViewportIndex' : 70,
'FragmentShadingRateKHR' : 4422,
'SubgroupBallotKHR' : 4423,
'DrawParameters' : 4427,
'WorkgroupMemoryExplicitLayoutKHR' : 4428,
'WorkgroupMemoryExplicitLayout8BitAccessKHR' : 4429,
'WorkgroupMemoryExplicitLayout16BitAccessKHR' : 4430,
'SubgroupVoteKHR' : 4431,
'StorageBuffer16BitAccess' : 4433,
'StorageUniformBufferBlock16' : 4433,
@ -644,11 +892,22 @@ spv = {
'StorageBuffer8BitAccess' : 4448,
'UniformAndStorageBuffer8BitAccess' : 4449,
'StoragePushConstant8' : 4450,
'DenormPreserve' : 4464,
'DenormFlushToZero' : 4465,
'SignedZeroInfNanPreserve' : 4466,
'RoundingModeRTE' : 4467,
'RoundingModeRTZ' : 4468,
'RayQueryProvisionalKHR' : 4471,
'RayQueryKHR' : 4472,
'RayTraversalPrimitiveCullingKHR' : 4478,
'RayTracingKHR' : 4479,
'Float16ImageAMD' : 5008,
'ImageGatherBiasLodAMD' : 5009,
'FragmentMaskAMD' : 5010,
'StencilExportEXT' : 5013,
'ImageReadWriteLodAMD' : 5015,
'Int64ImageEXT' : 5016,
'ShaderClockKHR' : 5055,
'SampleMaskOverrideCoverageNV' : 5249,
'GeometryShaderPassthroughNV' : 5251,
'ShaderViewportIndexLayerEXT' : 5254,
@ -657,22 +916,158 @@ spv = {
'ShaderStereoViewNV' : 5259,
'PerViewAttributesNV' : 5260,
'FragmentFullyCoveredEXT' : 5265,
'MeshShadingNV' : 5266,
'ImageFootprintNV' : 5282,
'FragmentBarycentricNV' : 5284,
'ComputeDerivativeGroupQuadsNV' : 5288,
'FragmentDensityEXT' : 5291,
'ShadingRateNV' : 5291,
'GroupNonUniformPartitionedNV' : 5297,
'ShaderNonUniform' : 5301,
'ShaderNonUniformEXT' : 5301,
'RuntimeDescriptorArray' : 5302,
'RuntimeDescriptorArrayEXT' : 5302,
'InputAttachmentArrayDynamicIndexing' : 5303,
'InputAttachmentArrayDynamicIndexingEXT' : 5303,
'UniformTexelBufferArrayDynamicIndexing' : 5304,
'UniformTexelBufferArrayDynamicIndexingEXT' : 5304,
'StorageTexelBufferArrayDynamicIndexing' : 5305,
'StorageTexelBufferArrayDynamicIndexingEXT' : 5305,
'UniformBufferArrayNonUniformIndexing' : 5306,
'UniformBufferArrayNonUniformIndexingEXT' : 5306,
'SampledImageArrayNonUniformIndexing' : 5307,
'SampledImageArrayNonUniformIndexingEXT' : 5307,
'StorageBufferArrayNonUniformIndexing' : 5308,
'StorageBufferArrayNonUniformIndexingEXT' : 5308,
'StorageImageArrayNonUniformIndexing' : 5309,
'StorageImageArrayNonUniformIndexingEXT' : 5309,
'InputAttachmentArrayNonUniformIndexing' : 5310,
'InputAttachmentArrayNonUniformIndexingEXT' : 5310,
'UniformTexelBufferArrayNonUniformIndexing' : 5311,
'UniformTexelBufferArrayNonUniformIndexingEXT' : 5311,
'StorageTexelBufferArrayNonUniformIndexing' : 5312,
'StorageTexelBufferArrayNonUniformIndexingEXT' : 5312,
'RayTracingNV' : 5340,
'VulkanMemoryModel' : 5345,
'VulkanMemoryModelKHR' : 5345,
'VulkanMemoryModelDeviceScope' : 5346,
'VulkanMemoryModelDeviceScopeKHR' : 5346,
'PhysicalStorageBufferAddresses' : 5347,
'PhysicalStorageBufferAddressesEXT' : 5347,
'ComputeDerivativeGroupLinearNV' : 5350,
'RayTracingProvisionalKHR' : 5353,
'CooperativeMatrixNV' : 5357,
'FragmentShaderSampleInterlockEXT' : 5363,
'FragmentShaderShadingRateInterlockEXT' : 5372,
'ShaderSMBuiltinsNV' : 5373,
'FragmentShaderPixelInterlockEXT' : 5378,
'DemoteToHelperInvocationEXT' : 5379,
'SubgroupShuffleINTEL' : 5568,
'SubgroupBufferBlockIOINTEL' : 5569,
'SubgroupImageBlockIOINTEL' : 5570,
'SubgroupImageMediaBlockIOINTEL' : 5579,
'RoundToInfinityINTEL' : 5582,
'FloatingPointModeINTEL' : 5583,
'IntegerFunctions2INTEL' : 5584,
'FunctionPointersINTEL' : 5603,
'IndirectReferencesINTEL' : 5604,
'AsmINTEL' : 5606,
'AtomicFloat32MinMaxEXT' : 5612,
'AtomicFloat64MinMaxEXT' : 5613,
'AtomicFloat16MinMaxEXT' : 5616,
'VectorComputeINTEL' : 5617,
'VectorAnyINTEL' : 5619,
'SubgroupAvcMotionEstimationINTEL' : 5696,
'SubgroupAvcMotionEstimationIntraINTEL' : 5697,
'SubgroupAvcMotionEstimationChromaINTEL' : 5698,
'VariableLengthArrayINTEL' : 5817,
'FunctionFloatControlINTEL' : 5821,
'FPGAMemoryAttributesINTEL' : 5824,
'FPFastMathModeINTEL' : 5837,
'ArbitraryPrecisionIntegersINTEL' : 5844,
'UnstructuredLoopControlsINTEL' : 5886,
'FPGALoopControlsINTEL' : 5888,
'KernelAttributesINTEL' : 5892,
'FPGAKernelAttributesINTEL' : 5897,
'FPGAMemoryAccessesINTEL' : 5898,
'FPGAClusterAttributesINTEL' : 5904,
'LoopFuseINTEL' : 5906,
'FPGABufferLocationINTEL' : 5920,
'USMStorageClassesINTEL' : 5935,
'IOPipesINTEL' : 5943,
'BlockingPipesINTEL' : 5945,
'FPGARegINTEL' : 5948,
'AtomicFloat32AddEXT' : 6033,
'AtomicFloat64AddEXT' : 6034,
'LongConstantCompositeINTEL' : 6089,
},
'RayFlagsShift' : {
'OpaqueKHR' : 0,
'NoOpaqueKHR' : 1,
'TerminateOnFirstHitKHR' : 2,
'SkipClosestHitShaderKHR' : 3,
'CullBackFacingTrianglesKHR' : 4,
'CullFrontFacingTrianglesKHR' : 5,
'CullOpaqueKHR' : 6,
'CullNoOpaqueKHR' : 7,
'SkipTrianglesKHR' : 8,
'SkipAABBsKHR' : 9,
},
'RayFlagsMask' : {
'MaskNone' : 0,
'OpaqueKHR' : 0x00000001,
'NoOpaqueKHR' : 0x00000002,
'TerminateOnFirstHitKHR' : 0x00000004,
'SkipClosestHitShaderKHR' : 0x00000008,
'CullBackFacingTrianglesKHR' : 0x00000010,
'CullFrontFacingTrianglesKHR' : 0x00000020,
'CullOpaqueKHR' : 0x00000040,
'CullNoOpaqueKHR' : 0x00000080,
'SkipTrianglesKHR' : 0x00000100,
'SkipAABBsKHR' : 0x00000200,
},
'RayQueryIntersection' : {
'RayQueryCandidateIntersectionKHR' : 0,
'RayQueryCommittedIntersectionKHR' : 1,
},
'RayQueryCommittedIntersectionType' : {
'RayQueryCommittedIntersectionNoneKHR' : 0,
'RayQueryCommittedIntersectionTriangleKHR' : 1,
'RayQueryCommittedIntersectionGeneratedKHR' : 2,
},
'RayQueryCandidateIntersectionType' : {
'RayQueryCandidateIntersectionTriangleKHR' : 0,
'RayQueryCandidateIntersectionAABBKHR' : 1,
},
'FragmentShadingRateShift' : {
'Vertical2Pixels' : 0,
'Vertical4Pixels' : 1,
'Horizontal2Pixels' : 2,
'Horizontal4Pixels' : 3,
},
'FragmentShadingRateMask' : {
'MaskNone' : 0,
'Vertical2Pixels' : 0x00000001,
'Vertical4Pixels' : 0x00000002,
'Horizontal2Pixels' : 0x00000004,
'Horizontal4Pixels' : 0x00000008,
},
'FPDenormMode' : {
'Preserve' : 0,
'FlushToZero' : 1,
},
'FPOperationMode' : {
'IEEE' : 0,
'ALT' : 1,
},
'Op' : {
@ -1016,12 +1411,29 @@ spv = {
'OpGroupNonUniformLogicalXor' : 364,
'OpGroupNonUniformQuadBroadcast' : 365,
'OpGroupNonUniformQuadSwap' : 366,
'OpCopyLogical' : 400,
'OpPtrEqual' : 401,
'OpPtrNotEqual' : 402,
'OpPtrDiff' : 403,
'OpTerminateInvocation' : 4416,
'OpSubgroupBallotKHR' : 4421,
'OpSubgroupFirstInvocationKHR' : 4422,
'OpSubgroupAllKHR' : 4428,
'OpSubgroupAnyKHR' : 4429,
'OpSubgroupAllEqualKHR' : 4430,
'OpSubgroupReadInvocationKHR' : 4432,
'OpTraceRayKHR' : 4445,
'OpExecuteCallableKHR' : 4446,
'OpConvertUToAccelerationStructureKHR' : 4447,
'OpIgnoreIntersectionKHR' : 4448,
'OpTerminateRayKHR' : 4449,
'OpTypeRayQueryKHR' : 4472,
'OpRayQueryInitializeKHR' : 4473,
'OpRayQueryTerminateKHR' : 4474,
'OpRayQueryGenerateIntersectionKHR' : 4475,
'OpRayQueryConfirmIntersectionKHR' : 4476,
'OpRayQueryProceedKHR' : 4477,
'OpRayQueryGetIntersectionTypeKHR' : 4479,
'OpGroupIAddNonUniformAMD' : 5000,
'OpGroupFAddNonUniformAMD' : 5001,
'OpGroupFMinNonUniformAMD' : 5002,
@ -1032,7 +1444,27 @@ spv = {
'OpGroupSMaxNonUniformAMD' : 5007,
'OpFragmentMaskFetchAMD' : 5011,
'OpFragmentFetchAMD' : 5012,
'OpReadClockKHR' : 5056,
'OpImageSampleFootprintNV' : 5283,
'OpGroupNonUniformPartitionNV' : 5296,
'OpWritePackedPrimitiveIndices4x8NV' : 5299,
'OpReportIntersectionKHR' : 5334,
'OpReportIntersectionNV' : 5334,
'OpIgnoreIntersectionNV' : 5335,
'OpTerminateRayNV' : 5336,
'OpTraceNV' : 5337,
'OpTypeAccelerationStructureKHR' : 5341,
'OpTypeAccelerationStructureNV' : 5341,
'OpExecuteCallableNV' : 5344,
'OpTypeCooperativeMatrixNV' : 5358,
'OpCooperativeMatrixLoadNV' : 5359,
'OpCooperativeMatrixStoreNV' : 5360,
'OpCooperativeMatrixMulAddNV' : 5361,
'OpCooperativeMatrixLengthNV' : 5362,
'OpBeginInvocationInterlockEXT' : 5364,
'OpEndInvocationInterlockEXT' : 5365,
'OpDemoteToHelperInvocationEXT' : 5380,
'OpIsHelperInvocationEXT' : 5381,
'OpSubgroupShuffleINTEL' : 5571,
'OpSubgroupShuffleDownINTEL' : 5572,
'OpSubgroupShuffleUpINTEL' : 5573,
@ -1041,8 +1473,182 @@ spv = {
'OpSubgroupBlockWriteINTEL' : 5576,
'OpSubgroupImageBlockReadINTEL' : 5577,
'OpSubgroupImageBlockWriteINTEL' : 5578,
'OpSubgroupImageMediaBlockReadINTEL' : 5580,
'OpSubgroupImageMediaBlockWriteINTEL' : 5581,
'OpUCountLeadingZerosINTEL' : 5585,
'OpUCountTrailingZerosINTEL' : 5586,
'OpAbsISubINTEL' : 5587,
'OpAbsUSubINTEL' : 5588,
'OpIAddSatINTEL' : 5589,
'OpUAddSatINTEL' : 5590,
'OpIAverageINTEL' : 5591,
'OpUAverageINTEL' : 5592,
'OpIAverageRoundedINTEL' : 5593,
'OpUAverageRoundedINTEL' : 5594,
'OpISubSatINTEL' : 5595,
'OpUSubSatINTEL' : 5596,
'OpIMul32x16INTEL' : 5597,
'OpUMul32x16INTEL' : 5598,
'OpConstFunctionPointerINTEL' : 5600,
'OpFunctionPointerCallINTEL' : 5601,
'OpAsmTargetINTEL' : 5609,
'OpAsmINTEL' : 5610,
'OpAsmCallINTEL' : 5611,
'OpAtomicFMinEXT' : 5614,
'OpAtomicFMaxEXT' : 5615,
'OpDecorateString' : 5632,
'OpDecorateStringGOOGLE' : 5632,
'OpMemberDecorateString' : 5633,
'OpMemberDecorateStringGOOGLE' : 5633,
'OpVmeImageINTEL' : 5699,
'OpTypeVmeImageINTEL' : 5700,
'OpTypeAvcImePayloadINTEL' : 5701,
'OpTypeAvcRefPayloadINTEL' : 5702,
'OpTypeAvcSicPayloadINTEL' : 5703,
'OpTypeAvcMcePayloadINTEL' : 5704,
'OpTypeAvcMceResultINTEL' : 5705,
'OpTypeAvcImeResultINTEL' : 5706,
'OpTypeAvcImeResultSingleReferenceStreamoutINTEL' : 5707,
'OpTypeAvcImeResultDualReferenceStreamoutINTEL' : 5708,
'OpTypeAvcImeSingleReferenceStreaminINTEL' : 5709,
'OpTypeAvcImeDualReferenceStreaminINTEL' : 5710,
'OpTypeAvcRefResultINTEL' : 5711,
'OpTypeAvcSicResultINTEL' : 5712,
'OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL' : 5713,
'OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL' : 5714,
'OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL' : 5715,
'OpSubgroupAvcMceSetInterShapePenaltyINTEL' : 5716,
'OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL' : 5717,
'OpSubgroupAvcMceSetInterDirectionPenaltyINTEL' : 5718,
'OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL' : 5719,
'OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL' : 5720,
'OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL' : 5721,
'OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL' : 5722,
'OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL' : 5723,
'OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL' : 5724,
'OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL' : 5725,
'OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL' : 5726,
'OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL' : 5727,
'OpSubgroupAvcMceSetAcOnlyHaarINTEL' : 5728,
'OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL' : 5729,
'OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL' : 5730,
'OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL' : 5731,
'OpSubgroupAvcMceConvertToImePayloadINTEL' : 5732,
'OpSubgroupAvcMceConvertToImeResultINTEL' : 5733,
'OpSubgroupAvcMceConvertToRefPayloadINTEL' : 5734,
'OpSubgroupAvcMceConvertToRefResultINTEL' : 5735,
'OpSubgroupAvcMceConvertToSicPayloadINTEL' : 5736,
'OpSubgroupAvcMceConvertToSicResultINTEL' : 5737,
'OpSubgroupAvcMceGetMotionVectorsINTEL' : 5738,
'OpSubgroupAvcMceGetInterDistortionsINTEL' : 5739,
'OpSubgroupAvcMceGetBestInterDistortionsINTEL' : 5740,
'OpSubgroupAvcMceGetInterMajorShapeINTEL' : 5741,
'OpSubgroupAvcMceGetInterMinorShapeINTEL' : 5742,
'OpSubgroupAvcMceGetInterDirectionsINTEL' : 5743,
'OpSubgroupAvcMceGetInterMotionVectorCountINTEL' : 5744,
'OpSubgroupAvcMceGetInterReferenceIdsINTEL' : 5745,
'OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL' : 5746,
'OpSubgroupAvcImeInitializeINTEL' : 5747,
'OpSubgroupAvcImeSetSingleReferenceINTEL' : 5748,
'OpSubgroupAvcImeSetDualReferenceINTEL' : 5749,
'OpSubgroupAvcImeRefWindowSizeINTEL' : 5750,
'OpSubgroupAvcImeAdjustRefOffsetINTEL' : 5751,
'OpSubgroupAvcImeConvertToMcePayloadINTEL' : 5752,
'OpSubgroupAvcImeSetMaxMotionVectorCountINTEL' : 5753,
'OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL' : 5754,
'OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL' : 5755,
'OpSubgroupAvcImeSetWeightedSadINTEL' : 5756,
'OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL' : 5757,
'OpSubgroupAvcImeEvaluateWithDualReferenceINTEL' : 5758,
'OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL' : 5759,
'OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL' : 5760,
'OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL' : 5761,
'OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL' : 5762,
'OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL' : 5763,
'OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL' : 5764,
'OpSubgroupAvcImeConvertToMceResultINTEL' : 5765,
'OpSubgroupAvcImeGetSingleReferenceStreaminINTEL' : 5766,
'OpSubgroupAvcImeGetDualReferenceStreaminINTEL' : 5767,
'OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL' : 5768,
'OpSubgroupAvcImeStripDualReferenceStreamoutINTEL' : 5769,
'OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL' : 5770,
'OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL' : 5771,
'OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL' : 5772,
'OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL' : 5773,
'OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL' : 5774,
'OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL' : 5775,
'OpSubgroupAvcImeGetBorderReachedINTEL' : 5776,
'OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL' : 5777,
'OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL' : 5778,
'OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL' : 5779,
'OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL' : 5780,
'OpSubgroupAvcFmeInitializeINTEL' : 5781,
'OpSubgroupAvcBmeInitializeINTEL' : 5782,
'OpSubgroupAvcRefConvertToMcePayloadINTEL' : 5783,
'OpSubgroupAvcRefSetBidirectionalMixDisableINTEL' : 5784,
'OpSubgroupAvcRefSetBilinearFilterEnableINTEL' : 5785,
'OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL' : 5786,
'OpSubgroupAvcRefEvaluateWithDualReferenceINTEL' : 5787,
'OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL' : 5788,
'OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL' : 5789,
'OpSubgroupAvcRefConvertToMceResultINTEL' : 5790,
'OpSubgroupAvcSicInitializeINTEL' : 5791,
'OpSubgroupAvcSicConfigureSkcINTEL' : 5792,
'OpSubgroupAvcSicConfigureIpeLumaINTEL' : 5793,
'OpSubgroupAvcSicConfigureIpeLumaChromaINTEL' : 5794,
'OpSubgroupAvcSicGetMotionVectorMaskINTEL' : 5795,
'OpSubgroupAvcSicConvertToMcePayloadINTEL' : 5796,
'OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL' : 5797,
'OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL' : 5798,
'OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL' : 5799,
'OpSubgroupAvcSicSetBilinearFilterEnableINTEL' : 5800,
'OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL' : 5801,
'OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL' : 5802,
'OpSubgroupAvcSicEvaluateIpeINTEL' : 5803,
'OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL' : 5804,
'OpSubgroupAvcSicEvaluateWithDualReferenceINTEL' : 5805,
'OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL' : 5806,
'OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL' : 5807,
'OpSubgroupAvcSicConvertToMceResultINTEL' : 5808,
'OpSubgroupAvcSicGetIpeLumaShapeINTEL' : 5809,
'OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL' : 5810,
'OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL' : 5811,
'OpSubgroupAvcSicGetPackedIpeLumaModesINTEL' : 5812,
'OpSubgroupAvcSicGetIpeChromaModeINTEL' : 5813,
'OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL' : 5814,
'OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL' : 5815,
'OpSubgroupAvcSicGetInterRawSadsINTEL' : 5816,
'OpVariableLengthArrayINTEL' : 5818,
'OpSaveMemoryINTEL' : 5819,
'OpRestoreMemoryINTEL' : 5820,
'OpLoopControlINTEL' : 5887,
'OpPtrCastToCrossWorkgroupINTEL' : 5934,
'OpCrossWorkgroupCastToPtrINTEL' : 5938,
'OpReadPipeBlockingINTEL' : 5946,
'OpWritePipeBlockingINTEL' : 5947,
'OpFPGARegINTEL' : 5949,
'OpRayQueryGetRayTMinKHR' : 6016,
'OpRayQueryGetRayFlagsKHR' : 6017,
'OpRayQueryGetIntersectionTKHR' : 6018,
'OpRayQueryGetIntersectionInstanceCustomIndexKHR' : 6019,
'OpRayQueryGetIntersectionInstanceIdKHR' : 6020,
'OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR' : 6021,
'OpRayQueryGetIntersectionGeometryIndexKHR' : 6022,
'OpRayQueryGetIntersectionPrimitiveIndexKHR' : 6023,
'OpRayQueryGetIntersectionBarycentricsKHR' : 6024,
'OpRayQueryGetIntersectionFrontFaceKHR' : 6025,
'OpRayQueryGetIntersectionCandidateAABBOpaqueKHR' : 6026,
'OpRayQueryGetIntersectionObjectRayDirectionKHR' : 6027,
'OpRayQueryGetIntersectionObjectRayOriginKHR' : 6028,
'OpRayQueryGetWorldRayDirectionKHR' : 6029,
'OpRayQueryGetWorldRayOriginKHR' : 6030,
'OpRayQueryGetIntersectionObjectToWorldKHR' : 6031,
'OpRayQueryGetIntersectionWorldToObjectKHR' : 6032,
'OpAtomicFAddEXT' : 6035,
'OpTypeBufferSurfaceINTEL' : 6086,
'OpTypeStructContinuedINTEL' : 6090,
'OpConstantCompositeContinuedINTEL' : 6091,
'OpSpecConstantCompositeContinuedINTEL' : 6092,
},
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,242 @@
#!/usr/bin/env python3
# Copyright (c) 2017-2020 Google LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Materials, and to
# permit persons to whom the Materials are furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Materials.
#
# MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
# KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
# SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
# https://www.khronos.org/registry/
#
# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
"""Generates a C language headers from a SPIR-V JSON grammar file"""
import errno
import json
import os.path
import re
DEFAULT_COPYRIGHT="""Copyright (c) 2020 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.
MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
https://www.khronos.org/registry/
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
""".split('\n')
def make_path_to_file(f):
"""Makes all ancestor directories to the given file, if they
don't yet exist.
Arguments:
f: The file whose ancestor directories are to be created.
"""
dir = os.path.dirname(os.path.abspath(f))
try:
os.makedirs(dir)
except OSError as e:
if e.errno == errno.EEXIST and os.path.isdir(dir):
pass
else:
raise
class ExtInstGrammar:
"""The grammar for an extended instruction set"""
def __init__(self, name, copyright, instructions, operand_kinds, version = None, revision = None):
self.name = name
self.copyright = copyright
self.instructions = instructions
self.operand_kinds = operand_kinds
self.version = version
self.revision = revision
class LangGenerator:
"""A language-specific generator"""
def __init__(self):
self.upper_case_initial = re.compile('^[A-Z]')
pass
def comment_prefix(self):
return ""
def namespace_prefix(self):
return ""
def uses_guards(self):
return False
def cpp_guard_preamble(self):
return ""
def cpp_guard_postamble(self):
return ""
def enum_value(self, prefix, name, value):
if self.upper_case_initial.match(name):
use_name = name
else:
use_name = '_' + name
return " {}{} = {},".format(prefix, use_name, value)
def generate(self, grammar):
"""Returns a string that is the language-specific header for the given grammar"""
parts = []
if grammar.copyright:
parts.extend(["{}{}".format(self.comment_prefix(), f) for f in grammar.copyright])
parts.append('')
guard = 'SPIRV_UNIFIED1_{}_H_'.format(grammar.name)
if self.uses_guards:
parts.append('#ifndef {}'.format(guard))
parts.append('#define {}'.format(guard))
parts.append('')
parts.append(self.cpp_guard_preamble())
if grammar.version:
parts.append(self.const_definition(grammar.name, 'Version', grammar.version))
if grammar.revision is not None:
parts.append(self.const_definition(grammar.name, 'Revision', grammar.revision))
parts.append('')
if grammar.instructions:
parts.append(self.enum_prefix(grammar.name, 'Instructions'))
for inst in grammar.instructions:
parts.append(self.enum_value(grammar.name, inst['opname'], inst['opcode']))
parts.append(self.enum_end(grammar.name, 'Instructions'))
parts.append('')
if grammar.operand_kinds:
for kind in grammar.operand_kinds:
parts.append(self.enum_prefix(grammar.name, kind['kind']))
for e in kind['enumerants']:
parts.append(self.enum_value(grammar.name, e['enumerant'], e['value']))
parts.append(self.enum_end(grammar.name, kind['kind']))
parts.append('')
parts.append(self.cpp_guard_postamble())
if self.uses_guards:
parts.append('#endif // {}'.format(guard))
# Ensre the file ends in an end of line
parts.append('')
return '\n'.join(parts)
class CLikeGenerator(LangGenerator):
def uses_guards(self):
return True
def comment_prefix(self):
return "// "
def const_definition(self, prefix, var, value):
# Use an anonymous enum. Don't use a static const int variable because
# that can bloat binary size.
return 'enum {0}{1}{2}{3} = {4},{1}{2}{3}_BitWidthPadding = 0x7fffffff{5};'.format(
'{', '\n ', prefix, var, value, '\n}')
def enum_prefix(self, prefix, name):
return 'enum {}{} {}'.format(prefix, name, '{')
def enum_end(self, prefix, enum):
return ' {}{}Max = 0x7fffffff\n{};\n'.format(prefix, enum, '}')
def cpp_guard_preamble(self):
return '#ifdef __cplusplus\nextern "C" {\n#endif\n'
def cpp_guard_postamble(self):
return '#ifdef __cplusplus\n}\n#endif\n'
class CGenerator(CLikeGenerator):
pass
def main():
import argparse
parser = argparse.ArgumentParser(description='Generate language headers from a JSON grammar')
parser.add_argument('--extinst-name',
type=str, required=True,
help='The name to use in tokens')
parser.add_argument('--extinst-grammar', metavar='<path>',
type=str, required=True,
help='input JSON grammar file for extended instruction set')
parser.add_argument('--extinst-output-base', metavar='<path>',
type=str, required=True,
help='Basename of the language-specific output file.')
args = parser.parse_args()
with open(args.extinst_grammar) as json_file:
grammar_json = json.loads(json_file.read())
if 'copyright' in grammar_json:
copyright = grammar_json['copyright']
else:
copyright = DEFAULT_COPYRIGHT
if 'version' in grammar_json:
version = grammar_json['version']
else:
version = 0
if 'operand_kinds' in grammar_json:
operand_kinds = grammar_json['operand_kinds']
else:
operand_kinds = []
grammar = ExtInstGrammar(name = args.extinst_name,
copyright = copyright,
instructions = grammar_json['instructions'],
operand_kinds = operand_kinds,
version = version,
revision = grammar_json['revision'])
make_path_to_file(args.extinst_output_base)
with open(args.extinst_output_base + '.h', 'w') as f:
f.write(CGenerator().generate(grammar))
if __name__ == '__main__':
main()

View File

@ -0,0 +1,28 @@
#!/usr/bin/env python3
"""Generate C headers for certain extended instruction sets"""
import subprocess
import os
# Assume we are running from the tools/buildHeaders directory
os.chdir('../../include/spirv/unified1')
def mk_extinst(name, grammar_file):
"""Generate one C header from a grammar"""
script = '../../../tools/buildHeaders/bin/generate_language_headers.py'
subprocess.check_call(['python3',
script,
'--extinst-name=' + name,
'--extinst-grammar=' + grammar_file,
'--extinst-output-base=' + name])
subprocess.check_call(['dos2unix', name + '.h'])
mk_extinst('DebugInfo', 'extinst.debuginfo.grammar.json')
mk_extinst('OpenCLDebugInfo100', 'extinst.opencl.debuginfo.100.grammar.json')
mk_extinst('AMD_gcn_shader', 'extinst.spv-amd-gcn-shader.grammar.json')
mk_extinst('AMD_shader_ballot', 'extinst.spv-amd-shader-ballot.grammar.json')
mk_extinst('AMD_shader_explicit_vertex_parameter', 'extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json')
mk_extinst('AMD_shader_trinary_minmax', 'extinst.spv-amd-shader-trinary-minmax.grammar.json')
mk_extinst('NonSemanticDebugPrintf', 'extinst.nonsemantic.debugprintf.grammar.json')
mk_extinst('NonSemanticClspvReflection', 'extinst.nonsemantic.clspvreflection.grammar.json')

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
python3 bin/makeExtinstHeaders.py
cd ../../include/spirv/unified1
../../../tools/buildHeaders/build/install/bin/buildSpvHeaders -H spirv.core.grammar.json
dos2unix spirv.*
dos2unix spirv.* SpirV.* spv.*

View File

@ -1,4 +1,4 @@
// Copyright (c) 2014-2018 The Khronos Group Inc.
// Copyright (c) 2014-2020 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
@ -42,6 +42,7 @@
#include <cctype>
#include <vector>
#include <utility>
#include <set>
#include "jsoncpp/dist/json/json.h"
@ -68,9 +69,9 @@ namespace {
TPrinter();
static const int DocMagicNumber = 0x07230203;
static const int DocVersion = 0x00010300;
static const int DocRevision = 1;
#define DocRevisionString "1"
static const int DocVersion = 0x00010500;
static const int DocRevision = 4;
#define DocRevisionString "4"
static const std::string DocCopyright;
static const std::string DocComment1;
static const std::string DocComment2;
@ -97,6 +98,7 @@ namespace {
virtual void printEpilogue(std::ostream&) const { }
virtual void printMeta(std::ostream&) const;
virtual void printTypes(std::ostream&) const { }
virtual void printHasResultType(std::ostream&) const { };
virtual std::string escapeComment(const std::string& s) const;
@ -167,7 +169,7 @@ namespace {
}
const std::string TPrinter::DocCopyright =
"Copyright (c) 2014-2018 The Khronos Group Inc.\n"
"Copyright (c) 2014-2020 The Khronos Group Inc.\n"
"\n"
"Permission is hereby granted, free of charge, to any person obtaining a copy\n"
"of this software and/or associated documentation files (the \"Materials\"),\n"
@ -197,13 +199,16 @@ namespace {
const std::string TPrinter::DocComment2 =
"Enumeration tokens for SPIR-V, in various styles:\n"
" C, C++, C++11, JSON, Lua, Python\n"
" C, C++, C++11, JSON, Lua, Python, C#, D\n"
"\n"
"- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL\n"
"- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL\n"
"- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL\n"
"- Lua will use tables, e.g.: spv.SourceLanguage.GLSL\n"
"- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']\n"
"- C# will use enum classes in the Specification class located in the \"Spv\" namespace,\n"
" e.g.: Spv.Specification.SourceLanguage.GLSL\n"
"- D will have tokens under the \"spv\" module, e.g: spv.SourceLanguage.GLSL\n"
"\n"
"Some tokens act like mask values, which can be OR'd together,\n"
"while others are mutually exclusive. The mask-like ones have\n"
@ -343,7 +348,7 @@ namespace {
bool printMax = (style != enumMask && maxEnum.size() > 0);
for (const auto& v : sorted)
out << enumFmt(opPrefix, v, style, !printMax && v.first == sorted.back().first);
out << enumFmt(opPrefix, v, style, !printMax && v.second == sorted.back().second);
if (printMax)
out << maxEnum;
@ -361,6 +366,7 @@ namespace {
printTypes(out);
printMeta(out);
printDefs(out);
printHasResultType(out);
printEpilogue(out);
}
@ -475,7 +481,7 @@ namespace {
}
virtual void printEpilogue(std::ostream& out) const override {
out << "#endif // #ifndef spirv_" << headerGuardSuffix() << std::endl;
out << "#endif" << std::endl;
}
virtual void printTypes(std::ostream& out) const override {
@ -491,6 +497,45 @@ namespace {
virtual std::string pre() const { return ""; } // C name prefix
virtual std::string headerGuardSuffix() const = 0;
virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& name) const { return pre() + name; }
virtual void printHasResultType(std::ostream& out) const
{
const Json::Value& enums = spvRoot["spv"]["enum"];
std::set<unsigned> seenValues;
for (auto opClass = enums.begin(); opClass != enums.end(); ++opClass) {
const auto opName = (*opClass)["Name"].asString();
if (opName != "Op") {
continue;
}
out << "#ifdef SPV_ENABLE_UTILITY_CODE" << std::endl;
out << "inline void " << pre() << "HasResultAndType(" << pre() << opName << " opcode, bool *hasResult, bool *hasResultType) {" << std::endl;
out << " *hasResult = *hasResultType = false;" << std::endl;
out << " switch (opcode) {" << std::endl;
out << " default: /* unknown opcode */ break;" << std::endl;
for (auto& inst : spv::InstructionDesc) {
// Filter out duplicate enum values, which would break the switch statement.
// These are probably just extension enums promoted to core.
if (seenValues.find(inst.value) != seenValues.end()) {
continue;
}
seenValues.insert(inst.value);
std::string name = inst.name;
out << " case " << fmtEnumUse("Op", name) << ": *hasResult = " << (inst.hasResult() ? "true" : "false") << "; *hasResultType = " << (inst.hasType() ? "true" : "false") << "; break;" << std::endl;
}
out << " }" << std::endl;
out << "}" << std::endl;
out << "#endif /* SPV_ENABLE_UTILITY_CODE */" << std::endl << std::endl;
}
}
};
// C printer
@ -549,7 +594,7 @@ namespace {
}
out << "\n} // end namespace spv\n\n";
TPrinterCBase::printEpilogue(out);
out << "#endif // #ifndef spirv_" << headerGuardSuffix() << std::endl;
}
std::string commentBOL() const override { return "// "; }
@ -597,6 +642,9 @@ namespace {
return enumFmt(s, v, style, true);
}
// Add type prefix for scoped enum
virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& name) const { return opPrefix + "::" + name; }
std::string headerGuardSuffix() const override { return "HPP"; }
};
@ -658,6 +706,76 @@ namespace {
}
};
// C# printer
class TPrinterCSharp final : public TPrinter {
private:
std::string commentBOL() const override { return "// "; }
void printPrologue(std::ostream& out) const override {
out << "namespace Spv\n{\n\n";
out << indent() << "public static class Specification\n";
out << indent() << "{\n";
}
void printEpilogue(std::ostream& out) const override {
out << indent() << "}\n";
out << "}\n";
}
std::string enumBeg(const std::string& s, enumStyle_t style) const override {
return indent(2) + "public enum " + s + styleStr(style) + "\n" + indent(2) + "{\n";
}
std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override {
return indent(2) + "}" + + (isLast ? "\n" : "\n\n");
}
std::string enumFmt(const std::string& s, const valpair_t& v,
enumStyle_t style, bool isLast) const override {
return indent(3) + prependIfDigit(s, v.second) + " = " + fmtStyleVal(v.first, style) + ",\n";
}
std::string fmtConstInt(unsigned val, const std::string& name,
const char* fmt, bool isLast) const override {
return indent(2) + std::string("public const uint ") + name +
" = " + fmtNum(fmt, val) + (isLast ? ";\n\n" : ";\n");
}
};
// D printer
class TPrinterD final : public TPrinter {
private:
std::string commentBeg() const override { return "/+\n"; }
std::string commentBOL() const override { return " + "; }
std::string commentEnd(bool isLast) const override { return " +/\n"; }
void printPrologue(std::ostream& out) const override {
out << "module spv;\n\n";
}
void printEpilogue(std::ostream& out) const override {
}
std::string enumBeg(const std::string& s, enumStyle_t style) const override {
return "enum " + s + styleStr(style) + " : uint\n{\n";
}
std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override {
return std::string("}\n\n");
}
std::string enumFmt(const std::string& s, const valpair_t& v,
enumStyle_t style, bool isLast) const override {
return indent() + prependIfDigit("_", v.second) + " = " + fmtStyleVal(v.first, style) + ",\n";
}
std::string fmtConstInt(unsigned val, const std::string& name,
const char* fmt, bool isLast) const override {
return std::string("enum uint ") + name +
" = " + fmtNum(fmt, val) + (isLast ? ";\n\n" : ";\n");
}
};
} // namespace
namespace spv {
@ -672,6 +790,8 @@ namespace spv {
langInfo.push_back(std::make_pair(ELangJSON, "spirv.json"));
langInfo.push_back(std::make_pair(ELangLua, "spirv.lua"));
langInfo.push_back(std::make_pair(ELangPython, "spirv.py"));
langInfo.push_back(std::make_pair(ELangCSharp, "spirv.cs"));
langInfo.push_back(std::make_pair(ELangD, "spv.d"));
for (const auto& lang : langInfo) {
std::ofstream out(lang.second, std::ios::out);
@ -697,6 +817,8 @@ namespace spv {
case ELangJSON: p = TPrinterPtr(new TPrinterJSON); break;
case ELangLua: p = TPrinterPtr(new TPrinterLua); break;
case ELangPython: p = TPrinterPtr(new TPrinterPython); break;
case ELangCSharp: p = TPrinterPtr(new TPrinterCSharp); break;
case ELangD: p = TPrinterPtr(new TPrinterD); break;
case ELangAll: PrintAllHeaders(); break;
default:
std::cerr << "Unknown language." << std::endl;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2014-2018 The Khronos Group Inc.
// Copyright (c) 2014-2019 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
@ -41,6 +41,8 @@ namespace spv {
ELangJSON, // JSON
ELangLua, // Lua
ELangPython, // Python
ELangCSharp, // CSharp
ELangD, // D
ELangAll, // print headers in all languages to files
};

View File

@ -1,4 +1,4 @@
// Copyright (c) 2014-2018 The Khronos Group Inc.
// Copyright (c) 2014-2020 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
@ -25,8 +25,10 @@
#include <assert.h>
#include <string.h>
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <fstream>
@ -40,6 +42,10 @@ namespace spv {
// parameterization information.
InstructionValues InstructionDesc;
// The ordered list (in printing order) of printing classes
// (specification subsections).
PrintingClasses InstructionPrintingClasses;
// Note: There is no entry for OperandOpcode. Use InstructionDesc instead.
EnumDefinition OperandClassParams[OperandOpcode];
EnumValues SourceLanguageParams;
@ -56,6 +62,8 @@ EnumValues ImageChannelDataTypeParams;
EnumValues ImageOperandsParams;
EnumValues FPFastMathParams;
EnumValues FPRoundingModeParams;
EnumValues FPDenormModeParams;
EnumValues FPOperationModeParams;
EnumValues LinkageTypeParams;
EnumValues DecorationParams;
EnumValues BuiltInParams;
@ -72,6 +80,11 @@ EnumValues ScopeParams;
EnumValues KernelEnqueueFlagsParams;
EnumValues KernelProfilingInfoParams;
EnumValues CapabilityParams;
EnumValues RayFlagsParams;
EnumValues RayQueryIntersectionParams;
EnumValues RayQueryCommittedIntersectionTypeParams;
EnumValues RayQueryCandidateIntersectionTypeParams;
EnumValues FragmentShadingRateParams;
std::pair<bool, std::string> ReadFile(const std::string& path)
{
@ -119,8 +132,7 @@ ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, co
else if (quantifier == "?")
return {OperandLiteralString, true};
else {
assert(0 && "this case should not exist");
return {OperandNone, false};
return {OperandOptionalLiteralStrings, false};
}
} else if (operandKind == "PairLiteralIntegerIdRef") {
// Used by OpSwitch in the grammar
@ -142,7 +154,7 @@ ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, co
} else if (operandKind == "LiteralSpecConstantOpInteger") {
type = OperandLiteralNumber;
} else if (operandKind == "LiteralContextDependentNumber") {
type = OperandVariableLiterals;
type = OperandAnySizeLiteralNumber;
} else if (operandKind == "SourceLanguage") {
type = OperandSource;
} else if (operandKind == "ExecutionModel") {
@ -169,6 +181,10 @@ ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, co
type = OperandImageChannelDataType;
} else if (operandKind == "FPRoundingMode") {
type = OperandFPRoundingMode;
} else if (operandKind == "FPDenormMode") {
type = OperandFPDenormMode;
} else if (operandKind == "FPOperationMode") {
type = OperandFPOperationMode;
} else if (operandKind == "LinkageType") {
type = OperandLinkageType;
} else if (operandKind == "AccessQualifier") {
@ -198,7 +214,17 @@ ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, co
} else if (operandKind == "FunctionControl") {
type = OperandFunction;
} else if (operandKind == "MemoryAccess") {
type = OperandMemoryAccess;
type = OperandMemoryOperands;
} else if (operandKind == "RayFlags") {
type = OperandRayFlags;
} else if (operandKind == "RayQueryIntersection") {
type = OperandRayQueryIntersection;
} else if (operandKind == "RayQueryCommittedIntersectionType") {
type = OperandRayQueryCommittedIntersectionType;
} else if (operandKind == "RayQueryCandidateIntersectionType") {
type = OperandRayQueryCandidateIntersectionType;
} else if (operandKind == "FragmentShadingRate") {
type = OperandFragmentShadingRate;
}
if (type == OperandNone) {
@ -230,7 +256,7 @@ unsigned int NumberStringToBit(const std::string& str)
return bit;
}
void jsonToSpirv(const std::string& jsonPath)
void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders)
{
// only do this once.
static bool initialized = false;
@ -285,12 +311,55 @@ void jsonToSpirv(const std::string& jsonPath)
return result;
};
// set up the printing classes
std::unordered_set<std::string> tags; // short-lived local for error checking below
const Json::Value printingClasses = root["instruction_printing_class"];
for (const auto& printingClass : printingClasses) {
if (printingClass["tag"].asString().size() > 0)
tags.insert(printingClass["tag"].asString()); // just for error checking
else
std::cerr << "Error: each instruction_printing_class requires a non-empty \"tag\"" << std::endl;
if (buildingHeaders || printingClass["tag"].asString() != "@exclude") {
InstructionPrintingClasses.push_back({printingClass["tag"].asString(),
printingClass["heading"].asString()});
}
}
// process the instructions
const Json::Value insts = root["instructions"];
unsigned maxOpcode = 0;
bool firstOpcode = true;
for (const auto& inst : insts) {
const unsigned int opcode = inst["opcode"].asUInt();
const auto printingClass = inst["class"].asString();
if (printingClass.size() == 0) {
std::cerr << "Error: " << inst["opname"].asString()
<< " requires a non-empty printing \"class\" tag" << std::endl;
}
if (!buildingHeaders && printingClass == "@exclude")
continue;
if (tags.find(printingClass) == tags.end()) {
std::cerr << "Error: " << inst["opname"].asString()
<< " requires a \"class\" declared as a \"tag\" in \"instruction printing_class\""
<< std::endl;
}
const auto opcode = inst["opcode"].asUInt();
const std::string name = inst["opname"].asString();
if (firstOpcode) {
maxOpcode = opcode;
firstOpcode = false;
} else {
if (maxOpcode > opcode) {
std::cerr << "Error: " << name
<< " is out of order. It follows the instruction with opcode " << maxOpcode
<< std::endl;
std::exit(1);
} else {
maxOpcode = opcode;
}
}
EnumCaps caps = getCaps(inst);
std::string version = inst["version"].asString();
std::string lastVersion = inst["lastVersion"].asString();
Extensions exts = getExts(inst);
OperandParameters operands;
bool defResultId = false;
@ -306,9 +375,9 @@ void jsonToSpirv(const std::string& jsonPath)
}
InstructionDesc.emplace_back(
std::move(EnumValue(opcode, name,
std::move(caps), std::move(version), std::move(exts),
std::move(caps), std::move(version), std::move(lastVersion), std::move(exts),
std::move(operands))),
defTypeId, defResultId);
printingClass, defTypeId, defResultId);
}
// Specific additional context-dependent operands
@ -331,14 +400,30 @@ void jsonToSpirv(const std::string& jsonPath)
return result;
};
unsigned maxValue = 0;
bool firstValue = true;
for (const auto& enumerant : source["enumerants"]) {
unsigned value;
bool skip_zero_in_bitfield;
std::tie(value, skip_zero_in_bitfield) = getValue(enumerant);
if (skip_zero_in_bitfield)
continue;
if (firstValue) {
maxValue = value;
firstValue = false;
} else {
if (maxValue > value) {
std::cerr << "Error: " << source["kind"] << " enumerant " << enumerant["enumerant"]
<< " is out of order. It has value " << value
<< " but follows the enumerant with value " << maxValue << std::endl;
std::exit(1);
} else {
maxValue = value;
}
}
EnumCaps caps(getCaps(enumerant));
std::string version = enumerant["version"].asString();
std::string lastVersion = enumerant["lastVersion"].asString();
Extensions exts(getExts(enumerant));
OperandParameters params;
const Json::Value& paramsJson = enumerant["parameters"];
@ -353,7 +438,7 @@ void jsonToSpirv(const std::string& jsonPath)
}
dest->emplace_back(
value, enumerant["enumerant"].asString(),
std::move(caps), std::move(version), std::move(exts), std::move(params));
std::move(caps), std::move(version), std::move(lastVersion), std::move(exts), std::move(params));
}
};
@ -404,6 +489,10 @@ void jsonToSpirv(const std::string& jsonPath)
establishOperandClass(enumName, OperandFPFastMath, &FPFastMathParams, operandEnum, category);
} else if (enumName == "FPRoundingMode") {
establishOperandClass(enumName, OperandFPRoundingMode, &FPRoundingModeParams, operandEnum, category);
} else if (enumName == "FPDenormMode") {
establishOperandClass(enumName, OperandFPDenormMode, &FPDenormModeParams, operandEnum, category);
} else if (enumName == "FPOperationMode") {
establishOperandClass(enumName, OperandFPOperationMode, &FPOperationModeParams, operandEnum, category);
} else if (enumName == "LinkageType") {
establishOperandClass(enumName, OperandLinkageType, &LinkageTypeParams, operandEnum, category);
} else if (enumName == "FunctionParameterAttribute") {
@ -421,7 +510,7 @@ void jsonToSpirv(const std::string& jsonPath)
} else if (enumName == "Dim") {
establishOperandClass(enumName, OperandDimensionality, &DimensionalityParams, operandEnum, category);
} else if (enumName == "MemoryAccess") {
establishOperandClass(enumName, OperandMemoryAccess, &MemoryAccessParams, operandEnum, category);
establishOperandClass(enumName, OperandMemoryOperands, &MemoryAccessParams, operandEnum, category);
} else if (enumName == "Scope") {
establishOperandClass(enumName, OperandScope, &ScopeParams, operandEnum, category);
} else if (enumName == "GroupOperation") {
@ -430,6 +519,16 @@ void jsonToSpirv(const std::string& jsonPath)
establishOperandClass(enumName, OperandKernelEnqueueFlags, &KernelEnqueueFlagsParams, operandEnum, category);
} else if (enumName == "KernelProfilingInfo") {
establishOperandClass(enumName, OperandKernelProfilingInfo, &KernelProfilingInfoParams, operandEnum, category);
} else if (enumName == "RayFlags") {
establishOperandClass(enumName, OperandRayFlags, &RayFlagsParams, operandEnum, category);
} else if (enumName == "RayQueryIntersection") {
establishOperandClass(enumName, OperandRayQueryIntersection, &RayQueryIntersectionParams, operandEnum, category);
} else if (enumName == "RayQueryCommittedIntersectionType") {
establishOperandClass(enumName, OperandRayQueryCommittedIntersectionType, &RayQueryCommittedIntersectionTypeParams, operandEnum, category);
} else if (enumName == "RayQueryCandidateIntersectionType") {
establishOperandClass(enumName, OperandRayQueryCandidateIntersectionType, &RayQueryCandidateIntersectionTypeParams, operandEnum, category);
} else if (enumName == "FragmentShadingRate") {
establishOperandClass(enumName, OperandFragmentShadingRate, &FragmentShadingRateParams, operandEnum, category);
}
}
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2014-2018 The Khronos Group Inc.
// Copyright (c) 2014-2020 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
@ -38,18 +38,22 @@ namespace spv {
std::pair<bool, std::string> ReadFile(const std::string& path);
// Fill in all the parameters
void jsonToSpirv(const std::string& jsonPath);
void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders);
// For parameterizing operands.
// The ordering here affects the printing order in the SPIR-V specification.
// Please add new operand classes at the end.
enum OperandClass {
OperandNone,
OperandId,
OperandVariableIds,
OperandOptionalLiteral,
OperandOptionalLiteralString,
OperandOptionalLiteralStrings,
OperandVariableLiterals,
OperandVariableIdLiteral,
OperandVariableLiteralId,
OperandAnySizeLiteralNumber,
OperandLiteralNumber,
OperandLiteralString,
OperandSource,
@ -76,18 +80,32 @@ enum OperandClass {
OperandLoop,
OperandFunction,
OperandMemorySemantics,
OperandMemoryAccess,
OperandMemoryOperands,
OperandScope,
OperandGroupOperation,
OperandKernelEnqueueFlags,
OperandKernelProfilingInfo,
OperandCapability,
OperandRayFlags,
OperandRayQueryIntersection,
OperandRayQueryCommittedIntersectionType,
OperandRayQueryCandidateIntersectionType,
OperandFragmentShadingRate,
OperandFPDenormMode,
OperandFPOperationMode,
OperandOpcode,
OperandCount
};
// For direct representation of the JSON grammar "instruction_printing_class".
struct PrintingClass {
std::string tag;
std::string heading;
};
using PrintingClasses = std::vector<PrintingClass>;
// Any specific enum can have a set of capabilities that allow it:
typedef std::vector<std::string> EnumCaps;
@ -145,6 +163,12 @@ public:
assert((where != end()) && "Could not find enum in the enum list");
return *where;
}
// gets *all* entries for the value, including the first one
void gatherAliases(unsigned value, std::vector<EValue*>& aliases) {
std::for_each(begin(), end(), [&](EValue& e) {
if (value == e.value)
aliases.push_back(&e);});
}
// Returns the EValue with the given name. We assume uniqueness
// by name.
EValue& at(std::string name) {
@ -167,9 +191,11 @@ private:
class EnumValue {
public:
EnumValue() : value(0), desc(nullptr) {}
EnumValue(unsigned int the_value, const std::string& the_name, EnumCaps&& the_caps, const std::string& the_version,
EnumValue(unsigned int the_value, const std::string& the_name, EnumCaps&& the_caps,
const std::string& the_firstVersion, const std::string& the_lastVersion,
Extensions&& the_extensions, OperandParameters&& the_operands) :
value(the_value), name(the_name), capabilities(std::move(the_caps)), version(std::move(the_version)),
value(the_value), name(the_name), capabilities(std::move(the_caps)),
firstVersion(std::move(the_firstVersion)), lastVersion(std::move(the_lastVersion)),
extensions(std::move(the_extensions)), operands(std::move(the_operands)), desc(nullptr) { }
// For ValueEnum, the value from the JSON file.
@ -178,7 +204,8 @@ public:
unsigned value;
std::string name;
EnumCaps capabilities;
std::string version;
std::string firstVersion;
std::string lastVersion;
// A feature only be enabled by certain extensions.
// An empty list means the feature does not require an extension.
// Normally, only Capability enums are enabled by extension. In turn,
@ -228,28 +255,39 @@ public:
// per OperandParameters above.
class InstructionValue : public EnumValue {
public:
InstructionValue(EnumValue&& e, bool has_type, bool has_result)
InstructionValue(EnumValue&& e, const std::string& printClass, bool has_type, bool has_result)
: EnumValue(std::move(e)),
printingClass(printClass),
opDesc("TBD"),
opClass(0),
typePresent(has_type),
resultPresent(has_result) {}
resultPresent(has_result),
alias(this) { }
InstructionValue(const InstructionValue& v)
{
*this = v;
alias = this;
}
bool hasResult() const { return resultPresent != 0; }
bool hasType() const { return typePresent != 0; }
void setAlias(const InstructionValue& a) { alias = &a; }
const InstructionValue& getAlias() const { return *alias; }
bool isAlias() const { return alias != this; }
std::string printingClass;
const char* opDesc;
int opClass;
protected:
int typePresent : 1;
int resultPresent : 1;
const InstructionValue* alias; // correct only after discovering the aliases; otherwise points to this
};
using InstructionValues = EnumValuesContainer<InstructionValue>;
// Parameterization info for all instructions.
extern InstructionValues InstructionDesc;
extern PrintingClasses InstructionPrintingClasses;
// These hold definitions of the enumerants used for operands.
// This is indexed by OperandClass, but not including OperandOpcode.

View File

@ -1,4 +1,4 @@
// Copyright (c) 2014-2018 The Khronos Group Inc.
// Copyright (c) 2014-2019 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
@ -50,6 +50,8 @@ void Usage()
" JSON - JSON format data\n"
" Lua - Lua module\n"
" Python - Python module (also accepts Py)\n"
" C# - C# module (also accepts CSharp)\n"
" D - D module\n"
" -H print header in all supported languages to files in current directory\n"
);
}
@ -90,6 +92,10 @@ bool ProcessArguments(int argc, char* argv[])
Language = spv::ELangLua;
} else if (language == "python" || language == "py") {
Language = spv::ELangPython;
} else if (language == "c#" || language == "csharp") {
Language = spv::ELangCSharp;
} else if (language == "d") {
Language = spv::ELangD;
} else
return false;
@ -113,7 +119,7 @@ int main(int argc, char* argv[])
return 1;
}
spv::jsonToSpirv(jsonPath);
spv::jsonToSpirv(jsonPath, (Options & EOptionPrintHeader) != 0);
if (Options & EOptionPrintHeader)
spv::PrintHeader(Language, std::cout);

View File

@ -6,25 +6,39 @@
#pragma once
#include <array>
#include <cstdint>
#include <functional>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <type_traits>
#include <unordered_set>
#include <variant>
#include <vector>
#include <spirv/unified1/spirv.hpp11>
namespace Sirit {
constexpr std::uint32_t GENERATOR_MAGIC_NUMBER = 0;
class Op;
class Declarations;
class Operand;
class Stream;
using Literal =
std::variant<std::uint32_t, std::uint64_t, std::int32_t, std::int64_t, float, double>;
using Id = const Op*;
struct Id {
std::uint32_t value;
};
[[nodiscard]] inline bool ValidId(Id id) noexcept {
return id.value != 0;
}
class Module {
public:
@ -39,6 +53,9 @@ public:
*/
std::vector<std::uint32_t> Assemble() const;
/// Patches deferred phi nodes calling the passed function on each phi argument
void PatchDeferredPhi(const std::function<Id(std::size_t index)>& func);
/// Adds a SPIR-V extension.
void AddExtension(std::string extension_name);
@ -49,24 +66,29 @@ public:
void SetMemoryModel(spv::AddressingModel addressing_model_, spv::MemoryModel memory_model_);
/// Adds an entry point.
void AddEntryPoint(spv::ExecutionModel execution_model, Id entry_point, std::string name,
const std::vector<Id>& interfaces = {});
void AddEntryPoint(spv::ExecutionModel execution_model, Id entry_point, std::string_view name,
std::span<const Id> interfaces = {});
/// Adds an entry point.
// TODO: Change std::is_convertible_v to std::convertible_to when compilers
// support it; same elsewhere.
template <typename... Ts>
void AddEntryPoint(spv::ExecutionModel execution_model, Id entry_point, std::string name,
requires(...&& std::is_convertible_v<Ts, Id>) void AddEntryPoint(
spv::ExecutionModel execution_model, Id entry_point, std::string_view name,
Ts&&... interfaces) {
AddEntryPoint(execution_model, std::move(entry_point), name, {interfaces...});
AddEntryPoint(execution_model, std::move(entry_point), name,
std::span<const Id>({interfaces...}));
}
/// Declare an execution mode for an entry point.
void AddExecutionMode(Id entry_point, spv::ExecutionMode mode,
const std::vector<Literal>& literals = {});
std::span<const Literal> literals = {});
/// Declare an execution mode for an entry point.
template <typename... Ts>
void AddExecutionMode(Id entry_point, spv::ExecutionMode mode, Ts&&... literals) {
AddExecutionMode(entry_point, mode, {literals...});
requires(...&& std::is_convertible_v<Ts, Literal>) void AddExecutionMode(
Id entry_point, spv::ExecutionMode mode, Ts&&... literals) {
AddExecutionMode(entry_point, mode, std::span<const Literal>({literals...}));
}
/**
@ -84,19 +106,13 @@ public:
return AddLabel(OpLabel());
}
/**
* Adds a local variable to the code
* @param variable Variable to insert into code.
* @return Returns variable.
*/
Id AddLocalVariable(Id label);
/// Adds a local variable to the code
Id AddLocalVariable(Id result_type, spv::StorageClass storage_class,
std::optional<Id> initializer = std::nullopt);
/**
* Adds a global variable
* @param variable Global variable to add.
* @return Returns variable.
*/
Id AddGlobalVariable(Id variable);
/// Adds a global variable
Id AddGlobalVariable(Id result_type, spv::StorageClass storage_class,
std::optional<Id> initializer = std::nullopt);
// Types
@ -121,7 +137,7 @@ public:
/// Returns type image.
Id TypeImage(Id sampled_type, spv::Dim dim, int depth, bool arrayed, bool ms, int sampled,
spv::ImageFormat image_format,
std::optional<spv::AccessQualifier> access_qualifier = {});
std::optional<spv::AccessQualifier> access_qualifier = std::nullopt);
/// Returns type sampler.
Id TypeSampler();
@ -136,27 +152,28 @@ public:
Id TypeRuntimeArray(Id element_type);
/// Returns type struct.
Id TypeStruct(const std::vector<Id>& members = {});
Id TypeStruct(std::span<const Id> members = {});
/// Returns type struct.
template <typename... Ts>
Id TypeStruct(Ts&&... members) {
return TypeStruct({members...});
requires(...&& std::is_convertible_v<Ts, Id>) Id TypeStruct(Ts&&... members) {
return TypeStruct(std::span<const Id>({members...}));
}
/// Returns type opaque.
Id TypeOpaque(std::string name);
Id TypeOpaque(std::string_view name);
/// Returns type pointer.
Id TypePointer(spv::StorageClass storage_class, Id type);
/// Returns type function.
Id TypeFunction(Id return_type, const std::vector<Id>& arguments = {});
Id TypeFunction(Id return_type, std::span<const Id> arguments = {});
/// Returns type function.
template <typename... Ts>
Id TypeFunction(Id return_type, Ts&&... arguments) {
return OpTypeFunction(return_type, {arguments...});
requires(...&& std::is_convertible_v<Ts, Id>) Id
TypeFunction(Id return_type, Ts&&... arguments) {
return TypeFunction(return_type, std::span<const Id>({arguments...}));
}
/// Returns type event.
@ -186,12 +203,13 @@ public:
Id Constant(Id result_type, const Literal& literal);
/// Returns a numeric scalar constant.
Id ConstantComposite(Id result_type, const std::vector<Id>& constituents);
Id ConstantComposite(Id result_type, std::span<const Id> constituents);
/// Returns a numeric scalar constant.
template <typename... Ts>
Id ConstantComposite(Id result_type, Ts&&... constituents) {
return ConstantComposite(result_type, {constituents...});
requires(...&& std::is_convertible_v<Ts, Id>) Id
ConstantComposite(Id result_type, Ts&&... constituents) {
return ConstantComposite(result_type, std::span<const Id>({constituents...}));
}
/// Returns a sampler constant.
@ -207,28 +225,50 @@ public:
Id OpFunction(Id result_type, spv::FunctionControlMask function_control, Id function_type);
/// Ends a function.
Id OpFunctionEnd();
void OpFunctionEnd();
/// Call a function.
Id OpFunctionCall(Id result_type, Id function, const std::vector<Id>& arguments = {});
Id OpFunctionCall(Id result_type, Id function, std::span<const Id> arguments = {});
/// Call a function.
template <typename... Ts>
Id OpFunctionCall(Id result_type, Id function, Ts&&... arguments) {
return OpFunctionCall(result_type, function, {arguments...});
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpFunctionCall(Id result_type, Id function, Ts&&... arguments) {
return OpFunctionCall(result_type, function, std::span<const Id>({arguments...}));
}
/// Declare a formal parameter of the current function.
Id OpFunctionParameter(Id result_type);
// Flow
/**
* The SSA phi function.
*
* @param result_type The result type.
* @param operands An immutable span of variable, parent block pairs
*/
Id OpPhi(Id result_type, std::span<const Id> operands);
/**
* The SSA phi function. This instruction will be revisited when patching phi nodes.
*
* @param result_type The result type.
* @param blocks An immutable span of block pairs.
*/
Id DeferredOpPhi(Id result_type, std::span<const Id> blocks);
/// Declare a structured loop.
Id OpLoopMerge(Id merge_block, Id continue_target, spv::LoopControlMask loop_control,
const std::vector<Id>& literals = {});
std::span<const Id> literals = {});
/// Declare a structured loop.
template <typename... Ts>
Id OpLoopMerge(Id merge_block, Id continue_target, spv::LoopControlMask loop_control,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpLoopMerge(Id merge_block, Id continue_target, spv::LoopControlMask loop_control,
Ts&&... literals) {
return OpLoopMerge(merge_block, continue_target, loop_control, {literals...});
return OpLoopMerge(merge_block, continue_target, loop_control,
std::span<const Id>({literals...}));
}
/// Declare a structured selection.
@ -238,8 +278,8 @@ public:
Id OpLabel();
/// The block label instruction: Any reference to a block is through this ref.
Id OpLabel(std::string label_name) {
return Name(OpLabel(), std::move(label_name));
Id OpLabel(std::string_view label_name) {
return Name(OpLabel(), label_name);
}
/// Unconditional jump to label.
@ -251,55 +291,62 @@ public:
std::uint32_t true_weight = 0, std::uint32_t false_weight = 0);
/// Multi-way branch to one of the operand label.
Id OpSwitch(Id selector, Id default_label, const std::vector<Literal>& literals,
const std::vector<Id>& labels);
Id OpSwitch(Id selector, Id default_label, std::span<const Literal> literals,
std::span<const Id> labels);
/// Returns with no value from a function with void return type.
Id OpReturn();
void OpReturn();
/// Behavior is undefined if this instruction is executed.
void OpUnreachable();
/// Return a value from a function.
Id OpReturnValue(Id value);
/// Fragment-shader discard.
Id OpKill();
void OpKill();
/// Demote fragment shader invocation to a helper invocation
void OpDemoteToHelperInvocationEXT();
// Debug
/// Assign a name string to a reference.
/// @return target
Id Name(Id target, std::string name);
Id Name(Id target, std::string_view name);
/// Assign a name string to a member of a structure type.
/// @return type
Id MemberName(Id type, std::uint32_t member, std::string name);
Id MemberName(Id type, std::uint32_t member, std::string_view name);
/// Assign a Result <id> to a string for use by other debug instructions.
Id String(std::string string);
Id String(std::string_view string);
/// Add source-level location information
Id OpLine(Id file, Literal line, Literal column);
// Memory
/// Allocate an object in memory, resulting in a copy to it.
Id OpVariable(Id result_type, spv::StorageClass storage_class, Id initializer = nullptr);
/// Form a pointer to a texel of an image. Use of such a pointer is limited to atomic operations.
/// Form a pointer to a texel of an image. Use of such a pointer is limited to atomic
/// operations.
Id OpImageTexelPointer(Id result_type, Id image, Id coordinate, Id sample);
/// Load through a pointer.
Id OpLoad(Id result_type, Id pointer, std::optional<spv::MemoryAccessMask> memory_access = {});
Id OpLoad(Id result_type, Id pointer,
std::optional<spv::MemoryAccessMask> memory_access = std::nullopt);
/// Store through a pointer.
Id OpStore(Id pointer, Id object, std::optional<spv::MemoryAccessMask> memory_access = {});
Id OpStore(Id pointer, Id object,
std::optional<spv::MemoryAccessMask> memory_access = std::nullopt);
/// Create a pointer into a composite object that can be used with OpLoad and OpStore.
Id OpAccessChain(Id result_type, Id base, const std::vector<Id>& indexes = {});
Id OpAccessChain(Id result_type, Id base, std::span<const Id> indexes = {});
/// Create a pointer into a composite object that can be used with OpLoad and OpStore.
template <typename... Ts>
Id OpAccessChain(Id result_type, Id base, Ts&&... indexes) {
return OpAccessChain(result_type, base, {indexes...});
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpAccessChain(Id result_type, Id base, Ts&&... indexes) {
return OpAccessChain(result_type, base, std::span<const Id>({indexes...}));
}
/// Extract a single, dynamically selected, component of a vector.
@ -310,50 +357,67 @@ public:
/// Make a copy of a composite object, while modifying one part of it.
Id OpCompositeInsert(Id result_type, Id object, Id composite,
const std::vector<Literal>& indexes = {});
std::span<const Literal> indexes = {});
/// Make a copy of a composite object, while modifying one part of it.
template <typename... Ts>
Id OpCompositeInsert(Id result_type, Id object, Id composite, Ts&&... indexes) {
return OpCompositeInsert(result_type, object, composite, {indexes...});
requires(...&& std::is_convertible_v<Ts, Literal>) Id
OpCompositeInsert(Id result_type, Id object, Id composite, Ts&&... indexes) {
const Literal stack_indexes[] = {std::forward<Ts>(indexes)...};
return OpCompositeInsert(result_type, object, composite,
std::span<const Literal>{stack_indexes});
}
/// Extract a part of a composite object.
Id OpCompositeExtract(Id result_type, Id composite, const std::vector<Literal>& indexes = {});
Id OpCompositeExtract(Id result_type, Id composite, std::span<const Literal> indexes = {});
/// Extract a part of a composite object.
template <typename... Ts>
Id OpCompositeExtract(Id result_type, Id composite, Ts&&... indexes) {
return OpCompositeExtract(result_type, composite, {indexes...});
requires(...&& std::is_convertible_v<Ts, Literal>) Id
OpCompositeExtract(Id result_type, Id composite, Ts&&... indexes) {
const Literal stack_indexes[] = {std::forward<Ts>(indexes)...};
return OpCompositeExtract(result_type, composite, std::span<const Literal>{stack_indexes});
}
/// Construct a new composite object from a set of constituent objects that will fully form it.
Id OpCompositeConstruct(Id result_type, const std::vector<Id>& ids);
Id OpCompositeConstruct(Id result_type, std::span<const Id> ids);
/// Construct a new composite object from a set of constituent objects that will fully form it.
template <typename... Ts>
Id OpCompositeConstruct(Id result_type, Ts&&... ids) {
return OpCompositeConstruct(result_type, {ids...});
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpCompositeConstruct(Id result_type, Ts&&... ids) {
return OpCompositeConstruct(result_type, std::span<const Id>({ids...}));
}
// Annotation
/// Add a decoration to target.
Id Decorate(Id target, spv::Decoration decoration, const std::vector<Literal>& literals = {});
Id Decorate(Id target, spv::Decoration decoration, std::span<const Literal> literals = {});
/// Add a decoration to target.
template <typename... Ts>
Id Decorate(Id target, spv::Decoration decoration, Ts&&... literals) {
return Decorate(target, decoration, {literals...});
requires(...&& std::is_convertible_v<Ts, Literal>) Id
Decorate(Id target, spv::Decoration decoration, Ts&&... literals) {
const Literal stack_literals[] = {std::forward<Ts>(literals)...};
return Decorate(target, decoration, std::span<const Literal>{stack_literals});
}
/// Add a decoration to target.
template <typename T>
requires std::is_enum_v<T> Id Decorate(Id target, spv::Decoration decoration, T literal) {
return Decorate(target, decoration, static_cast<std::uint32_t>(literal));
}
Id MemberDecorate(Id structure_type, Literal member, spv::Decoration decoration,
const std::vector<Literal>& literals = {});
std::span<const Literal> literals = {});
template <typename... Ts>
Id MemberDecorate(Id structure_type, Literal member, spv::Decoration decoration,
requires(...&& std::is_convertible_v<Ts, Literal>) Id
MemberDecorate(Id structure_type, Literal member, spv::Decoration decoration,
Ts&&... literals) {
return MemberDecorate(structure_type, member, decoration, {literals...});
const Literal stack_literals[] = {std::forward<Ts>(literals)...};
return MemberDecorate(structure_type, member, decoration,
std::span<const Literal>{stack_literals});
}
// Misc
@ -362,10 +426,17 @@ public:
Id OpUndef(Id result_type);
/// Emits the current values of all output variables to the current output primitive.
Id OpEmitVertex();
void OpEmitVertex();
/// Finish the current primitive and start a new one. No vertex is emitted.
Id OpEndPrimitive();
void OpEndPrimitive();
/// Emits the current values of all output variables to the current output primitive. After
/// execution, the values of all output variables are undefined.
void OpEmitStreamVertex(Id stream);
/// Finish the current primitive and start a new one. No vertex is emitted.
void OpEndStreamPrimitive(Id stream);
// Barrier
@ -569,7 +640,7 @@ public:
/// Integer substraction of Operand 1 and Operand 2.
Id OpISub(Id result_type, Id operand_1, Id operand_2);
/// Floating-point substraction of Operand 1 and Operand 2.
/// Floating-point subtraction of Operand 1 and Operand 2.
Id OpFSub(Id result_type, Id operand_1, Id operand_2);
/// Integer multiplication of Operand 1 and Operand 2.
@ -608,13 +679,13 @@ public:
// Extensions
/// Execute an instruction in an imported set of extended instructions.
Id OpExtInst(Id result_type, Id set, std::uint32_t instruction,
const std::vector<Id>& operands);
Id OpExtInst(Id result_type, Id set, std::uint32_t instruction, std::span<const Id> operands);
/// Execute an instruction in an imported set of extended instructions.
template <typename... Ts>
Id OpExtInst(Id result_type, Id set, std::uint32_t instruction, Ts&&... operands) {
return OpExtInst(result_type, set, instruction, {operands...});
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpExtInst(Id result_type, Id set, std::uint32_t instruction, Ts&&... operands) {
return OpExtInst(result_type, set, instruction, std::span<const Id>({operands...}));
}
/// Result is x if x >= 0; otherwise result is -x.
@ -756,6 +827,52 @@ public:
/// of the pixel specified by offset.
Id OpInterpolateAtOffset(Id result_type, Id interpolant, Id offset);
// Derivatives
/// Same result as either OpDPdxFine or OpDPdxCoarse on the input.
/// Selection of which one is based on external factors.
Id OpDPdx(Id result_type, Id operand);
/// Same result as either OpDPdyFine or OpDPdyCoarse on the input.
/// Selection of which one is based on external factors.
Id OpDPdy(Id result_type, Id operand);
/// Result is the same as computing the sum of the absolute values of OpDPdx and OpDPdy
/// on the input.
Id OpFwidth(Id result_type, Id operand);
/// Result is the partial derivative of the input with respect to the window x coordinate.
/// Uses local differencing based on the value of the input for the current fragment and
/// its immediate neighbor(s).
Id OpDPdxFine(Id result_type, Id operand);
/// Result is the partial derivative of the input with respect to the window y coordinate.
/// Uses local differencing based on the value of the input for the current fragment and
/// its immediate neighbor(s).
Id OpDPdyFine(Id result_type, Id operand);
/// Result is the same as computing the sum of the absolute values of OpDPdxFine and OpDPdyFine
/// on the input.
Id OpFwidthFine(Id result_type, Id operand);
/// Result is the partial derivative of the input with respect to the window x coordinate.
/// Uses local differencing based on the value of the input for the current fragment's
/// neighbors, and possibly, but not necessarily, includes the value of the input for the
/// current fragment. That is, over a given area, the implementation can compute x derivatives
/// in fewer unique locations than would be allowed for OpDPdxFine.
Id OpDPdxCoarse(Id result_type, Id operand);
/// Result is the partial derivative of the input with respect to the window y coordinate.
/// Uses local differencing based on the value of the input for the current fragment's
/// neighbors, and possibly, but not necessarily, includes the value of the input for the
/// current fragment. That is, over a given area, the implementation can compute y derivatives
/// in fewer unique locations than would be allowed for OpDPdyFine.
Id OpDPdyCoarse(Id result_type, Id operand);
/// Result is the same as computing the sum of the absolute values of OpDPdxCoarse and
/// OpDPdyCoarse on the input.
Id OpFwidthCoarse(Id result_type, Id operand);
// Image
/// Create a sampled image, containing both a sampler and an image.
@ -763,172 +880,191 @@ public:
/// Sample an image with an implicit level of detail.
Id OpImageSampleImplicitLod(Id result_type, Id sampled_image, Id coordinate,
std::optional<spv::ImageOperandsMask> image_operands = {},
const std::vector<Id>& operands = {});
std::optional<spv::ImageOperandsMask> image_operands = std::nullopt,
std::span<const Id> operands = {});
/// Sample an image with an implicit level of detail.
template <typename... Ts>
Id OpImageSampleImplicitLod(Id result_type, Id sampled_image, Id coordinate,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageSampleImplicitLod(Id result_type, Id sampled_image, Id coordinate,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageSampleImplicitLod(result_type, sampled_image, coordinate, image_operands,
{operands...});
std::span<const Id>({operands...}));
}
/// Sample an image using an explicit level of detail.
Id OpImageSampleExplicitLod(Id result_type, Id sampled_image, Id coordinate,
spv::ImageOperandsMask image_operands,
const std::vector<Id>& operands = {});
std::span<const Id> operands = {});
/// Sample an image using an explicit level of detail.
template <typename... Ts>
Id OpImageSampleExplicitLod(Id result_type, Id sampled_image, Id coordinate,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageSampleExplicitLod(Id result_type, Id sampled_image, Id coordinate,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageSampleExplicitLod(result_type, sampled_image, coordinate, image_operands,
{operands...});
std::span<const Id>({operands...}));
}
/// Sample an image doing depth-comparison with an implicit level of detail.
Id OpImageSampleDrefImplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
std::optional<spv::ImageOperandsMask> image_operands = {},
const std::vector<Id>& operands = {});
Id OpImageSampleDrefImplicitLod(
Id result_type, Id sampled_image, Id coordinate, Id dref,
std::optional<spv::ImageOperandsMask> image_operands = std::nullopt,
std::span<const Id> operands = {});
/// Sample an image doing depth-comparison with an implicit level of detail.
template <typename... Ts>
Id OpImageSampleDrefImplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageSampleDrefImplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageSampleDrefImplicitLod(result_type, sampled_image, coordinate, dref,
image_operands, {operands...});
image_operands, std::span<const Id>({operands...}));
}
/// Sample an image doing depth-comparison using an explicit level of detail.
Id OpImageSampleDrefExplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
spv::ImageOperandsMask image_operands,
const std::vector<Id>& operands = {});
std::span<const Id> operands = {});
/// Sample an image doing depth-comparison using an explicit level of detail.
template <typename... Ts>
Id OpImageSampleDrefExplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageSampleDrefExplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageSampleDrefExplicitLod(result_type, sampled_image, coordinate, dref,
image_operands, {operands...});
image_operands, std::span<const Id>({operands...}));
}
/// Sample an image with with a project coordinate and an implicit level of detail.
Id OpImageSampleProjImplicitLod(Id result_type, Id sampled_image, Id coordinate,
std::optional<spv::ImageOperandsMask> image_operands = {},
const std::vector<Id>& operands = {});
Id OpImageSampleProjImplicitLod(
Id result_type, Id sampled_image, Id coordinate,
std::optional<spv::ImageOperandsMask> image_operands = std::nullopt,
std::span<const Id> operands = {});
/// Sample an image with with a project coordinate and an implicit level of detail.
template <typename... Ts>
Id OpImageSampleProjImplicitLod(Id result_type, Id sampled_image, Id coordinate,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageSampleProjImplicitLod(Id result_type, Id sampled_image, Id coordinate,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageSampleProjImplicitLod(result_type, sampled_image, coordinate, image_operands,
{operands...});
std::span<const Id>({operands...}));
}
/// Sample an image with a project coordinate using an explicit level of detail.
Id OpImageSampleProjExplicitLod(Id result_type, Id sampled_image, Id coordinate,
spv::ImageOperandsMask image_operands,
const std::vector<Id>& operands = {});
std::span<const Id> operands = {});
/// Sample an image with a project coordinate using an explicit level of detail.
template <typename... Ts>
Id OpImageSampleProjExplicitLod(Id result_type, Id sampled_image, Id coordinate,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageSampleProjExplicitLod(Id result_type, Id sampled_image, Id coordinate,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageSampleProjExplicitLod(result_type, sampled_image, coordinate, image_operands,
{operands...});
std::span<const Id>({operands...}));
}
/// Sample an image with a project coordinate, doing depth-comparison, with an implicit level of
/// detail.
Id OpImageSampleProjDrefImplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
std::optional<spv::ImageOperandsMask> image_operands = {},
const std::vector<Id>& operands = {});
Id OpImageSampleProjDrefImplicitLod(
Id result_type, Id sampled_image, Id coordinate, Id dref,
std::optional<spv::ImageOperandsMask> image_operands = std::nullopt,
std::span<const Id> operands = {});
/// Sample an image with a project coordinate, doing depth-comparison, with an implicit level of
/// detail.
template <typename... Ts>
Id OpImageSampleProjDrefImplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageSampleProjDrefImplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageSampleProjDrefImplicitLod(result_type, sampled_image, coordinate, dref,
image_operands, {operands...});
image_operands, std::span<const Id>({operands...}));
}
/// Sample an image with a project coordinate, doing depth-comparison, using an explicit level
/// of detail.
Id OpImageSampleProjDrefExplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
spv::ImageOperandsMask image_operands,
const std::vector<Id>& operands = {});
std::span<const Id> operands = {});
/// Sample an image with a project coordinate, doing depth-comparison, using an explicit level
/// of detail.
template <typename... Ts>
Id OpImageSampleProjDrefExplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageSampleProjDrefExplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageSampleProjDrefExplicitLod(result_type, sampled_image, coordinate, dref,
image_operands, {operands...});
image_operands, std::span<const Id>({operands...}));
}
/// Fetch a single texel from an image whose Sampled operand is 1.
Id OpImageFetch(Id result_type, Id sampled_image, Id coordinate,
std::optional<spv::ImageOperandsMask> image_operands = {},
const std::vector<Id>& operands = {});
std::optional<spv::ImageOperandsMask> image_operands = std::nullopt,
std::span<const Id> operands = {});
/// Fetch a single texel from an image whose Sampled operand is 1.
template <typename... Ts>
Id OpImageFetch(Id result_type, Id sampled_image, Id coordinate,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageFetch(Id result_type, Id sampled_image, Id coordinate,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageFetch(result_type, sampled_image, coordinate, image_operands, {operands...});
return OpImageFetch(result_type, sampled_image, coordinate, image_operands,
std::span<const Id>({operands...}));
}
/// Gathers the requested component from four texels.
Id OpImageGather(Id result_type, Id sampled_image, Id coordinate, Id component,
std::optional<spv::ImageOperandsMask> image_operands = {},
const std::vector<Id>& operands = {});
std::optional<spv::ImageOperandsMask> image_operands = std::nullopt,
std::span<const Id> operands = {});
/// Gathers the requested component from four texels.
template <typename... Ts>
Id OpImageGather(Id result_type, Id sampled_image, Id coordinate, Id component,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageGather(Id result_type, Id sampled_image, Id coordinate, Id component,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageGather(result_type, sampled_image, coordinate, component, image_operands,
{operands...});
std::span<const Id>({operands...}));
}
/// Gathers the requested depth-comparison from four texels.
Id OpImageDrefGather(Id result_type, Id sampled_image, Id coordinate, Id dref,
std::optional<spv::ImageOperandsMask> image_operands = {},
const std::vector<Id>& operands = {});
std::optional<spv::ImageOperandsMask> image_operands = std::nullopt,
std::span<const Id> operands = {});
/// Gathers the requested depth-comparison from four texels.
template <typename... Ts>
Id OpImageDrefGather(Id result_type, Id sampled_image, Id coordinate, Id dref,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageDrefGather(Id result_type, Id sampled_image, Id coordinate, Id dref,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageDrefGather(result_type, sampled_image, coordinate, dref, image_operands,
{operands...});
std::span<const Id>({operands...}));
}
/// Read a texel from an image without a sampler.
Id OpImageRead(Id result_type, Id sampled_image, Id coordinate,
std::optional<spv::ImageOperandsMask> image_operands = {},
const std::vector<Id>& operands = {});
std::optional<spv::ImageOperandsMask> image_operands = std::nullopt,
std::span<const Id> operands = {});
/// Read a texel from an image without a sampler.
template <typename... Ts>
Id OpImageRead(Id result_type, Id sampled_image, Id coordinate,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageRead(Id result_type, Id sampled_image, Id coordinate,
spv::ImageOperandsMask image_operands, Ts&&... operands) {
return OpImageRead(result_type, sampled_image, coordinate, image_operands, {operands...});
return OpImageRead(result_type, sampled_image, coordinate, image_operands,
std::span<const Id>({operands...}));
}
/// Write a texel to an image without a sampler.
Id OpImageWrite(Id image, Id coordinate, Id texel,
std::optional<spv::ImageOperandsMask> image_operands = {},
const std::vector<Id>& operands = {});
std::optional<spv::ImageOperandsMask> image_operands = std::nullopt,
std::span<const Id> operands = {});
/// Write a texel to an image without a sampler.
template <typename... Ts>
Id OpImageWrite(Id image, Id coordinate, Id texel, spv::ImageOperandsMask image_operands,
requires(...&& std::is_convertible_v<Ts, Id>) Id
OpImageWrite(Id image, Id coordinate, Id texel, spv::ImageOperandsMask image_operands,
Ts&&... operands) {
return OpImageWrite(image, coordinate, texel, image_operands, {operands...});
return OpImageWrite(image, coordinate, texel, image_operands,
std::span<const Id>({operands...}));
}
/// Extract the image from a sampled image.
@ -950,6 +1086,50 @@ public:
/// Query the number of samples available per texel fetch in a multisample image.
Id OpImageQuerySamples(Id result_type, Id image);
/// Sample a sparse image with an implicit level of detail.
Id OpImageSparseSampleImplicitLod(Id result_type, Id sampled_image, Id coordinate,
std::optional<spv::ImageOperandsMask> image_operands,
std::span<const Id> operands);
/// Sample a sparse image using an explicit level of detail.
Id OpImageSparseSampleExplicitLod(Id result_type, Id sampled_image, Id coordinate,
spv::ImageOperandsMask image_operands,
std::span<const Id> operands);
/// Sample a sparse image doing depth-comparison with an implicit level of detail.
Id OpImageSparseSampleDrefImplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
std::optional<spv::ImageOperandsMask> image_operands,
std::span<const Id> operands);
/// Sample a sparse image doing depth-comparison using an explicit level of detail.
Id OpImageSparseSampleDrefExplicitLod(Id result_type, Id sampled_image, Id coordinate, Id dref,
spv::ImageOperandsMask image_operands,
std::span<const Id> operands);
/// Fetch a single texel from a sampled sparse image.
Id OpImageSparseFetch(Id result_type, Id image, Id coordinate,
std::optional<spv::ImageOperandsMask> image_operands,
std::span<const Id> operands);
/// Gathers the requested component from four texels of a sparse image.
Id OpImageSparseGather(Id result_type, Id sampled_image, Id coordinate, Id component,
std::optional<spv::ImageOperandsMask> image_operands,
std::span<const Id> operands);
/// Gathers the requested depth-comparison from four texels of a sparse image.
Id OpImageSparseDrefGather(Id result_type, Id sampled_image, Id coordinate, Id dref,
std::optional<spv::ImageOperandsMask> image_operands,
std::span<const Id> operands);
/// Translates a Resident Code into a Boolean. Result is false if any of the texels were in
/// uncommitted texture memory, and true otherwise.
Id OpImageSparseTexelsResident(Id result_type, Id resident_code);
/// Read a texel from a sparse image without a sampler.
Id OpImageSparseRead(Id result_type, Id image, Id coordinate,
std::optional<spv::ImageOperandsMask> image_operands,
std::span<const Id> operands);
// Group
/// Computes a bitfield value combining the Predicate value from all invocations in the current
@ -972,7 +1152,29 @@ public:
/// Return the value of the invocation identified by the current invocation's id within the
/// group xor'ed with mask.
Id OpGroupNonUniformShuffleXor(Id result_type, spv::Scope scope, Id value, Id mask);
Id OpGroupNonUniformShuffleXor(Id result_type, Id scope, Id value, Id mask);
/// Evaluates a predicate for all active invocations in the group, resulting in
/// true if predicate evaluates to true for all active invocations in the
/// group, otherwise the result is false.
Id OpGroupNonUniformAll(Id result_type, Id scope, Id predicate);
/// Evaluates a predicate for all active invocations in the group,
/// resulting in true if predicate evaluates to true for any active
/// invocation in the group, otherwise the result is false.
Id OpGroupNonUniformAny(Id result_type, Id scope, Id predicate);
/// Evaluates a value for all active invocations in the group. The result
/// is true if Value is equal for all active invocations in the group.
/// Otherwise, the result is false.
Id OpGroupNonUniformAllEqual(Id result_type, Id scope, Id value);
/// Result is a bitfield value combining the Predicate value from all
/// invocations in the group that execute the same dynamic instance of this
/// instruction. The bit is set to one if the corresponding invocation is
/// active and the Predicate for that invocation evaluated to true;
/// otherwise, it is set to zero.
Id OpGroupNonUniformBallot(Id result_type, Id scope, Id predicate);
// Atomic
@ -1077,38 +1279,27 @@ public:
Id OpAtomicXor(Id result_type, Id pointer, Id memory, Id semantics, Id value);
private:
Id AddCode(std::unique_ptr<Op> op);
Id AddCode(spv::Op opcode, std::optional<std::uint32_t> id = {});
Id AddDeclaration(std::unique_ptr<Op> op);
void AddAnnotation(std::unique_ptr<Op> op);
Id GetGLSLstd450();
std::uint32_t version{};
std::uint32_t bound{1};
std::uint32_t bound{};
std::unordered_set<std::string> extensions;
std::unordered_set<spv::Capability> capabilities;
std::unordered_set<std::unique_ptr<Op>> ext_inst_import;
std::unique_ptr<Op> glsl_std_450;
std::optional<Id> glsl_std_450;
spv::AddressingModel addressing_model{spv::AddressingModel::Logical};
spv::MemoryModel memory_model{spv::MemoryModel::GLSL450};
std::vector<std::unique_ptr<Op>> entry_points;
std::vector<std::unique_ptr<Op>> execution_modes;
std::vector<std::unique_ptr<Op>> debug;
std::vector<std::unique_ptr<Op>> annotations;
std::vector<std::unique_ptr<Op>> declarations;
std::vector<Id> global_variables;
std::vector<Id> code;
std::vector<std::unique_ptr<Op>> code_store;
std::unique_ptr<Stream> ext_inst_imports;
std::unique_ptr<Stream> entry_points;
std::unique_ptr<Stream> execution_modes;
std::unique_ptr<Stream> debug;
std::unique_ptr<Stream> annotations;
std::unique_ptr<Declarations> declarations;
std::unique_ptr<Stream> global_variables;
std::unique_ptr<Stream> code;
std::vector<std::uint32_t> deferred_phi_nodes;
};
} // namespace Sirit

View File

@ -1,22 +1,14 @@
add_library(sirit
../include/sirit/sirit.h
sirit.cpp
op.cpp
op.h
stream.cpp
stream.h
operand.cpp
operand.h
literal_number.cpp
literal_number.h
literal_string.cpp
literal_string.h
common_types.h
instructions/type.cpp
instructions/constant.cpp
instructions/function.cpp
instructions/flow.cpp
instructions/debug.cpp
instructions/derivatives.cpp
instructions/memory.cpp
instructions/annotation.cpp
instructions/misc.cpp

View File

@ -4,32 +4,24 @@
* 3-Clause BSD License
*/
#include <memory>
#include <vector>
#include "common_types.h"
#include "op.h"
#include <span>
#include "sirit/sirit.h"
#include "stream.h"
namespace Sirit {
Id Module::Decorate(Id target, spv::Decoration decoration, const std::vector<Literal>& literals) {
auto op{std::make_unique<Op>(spv::Op::OpDecorate)};
op->Add(target);
op->Add(static_cast<u32>(decoration));
op->Add(literals);
AddAnnotation(std::move(op));
return target;
Id Module::Decorate(Id target, spv::Decoration decoration, std::span<const Literal> literals) {
annotations->Reserve(3 + literals.size());
return *annotations << spv::Op::OpDecorate << target << decoration << literals << EndOp{};
}
Id Module::MemberDecorate(Id structure_type, Literal member, spv::Decoration decoration,
const std::vector<Literal>& literals) {
auto op{std::make_unique<Op>(spv::Op::OpMemberDecorate)};
op->Add(structure_type);
op->Add(member);
op->Add(static_cast<u32>(decoration));
op->Add(literals);
AddAnnotation(std::move(op));
return structure_type;
std::span<const Literal> literals) {
annotations->Reserve(4 + literals.size());
return *annotations << spv::Op::OpMemberDecorate << structure_type << member << decoration
<< literals << EndOp{};
}
} // namespace Sirit

View File

@ -4,35 +4,22 @@
* 3-Clause BSD License
*/
#include <memory>
#include "common_types.h"
#include "op.h"
#include "sirit/sirit.h"
#include "stream.h"
namespace Sirit {
#define DEFINE_UNARY(funcname, opcode) \
Id Module::funcname(Id result_type, Id operand) { \
auto op{std::make_unique<Op>(opcode, bound++, result_type)}; \
op->Add(operand); \
return AddCode(std::move(op)); \
code->Reserve(4); \
return *code << OpId{opcode, result_type} << operand << EndOp{}; \
}
#define DEFINE_BINARY(funcname, opcode) \
Id Module::funcname(Id result_type, Id operand_1, Id operand_2) { \
auto op{std::make_unique<Op>(opcode, bound++, result_type)}; \
op->Add(operand_1); \
op->Add(operand_2); \
return AddCode(std::move(op)); \
}
#define DEFINE_TRINARY(funcname, opcode) \
Id Module::funcname(Id result_type, Id operand_1, Id operand_2, Id operand_3) { \
auto op{std::make_unique<Op>(opcode, bound++, result_type)}; \
op->Add(operand_1); \
op->Add(operand_2); \
op->Add(operand_3); \
return AddCode(std::move(op)); \
code->Reserve(5); \
return *code << OpId{opcode, result_type} << operand_1 << operand_2 << EndOp{}; \
}
DEFINE_UNARY(OpSNegate, spv::Op::OpSNegate)

View File

@ -4,145 +4,101 @@
* 3-Clause BSD License
*/
#include "common_types.h"
#include "op.h"
#include "sirit/sirit.h"
#include "stream.h"
namespace Sirit {
Id Module::OpAtomicLoad(Id result_type, Id pointer, Id memory, Id semantics) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicLoad, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
return AddCode(std::move(op));
code->Reserve(6);
return *code << OpId{spv::Op::OpAtomicLoad, result_type} << pointer << memory << semantics
<< EndOp{};
}
Id Module::OpAtomicStore(Id pointer, Id memory, Id semantics, Id value) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicStore)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
op->Add(value);
return AddCode(std::move(op));
code->Reserve(5);
return *code << OpId{spv::Op::OpAtomicStore} << pointer << memory << semantics << value
<< EndOp{};
}
Id Module::OpAtomicExchange(Id result_type, Id pointer, Id memory, Id semantics, Id value) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicExchange, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
op->Add(value);
return AddCode(std::move(op));
code->Reserve(7);
return *code << OpId{spv::Op::OpAtomicExchange, result_type} << pointer << memory << semantics
<< value << EndOp{};
}
Id Module::OpAtomicCompareExchange(Id result_type, Id pointer, Id memory, Id equal, Id unequal,
Id value, Id comparator) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicCompareExchange, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(equal);
op->Add(unequal);
op->Add(value);
op->Add(comparator);
return AddCode(std::move(op));
code->Reserve(9);
return *code << OpId{spv::Op::OpAtomicCompareExchange, result_type} << pointer << memory
<< equal << unequal << value << comparator << EndOp{};
}
Id Module::OpAtomicIIncrement(Id result_type, Id pointer, Id memory, Id semantics) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicIIncrement, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
return AddCode(std::move(op));
code->Reserve(6);
return *code << OpId{spv::Op::OpAtomicIIncrement, result_type} << pointer << memory << semantics
<< EndOp{};
}
Id Module::OpAtomicIDecrement(Id result_type, Id pointer, Id memory, Id semantics) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicIDecrement, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
return AddCode(std::move(op));
code->Reserve(6);
return *code << OpId{spv::Op::OpAtomicIDecrement, result_type} << pointer << memory << semantics
<< EndOp{};
}
Id Module::OpAtomicIAdd(Id result_type, Id pointer, Id memory, Id semantics, Id value) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicIAdd, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
op->Add(value);
return AddCode(std::move(op));
code->Reserve(7);
return *code << OpId{spv::Op::OpAtomicIAdd, result_type} << pointer << memory << semantics
<< value << EndOp{};
}
Id Module::OpAtomicISub(Id result_type, Id pointer, Id memory, Id semantics, Id value) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicISub, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
op->Add(value);
return AddCode(std::move(op));
code->Reserve(7);
return *code << OpId{spv::Op::OpAtomicISub, result_type} << pointer << memory << semantics
<< value << EndOp{};
}
Id Module::OpAtomicSMin(Id result_type, Id pointer, Id memory, Id semantics, Id value) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicSMin, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
op->Add(value);
return AddCode(std::move(op));
code->Reserve(7);
return *code << OpId{spv::Op::OpAtomicSMin, result_type} << pointer << memory << semantics
<< value << EndOp{};
}
Id Module::OpAtomicUMin(Id result_type, Id pointer, Id memory, Id semantics, Id value) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicUMin, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
op->Add(value);
return AddCode(std::move(op));
code->Reserve(7);
return *code << OpId{spv::Op::OpAtomicUMin, result_type} << pointer << memory << semantics
<< value << EndOp{};
}
Id Module::OpAtomicSMax(Id result_type, Id pointer, Id memory, Id semantics, Id value) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicSMax, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
op->Add(value);
return AddCode(std::move(op));
code->Reserve(7);
return *code << OpId{spv::Op::OpAtomicSMax, result_type} << pointer << memory << semantics
<< value << EndOp{};
}
Id Module::OpAtomicUMax(Id result_type, Id pointer, Id memory, Id semantics, Id value) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicUMax, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
op->Add(value);
return AddCode(std::move(op));
code->Reserve(7);
return *code << OpId{spv::Op::OpAtomicUMax, result_type} << pointer << memory << semantics
<< value << EndOp{};
}
Id Module::OpAtomicAnd(Id result_type, Id pointer, Id memory, Id semantics, Id value) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicAnd, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
op->Add(value);
return AddCode(std::move(op));
code->Reserve(7);
return *code << OpId{spv::Op::OpAtomicAnd, result_type} << pointer << memory << semantics
<< value << EndOp{};
}
Id Module::OpAtomicOr(Id result_type, Id pointer, Id memory, Id semantics, Id value) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicOr, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
op->Add(value);
return AddCode(std::move(op));
code->Reserve(7);
return *code << OpId{spv::Op::OpAtomicOr, result_type} << pointer << memory << semantics
<< value << EndOp{};
}
Id Module::OpAtomicXor(Id result_type, Id pointer, Id memory, Id semantics, Id value) {
auto op{std::make_unique<Op>(spv::Op::OpAtomicXor, bound++, result_type)};
op->Add(pointer);
op->Add(memory);
op->Add(semantics);
op->Add(value);
return AddCode(std::move(op));
code->Reserve(7);
return *code << OpId{spv::Op::OpAtomicXor, result_type} << pointer << memory << semantics
<< value << EndOp{};
}
} // namespace Sirit

View File

@ -4,25 +4,20 @@
* 3-Clause BSD License
*/
#include <memory>
#include "op.h"
#include "sirit/sirit.h"
#include "stream.h"
namespace Sirit {
Id Module::OpControlBarrier(Id execution, Id memory, Id semantics) {
auto op = std::make_unique<Op>(spv::Op::OpControlBarrier);
op->Add(execution);
op->Add(memory);
op->Add(semantics);
return AddCode(std::move(op));
code->Reserve(4);
return *code << spv::Op::OpControlBarrier << execution << memory << semantics << EndOp{};
}
Id Module::OpMemoryBarrier(Id scope, Id semantics) {
auto op = std::make_unique<Op>(spv::Op::OpMemoryBarrier);
op->Add(scope);
op->Add(semantics);
return AddCode(std::move(op));
code->Reserve(3);
return *code << spv::Op::OpMemoryBarrier << scope << semantics << EndOp{};
}
} // namespace Sirit

View File

@ -4,96 +4,73 @@
* 3-Clause BSD License
*/
#include <memory>
#include "common_types.h"
#include "op.h"
#include "sirit/sirit.h"
#include "stream.h"
namespace Sirit {
Id Module::OpShiftRightLogical(Id result_type, Id base, Id shift) {
auto op{std::make_unique<Op>(spv::Op::OpShiftRightLogical, bound++, result_type)};
op->Add(base);
op->Add(shift);
return AddCode(std::move(op));
code->Reserve(5);
return *code << OpId{spv::Op::OpShiftRightLogical, result_type} << base << shift << EndOp{};
}
Id Module::OpShiftRightArithmetic(Id result_type, Id base, Id shift) {
auto op{std::make_unique<Op>(spv::Op::OpShiftRightArithmetic, bound++, result_type)};
op->Add(base);
op->Add(shift);
return AddCode(std::move(op));
code->Reserve(5);
return *code << OpId{spv::Op::OpShiftRightArithmetic, result_type} << base << shift << EndOp{};
}
Id Module::OpShiftLeftLogical(Id result_type, Id base, Id shift) {
auto op{std::make_unique<Op>(spv::Op::OpShiftLeftLogical, bound++, result_type)};
op->Add(base);
op->Add(shift);
return AddCode(std::move(op));
code->Reserve(5);
return *code << OpId{spv::Op::OpShiftLeftLogical, result_type} << base << shift << EndOp{};
}
Id Module::OpBitwiseOr(Id result_type, Id operand_1, Id operand_2) {
auto op{std::make_unique<Op>(spv::Op::OpBitwiseOr, bound++, result_type)};
op->Add(operand_1);
op->Add(operand_2);
return AddCode(std::move(op));
code->Reserve(5);
return *code << OpId{spv::Op::OpBitwiseOr, result_type} << operand_1 << operand_2 << EndOp{};
}
Id Module::OpBitwiseXor(Id result_type, Id operand_1, Id operand_2) {
auto op{std::make_unique<Op>(spv::Op::OpBitwiseXor, bound++, result_type)};
op->Add(operand_1);
op->Add(operand_2);
return AddCode(std::move(op));
code->Reserve(5);
return *code << OpId{spv::Op::OpBitwiseXor, result_type} << operand_1 << operand_2 << EndOp{};
}
Id Module::OpBitwiseAnd(Id result_type, Id operand_1, Id operand_2) {
auto op{std::make_unique<Op>(spv::Op::OpBitwiseAnd, bound++, result_type)};
op->Add(operand_1);
op->Add(operand_2);
return AddCode(std::move(op));
code->Reserve(5);
return *code << OpId{spv::Op::OpBitwiseAnd, result_type} << operand_1 << operand_2 << EndOp{};
}
Id Module::OpNot(Id result_type, Id operand) {
auto op{std::make_unique<Op>(spv::Op::OpNot, bound++, result_type)};
op->Add(operand);
return AddCode(std::move(op));
code->Reserve(4);
return *code << OpId{spv::Op::OpNot, result_type} << operand << EndOp{};
}
Id Module::OpBitFieldInsert(Id result_type, Id base, Id insert, Id offset, Id count) {
auto op{std::make_unique<Op>(spv::Op::OpBitFieldInsert, bound++, result_type)};
op->Add(base);
op->Add(insert);
op->Add(offset);
op->Add(count);
return AddCode(std::move(op));
code->Reserve(7);
return *code << OpId{spv::Op::OpBitFieldInsert, result_type} << base << insert << offset
<< count << EndOp{};
}
Id Module::OpBitFieldSExtract(Id result_type, Id base, Id offset, Id count) {
auto op{std::make_unique<Op>(spv::Op::OpBitFieldSExtract, bound++, result_type)};
op->Add(base);
op->Add(offset);
op->Add(count);
return AddCode(std::move(op));
code->Reserve(6);
return *code << OpId{spv::Op::OpBitFieldSExtract, result_type} << base << offset << count
<< EndOp{};
}
Id Module::OpBitFieldUExtract(Id result_type, Id base, Id offset, Id count) {
auto op{std::make_unique<Op>(spv::Op::OpBitFieldUExtract, bound++, result_type)};
op->Add(base);
op->Add(offset);
op->Add(count);
return AddCode(std::move(op));
code->Reserve(6);
return *code << OpId{spv::Op::OpBitFieldUExtract, result_type} << base << offset << count
<< EndOp{};
}
Id Module::OpBitReverse(Id result_type, Id base) {
auto op{std::make_unique<Op>(spv::Op::OpBitReverse, bound++, result_type)};
op->Add(base);
return AddCode(std::move(op));
code->Reserve(4);
return *code << OpId{spv::Op::OpBitReverse, result_type} << base << EndOp{};
}
Id Module::OpBitCount(Id result_type, Id base) {
auto op{std::make_unique<Op>(spv::Op::OpBitCount, bound++, result_type)};
op->Add(base);
return AddCode(std::move(op));
code->Reserve(4);
return *code << OpId{spv::Op::OpBitCount, result_type} << base << EndOp{};
}
} // namespace Sirit

View File

@ -5,42 +5,44 @@
*/
#include <cassert>
#include "op.h"
#include "sirit/sirit.h"
#include "stream.h"
namespace Sirit {
Id Module::ConstantTrue(Id result_type) {
return AddDeclaration(std::make_unique<Op>(spv::Op::OpConstantTrue, bound, result_type));
declarations->Reserve(3);
return *declarations << OpId{spv::Op::OpConstantTrue, result_type} << EndOp{};
}
Id Module::ConstantFalse(Id result_type) {
return AddDeclaration(std::make_unique<Op>(spv::Op::OpConstantFalse, bound, result_type));
declarations->Reserve(3);
return *declarations << OpId{spv::Op::OpConstantFalse, result_type} << EndOp{};
}
Id Module::Constant(Id result_type, const Literal& literal) {
auto op{std::make_unique<Op>(spv::Op::OpConstant, bound, result_type)};
op->Add(literal);
return AddDeclaration(std::move(op));
declarations->Reserve(3 + 2);
return *declarations << OpId{spv::Op::OpConstant, result_type} << literal << EndOp{};
}
Id Module::ConstantComposite(Id result_type, const std::vector<Id>& constituents) {
auto op{std::make_unique<Op>(spv::Op::OpConstantComposite, bound, result_type)};
op->Add(constituents);
return AddDeclaration(std::move(op));
Id Module::ConstantComposite(Id result_type, std::span<const Id> constituents) {
declarations->Reserve(3 + constituents.size());
return *declarations << OpId{spv::Op::OpConstantComposite, result_type} << constituents
<< EndOp{};
}
Id Module::ConstantSampler(Id result_type, spv::SamplerAddressingMode addressing_mode,
bool normalized, spv::SamplerFilterMode filter_mode) {
auto op{std::make_unique<Op>(spv::Op::OpConstantSampler, bound, result_type)};
op->Add(static_cast<u32>(addressing_mode));
op->Add(normalized ? 1 : 0);
op->Add(static_cast<u32>(filter_mode));
return AddDeclaration(std::move(op));
declarations->Reserve(6);
return *declarations << OpId{spv::Op::OpConstantSampler, result_type} << addressing_mode
<< normalized << filter_mode << EndOp{};
}
Id Module::ConstantNull(Id result_type) {
return AddDeclaration(std::make_unique<Op>(spv::Op::OpConstantNull, bound, result_type));
declarations->Reserve(3);
return *declarations << OpId{spv::Op::OpConstantNull, result_type} << EndOp{};
}
} // namespace Sirit

View File

@ -4,18 +4,16 @@
* 3-Clause BSD License
*/
#include <memory>
#include "common_types.h"
#include "op.h"
#include "sirit/sirit.h"
#include "stream.h"
namespace Sirit {
#define DEFINE_UNARY(opcode) \
Id Module::opcode(Id result_type, Id operand) { \
auto op{std::make_unique<Op>(spv::Op::opcode, bound++, result_type)}; \
op->Add(operand); \
return AddCode(std::move(op)); \
code->Reserve(4); \
return *code << OpId{spv::Op::opcode, result_type} << operand << EndOp{}; \
}
DEFINE_UNARY(OpConvertFToU)

View File

@ -4,44 +4,33 @@
* 3-Clause BSD License
*/
#include <memory>
#include <string>
#include "op.h"
#include "sirit/sirit.h"
#include "common_types.h"
#include "stream.h"
namespace Sirit {
Id Module::Name(Id target, std::string name) {
auto op{std::make_unique<Op>(spv::Op::OpName)};
op->Add(target);
op->Add(std::move(name));
debug.push_back(std::move(op));
Id Module::Name(Id target, std::string_view name) {
debug->Reserve(3 + WordsInString(name));
*debug << spv::Op::OpName << target << name << EndOp{};
return target;
}
Id Module::MemberName(Id type, u32 member, std::string name) {
auto op{std::make_unique<Op>(spv::Op::OpMemberName)};
op->Add(type);
op->Add(member);
op->Add(std::move(name));
debug.push_back(std::move(op));
Id Module::MemberName(Id type, u32 member, std::string_view name) {
debug->Reserve(4 + WordsInString(name));
*debug << spv::Op::OpMemberName << type << member << name << EndOp{};
return type;
}
Id Module::String(std::string string) {
auto op{std::make_unique<Op>(spv::Op::OpString, bound++)};
op->Add(std::move(string));
const auto id = op.get();
debug.push_back(std::move(op));
return id;
Id Module::String(std::string_view string) {
debug->Reserve(3 + WordsInString(string));
return *debug << OpId{spv::Op::OpString} << string << EndOp{};
}
Id Module::OpLine(Id file, Literal line, Literal column) {
auto op{std::make_unique<Op>(spv::Op::OpLine)};
op->Add(file);
op->Add(line);
op->Add(column);
return AddCode(std::move(op));
debug->Reserve(4);
return *debug << spv::Op::OpLine << file << line << column << EndOp{};
}
} // namespace Sirit

Some files were not shown because too many files have changed in this diff Show More