Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImGUI extension should require the user set Viewport and Scissor state outside of render() method #751

Open
devshgraphicsprogramming opened this issue Oct 8, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@devshgraphicsprogramming
Copy link
Member

We have this piece of code which is not elegant / resillient

SViewport const viewport

However for the user to be able to set this sanely, one must know the framebuffer Width and Height

float const frameBufferWidth = drawData->DisplaySize.x * drawData->FramebufferScale.x;

and this seems only knowable from ImGUI::GetDrawData

auto const* drawData = ImGui::GetDrawData();

Which probably needs a call to ImGUI::Render 🤦

P.S. also while you're at it, make the push constant setting an overridable lambda (so people can pump the data to the drawcall differently)

commandBuffer->pushConstants(m_pipeline->getLayout(), IShader::E_SHADER_STAGE::ESS_VERTEX | IShader::E_SHADER_STAGE::ESS_FRAGMENT, 0u, sizeof(constants), &constants);

std::function<void(IGPUCommandBuffer*,const PushConstants&)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants