<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wlroots.git/render/vulkan/shaders, branch master</title>
<subtitle>fork of wlroots with action binder support
</subtitle>
<id>https://git.vlhl.dev/navi/wayland/wlroots.git/atom?h=master</id>
<link rel='self' href='https://git.vlhl.dev/navi/wayland/wlroots.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.vlhl.dev/navi/wayland/wlroots.git/'/>
<updated>2024-01-26T13:50:55+00:00</updated>
<entry>
<title>render/vulkan: correct sRBG gamma expansion in shader</title>
<updated>2024-01-26T13:50:55+00:00</updated>
<author>
<name>Félix Poisot</name>
<email>felix@lhfblc.fr</email>
</author>
<published>2024-01-23T19:54:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vlhl.dev/navi/wayland/wlroots.git/commit/?id=5ae8ce807abbf6eab1113a36e190df50ffc2f9c1'/>
<id>urn:sha1:5ae8ce807abbf6eab1113a36e190df50ffc2f9c1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render/vulkan: undo alpha premult before sRGB encoding/decoding</title>
<updated>2023-10-17T15:28:56+00:00</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2023-10-17T10:21:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vlhl.dev/navi/wayland/wlroots.git/commit/?id=5adf325333602d5b1e7ccdeb122633bbc8040ace'/>
<id>urn:sha1:5adf325333602d5b1e7ccdeb122633bbc8040ace</id>
<content type='text'>
sRGB encoding/decoding needs to happen with straight alpha, not
pre-multiplied alpha.
</content>
</entry>
<entry>
<title>render/vulkan: document TEXTURE_TRANSFORM_* in shader</title>
<updated>2023-05-26T12:29:30+00:00</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2023-05-24T09:25:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vlhl.dev/navi/wayland/wlroots.git/commit/?id=28e8d92263280deb8e9f06261f57ca84fe6141cf'/>
<id>urn:sha1:28e8d92263280deb8e9f06261f57ca84fe6141cf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render/vulkan: allow rendering to non-8-bit buffers</title>
<updated>2023-05-12T15:09:02+00:00</updated>
<author>
<name>Manuel Stoeckl</name>
<email>code@mstoeckl.com</email>
</author>
<published>2022-11-20T02:47:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vlhl.dev/navi/wayland/wlroots.git/commit/?id=10dd41669492f7582c26bd3989536a66278df75d'/>
<id>urn:sha1:10dd41669492f7582c26bd3989536a66278df75d</id>
<content type='text'>
This is implemented by a two-subpass rendering scheme; the first
subpass draws (and blends) onto a linear R16G16B16A16_SFLOAT buffer,
while the second subpass performs linear-&gt;srgb conversion, writing
onto the actual output buffer.
</content>
</entry>
<entry>
<title>render/vulkan: add support for RGB565 texture format</title>
<updated>2022-11-25T14:19:27+00:00</updated>
<author>
<name>Manuel Stoeckl</name>
<email>code@mstoeckl.com</email>
</author>
<published>2022-11-12T03:53:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vlhl.dev/navi/wayland/wlroots.git/commit/?id=3ed69b49465f0b542d163da905dbc0864e19d5d8'/>
<id>urn:sha1:3ed69b49465f0b542d163da905dbc0864e19d5d8</id>
<content type='text'>
Since this does not have a matching _SRGB-type vulkan format, add a
new shader variant/pipeline to perform the sRGB-&gt;linear texture
conversion.
</content>
</entry>
<entry>
<title>render/vulkan: Optimize vertex shader</title>
<updated>2021-11-23T15:46:24+00:00</updated>
<author>
<name>Joshua Ashton</name>
<email>joshua@froggi.es</email>
</author>
<published>2021-11-10T11:41:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vlhl.dev/navi/wayland/wlroots.git/commit/?id=f132d66816263a509b46092e14755b5e3f0e258f'/>
<id>urn:sha1:f132d66816263a509b46092e14755b5e3f0e258f</id>
<content type='text'>
This ends up being a horrible global load:

  s_getpc_b64   s[4:5]                                  // 000000000000: BE841C80
  v_add_u32     v0, s2, v0                              // 000000000004: 68000002
  v_sub_co_u32  v1, vcc, 0, v0                          // 000000000008: 34020080
  v_max_i32     v1, v0, v1                              // 00000000000C: 1A020300
  v_and_b32     v1, 3, v1                               // 000000000010: 26020283
  v_cmp_lt_i32  s[0:1], v0, 0                           // 000000000014: D0C10000 00010100
  v_sub_co_u32  v0, vcc, 0, v1                          // 00000000001C: 34000280
  v_cndmask_b32  v0, v1, v0, s[0:1]                     // 000000000020: D1000000 00020101
  v_lshlrev_b32  v1, 3, v0                              // 000000000028: 24020083
  v_mad_u32_u24  v0, v0, 8, 4                           // 00000000002C: D1C30000 02111100
  v_min_u32     v1, 32, v1                              // 000000000034: 1C0202A0
  v_min_u32     v0, 32, v0                              // 000000000038: 1C0000A0
  s_getpc_b64   s[0:1]                                  // 00000000003C: BE801C00
  s_add_u32     s0, s0, 0x0000003c                      // 000000000040: 8000FF00 0000003C
  s_addc_u32    s1, s1, 0                               // 000000000048: 82018001
  global_load_dword  v1, v[1:2], s[0:1]                 // 00000000004C: DC508000 01000001
  global_load_dword  v0, v[0:1], s[0:1]                 // 000000000054: DC508000 00000000
  v_mov_b32     v2, 0                                   // 00000000005C: 7E040280
  v_mov_b32     v3, 1.0                                 // 000000000060: 7E0602F2
  s_waitcnt     vmcnt(0)                                // 000000000064: BF8C0F70
  exp           pos0, v1, v0, v2, v3 done               // 000000000068: C40008CF 03020001
  exp           param0, off, off, off, off              // 000000000070: C4000200 00000000
  s_endpgm                                              // 000000000078: BF810000
  v_cndmask_b32  v0, s0, v0, vcc                        // 00000000007C: 00000000
  v_cndmask_b32  v0, s0, v0, vcc                        // 000000000080: 00000000
  v_add_f16     v192, s0, v0                            // 000000000084: 3F800000
  v_cndmask_b32  v0, s0, v0, vcc                        // 000000000088: 00000000
  v_add_f16     v192, s0, v0                            // 00000000008C: 3F800000
  v_add_f16     v192, s0, v0                            // 000000000090: 3F800000
  v_cndmask_b32  v0, s0, v0, vcc                        // 000000000094: 00000000
  v_add_f16     v192, s0, v0                            // 000000000098: 3F800000
  v_cndmask_b32  v0, s0, v0, vcc                        // 00000000009C: 00000000

