Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpdConstants and SpdLinearSamplerConstants #9

Open
sagaceilo opened this issue Feb 14, 2023 · 1 comment
Open

SpdConstants and SpdLinearSamplerConstants #9

sagaceilo opened this issue Feb 14, 2023 · 1 comment

Comments

@sagaceilo
Copy link

I think it would be better to move

        struct SpdConstants
        {
            int mips;
            int numWorkGroupsPerSlice;
            int workGroupOffset[2];
        };

        struct SpdLinearSamplerConstants
        {
            int mips;
            int numWorkGroupsPerSlice;
            int workGroupOffset[2];
            float invInputSize[2];
            float padding[2];
        };

To ffx_spd.h under a A_CPU define. That would make it more convinient of using just

#define A_CPU
#include <fidelityfx/ffx_a.h>
#include <fidelityfx/ffx_spd.h>

In the implementation file. Currently they are hidden in example project file.

@jeremyong
Copy link

jeremyong commented Sep 17, 2023

FWIW, I can see why this remains in the SPD samples. In fact, I would go one step further and suggest that all the CPU code be separated altogether. The SPD constants are bound to be sourced very differently in different engines since you may not need the workgroup offset support, multiple-slice operation, and whatnot. Not to mention that you might want to pack this data along with other data that's persistently mapped in the frame or something (it's not uncommon for framebuffer metadata to be stored somewhere and reused by other postprocessing work). As a final consideration, different renderers/engines have different ways to "glue" data on the host and device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants