OSDN Git Service

Fix texture upload and internalformat handling.
authorNicolas Capens <capn@google.com>
Fri, 23 Feb 2018 01:14:07 +0000 (20:14 -0500)
committerNicolas Capens <nicolascapens@google.com>
Mon, 26 Feb 2018 17:40:12 +0000 (17:40 +0000)
commit3b4a25c5365486981157f8ba9a2aee539c162a0d
tree8fd0db788df299fed6f1b6663898b47ce9342d24
parent9e8bfcafec59e28fe4581cfaa3de0351044f98da
Fix texture upload and internalformat handling.

We weren't handling several of the format/type/internalformat combos
from table 3.2 of the OpenGL ES 3.0.5 spec. In particular those where
the format/type of a glTexSubImage2D() call can be used to update
images with an internal format not directly corresponding to it. Some
of these cases were handled using the blitter, but not all GL formats
have a SwiftShader equivalent. Also, the blitter is slower than
specialized C++ pixel transfer code, and the blitter's fallback path is
even slower.

This patch provides specialized pixel rectangle transfer code for each
combination of formats. We also now only store the effective sized
internal format of the images. Validation also happens using the sized
internal format wherever feasible, instead of unsized formats or
SwiftShader formats.

Change-Id: Id55db490002ab8fc2f16f766c43b43f121e5768e
Reviewed-on: https://swiftshader-review.googlesource.com/17429
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
31 files changed:
src/OpenGL/common/Image.cpp
src/OpenGL/common/Image.hpp
src/OpenGL/common/Surface.hpp
src/OpenGL/libEGL/Surface.cpp
src/OpenGL/libEGL/Surface.hpp
src/OpenGL/libGL/Texture.cpp
src/OpenGL/libGLES_CM/Context.cpp
src/OpenGL/libGLES_CM/Device.cpp
src/OpenGL/libGLES_CM/Device.hpp
src/OpenGL/libGLES_CM/Framebuffer.cpp
src/OpenGL/libGLES_CM/Renderbuffer.cpp
src/OpenGL/libGLES_CM/Renderbuffer.h
src/OpenGL/libGLES_CM/Texture.cpp
src/OpenGL/libGLES_CM/Texture.h
src/OpenGL/libGLES_CM/libGLES_CM.cpp
src/OpenGL/libGLES_CM/utilities.cpp
src/OpenGL/libGLES_CM/utilities.h
src/OpenGL/libGLESv2/Context.cpp
src/OpenGL/libGLESv2/Context.h
src/OpenGL/libGLESv2/Device.cpp
src/OpenGL/libGLESv2/Device.hpp
src/OpenGL/libGLESv2/Framebuffer.cpp
src/OpenGL/libGLESv2/Renderbuffer.cpp
src/OpenGL/libGLESv2/Renderbuffer.h
src/OpenGL/libGLESv2/Texture.cpp
src/OpenGL/libGLESv2/Texture.h
src/OpenGL/libGLESv2/libGLESv2.cpp
src/OpenGL/libGLESv2/libGLESv3.cpp
src/OpenGL/libGLESv2/utilities.cpp
src/OpenGL/libGLESv2/utilities.h
src/Renderer/Blitter.cpp