Packaging runtime mountable DLC with bShareMaterialShaderCode for PSO Caches

Hello,

We have come across an issue trying to produce a separate pak file for our DLC while also utilizing PSO caches.

The PSO docs state that in order to use PSO Caches, you need to set bShareMaterialShaderCode=True

However, having that on causes issues when trying to produce a separate pak file for DLC, as it doesn’t seem to respect the boundaries between base-game and plugin content.

How can we package runtime-mountable DLC while still using material shader code sharing to satisfy PSO cache prerequisites?

Hello,

Thank you for reaching out.

I’ve been assigned this issue, and we will be looking into PSO Caches with DLC content for you.

Hello,

When working with PSOs and DLC, you will need to patch the main game with the PSOs from the DLC at the same time as you release the DLC. This ticket goes into more detail about the topic:

[Content removed]

If you are experiencing different issues, can you please describe them in more detail?

Please let us know if this helps.

Thank you Stephen,

That discussion seems to cover what to do after you’ve collected PSO caches, but the issue I’m trying to face first is producing separate PAK files for the DLC plugin.

Having bShareMaterialShaderCode on causes errors when trying to package the base game content separately from DLC content. But having it being on is required to collect or use PSO caches.

Hello,

Thank you for the clarification.

Can you please attach an example of the errors you are seeing?

It would also be helpful to know what pakchunk settings you are using to separate the pak files, or other setting different from default split DLC plugin packaging.

Hi Stephen,

The errors we see when doing this are a bunch of missing shader errors:

 LogMaterial: Error: Tried to access an uncooked shader map ID in a cooked application
 LogShaders: Error: Missing shader resource for hash '3F9B48621478468A51AC2DD10CE6FA03F829E8BA' for shader platform 0 in the shader library
 LogMaterial: Warning: Invalid shader map ID caching shaders for 'M_LMaster_ItemOrCar', will use default material.
 LogMaterial: Can't compile M_LMaster_ItemOrCar with cooked content, will use default material instead
 LogMaterial: Warning: [AssetLog] ...MI_Resource_Cult_Twine_01_Metal: Failed to compile Material Instance with Base M_LMaster_ItemOrCar for platform PCD3D_SM5, Default Material will be used in game.

As for pakchunk, we don’t do anything special. We just use -DLCPakPluginFile to make the DLC’s pak separately

Hello,

Thank you for this information.

We were unable to reproduce these error messages in our tests with a DLC adding more Materials, while using PSO Caches.

Can you please send us a minimal test project that demonstrates these error messages, and include reproductions steps?

The guide for test projects:

[Content removed]

Here is a minimal repro project. It has 3 materials:

  1. Base Material, located in base game
  2. Instance of Material #1, located in DLC plugin
  3. Base Material, located in DLC plugin

They are loaded via soft-ref at begin play.

When bShareMaterialShaderCode is false: all materials load and render appropriately, but I cannot use PSO caching

When bShareMaterialShaderCode is true: PSO caching runs, materials #1 and #2 load and render appropriately, but material #3 fails to compile showing as the broken grid texture.

So the question is how do I get my DLC materials to compile and let me use PSO caching?

[Image Removed]

Hello,

We were able to identify the command-line option “-manifests” when cooking the DLC is connected to the issue. When we remove it, all three materials load correctly.

Are you intending to use streaming installs that “-manifests” enables? We did not see the other command-line options related to them (“-createchunkinstall”, “-chunkinstalldirectory”, or “-chunkinstallversion”)

Please let us know if this helps.

Thank you Stephen,

“-manifests” was the key. We also happened to have `bGenerateChunks=True` on in our game ini, which we found turned manifests on.

Removing -manifests and also adding `-ini:Game:[/Script/UnrealEd.ProjectPackagingSettings]:bGenerateChunks=False` to `additionalcookeroptions` in our DLC packaging script has fixed the issue.

Thank you!

Hello,

Thank you for the confirmation that it works now.

Can we now close your case? You can always re-open it if you find you need additional assistance for the same issue.