Add a flag to ImTextureID that disables alpha test
This commit is contained in:
@@ -203,11 +203,16 @@ void ImGuiDrawer::RenderDrawLists(ImDrawData* data) {
|
||||
for (int j = 0; j < cmd_list->CmdBuffer.size(); ++j) {
|
||||
const auto& cmd = cmd_list->CmdBuffer[j];
|
||||
|
||||
if (reinterpret_cast<uintptr_t>(cmd.TextureId) & kIgnoreAlpha) {
|
||||
drawer->EnableAlphaTest(false);
|
||||
}
|
||||
|
||||
ImmediateDraw draw;
|
||||
draw.primitive_type = ImmediatePrimitiveType::kTriangles;
|
||||
draw.count = cmd.ElemCount;
|
||||
draw.index_offset = index_offset;
|
||||
draw.texture_handle = reinterpret_cast<uintptr_t>(cmd.TextureId);
|
||||
draw.texture_handle =
|
||||
reinterpret_cast<uintptr_t>(cmd.TextureId) & 0xFFFFFFFF;
|
||||
draw.scissor = true;
|
||||
draw.scissor_rect[0] = static_cast<int>(cmd.ClipRect.x);
|
||||
draw.scissor_rect[1] = static_cast<int>(height - cmd.ClipRect.w);
|
||||
@@ -215,6 +220,10 @@ void ImGuiDrawer::RenderDrawLists(ImDrawData* data) {
|
||||
draw.scissor_rect[3] = static_cast<int>(cmd.ClipRect.w - cmd.ClipRect.y);
|
||||
drawer->Draw(draw);
|
||||
|
||||
if (reinterpret_cast<uintptr_t>(cmd.TextureId) & kIgnoreAlpha) {
|
||||
drawer->EnableAlphaTest(true);
|
||||
}
|
||||
|
||||
index_offset += cmd.ElemCount;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user