[PATCH vkd3d 4/4] vkd3d-compiler: Default to HLSL as a source format when preprocessing.
Henri Verbeet
hverbeet at gmail.com
Mon Nov 30 11:29:52 CST 2020
On Mon, 30 Nov 2020 at 20:34, Zebediah Figura (she/her)
<zfigura at codeweavers.com> wrote:
> On 11/30/20 7:05 AM, Henri Verbeet wrote:
> > On Fri, 27 Nov 2020 at 20:01, Zebediah Figura (she/her)
> > <zfigura at codeweavers.com> wrote:
> >> [Perhaps we should also add something like
> >> vkd3d_shader_get_supported_preprocessor_types()?]
> > Possibly, although at least initially we could probably get away with
> > simply returning a copy of the input for source formats that do not
> > have an inherent associated preprocessor.
> >
> That's a good idea, actually; I hadn't thought of that. That does mean
> that for backwards compatibility's sake there's not a lot of point in
> later adding vkd3d_shader_get_supported_preprocessor_types().
Not as long as we stick to the standard preprocessor for each source
format, no. But if we did want to add e.g. a m4 preprocessor, we could
do something like the following:
enum vkd3d_shader_preprocessor
{
VKD3D_SHADER_PREPROCESSOR_NONE, /* Or
VKD3D_SHADER_PREPROCESSOR_IDENTITY, if you prefer. */
VKD3D_SHADER_PREPROCESSOR_HLSL,
VKD3D_SHADER_PREPROCESSOR_M4,
...
};
struct vkd3d_shader_preprocess2_info
{
enum vkd3d_shader_preprocessor preprocessor;
...
};
const enum vkd3d_shader_preprocessor
*vkd3d_shader_get_supported_preprocessors(
enum vkd3d_shader_source_type source_type, unsigned int *count);
I wouldn't necessarily expect a lot of demand for that feature though.
More information about the wine-devel
mailing list