Move EnableDepthTest functionality into a bool alpha_blend var on ImmediateDraw.
This commit is contained in:
@@ -203,16 +203,15 @@ 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) & 0xFFFFFFFF;
|
||||
draw.alpha_blend =
|
||||
reinterpret_cast<uintptr_t>(cmd.TextureId) & kIgnoreAlpha ? false
|
||||
: true;
|
||||
draw.scissor = true;
|
||||
draw.scissor_rect[0] = static_cast<int>(cmd.ClipRect.x);
|
||||
draw.scissor_rect[1] = static_cast<int>(height - cmd.ClipRect.w);
|
||||
@@ -220,10 +219,6 @@ 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