// // Copyright 2018 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. //
// Context.inl.h: Defines inline functions of gl::Context class // Has to be included after libANGLE/Context.h when using one // of the defined functions
ANGLE_INLINE void MarkShaderStorageUsage(const Context *context)
{ for (size_t index : context->getStateCache().getActiveShaderStorageBufferIndices())
{
Buffer *buffer = context->getState().getIndexedShaderStorageBuffer(index).get(); if (buffer)
{
buffer->onDataChanged();
}
}
for (size_t index : context->getStateCache().getActiveImageUnitIndices())
{ const ImageUnit &imageUnit = context->getState().getImageUnit(index); const Texture *texture = imageUnit.texture.get(); if (texture)
{
texture->onStateChange(angle::SubjectMessage::ContentsChanged);
}
}
}
// Return true if the draw is a no-op, else return false. // If there is no active program for the vertex or fragment shader stages, the results of vertex // and fragment shader execution will respectively be undefined. However, this is not // an error. ANGLE will treat this as a no-op. // A no-op draw occurs if the count of vertices is less than the minimum required to // have a valid primitive for this mode (0 for points, 0-1 for lines, 0-2 for tris).
ANGLE_INLINE bool Context::noopDraw(PrimitiveMode mode, GLsizei count) const
{ if (!mStateCache.getCanDraw())
{ returntrue;
}
ANGLE_INLINE void Context::drawArrays(PrimitiveMode mode, GLint first, GLsizei count)
{ // No-op if count draws no primitives for given mode if (noopDraw(mode, count))
{
ANGLE_CONTEXT_TRY(mImplementation->handleNoopDrawEvent()); return;
}
ANGLE_INLINE void Context::drawElements(PrimitiveMode mode,
GLsizei count,
DrawElementsType type, constvoid *indices)
{ // No-op if count draws no primitives for given mode if (noopDraw(mode, count))
{
ANGLE_CONTEXT_TRY(mImplementation->handleNoopDrawEvent()); return;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.