Jump to content
  • Advertisement

svyatoslav.toder

Member
  • Content Count

    5
  • Joined

  • Last visited

Everything posted by svyatoslav.toder

  1. svyatoslav.toder

    GPU memory management

    I've narrowed it down to this part of code. 4 FullHD windows take around 100MiB, and CodeXL can only see few static buffers, that take much less.   [source] PIXELFORMATDESCRIPTOR pixelFormat; int format; deviceContextHandle = GetDC(windowHandle); ZeroMemory(&pixelFormat, sizeof(pixelFormat)); pixelFormat.nSize = sizeof(pixelFormat); pixelFormat.nVersion = 1; pixelFormat.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; pixelFormat.iPixelType = PFD_TYPE_RGBA; pixelFormat.cColorBits = 24; pixelFormat.cDepthBits = 16; pixelFormat.iLayerType = PFD_MAIN_PLANE; format = ChoosePixelFormat(deviceContextHandle, &pixelFormat); SetPixelFormat(deviceContextHandle, format, &pixelFormat); if (renderContextHandle == NULL) renderContextHandle = wglCreateContext(deviceContextHandle); wglMakeCurrent(deviceContextHandle, renderContextHandle); PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT"); if (wglSwapIntervalEXT) wglSwapIntervalEXT(0); GLenum glewinit = glewInit(); glDisable(GL_LIGHTING); glShadeModel(GL_SMOOTH);   wglMakeCurrent(deviceContextHandle, renderContextHandle); SwapBuffers(deviceContextHandle); [/source]   UPD: So, now the question sounds like "what sort of data is bound to each device context? And why CodeXL/gDEBugger do not see it?"
  2. svyatoslav.toder

    GPU memory management

    I am using textures as a buffer to minimize GPU load. gDEBugger shows that around 40-60MiB is consumed, but gpu-z shows that memory consumption increases from ~128MiB to ~256MiB and then we get a GL_OUT_OF_MEMORY on 256MiB video cards. There is only one rendering context and few device contexts, but this happens even if there is only one device context. Textures are created in a following way: glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, textureWidth, textureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); //GL_OUT_OF_MEMORY here and bound to framebuffer: glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texture, 0); Texture sizes are a power of two.   Why does memory consumption increases more then two times?
  3. svyatoslav.toder

    GPU memory management

    I didn't do anything with depth attachments explicitly, could it be created implicitly?
  4. svyatoslav.toder

    GPU memory management

    There are around 10-15 FBO's. Do I understand correctly, that FBO itself will consume less then 1KiB of memory? I only attach single GL_COLOR_ATTACHMENT0_EXT to each FBO.
  5. svyatoslav.toder

    GPU memory management

    I've seen GL_OUT_OF_MEMORY on NVidia QUADRO (do not remember exact model), but it also appears on HD Graphics 4600 (memory usage increases from ~100MiB to ~280MiB, when gDEBugger shows ~90MiB)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!