w23 / xash3d-fwgs

Vulkan Ray Tracing fork of Xash3D FWGS engine. Intended to be merged into master at some point in the future.
163 stars 16 forks source link

texture binding count in meatpipe is not congruent to native vk_textures count #569

Open w23 opened 1 year ago

w23 commented 1 year ago

There is MAX_TEXTURES in native code in vk_const.h read from vk_textures.{c,h}. And there is a specialization constant in shaders/ray_interop.h.

There's no direct tie between those. They are "accidentally" the same. For binding on meatpipe side the default spec const value is used. However, later in vulkan code it will feed it with a pointer to an array in vk_textures with the size from vk_const.h.

This is the only code that specifies the size of texture descriptors array to bind: https://github.com/w23/xash3d-fwgs/blob/258c3ec48e2da7ce1508b44c438c11f07c6882b5/ref/vk/vk_meatpipe.c#L216 It is a default value from MAX_TEXTURES specialization constant.

What should be done, ideally:

w23 commented 12 months ago

Can be done when touching shaders (inappropriately) wrt texture bindings next time.