Descriptorize Texture

This patch introduces texture descriptor for texture creation instead
of texture builders.

This patch also adds "arrayLayer" to texture descriptor and removes
mDevice in TextureD3D12.
This commit is contained in:
Jiawei Shao
2018-08-27 08:44:48 +08:00
committed by Corentin Wallez
parent 75559bf1be
commit 425428f97b
46 changed files with 300 additions and 341 deletions

View File

@@ -13,6 +13,7 @@
// limitations under the License.
#include "dawn_native/opengl/TextureGL.h"
#include "dawn_native/opengl/DeviceGL.h"
#include "common/Assert.h"
@@ -67,11 +68,12 @@ namespace dawn_native { namespace opengl {
// Texture
Texture::Texture(TextureBuilder* builder) : Texture(builder, GenTexture()) {
Texture::Texture(Device* device, const TextureDescriptor* descriptor)
: Texture(device, descriptor, GenTexture()) {
}
Texture::Texture(TextureBuilder* builder, GLuint handle)
: TextureBase(builder), mHandle(handle) {
Texture::Texture(Device* device, const TextureDescriptor* descriptor, GLuint handle)
: TextureBase(device, descriptor), mHandle(handle) {
mTarget = TargetForDimension(GetDimension());
uint32_t width = GetWidth();