NVIDIAGameWorks / RTXGI-DDGI

RTX Global Illumination (RTXGI)
https://developer.nvidia.com/rtxgi
Other
683 stars 55 forks source link

UE4: apply patch error #46

Closed Choconuts closed 3 years ago

Choconuts commented 3 years ago

I cannot apply patches to the UE4 repo or the NvRTX repo, no matter which version I chose. When I use git apply --check *.*.patch command, the following error occurs:

error: patch failed: Engine/Source/Runtime/Renderer/Private/DeferredShadingRenderer.cpp:272
error: Engine/Source/Runtime/Renderer/Private/DeferredShadingRenderer.cpp: patch does not apply
error: patch failed: Engine/Source/Runtime/Renderer/Private/DeferredShadingRenderer.h:32
error: Engine/Source/Runtime/Renderer/Private/DeferredShadingRenderer.h: patch does not apply
error: patch failed: Engine/Source/Runtime/Renderer/Private/IndirectLightRendering.cpp:342
error: Engine/Source/Runtime/Renderer/Private/IndirectLightRendering.cpp: patch does not apply
error: patch failed: Engine/Source/Runtime/Renderer/Private/RayTracing/RayTracingLighting.h:14
error: Engine/Source/Runtime/Renderer/Private/RayTracing/RayTracingLighting.h: patch does not apply
error: patch failed: Engine/Source/Runtime/Renderer/Private/SystemTextures.h:11
error: Engine/Source/Runtime/Renderer/Private/SystemTextures.h: patch does not apply

I've tested v4.26.1. and v4.25.3. The engine itself is always built well with my VS2017, but if I force to apply the patch (by git apply --reject and manually edit the .rej files) there will be a lot of compile errors.

How can I deal with this?

gmk1072 commented 3 years ago

I believe I was running into the same issues as you have here. What fixed it for me is converting the patches EOL(End OF Line) to Unix. If you don't want to do that I think you can also try running the command through something like git bash as it seems to be able to handle applying the patch versus just regular cmd.

You can convert the EOL of the patch in notepad++. Open the patch file you are trying to apply with notepad++, click Edit>EOL conversion>Unix(LF). Save over the patch file you are trying to apply, then you should be good to go.

If that doesn't work, I'm not sure what your issues could be.

acmarrs-nvidia commented 3 years ago

This is a duplicate of #35.

How to properly clone UE4, the RTXGI SDK, and apply the patch is covered in the UE4 Getting Started Guide.

@gmk1072 is likely correct about the root of your problem being line endings.