Commit d68248be by Jamie Madill Committed by Commit Bot

Update Texture dirty bits documentation.

BUG=angleproject:1387 Change-Id: Ie2277874acb9e7a3eed4bce327f2c08750213967 Reviewed-on: https://chromium-review.googlesource.com/660419Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 265a6d43
......@@ -2968,13 +2968,14 @@ void Program::updateSamplerUniform(const VariableLocation &locationInfo,
GLsizei clampedCount,
const GLint *v)
{
// Invalidate the validation cache only if we modify the sampler data.
ASSERT(mState.isSamplerUniformIndex(locationInfo.index));
GLuint samplerIndex = mState.getSamplerIndexFromUniformIndex(locationInfo.index);
std::vector<GLuint> *boundTextureUnits =
&mState.mSamplerBindings[samplerIndex].boundTextureUnits;
std::copy(v, v + clampedCount, boundTextureUnits->begin() + locationInfo.element);
// Invalidate the validation cache.
mCachedValidateSamplersResult.reset();
}
......
......@@ -536,6 +536,18 @@ class State : public OnAttachmentDirtyReceiver, angle::NonCopyable
typedef std::map<GLenum, TextureBindingVector> TextureBindingMap;
TextureBindingMap mSamplerTextures;
// Texture Completeness Caching
// ----------------------------
// The texture completeness cache uses dirty bits to avoid having to scan the list
// of textures each draw call. This gl::State class implements OnAttachmentDirtyReceiver,
// and keeps an array of bindings to the Texture class. When the Textures are marked dirty,
// they send messages to the State class (and any Framebuffers they're attached to) via the
// State::signal method (see above). Internally this then invalidates the completeness cache.
//
// Note this requires that we also invalidate the completeness cache manually on events like
// re-binding textures/samplers or a change in the program. For more information see the
// signal_utils.h header and the design doc linked there.
// A cache of complete textures. nullptr indicates unbound or incomplete.
// Don't use BindingPointer because this cache is only valid within a draw call.
// Also stores a notification channel to the texture itself to handle texture change events.
......
......@@ -6,6 +6,8 @@
// signal_utils:
// Helper classes for tracking dependent state changes between objects.
// These changes are signaled to the dependent class via channels.
// See design document:
// https://docs.google.com/document/d/15Edfotqg6_l1skTEL8ADQudF_oIdNa7i8Po43k6jMd4/
#ifndef LIBANGLE_SIGNAL_UTILS_H_
#define LIBANGLE_SIGNAL_UTILS_H_
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment