summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-08-26 21:13:55 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-08-26 21:13:55 +0000
commit71f1ad60962386b6dc3e6dd6f1a7da598ce63965 (patch)
tree907d1d70fffc0da2bcca933c9bc065ccb7e962e6 /Graphics/GraphicsEngineOpenGL
parentAdded comment (diff)
downloadDiligentCore-71f1ad60962386b6dc3e6dd6f1a7da598ce63965.tar.gz
DiligentCore-71f1ad60962386b6dc3e6dd6f1a7da598ce63965.zip
Implemented raw buffers (fixed https://github.com/DiligentGraphics/DiligentCore/issues/18).
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/BufferViewGLImpl.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/Texture2DArray_OGL.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/Texture2D_OGL.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/Texture3D_OGL.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/TextureCubeArray_OGL.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/TextureCube_OGL.cpp2
6 files changed, 6 insertions, 6 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/src/BufferViewGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/BufferViewGLImpl.cpp
index 51e2e2e1..fc2022b6 100644
--- a/Graphics/GraphicsEngineOpenGL/src/BufferViewGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/BufferViewGLImpl.cpp
@@ -57,7 +57,7 @@ namespace Diligent
m_GLTexBuffer.Create();
ContextState.BindTexture(-1, GL_TEXTURE_BUFFER, m_GLTexBuffer );
- const auto &BuffFmt = pBuffer->GetDesc().Format;
+ const auto &BuffFmt = ViewDesc.Format;
VERIFY_EXPR(BuffFmt.ValueType != VT_UNDEFINED);
auto GLFormat = TypeToGLTexFormat( BuffFmt.ValueType, BuffFmt.NumComponents, BuffFmt.IsNormalized );
glTexBuffer( GL_TEXTURE_BUFFER, GLFormat, pBuffer->GetGLHandle() );
diff --git a/Graphics/GraphicsEngineOpenGL/src/Texture2DArray_OGL.cpp b/Graphics/GraphicsEngineOpenGL/src/Texture2DArray_OGL.cpp
index 8c943e62..efa485dc 100644
--- a/Graphics/GraphicsEngineOpenGL/src/Texture2DArray_OGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/Texture2DArray_OGL.cpp
@@ -179,7 +179,7 @@ void Texture2DArray_OGL::UpdateData(IDeviceContext *pContext, Uint32 MipLevel, U
else
{
const auto TexFmtInfo = GetTextureFormatAttribs(m_Desc.Format);
- const auto PixelSize = TexFmtInfo.NumComponents * TexFmtInfo.ComponentSize;
+ const auto PixelSize = Uint32{TexFmtInfo.NumComponents} * Uint32{TexFmtInfo.ComponentSize};
VERIFY( (SubresData.Stride % PixelSize)==0, "Data stride is not multiple of pixel size" );
glPixelStorei(GL_UNPACK_ROW_LENGTH, SubresData.Stride / PixelSize);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
diff --git a/Graphics/GraphicsEngineOpenGL/src/Texture2D_OGL.cpp b/Graphics/GraphicsEngineOpenGL/src/Texture2D_OGL.cpp
index 0d448ca5..d6bfaa50 100644
--- a/Graphics/GraphicsEngineOpenGL/src/Texture2D_OGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/Texture2D_OGL.cpp
@@ -179,7 +179,7 @@ void Texture2D_OGL::UpdateData( IDeviceContext *pContext, Uint32 MipLevel, Uint3
else
{
const auto& TexFmtInfo = GetTextureFormatAttribs(m_Desc.Format);
- const auto PixelSize = TexFmtInfo.NumComponents * TexFmtInfo.ComponentSize;
+ const auto PixelSize = Uint32{TexFmtInfo.NumComponents} * Uint32{TexFmtInfo.ComponentSize};
VERIFY( (SubresData.Stride % PixelSize)==0, "Data stride is not multiple of pixel size" );
glPixelStorei(GL_UNPACK_ROW_LENGTH, SubresData.Stride / PixelSize);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
diff --git a/Graphics/GraphicsEngineOpenGL/src/Texture3D_OGL.cpp b/Graphics/GraphicsEngineOpenGL/src/Texture3D_OGL.cpp
index 064a365b..51b52c88 100644
--- a/Graphics/GraphicsEngineOpenGL/src/Texture3D_OGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/Texture3D_OGL.cpp
@@ -129,7 +129,7 @@ void Texture3D_OGL::UpdateData( IDeviceContext *pContext, Uint32 MipLevel, Uint3
glPixelStorei(GL_UNPACK_SKIP_IMAGES, 0);
const auto TexFmtInfo = GetTextureFormatAttribs(m_Desc.Format);
- const auto PixelSize = TexFmtInfo.NumComponents * TexFmtInfo.ComponentSize;
+ const auto PixelSize = Uint32{TexFmtInfo.NumComponents} * Uint32{TexFmtInfo.ComponentSize};
VERIFY( (SubresData.Stride % PixelSize)==0, "Data stride is not multiple of pixel size" );
glPixelStorei(GL_UNPACK_ROW_LENGTH, SubresData.Stride / PixelSize);
diff --git a/Graphics/GraphicsEngineOpenGL/src/TextureCubeArray_OGL.cpp b/Graphics/GraphicsEngineOpenGL/src/TextureCubeArray_OGL.cpp
index 25f6d9fb..945b137d 100644
--- a/Graphics/GraphicsEngineOpenGL/src/TextureCubeArray_OGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/TextureCubeArray_OGL.cpp
@@ -167,7 +167,7 @@ void TextureCubeArray_OGL::UpdateData( IDeviceContext *pContext, Uint32 MipLevel
else
{
const auto TexFmtInfo = GetTextureFormatAttribs(m_Desc.Format);
- const auto PixelSize = TexFmtInfo.NumComponents * TexFmtInfo.ComponentSize;
+ const auto PixelSize = Uint32{TexFmtInfo.NumComponents} * Uint32{TexFmtInfo.ComponentSize};
VERIFY( (SubresData.Stride % PixelSize)==0, "Data stride is not multiple of pixel size" );
glPixelStorei(GL_UNPACK_ROW_LENGTH, SubresData.Stride / PixelSize);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
diff --git a/Graphics/GraphicsEngineOpenGL/src/TextureCube_OGL.cpp b/Graphics/GraphicsEngineOpenGL/src/TextureCube_OGL.cpp
index 50103afc..52414776 100644
--- a/Graphics/GraphicsEngineOpenGL/src/TextureCube_OGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/TextureCube_OGL.cpp
@@ -180,7 +180,7 @@ void TextureCube_OGL::UpdateData( IDeviceContext *pContext, Uint32 MipLevel, Uin
else
{
const auto& TexFmtInfo = GetTextureFormatAttribs(m_Desc.Format);
- const auto PixelSize = TexFmtInfo.NumComponents * TexFmtInfo.ComponentSize;
+ const auto PixelSize = Uint32{TexFmtInfo.NumComponents} * Uint32{TexFmtInfo.ComponentSize};
VERIFY( (SubresData.Stride % PixelSize)==0, "Data stride is not multiple of pixel size" );
glPixelStorei(GL_UNPACK_ROW_LENGTH, SubresData.Stride / PixelSize);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);