With some bit magic, we can get something much nicer:

  v_add_u32     v0, s2, v0                              // 000000000000: 68000002
  v_add_u32     v1, 1, v0                               // 000000000004: 68020081
  v_and_b32     v1, 2, v1                               // 000000000008: 26020282
  v_cvt_f32_i32  v1, v1                                 // 00000000000C: 7E020B01
  v_mul_f32     v1, 0.5, v1                             // 000000000010: 0A0202F0
  v_and_b32     v0, 2, v0                               // 000000000014: 26000082
  v_cvt_f32_i32  v0, v0                                 // 000000000018: 7E000B00
  v_mul_f32     v0, 0.5, v0                             // 00000000001C: 0A0000F0
  v_mov_b32     v2, 0                                   // 000000000020: 7E040280
  v_mov_b32     v3, 1.0                                 // 000000000024: 7E0602F2
  exp           pos0, v1, v0, v2, v3 done               // 000000000028: C40008CF 03020001
  exp           param0, off, off, off, off              // 000000000030: C4000200 00000000
  s_endpgm                                              // 000000000038: BF810000

The above output was based on just shoving it in ShaderPlayground -- I was not able to use pipeline feedback as I was unable to get RenderDoc working due to the EXT_physical_device_drm requirement.

I additionally considered using &gt;&gt; 1 instead of * 0.5, but AMD has dedicated modifiers to merge a * 0.5, * 2.0, etc in a single instruction. (Albeit, not taken advantage of in the code above, but might with ACO)

Signed-off-by: Joshua Ashton &lt;joshua@froggi.es&gt;
</content>
</entry>
<entry>
<title>render/vulkan: quiet glslangValidator</title>
<updated>2021-11-23T15:38:56+00:00</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2021-11-07T12:22:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vlhl.dev/navi/wayland/wlroots.git/commit/?id=5332935afcdd519dd2dd9dbfeb50c6aa0f91e9c3'/>
<id>urn:sha1:5332935afcdd519dd2dd9dbfeb50c6aa0f91e9c3</id>
<content type='text'>
This suppresses the output filename printed to stdout. Errors and
warnings should still be printed to stderr as usual.
</content>
</entry>
<entry>
<title>render/vulkan: Use image view swizzles instead of shader hack</title>
<updated>2021-10-18T13:57:46+00:00</updated>
<author>
<name>Joshua Ashton</name>
<email>joshua@froggi.es</email>
</author>
<published>2021-10-16T14:31:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vlhl.dev/navi/wayland/wlroots.git/commit/?id=b62ce3c3c83e2719e5fb02306dafe5f0bf5dd91c'/>
<id>urn:sha1:b62ce3c3c83e2719e5fb02306dafe5f0bf5dd91c</id>
<content type='text'>
Signed-off-by: Joshua Ashton &lt;joshua@froggi.es&gt;
</content>
</entry>
<entry>
<title>render/vulkan: add Vulkan renderer</title>
<updated>2021-10-18T09:51:13+00:00</updated>
<author>
<name>nyorain</name>
<email>nyorain@gmail.com</email>
</author>
<published>2021-02-21T17:30:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vlhl.dev/navi/wayland/wlroots.git/commit/?id=8e346922508aa3eaccd6e12f2917f6574f349843'/>
<id>urn:sha1:8e346922508aa3eaccd6e12f2917f6574f349843</id>
<content type='text'>
This new renderer is implemented with the existing wlr_renderer API
(which is known to be sub-optimal for some operations). It's not
used by default, but users can opt-in by setting WLR_RENDERER=vulkan.

The renderer depends on VK_EXT_image_drm_format_modifier and
VK_EXT_physical_device_drm.

Co-authored-by: Simon Ser &lt;contact@emersion.fr&gt;
Co-authored-by: Jan Beich &lt;jbeich@FreeBSD.org&gt;
</content>
</entry>
</feed>
