1// Copyright 2019 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; 16 17layout(push_constant) uniform ImageFormatBlock { 18 uint compFormat; 19 uint baseLayer; 20} 21u_pushConstant; 22 23layout(binding = 0, rg32ui) readonly uniform uimage${type} u_image0; 24layout(binding = 1, r16) writeonly uniform image${type} u_image1; 25 26void main(void) { 27 ivec3 pos = ivec3(gl_GlobalInvocationID.xyz); 28 pos.z += int(u_pushConstant.baseLayer); 29 uvec4 srcBlock = imageLoad(u_image0, getPos${type}(pos)); 30 31 float[16] decompressed = eac_decode_single_channel_block_float( 32 flip32(srcBlock[0]), flip32(srcBlock[1]), false); 33 34 for (int y = 0; y < BLOCK_Y_SIZE_${type}; y++) { 35 for (int x = 0; x < 4; x++) { 36 imageStore(u_image1, 37 getPos${type}(ivec3(pos.xy * 4 + ivec2(x, y), pos.z)), 38 vec4(decompressed[y * 4 + x], 0, 0, 1)); 39 } 40 } 41} 42