On 3/7/22 12:15, Henri Verbeet wrote:
On Mon, 7 Mar 2022 at 17:47, Zebediah Figura zfigura@codeweavers.com wrote:
On 3/7/22 05:40, Henri Verbeet wrote:
On Mon, 7 Mar 2022 at 03:05, Zebediah Figura zfigura@codeweavers.com wrote: The traditional way to do this kind of thing is a here-document/here-string construction. Is that something we've considered?
Not per se, although I'm not sure it's an improvement. Here-strings are kind of more inconvenient to type, and get away with it in the general case because they're kind of rare, but we'll have at least one per file.
Would we? HLSL attributes aren't uncommon, but we certainly already have a fair number of existing .shader_test files without them. We should be able to keep those as-is.
Eh, I guess I wasn't thinking correctly. Indeed the point would be not to use them in every file...
Perhaps more saliently, I'd like to be able to easily visually parse sections (especially since we won't have anything like syntax highlighting to help us), which implies at least that the test header should be dissimilar to HLSL attributes.
I suppose we could also just indent the shaders by one level, and then strip that indentation before compilation. E.g.:
[pixel shader] uniform float4 colour; float4 main() : sv_target { return colour; } [vertex shader] ...
Actually I think I like that option the most of anything that's been proposed.