mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 23:26:24 +00:00
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:
committed by
Corentin Wallez
parent
75559bf1be
commit
425428f97b
@@ -136,13 +136,16 @@ dawn::SwapChain GetSwapChain(const dawn::Device &device) {
|
||||
}
|
||||
|
||||
dawn::TextureView CreateDefaultDepthStencilView(const dawn::Device& device) {
|
||||
auto depthStencilTexture = device.CreateTextureBuilder()
|
||||
.SetDimension(dawn::TextureDimension::e2D)
|
||||
.SetExtent(640, 480, 1)
|
||||
.SetFormat(dawn::TextureFormat::D32FloatS8Uint)
|
||||
.SetMipLevels(1)
|
||||
.SetAllowedUsage(dawn::TextureUsageBit::OutputAttachment)
|
||||
.GetResult();
|
||||
dawn::TextureDescriptor descriptor;
|
||||
descriptor.dimension = dawn::TextureDimension::e2D;
|
||||
descriptor.width = 640;
|
||||
descriptor.height = 480;
|
||||
descriptor.depth = 1;
|
||||
descriptor.arrayLayer = 1;
|
||||
descriptor.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.mipLevel = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
||||
auto depthStencilTexture = device.CreateTexture(&descriptor);
|
||||
return depthStencilTexture.CreateTextureViewBuilder()
|
||||
.GetResult();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user