Files
unkernel/test/vk/host/shaders/tbfetch.comp
Pooya Parsa c7ad16303d vk: fill the gaps games, mpv and Vulkan 1.2 callers hit (#32, #33) and add texel buffers: timeline semaphores are offered (values reached at the submit as fences are, a queue wait for a value nothing has signalled holds that submit and the later ones in the ICD until it is given), with imageless framebuffers, separate depth/stencil layouts, multiDrawIndirect, HOST_CACHED on the host-visible memory type, image_format_list and swapchain_mutable_format, and one more inter-stage location for wgpu-hal; the translator marks storage buffers a module never writes read-only, reflects only the resources an entry point reaches, drops OpLine, folds OpSpecConstantOp on integers, booleans and composites, lowers isinf/isnan and int[1] sample masks; the host sizes uniform bindings in 16-byte steps, copies block-compressed images in whole blocks and between size-compatible formats, binds placeholders for unwritten textures and samplers, takes storage bindings at unaligned offsets in dispatches through a scratch copy, rewrites indexed triangle fans as lists and no longer truncates sizes of 2 GiB and more; texel buffers (VkBufferView, both descriptor types) run as a storage buffer of words plus a per-view parameter block, decoded by the view's format in WGSL; the base profile exports LIBGL_KOPPER_DISABLE=1 so Mesa's zink stays off kwvk; mpv's gpu-next (yuv420p and rgb24), DDNet with its own SPIR-V and vkd3d's texel-buffer pipelines run; checks in test/vk (vk-timeline, vk-texel, host cases, translator shaders) and a games stage for the test disk
2026-11-28 13:05:33 +00:00

24 lines
734 B
Plaintext

// SPDX-License-Identifier: MIT
// Copyright (C) 2026 Pooya Parsa <pooya@pi0.io>
#version 450
// Uniform texel buffers of the three sampled types, fetched into a buffer
// with their sizes (test/vk/host/client.js, texel buffers).
layout(local_size_x = 8) in;
layout(set = 0, binding = 0) uniform samplerBuffer f;
layout(set = 0, binding = 1) uniform isamplerBuffer i;
layout(set = 0, binding = 2) uniform usamplerBuffer u;
layout(set = 0, binding = 3) buffer O {
vec4 f[8];
ivec4 i[8];
uvec4 u[8];
ivec4 n;
} o;
void main() {
int k = int(gl_LocalInvocationIndex);
o.f[k] = texelFetch(f, k);
o.i[k] = texelFetch(i, k);
o.u[k] = texelFetch(u, k);
if (k == 0)
o.n = ivec4(textureSize(f), textureSize(i), textureSize(u), 0);
}