1#!amber 2# Copyright 2020 The Amber Authors. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# https://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16INSTANCE_EXTENSION VK_KHR_get_physical_device_properties2 17DEVICE_EXTENSION VK_KHR_shader_float16_int8 18DEVICE_EXTENSION VK_KHR_storage_buffer_storage_class 19DEVICE_EXTENSION VK_KHR_8bit_storage 20DEVICE_FEATURE Float16Int8Features.shaderInt8 21DEVICE_FEATURE Storage8BitFeatures.uniformAndStorageBuffer8BitAccess 22DEVICE_FEATURE Storage8BitFeatures.storagePushConstant8 23 24SHADER compute comp_shader GLSL 25#version 450 26#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require 27 28layout(set=0, binding=0) buffer Buf { 29 int8_t value; 30} data; 31 32layout(push_constant) uniform PushConstantsBlock { 33 int8_t factor; 34} pushConstants; 35 36void main() { 37 data.value = data.value * pushConstants.factor; 38} 39END 40 41BUFFER buf DATA_TYPE int8 DATA 63 END 42BUFFER pushc DATA_TYPE int8 DATA 2 END 43 44PIPELINE compute pipeline 45 ATTACH comp_shader 46 47 BIND BUFFER buf AS storage DESCRIPTOR_SET 0 BINDING 0 48 BIND BUFFER pushc AS push_constant 49END 50 51RUN pipeline 1 1 1 52 53EXPECT buf IDX 0 EQ 126 54