зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1425488 - Reset last fenceId on write to buffers. - r=lenzak
MozReview-Commit-ID: HwPpGWKNA9W
This commit is contained in:
Родитель
c9146314e9
Коммит
93dacf53b5
|
@ -86,6 +86,8 @@ WebGL2Context::CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
|
|||
const ScopedLazyBind readBind(gl, readTarget, readBuffer);
|
||||
const ScopedLazyBind writeBind(gl, writeTarget, writeBuffer);
|
||||
gl->fCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
|
||||
|
||||
writeBuffer->ResetLastUpdateFenceId();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -132,16 +134,16 @@ WebGL2Context::GetBufferSubData(GLenum target, GLintptr srcByteOffset,
|
|||
case LOCAL_GL_STREAM_READ:
|
||||
case LOCAL_GL_DYNAMIC_READ:
|
||||
if (mCompletedFenceId < buffer->mLastUpdateFenceId) {
|
||||
GeneratePerfWarning("%s: Reading from a buffer without checking for previous"
|
||||
" command completion likely causes pipeline stalls."
|
||||
" Please use FenceSync.",
|
||||
funcName);
|
||||
GenerateWarning("%s: Reading from a buffer without checking for previous"
|
||||
" command completion likely causes pipeline stalls."
|
||||
" Please use FenceSync.",
|
||||
funcName);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
GeneratePerfWarning("%s: Reading from a buffer with usage other than *_READ"
|
||||
" causes pipeline stalls. Copy through a STREAM_READ buffer.",
|
||||
funcName);
|
||||
GenerateWarning("%s: Reading from a buffer with usage other than *_READ"
|
||||
" causes pipeline stalls. Copy through a STREAM_READ buffer.",
|
||||
funcName);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -166,6 +166,8 @@ WebGLBuffer::BufferData(GLenum target, size_t size, const void* data, GLenum usa
|
|||
mIndexRanges.clear();
|
||||
}
|
||||
}
|
||||
|
||||
ResetLastUpdateFenceId();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -197,6 +199,8 @@ WebGLBuffer::BufferSubData(GLenum target, size_t dstByteOffset, size_t dataLen,
|
|||
const ScopedLazyBind lazyBind(gl, target, this);
|
||||
|
||||
gl->fBufferSubData(target, dstByteOffset, dataLen, uploadData);
|
||||
|
||||
ResetLastUpdateFenceId();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -409,6 +413,12 @@ WebGLBuffer::ValidateCanBindToTarget(const char* funcName, GLenum target)
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
WebGLBuffer::ResetLastUpdateFenceId() const
|
||||
{
|
||||
mLastUpdateFenceId = mContext->mNextFenceId;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
WebGLBuffer::WrapObject(JSContext* cx, JS::Handle<JSObject*> givenProto)
|
||||
{
|
||||
|
|
|
@ -105,7 +105,7 @@ protected:
|
|||
size_t mByteLength;
|
||||
size_t mTFBindCount;
|
||||
size_t mNonTFBindCount;
|
||||
uint64_t mLastUpdateFenceId = 0;
|
||||
mutable uint64_t mLastUpdateFenceId = 0;
|
||||
|
||||
struct IndexRange final {
|
||||
GLenum type;
|
||||
|
@ -128,6 +128,8 @@ protected:
|
|||
|
||||
public:
|
||||
CacheMapInvalidator mFetchInvalidator;
|
||||
|
||||
void ResetLastUpdateFenceId() const;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -337,6 +337,10 @@ public:
|
|||
*out_error = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Technically we don't know that this will be updated yet, but we can
|
||||
// speculatively mark it.
|
||||
buffer->ResetLastUpdateFenceId();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1423,6 +1423,8 @@ WebGLContext::ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum
|
|||
const ScopedLazyBind lazyBind(gl, LOCAL_GL_PIXEL_PACK_BUFFER, buffer);
|
||||
|
||||
ReadPixelsImpl(x, y, width, height, format, type, (void*)offset, bytesAfterOffset);
|
||||
|
||||
buffer->ResetLastUpdateFenceId();
|
||||
}
|
||||
|
||||
static webgl::PackingInfo
|
||||
|
|
Загрузка…
Ссылка в новой задаче