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.7 6.6 6.5 Change-Id: I3c0aeb2a3669d4f8c279f7ace9a8a55e92988807 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit f52018e45ff19fd487e729321b6d2d1750f33a4a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
0a92c970b7
commit
d049d7cdba
@ -356,6 +356,10 @@ QT_BEGIN_NAMESPACE
|
|||||||
#define GL_MAP_WRITE_BIT 0x0002
|
#define GL_MAP_WRITE_BIT 0x0002
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef GL_MAP_INVALIDATE_BUFFER_BIT
|
||||||
|
#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef GL_TEXTURE_2D_MULTISAMPLE
|
#ifndef GL_TEXTURE_2D_MULTISAMPLE
|
||||||
#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
|
#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
|
||||||
#endif
|
#endif
|
||||||
@ -5328,7 +5332,7 @@ char *QGles2Buffer::beginFullDynamicBufferUpdateForCurrentFrame()
|
|||||||
rhiD->f->glBindBuffer(targetForDataOps, buffer);
|
rhiD->f->glBindBuffer(targetForDataOps, buffer);
|
||||||
if (rhiD->caps.properMapBuffer) {
|
if (rhiD->caps.properMapBuffer) {
|
||||||
return static_cast<char *>(rhiD->f->glMapBufferRange(targetForDataOps, 0, nonZeroSize,
|
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 {
|
} else {
|
||||||
// Need some storage for the data, use the otherwise unused 'data' member.
|
// Need some storage for the data, use the otherwise unused 'data' member.
|
||||||
if (data.isEmpty())
|
if (data.isEmpty())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user