rhi: gl: Clean up UNPACK_ROW_LENGTH handling
Be consistent and do not attempt to set GL_UNPACK_ROW_LENGTH on GLES 2.0. Have an appropriate flag in caps. Task-number: QTBUG-120565 Change-Id: I7b4db49480c2225b11807681d9bc77d2f2615e30 Reviewed-by: Andy Nichols <andy.nichols@qt.io>bb10
parent
124e7d896b
commit
f8786a8673
|
|
@ -1096,6 +1096,8 @@ bool QRhiGles2::create(QRhi::Flags flags)
|
|||
caps.glesMultiviewMultisampleRenderToTexture = false;
|
||||
}
|
||||
|
||||
caps.unpackRowLength = !caps.gles || caps.ctxMajor >= 3;
|
||||
|
||||
nativeHandlesStruct.context = ctx;
|
||||
|
||||
contextLost = false;
|
||||
|
|
@ -1426,7 +1428,7 @@ bool QRhiGles2::isFeatureSupported(QRhi::Feature feature) const
|
|||
case QRhi::PipelineCacheDataLoadSave:
|
||||
return caps.programBinary;
|
||||
case QRhi::ImageDataStride:
|
||||
return !caps.gles || caps.ctxMajor >= 3;
|
||||
return caps.unpackRowLength;
|
||||
case QRhi::RenderBufferImport:
|
||||
return true;
|
||||
case QRhi::ThreeDimensionalTextures:
|
||||
|
|
@ -2363,7 +2365,7 @@ void QRhiGles2::enqueueSubresUpload(QGles2Texture *texD, QGles2CommandBuffer *cb
|
|||
dataStride = bytesPerLine;
|
||||
|
||||
cmd.args.subImage.rowStartAlign = (dataStride & 3) ? 1 : 4;
|
||||
cmd.args.subImage.rowLength = bytesPerPixel ? dataStride / bytesPerPixel : 0;
|
||||
cmd.args.subImage.rowLength = caps.unpackRowLength ? (bytesPerPixel ? dataStride / bytesPerPixel : 0) : 0;
|
||||
|
||||
cmd.args.subImage.data = data;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1014,7 +1014,10 @@ public:
|
|||
halfAttributes(false),
|
||||
multiView(false),
|
||||
timestamps(false),
|
||||
objectLabel(false)
|
||||
objectLabel(false),
|
||||
glesMultisampleRenderToTexture(false),
|
||||
glesMultiviewMultisampleRenderToTexture(false),
|
||||
unpackRowLength(false)
|
||||
{ }
|
||||
int ctxMajor;
|
||||
int ctxMinor;
|
||||
|
|
@ -1073,6 +1076,7 @@ public:
|
|||
uint objectLabel : 1;
|
||||
uint glesMultisampleRenderToTexture : 1;
|
||||
uint glesMultiviewMultisampleRenderToTexture : 1;
|
||||
uint unpackRowLength : 1;
|
||||
} caps;
|
||||
QGles2SwapChain *currentSwapChain = nullptr;
|
||||
QSet<GLint> supportedCompressedFormats;
|
||||
|
|
|
|||
Loading…
Reference in New Issue