summaryrefslogtreecommitdiff
path: root/docs/features.txt
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>2023-03-02 23:05:50 -0500
committerMarge Bot <emma+marge@anholt.net>2023-03-11 02:26:31 +0000
commit6b22a02f9085b26cbeaad770502aa63d3bbd95ac (patch)
tree085de9f497b9edcd1dca8c2912762d4497352479 /docs/features.txt
parent826649ba1959e56d527feccc31a8a466337a4a03 (diff)
downloadmesa-6b22a02f9085b26cbeaad770502aa63d3bbd95ac.tar.gz
asahi,agx: Implement buffer textures with gnarly NIR
Implement buffer textures in full generality. There are a few issues here: * OpenGL requires buffer textures support a minimum size of 65536 elements, however 1D textures in AGX are (at most) 8192 elements. * OpenGL 4.0 (and OpenGL ES) require buffer textures to support the "RGB32" texture formats. These are 3 packed channels of 32-bits each. In general, non-power-of-two texel sizes are problematic. AGX does not support any such formats and we rely on the GL frontend to lower to a padded format (RGBX) if necessary. Such a lowering cannot work for buffer textures, however, so we need to find a way to implement RGB32 buffer textures. We solve these issues in the follow way: * Use 2D texture descriptors for buffer textures, with a large fixed power-of-two size along one axis. Then large texel indices may be accessed at a small vec2 texel coordinate, and since the fixed dimension is a power-of-two, that vector may be recovered by simply shifting and masking. This effectively avoids size restriction. We do need to clamp texel indices to the buffer size to avoid faulting on OOB reads, since we may read past the end of the buffer (if the app binds a non-page-aligned offset into the buffer). * Use a general purpose memory load for RGB32 buffer textures. Lower the texture load instruction to a memory load from the buffer and some address arithmetic. There's no format conversion needed for RGB32, other than maybe filling in a format-appropriate alpha, so this is straightforward. Again, we need to clamp the texel index for robustness with OOB reads. Each of these solutions brings its own problem. * Using 2D textures instead of 1D requires physically rounding up the buffer size when packing the descriptor, so we can no longer implement textureSize() by reading off the texture descriptor like normal. * We don't know at compile-time whether a given texture load will read from an RGB32 buffer texture or not, so we need to emit code for both. In Vulkan, we can't key the shader to this property, either, since it's descriptor set state and not pipeline state. And each of these problems in turn brings its own solution: * The texture descriptor is linear, so the "compression buffer address" field is ignored by the hardware. We stash the real buffer size there so that textureSize becomes a load from the texture descriptor like usual, without requiring a sideband (which would complicate bindless textures). * If we determine a texture descriptor contains RGB32 data, then it will never be interpreted by the hardware and hence does not need to be a valid texture descriptor. So, we extend the hardware's format enum to contain a software-defined RGB32 format enum. Then, when lowering texture buffer loads, we either read it as a typed RGB32 memory load or as a texture load depending on the value of the format field in the texture descriptor. All of this is accomplished with a big NIR pass generating a pile of strange looking code. But it should be good enough in practice for this silly feature. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21672>
Diffstat (limited to 'docs/features.txt')
-rw-r--r--docs/features.txt20
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/features.txt b/docs/features.txt
index 9f9c52db416..badec84db6a 100644
--- a/docs/features.txt
+++ b/docs/features.txt
@@ -69,17 +69,17 @@ GL 3.0, GLSL 1.30 --- all DONE: freedreno, i965, nv50, nvc0, r600, radeonsi, llv
(*) freedreno (a2xx-a4xx), llvmpipe, and softpipe have fake Multisample anti-aliasing support
-GL 3.1, GLSL 1.40 --- all DONE: freedreno, i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe, virgl, zink, d3d12, panfrost
+GL 3.1, GLSL 1.40 --- all DONE: freedreno, i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe, virgl, zink, d3d12, panfrost, asahi
Forward compatible context support/deprecations DONE
- GL_ARB_draw_instanced (Instanced drawing) DONE (etnaviv/HALTI2, v3d, asahi)
- GL_ARB_copy_buffer (Buffer copying) DONE (v3d, vc4, lima, asahi)
- GL_NV_primitive_restart (Primitive restart) DONE (v3d, asahi)
- 16 vertex texture image units DONE (asahi)
+ GL_ARB_draw_instanced (Instanced drawing) DONE (etnaviv/HALTI2, v3d)
+ GL_ARB_copy_buffer (Buffer copying) DONE (v3d, vc4, lima)
+ GL_NV_primitive_restart (Primitive restart) DONE (v3d)
+ 16 vertex texture image units DONE ()
GL_ARB_texture_buffer_object (Texture buffer objs) DONE (v3d)
- GL_ARB_texture_rectangle (Rectangular textures) DONE (v3d, vc4, lima, asahi)
- GL_ARB_uniform_buffer_object (Uniform buffer objs) DONE (v3d, asahi)
- GL_EXT_texture_snorm (Signed normalized textures) DONE (v3d, asahi)
+ GL_ARB_texture_rectangle (Rectangular textures) DONE (v3d, vc4, lima)
+ GL_ARB_uniform_buffer_object (Uniform buffer objs) DONE (v3d)
+ GL_EXT_texture_snorm (Signed normalized textures) DONE (v3d)
GL 3.2, GLSL 1.50 --- all DONE: freedreno, i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe, virgl, zink, d3d12
@@ -132,7 +132,7 @@ GL 4.0, GLSL 4.00 --- all DONE: freedreno/a6xx, i965/gen7+, nvc0, r600, radeonsi
GL_ARB_sample_shading DONE (freedreno/a6xx, i965/gen6+, nv50, panfrost)
GL_ARB_shader_subroutine DONE (freedreno, i965/gen6+, nv50, softpipe)
GL_ARB_tessellation_shader DONE (freedreno/a6xx, i965/gen7+, )
- GL_ARB_texture_buffer_object_rgb32 DONE (freedreno, i965/gen6+, softpipe, panfrost)
+ GL_ARB_texture_buffer_object_rgb32 DONE (freedreno, i965/gen6+, softpipe, panfrost, asahi)
GL_ARB_texture_cube_map_array DONE (freedreno/a4xx+, i965/gen6+, nv50, softpipe)
GL_ARB_texture_gather DONE (freedreno, i965/gen6+, nv50, softpipe, v3d, panfrost, asahi)
GL_ARB_texture_query_lod DONE (freedreno, i965, nv50, softpipe, v3d, panfrost)
@@ -288,7 +288,7 @@ GLES3.2, GLSL ES 3.2 -- all DONE: freedreno/a6xx, i965/gen9+, radeonsi, virgl, l
GL_OES_shader_multisample_interpolation DONE (freedreno/a6xx, i965, nvc0, r600)
GL_OES_tessellation_shader DONE (freedreno/a6xx, all drivers that support GL_ARB_tessellation_shader)
GL_OES_texture_border_clamp DONE (all drivers)
- GL_OES_texture_buffer DONE (freedreno, i965, nvc0, r600, softpipe, panfrost)
+ GL_OES_texture_buffer DONE (freedreno, i965, nvc0, r600, softpipe, panfrost, asahi)
GL_OES_texture_cube_map_array DONE (freedreno/a4xx+, i965/hsw+, nvc0, r600, softpipe)
GL_OES_texture_stencil8 DONE (all drivers that support GL_ARB_texture_stencil8)
GL_OES_texture_storage_multisample_2d_array DONE (all drivers that support GL_ARB_texture_multisample)