Greetings,
I build GLSL shaders that are converted to SPIR-V using spirv cross according to the GL_KHR_vulkan_glsl extension:
Name
KHR_vulkan_glsl
Name Strings
GL_KHR_vulkan_glsl
Contact
John Kessenich (johnkessenich 'at' google.com), Google
Contributors
Jeff Bolz, NVIDIA
Kerch Holt, NVIDIA
Kenneth Benzie, Codeplay
Neil Henning, Codeplay
Neil Hickey, ARM
Daniel Koch, NVIDIA
This file has been truncated. show original
Now I want to get into push constants but I unfortunately had to realize that several of my shaders break the 128 byte limit my platform provides.
I seek to remedy this problem by converting the colors to 4-component uint8 types which I assume would be the GLSL u8vec4 datatype.
Does anyone know of an example C++ program where this datatype or something comparable is used with push_constants?
Regards.
waman
April 2, 2021, 1:11pm
2
I know it’s a bit aside of what you asked but if you don’t find the sort of solution you are looking for an index in the push constants might help.
That index could then be used in combination with a buffer that holds the larger piece of info that you need, i.e. colors in your case.
Lemin
April 10, 2021, 5:05pm
3
Glsl has pack/unpack for normalised values . As for C++ part, why dont you just multiply the color by 256, convert to char and pack with bitshifts to a 32 bit int? If I recall correctly, push constants just take the memory and give it to the shader
system
Closed
October 19, 2021, 2:00pm
4
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.