Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(767)

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 2336613002: glTexStorage requires sized formats, ensure that we're following that rule (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index e002d5101bab5a114a75f5ea8d0e219989d0a675..f4252d8eb31adf1fc07511dfd829f08fca6eec50 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -993,6 +993,7 @@ static bool allocate_and_populate_uncompressed_texture(const GrSurfaceDesc& desc
const GrGLCaps& caps,
GrGLenum target,
GrGLenum internalFormat,
+ GrGLenum sizedInternalFormat,
Brian Osman 2016/09/12 15:08:17 FWIW: Don't think we need to change allocate_and_p
bsalomon 2016/09/12 15:14:54 My only hesitation here is that calling this sized
GrGLenum externalFormat,
GrGLenum externalType,
const SkTArray<GrMipLevel>& texels,
@@ -1012,7 +1013,7 @@ static bool allocate_and_populate_uncompressed_texture(const GrSurfaceDesc& desc
GL_ALLOC_CALL(&interface,
TexStorage2D(target,
texels.count(),
- internalFormat,
+ sizedInternalFormat,
desc.fWidth, desc.fHeight));
GrGLenum error = check_alloc_error(desc, &interface);
if (error != GR_GL_NO_ERROR) {
@@ -1254,6 +1255,8 @@ bool GrGLGpu::uploadTexData(const GrSurfaceDesc& desc,
&externalFormat, &externalType)) {
return false;
}
+ GrGLenum sizedInternalFormat = this->glCaps().configSizedInternalFormat(desc.fConfig);
+
/*
* Check whether to allocate a temporary buffer for flipping y or
* because our srcData has extra bytes past each row. If so, we need
@@ -1356,9 +1359,9 @@ bool GrGLGpu::uploadTexData(const GrSurfaceDesc& desc,
0 == left && 0 == top &&
desc.fWidth == width && desc.fHeight == height) {
succeeded = allocate_and_populate_uncompressed_texture(desc, *interface, caps, target,
- internalFormat, externalFormat,
- externalType, texelsShallowCopy,
- width, height);
+ internalFormat, sizedInternalFormat,
+ externalFormat, externalType,
+ texelsShallowCopy, width, height);
} else {
if (swFlipY || glFlipY) {
top = desc.fHeight - (top + height);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698