mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 10:51:35 +00:00
Remove TextureViewBuilder and add CreateDefaultTextureView entry point
This patch is the first one to descriptorze texture view. In this patch, we completely remove TextureViewBuilder and add the entry point CreateDefaultTextureView for creating a texture view on a non-array 2D texture using the same type and format. Texture view descriptors and 2D array texture views will be supported in the next patch. BUG=dawn:1, dawn:16 Change-Id: Ibd2a0bcf02cbb567a98d2faaaaa897eff2c062e5 Reviewed-on: https://dawn-review.googlesource.com/1440 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
parent
03e1813fd2
commit
3d670506e3
13
dawn.json
13
dawn.json
@ -985,8 +985,8 @@
|
|||||||
"category": "object",
|
"category": "object",
|
||||||
"methods": [
|
"methods": [
|
||||||
{
|
{
|
||||||
"name": "create texture view builder",
|
"name": "create default texture view",
|
||||||
"returns": "texture view builder"
|
"returns": "texture view"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -1038,15 +1038,6 @@
|
|||||||
"texture view": {
|
"texture view": {
|
||||||
"category": "object"
|
"category": "object"
|
||||||
},
|
},
|
||||||
"texture view builder": {
|
|
||||||
"category": "object",
|
|
||||||
"methods": [
|
|
||||||
{
|
|
||||||
"name": "get result",
|
|
||||||
"returns": "texture view"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"vertex format": {
|
"vertex format": {
|
||||||
"category": "enum",
|
"category": "enum",
|
||||||
"values": [
|
"values": [
|
||||||
|
@ -72,9 +72,7 @@ void frame() {
|
|||||||
dawnTexture backbuffer = dawnSwapChainGetNextTexture(swapchain);
|
dawnTexture backbuffer = dawnSwapChainGetNextTexture(swapchain);
|
||||||
dawnTextureView backbufferView;
|
dawnTextureView backbufferView;
|
||||||
{
|
{
|
||||||
dawnTextureViewBuilder builder = dawnTextureCreateTextureViewBuilder(backbuffer);
|
backbufferView = dawnTextureCreateDefaultTextureView(backbuffer);
|
||||||
backbufferView = dawnTextureViewBuilderGetResult(builder);
|
|
||||||
dawnTextureViewBuilderRelease(builder);
|
|
||||||
}
|
}
|
||||||
dawnRenderPassDescriptor renderpassInfo;
|
dawnRenderPassDescriptor renderpassInfo;
|
||||||
{
|
{
|
||||||
|
@ -131,7 +131,7 @@ void init() {
|
|||||||
.SetInputState(inputState)
|
.SetInputState(inputState)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
dawn::TextureView view = texture.CreateTextureViewBuilder().GetResult();
|
dawn::TextureView view = texture.CreateDefaultTextureView();
|
||||||
|
|
||||||
bindGroup = device.CreateBindGroupBuilder()
|
bindGroup = device.CreateBindGroupBuilder()
|
||||||
.SetLayout(bgl)
|
.SetLayout(bgl)
|
||||||
|
@ -146,8 +146,7 @@ dawn::TextureView CreateDefaultDepthStencilView(const dawn::Device& device) {
|
|||||||
descriptor.mipLevel = 1;
|
descriptor.mipLevel = 1;
|
||||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
||||||
auto depthStencilTexture = device.CreateTexture(&descriptor);
|
auto depthStencilTexture = device.CreateTexture(&descriptor);
|
||||||
return depthStencilTexture.CreateTextureViewBuilder()
|
return depthStencilTexture.CreateDefaultTextureView();
|
||||||
.GetResult();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetNextRenderPassDescriptor(const dawn::Device& device,
|
void GetNextRenderPassDescriptor(const dawn::Device& device,
|
||||||
@ -156,7 +155,7 @@ void GetNextRenderPassDescriptor(const dawn::Device& device,
|
|||||||
dawn::Texture* backbuffer,
|
dawn::Texture* backbuffer,
|
||||||
dawn::RenderPassDescriptor* info) {
|
dawn::RenderPassDescriptor* info) {
|
||||||
*backbuffer = swapchain.GetNextTexture();
|
*backbuffer = swapchain.GetNextTexture();
|
||||||
auto backbufferView = backbuffer->CreateTextureViewBuilder().GetResult();
|
auto backbufferView = backbuffer->CreateDefaultTextureView();
|
||||||
*info = device.CreateRenderPassDescriptorBuilder()
|
*info = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, backbufferView, dawn::LoadOp::Clear)
|
.SetColorAttachment(0, backbufferView, dawn::LoadOp::Clear)
|
||||||
.SetDepthStencilAttachment(depthStencilView, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
.SetDepthStencilAttachment(depthStencilView, dawn::LoadOp::Clear, dawn::LoadOp::Clear)
|
||||||
|
@ -438,7 +438,7 @@ namespace {
|
|||||||
.GetResult();
|
.GetResult();
|
||||||
queue.Submit(1, &cmdbuf);
|
queue.Submit(1, &cmdbuf);
|
||||||
|
|
||||||
textures[iTextureID] = oTexture.CreateTextureViewBuilder().GetResult();
|
textures[iTextureID] = oTexture.CreateDefaultTextureView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ namespace dawn_native {
|
|||||||
RenderPassDescriptorBuilder* builder) = 0;
|
RenderPassDescriptorBuilder* builder) = 0;
|
||||||
virtual RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) = 0;
|
virtual RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) = 0;
|
||||||
virtual SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) = 0;
|
virtual SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) = 0;
|
||||||
virtual TextureViewBase* CreateTextureView(TextureViewBuilder* builder) = 0;
|
virtual TextureViewBase* CreateDefaultTextureView(TextureBase* texture) = 0;
|
||||||
|
|
||||||
virtual void TickImpl() = 0;
|
virtual void TickImpl() = 0;
|
||||||
|
|
||||||
|
@ -126,13 +126,13 @@ namespace dawn_native {
|
|||||||
return mUsage;
|
return mUsage;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureViewBuilder* TextureBase::CreateTextureViewBuilder() {
|
TextureViewBase* TextureBase::CreateDefaultTextureView() {
|
||||||
return new TextureViewBuilder(mDevice, this);
|
return mDevice->CreateDefaultTextureView(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TextureViewBase
|
// TextureViewBase
|
||||||
|
|
||||||
TextureViewBase::TextureViewBase(TextureViewBuilder* builder) : mTexture(builder->mTexture) {
|
TextureViewBase::TextureViewBase(TextureBase* texture) : mTexture(texture) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const TextureBase* TextureViewBase::GetTexture() const {
|
const TextureBase* TextureViewBase::GetTexture() const {
|
||||||
@ -143,14 +143,4 @@ namespace dawn_native {
|
|||||||
return mTexture.Get();
|
return mTexture.Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TextureViewBuilder
|
|
||||||
|
|
||||||
TextureViewBuilder::TextureViewBuilder(DeviceBase* device, TextureBase* texture)
|
|
||||||
: Builder(device), mTexture(texture) {
|
|
||||||
}
|
|
||||||
|
|
||||||
TextureViewBase* TextureViewBuilder::GetResultImpl() {
|
|
||||||
return mDevice->CreateTextureView(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace dawn_native
|
} // namespace dawn_native
|
||||||
|
@ -53,7 +53,7 @@ namespace dawn_native {
|
|||||||
DeviceBase* GetDevice() const;
|
DeviceBase* GetDevice() const;
|
||||||
|
|
||||||
// Dawn API
|
// Dawn API
|
||||||
TextureViewBuilder* CreateTextureViewBuilder();
|
TextureViewBase* CreateDefaultTextureView();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DeviceBase* mDevice;
|
DeviceBase* mDevice;
|
||||||
@ -68,7 +68,7 @@ namespace dawn_native {
|
|||||||
|
|
||||||
class TextureViewBase : public RefCounted {
|
class TextureViewBase : public RefCounted {
|
||||||
public:
|
public:
|
||||||
TextureViewBase(TextureViewBuilder* builder);
|
TextureViewBase(TextureBase* texture);
|
||||||
|
|
||||||
const TextureBase* GetTexture() const;
|
const TextureBase* GetTexture() const;
|
||||||
TextureBase* GetTexture();
|
TextureBase* GetTexture();
|
||||||
@ -77,18 +77,6 @@ namespace dawn_native {
|
|||||||
Ref<TextureBase> mTexture;
|
Ref<TextureBase> mTexture;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TextureViewBuilder : public Builder<TextureViewBase> {
|
|
||||||
public:
|
|
||||||
TextureViewBuilder(DeviceBase* device, TextureBase* texture);
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class TextureViewBase;
|
|
||||||
|
|
||||||
TextureViewBase* GetResultImpl() override;
|
|
||||||
|
|
||||||
Ref<TextureBase> mTexture;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace dawn_native
|
} // namespace dawn_native
|
||||||
|
|
||||||
#endif // DAWNNATIVE_TEXTURE_H_
|
#endif // DAWNNATIVE_TEXTURE_H_
|
||||||
|
@ -325,8 +325,8 @@ namespace dawn_native { namespace d3d12 {
|
|||||||
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
||||||
return new Texture(this, descriptor);
|
return new Texture(this, descriptor);
|
||||||
}
|
}
|
||||||
TextureViewBase* Device::CreateTextureView(TextureViewBuilder* builder) {
|
TextureViewBase* Device::CreateDefaultTextureView(TextureBase* texture) {
|
||||||
return new TextureView(builder);
|
return new TextureView(texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
}} // namespace dawn_native::d3d12
|
}} // namespace dawn_native::d3d12
|
||||||
|
@ -51,7 +51,7 @@ namespace dawn_native { namespace d3d12 {
|
|||||||
RenderPassDescriptorBuilder* builder) override;
|
RenderPassDescriptorBuilder* builder) override;
|
||||||
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
||||||
SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;
|
SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;
|
||||||
TextureViewBase* CreateTextureView(TextureViewBuilder* builder) override;
|
TextureViewBase* CreateDefaultTextureView(TextureBase* texture) override;
|
||||||
|
|
||||||
void TickImpl() override;
|
void TickImpl() override;
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ namespace dawn_native { namespace d3d12 {
|
|||||||
mLastUsage = usage;
|
mLastUsage = usage;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureView::TextureView(TextureViewBuilder* builder) : TextureViewBase(builder) {
|
TextureView::TextureView(TextureBase* texture) : TextureViewBase(texture) {
|
||||||
mSrvDesc.Format = D3D12TextureFormat(GetTexture()->GetFormat());
|
mSrvDesc.Format = D3D12TextureFormat(GetTexture()->GetFormat());
|
||||||
mSrvDesc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
|
mSrvDesc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
|
||||||
switch (GetTexture()->GetDimension()) {
|
switch (GetTexture()->GetDimension()) {
|
||||||
|
@ -47,7 +47,7 @@ namespace dawn_native { namespace d3d12 {
|
|||||||
|
|
||||||
class TextureView : public TextureViewBase {
|
class TextureView : public TextureViewBase {
|
||||||
public:
|
public:
|
||||||
TextureView(TextureViewBuilder* builder);
|
TextureView(TextureBase* builder);
|
||||||
|
|
||||||
const D3D12_SHADER_RESOURCE_VIEW_DESC& GetSRVDescriptor() const;
|
const D3D12_SHADER_RESOURCE_VIEW_DESC& GetSRVDescriptor() const;
|
||||||
D3D12_RENDER_TARGET_VIEW_DESC GetRTVDescriptor();
|
D3D12_RENDER_TARGET_VIEW_DESC GetRTVDescriptor();
|
||||||
|
@ -47,7 +47,7 @@ namespace dawn_native { namespace metal {
|
|||||||
RenderPassDescriptorBuilder* builder) override;
|
RenderPassDescriptorBuilder* builder) override;
|
||||||
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
||||||
SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;
|
SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;
|
||||||
TextureViewBase* CreateTextureView(TextureViewBuilder* builder) override;
|
TextureViewBase* CreateDefaultTextureView(TextureBase* texture) override;
|
||||||
|
|
||||||
void TickImpl() override;
|
void TickImpl() override;
|
||||||
|
|
||||||
|
@ -131,8 +131,8 @@ namespace dawn_native { namespace metal {
|
|||||||
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
||||||
return new Texture(this, descriptor);
|
return new Texture(this, descriptor);
|
||||||
}
|
}
|
||||||
TextureViewBase* Device::CreateTextureView(TextureViewBuilder* builder) {
|
TextureViewBase* Device::CreateDefaultTextureView(TextureBase* texture) {
|
||||||
return new TextureView(builder);
|
return new TextureView(texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Device::TickImpl() {
|
void Device::TickImpl() {
|
||||||
|
@ -39,7 +39,7 @@ namespace dawn_native { namespace metal {
|
|||||||
|
|
||||||
class TextureView : public TextureViewBase {
|
class TextureView : public TextureViewBase {
|
||||||
public:
|
public:
|
||||||
TextureView(TextureViewBuilder* builder);
|
TextureView(TextureBase* texture);
|
||||||
};
|
};
|
||||||
|
|
||||||
}} // namespace dawn_native::metal
|
}} // namespace dawn_native::metal
|
||||||
|
@ -98,7 +98,7 @@ namespace dawn_native { namespace metal {
|
|||||||
return mMtlTexture;
|
return mMtlTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureView::TextureView(TextureViewBuilder* builder) : TextureViewBase(builder) {
|
TextureView::TextureView(TextureBase* texture) : TextureViewBase(texture) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}} // namespace dawn_native::metal
|
}} // namespace dawn_native::metal
|
||||||
|
@ -94,8 +94,8 @@ namespace dawn_native { namespace null {
|
|||||||
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
||||||
return new Texture(this, descriptor);
|
return new Texture(this, descriptor);
|
||||||
}
|
}
|
||||||
TextureViewBase* Device::CreateTextureView(TextureViewBuilder* builder) {
|
TextureViewBase* Device::CreateDefaultTextureView(TextureBase* texture) {
|
||||||
return new TextureView(builder);
|
return new TextureView(texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Device::TickImpl() {
|
void Device::TickImpl() {
|
||||||
|
@ -105,7 +105,7 @@ namespace dawn_native { namespace null {
|
|||||||
RenderPassDescriptorBuilder* builder) override;
|
RenderPassDescriptorBuilder* builder) override;
|
||||||
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
||||||
SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;
|
SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;
|
||||||
TextureViewBase* CreateTextureView(TextureViewBuilder* builder) override;
|
TextureViewBase* CreateDefaultTextureView(TextureBase* texture) override;
|
||||||
|
|
||||||
void TickImpl() override;
|
void TickImpl() override;
|
||||||
|
|
||||||
|
@ -102,8 +102,8 @@ namespace dawn_native { namespace opengl {
|
|||||||
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
||||||
return new Texture(this, descriptor);
|
return new Texture(this, descriptor);
|
||||||
}
|
}
|
||||||
TextureViewBase* Device::CreateTextureView(TextureViewBuilder* builder) {
|
TextureViewBase* Device::CreateDefaultTextureView(TextureBase* texture) {
|
||||||
return new TextureView(builder);
|
return new TextureView(texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Device::TickImpl() {
|
void Device::TickImpl() {
|
||||||
|
@ -42,7 +42,7 @@ namespace dawn_native { namespace opengl {
|
|||||||
RenderPassDescriptorBuilder* builder) override;
|
RenderPassDescriptorBuilder* builder) override;
|
||||||
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
||||||
SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;
|
SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;
|
||||||
TextureViewBase* CreateTextureView(TextureViewBuilder* builder) override;
|
TextureViewBase* CreateDefaultTextureView(TextureBase* texture) override;
|
||||||
|
|
||||||
void TickImpl() override;
|
void TickImpl() override;
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ namespace dawn_native { namespace opengl {
|
|||||||
|
|
||||||
// TextureView
|
// TextureView
|
||||||
|
|
||||||
TextureView::TextureView(TextureViewBuilder* builder) : TextureViewBase(builder) {
|
TextureView::TextureView(TextureBase* texture) : TextureViewBase(texture) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}} // namespace dawn_native::opengl
|
}} // namespace dawn_native::opengl
|
||||||
|
@ -46,7 +46,7 @@ namespace dawn_native { namespace opengl {
|
|||||||
|
|
||||||
class TextureView : public TextureViewBase {
|
class TextureView : public TextureViewBase {
|
||||||
public:
|
public:
|
||||||
TextureView(TextureViewBuilder* builder);
|
TextureView(TextureBase* texture);
|
||||||
};
|
};
|
||||||
|
|
||||||
}} // namespace dawn_native::opengl
|
}} // namespace dawn_native::opengl
|
||||||
|
@ -266,8 +266,8 @@ namespace dawn_native { namespace vulkan {
|
|||||||
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
||||||
return new Texture(this, descriptor);
|
return new Texture(this, descriptor);
|
||||||
}
|
}
|
||||||
TextureViewBase* Device::CreateTextureView(TextureViewBuilder* builder) {
|
TextureViewBase* Device::CreateDefaultTextureView(TextureBase* texture) {
|
||||||
return new TextureView(builder);
|
return new TextureView(texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Device::TickImpl() {
|
void Device::TickImpl() {
|
||||||
|
@ -74,7 +74,7 @@ namespace dawn_native { namespace vulkan {
|
|||||||
RenderPassDescriptorBuilder* builder) override;
|
RenderPassDescriptorBuilder* builder) override;
|
||||||
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;
|
||||||
SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;
|
SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;
|
||||||
TextureViewBase* CreateTextureView(TextureViewBuilder* builder) override;
|
TextureViewBase* CreateDefaultTextureView(TextureBase* texture) override;
|
||||||
|
|
||||||
void TickImpl() override;
|
void TickImpl() override;
|
||||||
|
|
||||||
|
@ -342,8 +342,8 @@ namespace dawn_native { namespace vulkan {
|
|||||||
mLastUsage = usage;
|
mLastUsage = usage;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureView::TextureView(TextureViewBuilder* builder) : TextureViewBase(builder) {
|
TextureView::TextureView(TextureBase* texture) : TextureViewBase(texture) {
|
||||||
Device* device = ToBackend(builder->GetDevice());
|
Device* device = ToBackend(texture->GetDevice());
|
||||||
|
|
||||||
VkImageViewCreateInfo createInfo;
|
VkImageViewCreateInfo createInfo;
|
||||||
createInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
|
createInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
|
||||||
|
@ -50,7 +50,7 @@ namespace dawn_native { namespace vulkan {
|
|||||||
|
|
||||||
class TextureView : public TextureViewBase {
|
class TextureView : public TextureViewBase {
|
||||||
public:
|
public:
|
||||||
TextureView(TextureViewBuilder* builder);
|
TextureView(TextureBase* texture);
|
||||||
~TextureView();
|
~TextureView();
|
||||||
|
|
||||||
VkImageView GetHandle() const;
|
VkImageView GetHandle() const;
|
||||||
|
@ -702,7 +702,7 @@ TEST_P(BlendStateTest, IndependentBlendState) {
|
|||||||
|
|
||||||
for (uint32_t i = 0; i < 4; ++i) {
|
for (uint32_t i = 0; i < 4; ++i) {
|
||||||
renderTargets[i] = device.CreateTexture(&descriptor);
|
renderTargets[i] = device.CreateTexture(&descriptor);
|
||||||
renderTargetViews[i] = renderTargets[i].CreateTextureViewBuilder().GetResult();
|
renderTargetViews[i] = renderTargets[i].CreateDefaultTextureView();
|
||||||
}
|
}
|
||||||
|
|
||||||
dawn::RenderPassDescriptor renderpass = device.CreateRenderPassDescriptorBuilder()
|
dawn::RenderPassDescriptor renderpass = device.CreateRenderPassDescriptorBuilder()
|
||||||
|
@ -35,7 +35,7 @@ class DepthStencilStateTest : public DawnTest {
|
|||||||
renderTargetDescriptor.usage = dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc;
|
renderTargetDescriptor.usage = dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc;
|
||||||
renderTarget = device.CreateTexture(&renderTargetDescriptor);
|
renderTarget = device.CreateTexture(&renderTargetDescriptor);
|
||||||
|
|
||||||
renderTargetView = renderTarget.CreateTextureViewBuilder().GetResult();
|
renderTargetView = renderTarget.CreateDefaultTextureView();
|
||||||
|
|
||||||
dawn::TextureDescriptor depthDescriptor;
|
dawn::TextureDescriptor depthDescriptor;
|
||||||
depthDescriptor.dimension = dawn::TextureDimension::e2D;
|
depthDescriptor.dimension = dawn::TextureDimension::e2D;
|
||||||
@ -48,7 +48,7 @@ class DepthStencilStateTest : public DawnTest {
|
|||||||
depthDescriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
depthDescriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
||||||
depthTexture = device.CreateTexture(&depthDescriptor);
|
depthTexture = device.CreateTexture(&depthDescriptor);
|
||||||
|
|
||||||
depthTextureView = depthTexture.CreateTextureViewBuilder().GetResult();
|
depthTextureView = depthTexture.CreateDefaultTextureView();
|
||||||
|
|
||||||
renderpass = device.CreateRenderPassDescriptorBuilder()
|
renderpass = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, renderTargetView, dawn::LoadOp::Clear)
|
.SetColorAttachment(0, renderTargetView, dawn::LoadOp::Clear)
|
||||||
|
@ -66,7 +66,7 @@ class RenderPassLoadOpTests : public DawnTest {
|
|||||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc;
|
descriptor.usage = dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc;
|
||||||
renderTarget = device.CreateTexture(&descriptor);
|
renderTarget = device.CreateTexture(&descriptor);
|
||||||
|
|
||||||
renderTargetView = renderTarget.CreateTextureViewBuilder().GetResult();
|
renderTargetView = renderTarget.CreateDefaultTextureView();
|
||||||
|
|
||||||
RGBA8 zero(0, 0, 0, 0);
|
RGBA8 zero(0, 0, 0, 0);
|
||||||
std::fill(expectZero.begin(), expectZero.end(), zero);
|
std::fill(expectZero.begin(), expectZero.end(), zero);
|
||||||
|
@ -105,7 +105,7 @@ protected:
|
|||||||
.GetResult();
|
.GetResult();
|
||||||
|
|
||||||
queue.Submit(1, ©);
|
queue.Submit(1, ©);
|
||||||
mTextureView = texture.CreateTextureViewBuilder().GetResult();
|
mTextureView = texture.CreateDefaultTextureView();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestAddressModes(AddressModeTestCase u, AddressModeTestCase v, AddressModeTestCase w) {
|
void TestAddressModes(AddressModeTestCase u, AddressModeTestCase v, AddressModeTestCase w) {
|
||||||
|
@ -33,8 +33,7 @@ dawn::TextureView Create2DAttachment(dawn::Device& device, uint32_t width, uint3
|
|||||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
||||||
dawn::Texture attachment = device.CreateTexture(&descriptor);
|
dawn::Texture attachment = device.CreateTexture(&descriptor);
|
||||||
|
|
||||||
return attachment.CreateTextureViewBuilder()
|
return attachment.CreateDefaultTextureView();
|
||||||
.GetResult();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// A render pass with no attachments isn't valid
|
// A render pass with no attachments isn't valid
|
||||||
|
@ -85,8 +85,7 @@ dawn::RenderPassDescriptor ValidationTest::CreateSimpleRenderPass() {
|
|||||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
||||||
|
|
||||||
auto colorBuffer = device.CreateTexture(&descriptor);
|
auto colorBuffer = device.CreateTexture(&descriptor);
|
||||||
auto colorView = colorBuffer.CreateTextureViewBuilder()
|
auto colorView = colorBuffer.CreateDefaultTextureView();
|
||||||
.GetResult();
|
|
||||||
|
|
||||||
return device.CreateRenderPassDescriptorBuilder()
|
return device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, colorView, dawn::LoadOp::Clear)
|
.SetColorAttachment(0, colorView, dawn::LoadOp::Clear)
|
||||||
@ -139,7 +138,7 @@ ValidationTest::DummyRenderPass ValidationTest::CreateDummyRenderPass() {
|
|||||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
descriptor.usage = dawn::TextureUsageBit::OutputAttachment;
|
||||||
dummy.attachment = device.CreateTexture(&descriptor);
|
dummy.attachment = device.CreateTexture(&descriptor);
|
||||||
|
|
||||||
dawn::TextureView view = AssertWillBeSuccess(dummy.attachment.CreateTextureViewBuilder()).GetResult();
|
dawn::TextureView view = dummy.attachment.CreateDefaultTextureView();
|
||||||
|
|
||||||
dummy.renderPass = AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
dummy.renderPass = AssertWillBeSuccess(device.CreateRenderPassDescriptorBuilder())
|
||||||
.SetColorAttachment(0, view, dawn::LoadOp::Clear)
|
.SetColorAttachment(0, view, dawn::LoadOp::Clear)
|
||||||
|
@ -145,7 +145,7 @@ namespace utils {
|
|||||||
dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc;
|
dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::TransferSrc;
|
||||||
result.color = device.CreateTexture(&descriptor);
|
result.color = device.CreateTexture(&descriptor);
|
||||||
|
|
||||||
dawn::TextureView colorView = result.color.CreateTextureViewBuilder().GetResult();
|
dawn::TextureView colorView = result.color.CreateDefaultTextureView();
|
||||||
result.renderPassInfo = device.CreateRenderPassDescriptorBuilder()
|
result.renderPassInfo = device.CreateRenderPassDescriptorBuilder()
|
||||||
.SetColorAttachment(0, colorView, dawn::LoadOp::Clear)
|
.SetColorAttachment(0, colorView, dawn::LoadOp::Clear)
|
||||||
.GetResult();
|
.GetResult();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user