Skip to content

Request to isolate NRC from SHARC-specific code in shaders #14

Description

@BattleAxeVR

Hi, I'd like to request some compile guards be added to the shader source code so that, similar to how it's done in the CPP files, all SHARC and/or NRC-specific code is compile-guarded by ifdefs as guide-rails to quickly follow (and integrate) what's needed/relevant to each cache scheme and what isn't.

Image

However, in the shaders, this isn't done. NRC and SHARC code are intermingled, willy nilly, which is confusing and not ideal when trying to debug some weird issues I'm having.

I compile my SHARC vs NRC specific UPDATE vs QUERY ray tracing passes via slang files and defines to enable each one independently, and this works fine, but I had to first basically add these compile guards around your own code first.

NRC headers, for instance, if ENABLE_NRC isn't defined, it STILL defines those function stubs, they just do nothing.

This, frankly, is a code bloat from my perspective.

Functions shouldn't be called in the first place, if they are defined away to nothingness.

So it's better to put the ifdefs around the calling code (in the shaders I mean), than in the NRC headers themselves.

That would not only simplify my life, but make debugging easier.

Here for ex, while debugging, it wasn't clear to me originally how NRC differs from SHARC, insomuch as NRC's separate "resolve" pass does what query pass does in SHARC (appending / accumulating the cached radiance into the raygen shader itself). SHARC seems better and more efficient than NRC overall, frankly, with only subtle difference in image quality. But I'm happy to keep experimenting / using both.

(line 618 doesn't need an NRC_UPDATE compile guard, it's meant to be called in both cases, update and query)

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions