summaryrefslogtreecommitdiffstats
path: root/tools/gfx/open-gl/render-gl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/open-gl/render-gl.cpp')
-rw-r--r--tools/gfx/open-gl/render-gl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/gfx/open-gl/render-gl.cpp b/tools/gfx/open-gl/render-gl.cpp
index 0cf05e665..7daf577ef 100644
--- a/tools/gfx/open-gl/render-gl.cpp
+++ b/tools/gfx/open-gl/render-gl.cpp
@@ -2246,9 +2246,10 @@ SLANG_NO_THROW Result SLANG_MCALL GLDevice::readTextureResource(
if (outPixelSize)
*outPixelSize = sizeof(uint32_t);
- RefPtr<ListBlob> blob = new ListBlob();
- blob->m_data.setCount(requiredSize);
- auto buffer = blob->m_data.begin();
+ List<uint8_t> blobData;
+
+ blobData.setCount(requiredSize);
+ auto buffer = blobData.begin();
glBindTexture(resource->m_target, resource->m_handle);
glGetTexImage(resource->m_target, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
@@ -2263,8 +2264,8 @@ SLANG_NO_THROW Result SLANG_MCALL GLDevice::readTextureResource(
}
}
+ auto blob = ListBlob::moveCreate(blobData);
returnComPtr(outBlob, blob);
-
return SLANG_OK;
}