зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1041830
- Backout bug 1030206. r=dglastonbury
This commit is contained in:
Родитель
7ccb47f35d
Коммит
7595c3de89
|
@ -2173,7 +2173,7 @@ WebGLContext::ReadPixels(GLint x, GLint y, GLsizei width,
|
|||
mBoundFramebuffer->ColorAttachmentCount() &&
|
||||
mBoundFramebuffer->ColorAttachment(0).IsDefined())
|
||||
{
|
||||
isSourceTypeFloat = mBoundFramebuffer->ColorAttachment(0).IsFloatType();
|
||||
isSourceTypeFloat = mBoundFramebuffer->ColorAttachment(0).IsReadableFloat();
|
||||
}
|
||||
|
||||
if (isReadTypeFloat != isSourceTypeFloat)
|
||||
|
|
|
@ -62,17 +62,14 @@ WebGLFramebuffer::Attachment::HasAlpha() const
|
|||
}
|
||||
|
||||
bool
|
||||
WebGLFramebuffer::Attachment::IsFloatType(FloatType floatType) const
|
||||
WebGLFramebuffer::Attachment::IsReadableFloat() const
|
||||
{
|
||||
if (Texture() && Texture()->HasImageInfoAt(mTexImageTarget, mTexImageLevel)) {
|
||||
GLenum type = Texture()->ImageInfoAt(mTexImageTarget, mTexImageLevel).WebGLType();
|
||||
switch (type) {
|
||||
case LOCAL_GL_FLOAT:
|
||||
return floatType == FloatType::Full ||
|
||||
floatType == FloatType::Any;
|
||||
case LOCAL_GL_HALF_FLOAT_OES:
|
||||
return floatType == FloatType::Half ||
|
||||
floatType == FloatType::Any;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -82,12 +79,9 @@ WebGLFramebuffer::Attachment::IsFloatType(FloatType floatType) const
|
|||
switch (format) {
|
||||
case LOCAL_GL_RGB16F:
|
||||
case LOCAL_GL_RGBA16F:
|
||||
return floatType == FloatType::Half ||
|
||||
floatType == FloatType::Any;
|
||||
case LOCAL_GL_RGB32F:
|
||||
case LOCAL_GL_RGBA32F:
|
||||
return floatType == FloatType::Full ||
|
||||
floatType == FloatType::Any;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -636,26 +630,6 @@ WebGLFramebuffer::HasIncompleteAttachments() const
|
|||
size_t count = mColorAttachments.Length();
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
hasIncomplete |= IsIncomplete(mColorAttachments[i]);
|
||||
|
||||
if (mColorAttachments[i].IsDefined()) {
|
||||
// Excerpt from http://www.khronos.org/registry/webgl/extensions/OES_texture_float/
|
||||
// New implementations should not implicitly support float rendering and
|
||||
// applications should be modified to explicitly enable WEBGL_color_buffer_float.
|
||||
if (mColorAttachments[i].IsFloatType(Attachment::FloatType::Full) &&
|
||||
!Context()->IsExtensionEnabled(WebGLExtensionID::WEBGL_color_buffer_float))
|
||||
{
|
||||
hasIncomplete |= true;
|
||||
}
|
||||
|
||||
// Excerpt from http://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/
|
||||
// New implementations should not implicitly support float rendering and
|
||||
// applications should be modified to explicitly enable OES_color_buffer_half_float.
|
||||
if (mColorAttachments[i].IsFloatType(Attachment::FloatType::Half) &&
|
||||
!Context()->IsExtensionEnabled(WebGLExtensionID::EXT_color_buffer_half_float))
|
||||
{
|
||||
hasIncomplete |= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hasIncomplete |= IsIncomplete(mDepthAttachment);
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "nsWrapperCache.h"
|
||||
|
||||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/TypedEnum.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -53,15 +52,7 @@ public:
|
|||
bool IsDeleteRequested() const;
|
||||
|
||||
bool HasAlpha() const;
|
||||
|
||||
// For IsFloatType()
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(FloatType)
|
||||
Any = 0,
|
||||
Half,
|
||||
Full
|
||||
MOZ_END_NESTED_ENUM_CLASS(FloatType)
|
||||
|
||||
bool IsFloatType(FloatType floatType = FloatType::Any) const;
|
||||
bool IsReadableFloat() const;
|
||||
|
||||
void SetTexImage(WebGLTexture* tex, GLenum target, GLint level);
|
||||
void SetRenderbuffer(WebGLRenderbuffer* rb);
|
||||
|
@ -205,8 +196,6 @@ private:
|
|||
mDepthStencilAttachment;
|
||||
};
|
||||
|
||||
MOZ_FINISH_NESTED_ENUM_CLASS(WebGLFramebuffer::Attachment::FloatType)
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче