summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-11-25 04:31:42 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-11-25 04:31:42 +0000
commit17b24246757390d29be93ce3447745e7b4936f5a (patch)
tree7c0ad81014bd2c61debf7f3b4c89c445eab73beb /Graphics/GraphicsEngineOpenGL
parentUpdated parameter order of IDeviceContext::CopyBuffer (diff)
downloadDiligentCore-17b24246757390d29be93ce3447745e7b4936f5a.tar.gz
DiligentCore-17b24246757390d29be93ce3447745e7b4936f5a.zip
Renamed/moved ITexture::Map() to IDeviceContext::MapTextureSubresource()
Renamed/moved ITexture::Unmap() to IDeviceContext::UnmapTextureSubresource()
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h10
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/TextureBaseGL.h10
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp6
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp20
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp19
5 files changed, 33 insertions, 32 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
index 71c196e9..8741bf47 100644
--- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
@@ -95,6 +95,16 @@ public:
Uint32 DstY,
Uint32 DstZ)override final;
+ virtual void MapTextureSubresource( ITexture* pTexture,
+ Uint32 MipLevel,
+ Uint32 ArraySlice,
+ MAP_TYPE MapType,
+ Uint32 MapFlags,
+ const Box* pMapRegion,
+ MappedTextureSubresource& MappedData )override final;
+
+
+ virtual void UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice)override final;
virtual void FinishFrame()override final;
diff --git a/Graphics/GraphicsEngineOpenGL/include/TextureBaseGL.h b/Graphics/GraphicsEngineOpenGL/include/TextureBaseGL.h
index 63ad8e02..934e0c8e 100644
--- a/Graphics/GraphicsEngineOpenGL/include/TextureBaseGL.h
+++ b/Graphics/GraphicsEngineOpenGL/include/TextureBaseGL.h
@@ -64,16 +64,6 @@ public:
virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface )override;
- //virtual void CopyData(CTexture *pSrcTexture, Uint32 SrcOffset, Uint32 DstOffset, Uint32 Size);
- virtual void Map(IDeviceContext* pContext,
- Uint32 MipLevel,
- Uint32 ArraySlice,
- MAP_TYPE MapType,
- Uint32 MapFlags,
- const Box* pMapRegion,
- MappedTextureSubresource& MappedData)override;
- virtual void Unmap(IDeviceContext *pContext, Uint32 MipLevel, Uint32 ArraySlice)override;
-
const GLObjectWrappers::GLTextureObj& GetGLHandle()const{ return m_GlTexture; }
virtual GLenum GetBindTarget()const override final{return m_BindTarget;}
GLenum GetGLTexFormat()const{ return m_GLTexFormat; }
diff --git a/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp
index ed9cfed5..20de77fb 100644
--- a/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/BufferGLImpl.cpp
@@ -316,13 +316,13 @@ void BufferGLImpl::Unmap( IDeviceContext *pContext, MAP_TYPE MapType, Uint32 Map
glBindBuffer(m_uiMapTarget, m_GlBuffer);
auto Result = glUnmapBuffer(m_uiMapTarget);
- // glUnmapBuffer() returns TRUE unless data values in the buffer�s data store have
+ // glUnmapBuffer() returns TRUE unless data values in the buffer's data store have
// become corrupted during the period that the buffer was mapped. Such corruption
// can be the result of a screen resolution change or other window system - dependent
// event that causes system heaps such as those for high - performance graphics memory
// to be discarded. GL implementations must guarantee that such corruption can
- // occur only during the periods that a buffer�s data store is mapped. If such corruption
- // has occurred, glUnmapBuffer() returns FALSE, and the contents of the buffer�s
+ // occur only during the periods that a buffer's data store is mapped. If such corruption
+ // has occurred, glUnmapBuffer() returns FALSE, and the contents of the buffer's
// data store become undefined.
VERIFY( Result != GL_FALSE, "Failed to unmap buffer. The data may have been corrupted" );
glBindBuffer(m_uiMapTarget, 0);
diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
index 3c69d7c0..fee3867c 100644
--- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
@@ -1053,6 +1053,26 @@ namespace Diligent
pDstTexGL->CopyData(this, pSrcTexGL, SrcMipLevel, SrcSlice, pSrcBox, DstMipLevel, DstSlice, DstX, DstY, DstZ);
}
+ void DeviceContextGLImpl::MapTextureSubresource( ITexture* pTexture,
+ Uint32 MipLevel,
+ Uint32 ArraySlice,
+ MAP_TYPE MapType,
+ Uint32 MapFlags,
+ const Box* pMapRegion,
+ MappedTextureSubresource& MappedData )
+ {
+ TDeviceContextBase::MapTextureSubresource(pTexture, MipLevel, ArraySlice, MapType, MapFlags, pMapRegion, MappedData);
+ LOG_ERROR_MESSAGE("Texture mapping is not supported in OpenGL");
+ MappedData = MappedTextureSubresource{};
+ }
+
+
+ void DeviceContextGLImpl::UnmapTextureSubresource(ITexture* pTexture, Uint32 MipLevel, Uint32 ArraySlice)
+ {
+ TDeviceContextBase::UnmapTextureSubresource( pTexture, MipLevel, ArraySlice);
+ LOG_ERROR_MESSAGE("Texture mapping is not supported in OpenGL");
+ }
+
void DeviceContextGLImpl::TransitionResourceStates(Uint32 BarrierCount, StateTransitionDesc* pResourceBarriers)
{
diff --git a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp
index 5509aa2c..29ccab1a 100644
--- a/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/TextureBaseGL.cpp
@@ -487,25 +487,6 @@ void TextureBaseGL :: CopyData(DeviceContextGLImpl *pDeviceCtxGL,
}
-void TextureBaseGL :: Map(IDeviceContext* pContext,
- Uint32 MipLevel,
- Uint32 ArraySlice,
- MAP_TYPE MapType,
- Uint32 MapFlags,
- const Box* pMapRegion,
- MappedTextureSubresource& MappedData)
-{
- TTextureBase::Map(pContext, MipLevel, ArraySlice, MapType, MapFlags, pMapRegion, MappedData);
- LOG_ERROR_MESSAGE("Texture mapping is not supported in OpenGL");
- MappedData = MappedTextureSubresource{};
-}
-
-void TextureBaseGL::Unmap(IDeviceContext* pContext, Uint32 MipLevel, Uint32 ArraySlice)
-{
- TTextureBase::Unmap(pContext, MipLevel, ArraySlice);
- LOG_ERROR_MESSAGE("Texture mapping is not supported in OpenGL");
-}
-
void TextureBaseGL::TextureMemoryBarrier( Uint32 RequiredBarriers, GLContextState &GLContextState )
{
#if GL_ARB_shader_image_load_store