mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-20 08:17:54 +00:00
nvnflinger/gpu: implement blending
This commit is contained in:
parent
effe70a904
commit
1c32e4157c
37 changed files with 383 additions and 141 deletions
|
@ -92,6 +92,21 @@ void WindowAdaptPass::DrawToFramebuffer(ProgramManager& program_manager, std::li
|
|||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
for (size_t i = 0; i < layer_count; i++) {
|
||||
switch (framebuffers[i].blending) {
|
||||
case Tegra::BlendMode::Opaque:
|
||||
default:
|
||||
glDisablei(GL_BLEND, 0);
|
||||
break;
|
||||
case Tegra::BlendMode::Premultiplied:
|
||||
glEnablei(GL_BLEND, 0);
|
||||
glBlendFuncSeparatei(0, GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO);
|
||||
break;
|
||||
case Tegra::BlendMode::Coverage:
|
||||
glEnablei(GL_BLEND, 0);
|
||||
glBlendFuncSeparatei(0, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO);
|
||||
break;
|
||||
}
|
||||
|
||||
glBindTextureUnit(0, textures[i]);
|
||||
glProgramUniformMatrix3x2fv(vert.handle, ModelViewMatrixLocation, 1, GL_FALSE,
|
||||
matrices[i].data());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue