From fcd56ce18a5a91e31d0a8a474f137f6794a94af7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 30 Jul 2026 09:30:56 +0530 Subject: [PATCH] Mark struct members as uniform --- kitty/shaders/custom/pipeline.slang | 6 +----- kitty/shaders/custom/types.slang | 5 +++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/kitty/shaders/custom/pipeline.slang b/kitty/shaders/custom/pipeline.slang index 89916cf5d..d64953295 100644 --- a/kitty/shaders/custom/pipeline.slang +++ b/kitty/shaders/custom/pipeline.slang @@ -39,11 +39,7 @@ uniform Sampler2D backbuffer; uniform uint timestamp; public float4 pipeline_fragment_main(float2 texcoord) { - KittyCustomShaderData d; - d.backbuffer = backbuffer; - d.texcoord = texcoord; - d.backbuffer = backbuffer; - d.timestamp = timestamp; + KittyCustomShaderData d = {timestamp, backbuffer, texcoord}; float4 color = backbuffer.Sample(texcoord); // PIPELINE return color; diff --git a/kitty/shaders/custom/types.slang b/kitty/shaders/custom/types.slang index c5d0c5a5f..87a7b16f8 100644 --- a/kitty/shaders/custom/types.slang +++ b/kitty/shaders/custom/types.slang @@ -5,7 +5,8 @@ public struct KittyCustomShaderData { - public uint timestamp; + public uniform uint timestamp; + public uniform Sampler2D backbuffer; + public float2 texcoord; - public Sampler2D backbuffer; }