# Texture become empty after ReloadPackages, how to debug rendering code?

**URL:** <https://forums.unrealengine.com/t/texture-become-empty-after-reloadpackages-how-to-debug-rendering-code/2517392>\
**Category:** Programming & Scripting\
**Tags:** package, Render, unreal-engine, question, hot-reload\
**Created:** [May 19, 2025, 2:22am UTC](https://forums.unrealengine.com/t/texture-become-empty-after-reloadpackages-how-to-debug-rendering-code/2517392 "2025-05-19T02:22:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CheapMeow](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cheapmeow/32/1009431_2.png) [@CheapMeow](https://forums.unrealengine.com/u/CheapMeow)\
**Post date:** [May 19, 2025, 2:22am UTC](https://forums.unrealengine.com/t/texture-become-empty-after-reloadpackages-how-to-debug-rendering-code/2517392/1 "2025-05-19T02:22:40Z")

</div>

## Problem

I use `ReloadPackages` to reload texture A from new pak files at runtime. UI that use texture A is refreshed perfectly, but Material B that use texture A is turning black. I use RenderDoc, and find my new texture A is not used by Material B.

## Showcase

Following screen captures show one UI on the left side and one mesh on the right side.

Before ReloadPackages to reload texture A

 ![Before ReloadPackages](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/7/5f73e2831f192344e93b86e91aae4ec66d4fdbc8.jpeg)

After ReloadPackages to reload texture A

 ![After ReloadPackages](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/5/c/85c275e149c4f204f02add36accb26e82af7d165.jpeg)

Following screen captures show renderdoc capture.

Before ReloadPackages to reload texture A

 ![Screenshot 2025-05-19 101816](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/2/d/52dd428e18eccaaabbc6c419bef9407af6587f30.png)

After ReloadPackages to reload texture A

 ![Screenshot 2025-05-19 101907](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/a/64a60ac8757f8db304457697b12a17fd66d1c267.png)

Caution: Even though the texture info in bottom bar in RenderDoc is `BlackAlphaOneDummy`, it is an error of RenderDoc. I want to click the empty texture `PS 6`, and the texture info show the last clicked texture info except from `PS 6`. It may because `PS 6` is empty, so clicking on empty doesn’t refresh texture info in bottom bar.  
Does anyone have idea about how to debug?

---

<div class="post-metadata">

**Author:** ![CheapMeow](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cheapmeow/32/1009431_2.png) [@CheapMeow](https://forums.unrealengine.com/u/CheapMeow)\
**Post date:** [May 19, 2025, 10:47am UTC](https://forums.unrealengine.com/t/texture-become-empty-after-reloadpackages-how-to-debug-rendering-code/2517392/2 "2025-05-19T10:47:02Z")

</div>

In base pass draw call `FMeshDrawCommand::SubmitDraw`, I find it may be relevent with texture binding:

```cpp
MeshDrawCommand.ShaderBindings.SetOnCommandList(RHICmdList, MeshPipelineState.BoundShaderState.AsBoundShaderState(), StateCache.ShaderBindings);

```

I add breakpoint in this function:

```cpp
RHICmdList.SetShaderSampler(Shader, Parameter.BaseIndex, Sampler);

```

```cpp
RHICmdList.SetShaderTexture(Shader, Parameter.BaseIndex, Texture);

```

But the breakpoint never hit. So strange.

But I find that RenderDoc give the function call that bind the texture:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/8/d/58d876508d7479a28bc41008a8c1f886a28b7c9d.png)

Search `PSSetShaderResources` I find

```cpp
D3D11_STATE_CACHE_INLINE void InternalSetShaderResourceView(uint32 ResourceIndex, ID3D11ShaderResourceView*& SRV)

```

Now I am going to search the usage of this function and hoping I can find the final relevent code about chossing texture from package or pointer to bind.

To do that, I add a breakpoint to `PSSetShaderResources` and find it also can’t be hit.

So strange looks like I can’t find a function to bind image to renderer.

---

<div class="post-metadata">

**Author:** ![CheapMeow](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cheapmeow/32/1009431_2.png) [@CheapMeow](https://forums.unrealengine.com/u/CheapMeow)\
**Post date:** [May 20, 2025, 2:35am UTC](https://forums.unrealengine.com/t/texture-become-empty-after-reloadpackages-how-to-debug-rendering-code/2517392/3 "2025-05-20T02:35:45Z")

</div>

I am going to close the problem because troblues comes in debugging shader parameters binding. It is another topic.
