Skip to content

Commit

Permalink
GL3Plus: remove commented out code for image bind
Browse files Browse the repository at this point in the history
already implemented
  • Loading branch information
paroj committed Sep 3, 2024
1 parent d314141 commit f4ada46
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 58 deletions.
2 changes: 0 additions & 2 deletions RenderSystems/GL3Plus/include/OgreGL3PlusTextureManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ namespace Ogre {
/// @copydoc TextureManager::getNativeFormat
PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage) override;

// void bindImages();

/* TexturePtr createManual(const String & name, const String& group, */
/* TextureType texType, uint width, uint height, uint depth, int numMipmaps, */
/* PixelFormat format, int usage, ManualResourceLoader* loader, bool hwGamma, */
Expand Down
4 changes: 0 additions & 4 deletions RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1650,10 +1650,6 @@ namespace Ogre {

// Pass on parameters from params to program object uniforms.
program->updateUniforms(params, mask, gptype);

// FIXME This needs to be moved somewhere texture specific.
// Update image bindings for image load/store
// static_cast<GL3PlusTextureManager*>(mTextureManager)->bindImages();
}

void GL3PlusRenderSystem::beginProfileEvent( const String &eventName )
Expand Down
23 changes: 0 additions & 23 deletions RenderSystems/GL3Plus/src/OgreGL3PlusTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,29 +383,6 @@ namespace Ogre {

// TODO
// * add memory barrier
// * material script access (can have multiple instances for a single texture_unit)
// shader_access <binding point> [<access>] [<mipmap level>] [<texture array layer>] [<format>]
// shader_access 2 read_write 0 0 PF_UINT32_R
// binding point - location to bind for shader access; for OpenGL this must be unique and is not related to texture binding point
// access - give the shader read, write, or read_write privileges [default read_write]
// mipmap level - texture mipmap level to use [default 0]
// texture array layer - layer of texture array to use: 'all', or layer number (if not layered, just use 0) [default 0]
// format - texture format to be read in shader; for OpenGL this may be different than bound texture format - not sure about DX11 [default same format as texture]
// Note that for OpenGL the shader access (image) binding point
// must be specified, it is NOT the same as the texture binding point,
// and it must be unique among textures in this pass.
// * enforce binding point uniqueness by checking against
// image binding point allocation list in GL3PlusTextureManager
// * generalize for other render systems by introducing vitual method in Texture
// for (image in mImages)
// {
// OGRE_CHECK_GL_ERROR(
// glBindImageTexture(
// mImageBind, mTextureID,
// mMipmapLevel,
// mLayered.find('all') != str::npos ? GL_TRUE : GL_FALSE, mLayer,
// mImageAccess (READ, WRITE, READ_WRITE),
// toImageFormat(mFormatInShader))); //GL_RGBA8)); //GL_R32UI)); GL_READ_WRITE
if (mRenderSystem->hasMinGLVersion(4, 2) || mRenderSystem->checkExtension("GL_ARB_shader_image_load_store"))
{
OGRE_CHECK_GL_ERROR(glBindImageTexture(bindPoint, mTextureID, mipmapLevel, isArrayTexture, textureArrayIndex, GlAccess, GlFormat));
Expand Down
29 changes: 0 additions & 29 deletions RenderSystems/GL3Plus/src/OgreGL3PlusTextureManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,33 +245,4 @@ namespace Ogre {
// Supported
return format;
}

// void GL3PlusTextureManager::registerImage(TexturePtr texture)
// {
// mImages.push_back(texture);
// }

//FIXME Should this become a standard Texture class feature?
// void GL3PlusTextureManager::bindImages()
// {
// //FIXME currently produces a GL_INVALID_OPERATION, so temporarily run once
// // static bool images_bound = false;

// TexturePtrList::iterator texture = mImages.begin();
// TexturePtrList::iterator end = mImages.end();

// // if (!images_bound && !mImages.empty()) {
// for (; texture != end; texture++)
// {
// //std::cout << "IMAGE LOAD/STORE" << std::endl;
// GL3PlusTexturePtr tex = texture->staticCast<GL3PlusTexture>();
// //TODO This needs to be redone so that:
// // * binding point (first parameter) and possibly other parameters come from shader
// // * simple conversion of shader format to GLenum format
// // * material scripts can create images
// //OGRE_CHECK_GL_ERROR(glBindImageTexture(0, tex->getGLID(), 0, GL_FALSE, 0, GL_READ_WRITE, GL_RGBA8));
// }
// // images_bound = true;
// // }
// }
}

0 comments on commit f4ada46

Please sign in to comment.