MCPcopy Create free account
hub / github.com/baldurk/renderdoc / getFramebufferCopyMask

Function getFramebufferCopyMask

renderdoc/driver/gl/gl_pixelhistory.cpp:499–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497}
498
499GLbitfield getFramebufferCopyMask(WrappedOpenGL *driver)
500{
501 GLuint curDepth = 0;
502 GLuint curStencil = 0;
503 GLuint curColor = 0;
504
505 GLint colorAttachment;
506 driver->glGetIntegerv(eGL_READ_BUFFER, &colorAttachment);
507
508 if(colorAttachment)
509 {
510 driver->glGetFramebufferAttachmentParameteriv(eGL_READ_FRAMEBUFFER, GLenum(colorAttachment),
511 eGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
512 (GLint *)&curColor);
513 }
514 driver->glGetFramebufferAttachmentParameteriv(eGL_DRAW_FRAMEBUFFER, eGL_DEPTH_ATTACHMENT,
515 eGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
516 (GLint *)&curDepth);
517
518 driver->glGetFramebufferAttachmentParameteriv(eGL_DRAW_FRAMEBUFFER, eGL_STENCIL_ATTACHMENT,
519 eGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
520 (GLint *)&curStencil);
521
522 GLbitfield mask = 0;
523 if(curColor)
524 {
525 mask |= eGL_COLOR_BUFFER_BIT;
526 }
527 if(curDepth)
528 {
529 mask |= eGL_DEPTH_BUFFER_BIT;
530 }
531 if(curStencil)
532 {
533 mask |= eGL_STENCIL_BUFFER_BIT;
534 }
535 return mask;
536}
537
538uint32_t getFramebufferColIndex(WrappedOpenGL *driver, ResourceId target)
539{

Callers 5

QueryNumFragmentsByEventFunction · 0.85

Calls 2

glGetIntegervMethod · 0.45

Tested by

no test coverage detected