rhi: gl: Map with write+invalidate

Presumably the equivalent of D3D11_MAP_WRITE_DISCARD.
Stating READ is pointless given reading is not possible with other
backends such as D3D11.

Task-number: QTBUG-125087
Pick-to: 6.8 6.7 6.6 6.5
Change-Id: I3c0aeb2a3669d4f8c279f7ace9a8a55e92988807
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2024-07-03 14:57:41 +02:00
parent c7d536a837
commit f52018e45f

View File

@ -364,6 +364,10 @@ QT_BEGIN_NAMESPACE
#define GL_MAP_WRITE_BIT 0x0002
#endif
#ifndef GL_MAP_INVALIDATE_BUFFER_BIT
#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
#endif
#ifndef GL_TEXTURE_2D_MULTISAMPLE
#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
#endif
@ -5344,7 +5348,7 @@ char *QGles2Buffer::beginFullDynamicBufferUpdateForCurrentFrame()
rhiD->f->glBindBuffer(targetForDataOps, buffer);
if (rhiD->caps.properMapBuffer) {
return static_cast<char *>(rhiD->f->glMapBufferRange(targetForDataOps, 0, nonZeroSize,
GL_MAP_READ_BIT | GL_MAP_WRITE_BIT));
GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT));
} else {
// Need some storage for the data, use the otherwise unused 'data' member.
if (data.isEmpty())