MCPcopy Create free account
hub / github.com/OGRECave/ogre / createShaderAccessPoint

Method createShaderAccessPoint

RenderSystems/GL3Plus/src/OgreGL3PlusTexture.cpp:350–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348 }
349
350 void GL3PlusTexture::createShaderAccessPoint(uint bindPoint, TextureAccess access,
351 int mipmapLevel, int textureArrayIndex,
352 PixelFormat format)
353 {
354 GLenum GlAccess = 0;
355
356 switch (access)
357 {
358 case TA_READ:
359 GlAccess = GL_READ_ONLY;
360 break;
361 case TA_WRITE:
362 GlAccess = GL_WRITE_ONLY;
363 break;
364 case TA_READ_WRITE:
365 GlAccess = GL_READ_WRITE;
366 break;
367 }
368
369 if (format == PF_UNKNOWN) format = mFormat;
370 GLenum GlFormat = GL3PlusPixelUtil::getClosestGLImageInternalFormat(format);
371 GLboolean isArrayTexture = mTextureType == TEX_TYPE_2D_ARRAY;
372
373 // TODO
374 // * add memory barrier
375 if (mRenderSystem->hasMinGLVersion(4, 2) || mRenderSystem->checkExtension("GL_ARB_shader_image_load_store"))
376 {
377 OGRE_CHECK_GL_ERROR(glBindImageTexture(bindPoint, mTextureID, mipmapLevel, isArrayTexture, textureArrayIndex, GlAccess, GlFormat));
378 }
379 }
380
381
382}

Callers 1

Calls 2

hasMinGLVersionMethod · 0.80
checkExtensionMethod · 0.80

Tested by

no test coverage detected