Skip to content

Commit

Permalink
drm: Add comment and cleanup style a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Feb 24, 2025
1 parent 847fe2e commit 8ce5a7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/backend/drm/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,9 +1033,8 @@ CDRMRenderer::SBlitResult CDRMRenderer::blit(SP<IBuffer> from, SP<IBuffer> to, S
GLCALL(glTexParameteri(fromTex.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST));
GLCALL(glTexParameteri(fromTex.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST));

if (intermediateBuf) {
if (intermediateBuf)
GLCALL(glTexImage2D(fromTex.target, 0, PIXEL_BUFFER_FORMAT, fromDma.size.x, fromDma.size.y, 0, PIXEL_BUFFER_FORMAT, GL_UNSIGNED_BYTE, intermediateBuf));
}

GLCALL(glUseProgram(SHADER.program));
GLCALL(glDisable(GL_BLEND));
Expand Down
2 changes: 2 additions & 0 deletions src/backend/drm/Renderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace Aquamarine {
GLuint fbo = 0, rbo = 0;
SGLTex tex;
Hyprutils::Signal::CHyprSignalListener bufferDestroy;
// This is malloc'd manually instead of using a std::vector to keep lifetime management in line with the rest of the class,
// which e.g. doesn't immediately free the eglImage on drop but instead waits until onBufferAttachmentDrop.
uint8_t* intermediateBuf = nullptr;
size_t intermediateBufLen = 0;

Expand Down

0 comments on commit 8ce5a7c

Please sign in to comment.