Skip to content

Commit 2968746

Browse files
committed
Application: Correctly set DX11 View for NULL textures (#162)
1 parent 0a00715 commit 2968746

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/CHANGELOG.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,6 @@ v0.9.1 (WIP):
198198

199199
BUGFIX: Editor: Make selection rect sharp
200200

201-
BUGFIX: Editor: Don't populate unused channels with empty draw command, fixes memory leak (#168, #165)
201+
BUGFIX: Editor: Don't populate unused channels with empty draw command, fixes memory leak (#168, #165)
202+
203+
BUGFIX: Application: Correctly set DX11 View for NULL textures (#162)

examples/application/source/imgui_impl_dx11.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data)
274274

275275
// Bind texture, Draw
276276
TEXTURE* texture = (TEXTURE*)pcmd->TextureId;
277-
ctx->PSSetShaderResources(0, 1, &texture->View);
277+
ID3D11ShaderResourceView* textureView = texture ? texture->View : nullptr;
278+
ctx->PSSetShaderResources(0, 1, &textureView);
278279
ctx->DrawIndexed(pcmd->ElemCount, pcmd->IdxOffset + global_idx_offset, pcmd->VtxOffset + global_vtx_offset);
279280
}
280281
}

0 commit comments

Comments
 (0)