diff --git a/src/backend/common/Pipeline.cpp b/src/backend/common/Pipeline.cpp index 2ea4adb321..0722106bf0 100644 --- a/src/backend/common/Pipeline.cpp +++ b/src/backend/common/Pipeline.cpp @@ -26,7 +26,7 @@ namespace backend { // PipelineBase PipelineBase::PipelineBase(PipelineBuilder* builder) - : device(builder->device), stageMask(builder->stageMask), layout(std::move(builder->layout)), + : stageMask(builder->stageMask), layout(std::move(builder->layout)), renderPass(std::move(builder->renderPass)), subpass(builder->subpass), inputState(std::move(builder->inputState)), depthStencilState(std::move(builder->depthStencilState)) { diff --git a/src/backend/common/Pipeline.h b/src/backend/common/Pipeline.h index da649f4dca..837f4fea72 100644 --- a/src/backend/common/Pipeline.h +++ b/src/backend/common/Pipeline.h @@ -53,8 +53,6 @@ namespace backend { bool IsCompute() const; private: - DeviceBase* device; - nxt::ShaderStageBit stageMask; Ref layout; Ref renderPass; diff --git a/src/backend/metal/CommandBufferMTL.h b/src/backend/metal/CommandBufferMTL.h index ba3a895ccc..0c95dca091 100644 --- a/src/backend/metal/CommandBufferMTL.h +++ b/src/backend/metal/CommandBufferMTL.h @@ -26,7 +26,7 @@ namespace metal { class CommandBuffer : public CommandBufferBase { public: - CommandBuffer(Device* device, CommandBufferBuilder* builder); + CommandBuffer(CommandBufferBuilder* builder); ~CommandBuffer(); void FillCommands(id commandBuffer); diff --git a/src/backend/metal/CommandBufferMTL.mm b/src/backend/metal/CommandBufferMTL.mm index 80ac7d5a20..8d9125910e 100644 --- a/src/backend/metal/CommandBufferMTL.mm +++ b/src/backend/metal/CommandBufferMTL.mm @@ -119,8 +119,9 @@ namespace metal { }; } - CommandBuffer::CommandBuffer(Device* device, CommandBufferBuilder* builder) - : CommandBufferBase(builder), device(device), commands(builder->AcquireCommands()) { + CommandBuffer::CommandBuffer(CommandBufferBuilder* builder) + : CommandBufferBase(builder), device(ToBackend(builder->GetDevice())), + commands(builder->AcquireCommands()) { } CommandBuffer::~CommandBuffer() { diff --git a/src/backend/metal/MetalBackend.h b/src/backend/metal/MetalBackend.h index fdc66295be..33c01b4cea 100644 --- a/src/backend/metal/MetalBackend.h +++ b/src/backend/metal/MetalBackend.h @@ -139,32 +139,23 @@ namespace metal { class BindGroup : public BindGroupBase { public: - BindGroup(Device* device, BindGroupBuilder* builder); - - private: - Device* device; + BindGroup(BindGroupBuilder* builder); }; class BindGroupLayout : public BindGroupLayoutBase { public: - BindGroupLayout(Device* device, BindGroupLayoutBuilder* builder); - - private: - Device* device; + BindGroupLayout(BindGroupLayoutBuilder* builder); }; class Framebuffer : public FramebufferBase { public: - Framebuffer(Device* device, FramebufferBuilder* builder); + Framebuffer(FramebufferBuilder* builder); ~Framebuffer(); - - private: - Device* device; }; class Queue : public QueueBase { public: - Queue(Device* device, QueueBuilder* builder); + Queue(QueueBuilder* builder); ~Queue(); id GetMTLCommandQueue(); @@ -173,17 +164,13 @@ namespace metal { void Submit(uint32_t numCommands, CommandBuffer* const * commands); private: - Device* device; id commandQueue = nil; }; class RenderPass : public RenderPassBase { public: - RenderPass(Device* device, RenderPassBuilder* builder); + RenderPass(RenderPassBuilder* builder); ~RenderPass(); - - private: - Device* device; }; } diff --git a/src/backend/metal/MetalBackend.mm b/src/backend/metal/MetalBackend.mm index 0576373055..64789de0db 100644 --- a/src/backend/metal/MetalBackend.mm +++ b/src/backend/metal/MetalBackend.mm @@ -82,10 +82,10 @@ namespace metal { } BindGroupBase* Device::CreateBindGroup(BindGroupBuilder* builder) { - return new BindGroup(this, builder); + return new BindGroup(builder); } BindGroupLayoutBase* Device::CreateBindGroupLayout(BindGroupLayoutBuilder* builder) { - return new BindGroupLayout(this, builder); + return new BindGroupLayout(builder); } BufferBase* Device::CreateBuffer(BufferBuilder* builder) { return new Buffer(builder); @@ -94,7 +94,7 @@ namespace metal { return new BufferView(builder); } CommandBufferBase* Device::CreateCommandBuffer(CommandBufferBuilder* builder) { - return new CommandBuffer(this, builder); + return new CommandBuffer(builder); } DepthStencilStateBase* Device::CreateDepthStencilState(DepthStencilStateBuilder* builder) { return new DepthStencilState(builder); @@ -103,7 +103,7 @@ namespace metal { return new InputState(builder); } FramebufferBase* Device::CreateFramebuffer(FramebufferBuilder* builder) { - return new Framebuffer(this, builder); + return new Framebuffer(builder); } PipelineBase* Device::CreatePipeline(PipelineBuilder* builder) { return new Pipeline(builder); @@ -112,10 +112,10 @@ namespace metal { return new PipelineLayout(builder); } QueueBase* Device::CreateQueue(QueueBuilder* builder) { - return new Queue(this, builder); + return new Queue(builder); } RenderPassBase* Device::CreateRenderPass(RenderPassBuilder* builder) { - return new RenderPass(this, builder); + return new RenderPass(builder); } SamplerBase* Device::CreateSampler(SamplerBuilder* builder) { return new Sampler(builder); @@ -251,20 +251,20 @@ namespace metal { // Bind Group - BindGroup::BindGroup(Device* device, BindGroupBuilder* builder) - : BindGroupBase(builder), device(device) { + BindGroup::BindGroup(BindGroupBuilder* builder) + : BindGroupBase(builder) { } // Bind Group Layout - BindGroupLayout::BindGroupLayout(Device* device, BindGroupLayoutBuilder* builder) - : BindGroupLayoutBase(builder), device(device) { + BindGroupLayout::BindGroupLayout(BindGroupLayoutBuilder* builder) + : BindGroupLayoutBase(builder) { } // Framebuffer - Framebuffer::Framebuffer(Device* device, FramebufferBuilder* builder) - : FramebufferBase(builder), device(device) { + Framebuffer::Framebuffer(FramebufferBuilder* builder) + : FramebufferBase(builder) { } Framebuffer::~Framebuffer() { @@ -272,8 +272,9 @@ namespace metal { // Queue - Queue::Queue(Device* device, QueueBuilder* builder) - : QueueBase(builder), device(device) { + Queue::Queue(QueueBuilder* builder) + : QueueBase(builder) { + Device* device = ToBackend(builder->GetDevice()); commandQueue = [device->GetMTLDevice() newCommandQueue]; } @@ -299,8 +300,8 @@ namespace metal { // RenderPass - RenderPass::RenderPass(Device* device, RenderPassBuilder* builder) - : RenderPassBase(builder), device(device) { + RenderPass::RenderPass(RenderPassBuilder* builder) + : RenderPassBase(builder) { } RenderPass::~RenderPass() { diff --git a/src/backend/opengl/CommandBufferGL.cpp b/src/backend/opengl/CommandBufferGL.cpp index 8b470d9841..9a86d5a1ed 100644 --- a/src/backend/opengl/CommandBufferGL.cpp +++ b/src/backend/opengl/CommandBufferGL.cpp @@ -27,8 +27,8 @@ namespace backend { namespace opengl { - CommandBuffer::CommandBuffer(Device* device, CommandBufferBuilder* builder) - : CommandBufferBase(builder), device(device), commands(builder->AcquireCommands()) { + CommandBuffer::CommandBuffer(CommandBufferBuilder* builder) + : CommandBufferBase(builder), commands(builder->AcquireCommands()) { } CommandBuffer::~CommandBuffer() { diff --git a/src/backend/opengl/CommandBufferGL.h b/src/backend/opengl/CommandBufferGL.h index d380f42fe6..69aa8a9365 100644 --- a/src/backend/opengl/CommandBufferGL.h +++ b/src/backend/opengl/CommandBufferGL.h @@ -25,13 +25,12 @@ namespace opengl { class CommandBuffer : public CommandBufferBase { public: - CommandBuffer(Device* device, CommandBufferBuilder* builder); + CommandBuffer(CommandBufferBuilder* builder); ~CommandBuffer(); void Execute(); private: - Device* device; CommandIterator commands; }; diff --git a/src/backend/opengl/DepthStencilStateGL.cpp b/src/backend/opengl/DepthStencilStateGL.cpp index a814c561e7..fd947e8d35 100644 --- a/src/backend/opengl/DepthStencilStateGL.cpp +++ b/src/backend/opengl/DepthStencilStateGL.cpp @@ -64,8 +64,8 @@ namespace opengl { } } - DepthStencilState::DepthStencilState(Device* device, DepthStencilStateBuilder* builder) - : DepthStencilStateBase(builder), device(device) { + DepthStencilState::DepthStencilState(DepthStencilStateBuilder* builder) + : DepthStencilStateBase(builder) { } void DepthStencilState::ApplyNow(PersistentPipelineState &persistentPipelineState) const { diff --git a/src/backend/opengl/DepthStencilStateGL.h b/src/backend/opengl/DepthStencilStateGL.h index 9eba5edf1a..8245a87818 100644 --- a/src/backend/opengl/DepthStencilStateGL.h +++ b/src/backend/opengl/DepthStencilStateGL.h @@ -25,12 +25,9 @@ namespace opengl { class DepthStencilState : public DepthStencilStateBase { public: - DepthStencilState(Device* device, DepthStencilStateBuilder* builder); + DepthStencilState(DepthStencilStateBuilder* builder); void ApplyNow(PersistentPipelineState &persistentPipelineState) const; - - private: - Device* device; }; } diff --git a/src/backend/opengl/OpenGLBackend.cpp b/src/backend/opengl/OpenGLBackend.cpp index 829587cbc8..4cf071cfbd 100644 --- a/src/backend/opengl/OpenGLBackend.cpp +++ b/src/backend/opengl/OpenGLBackend.cpp @@ -49,52 +49,52 @@ namespace opengl { // Device BindGroupBase* Device::CreateBindGroup(BindGroupBuilder* builder) { - return new BindGroup(this, builder); + return new BindGroup(builder); } BindGroupLayoutBase* Device::CreateBindGroupLayout(BindGroupLayoutBuilder* builder) { - return new BindGroupLayout(this, builder); + return new BindGroupLayout(builder); } BufferBase* Device::CreateBuffer(BufferBuilder* builder) { - return new Buffer(this, builder); + return new Buffer(builder); } BufferViewBase* Device::CreateBufferView(BufferViewBuilder* builder) { - return new BufferView(this, builder); + return new BufferView(builder); } CommandBufferBase* Device::CreateCommandBuffer(CommandBufferBuilder* builder) { - return new CommandBuffer(this, builder); + return new CommandBuffer(builder); } DepthStencilStateBase* Device::CreateDepthStencilState(DepthStencilStateBuilder* builder) { - return new DepthStencilState(this, builder); + return new DepthStencilState(builder); } InputStateBase* Device::CreateInputState(InputStateBuilder* builder) { - return new InputState(this, builder); + return new InputState(builder); } FramebufferBase* Device::CreateFramebuffer(FramebufferBuilder* builder) { - return new Framebuffer(this, builder); + return new Framebuffer(builder); } PipelineBase* Device::CreatePipeline(PipelineBuilder* builder) { - return new Pipeline(this, builder); + return new Pipeline(builder); } PipelineLayoutBase* Device::CreatePipelineLayout(PipelineLayoutBuilder* builder) { - return new PipelineLayout(this, builder); + return new PipelineLayout(builder); } QueueBase* Device::CreateQueue(QueueBuilder* builder) { - return new Queue(this, builder); + return new Queue(builder); } RenderPassBase* Device::CreateRenderPass(RenderPassBuilder* builder) { - return new RenderPass(this, builder); + return new RenderPass(builder); } SamplerBase* Device::CreateSampler(SamplerBuilder* builder) { - return new Sampler(this, builder); + return new Sampler(builder); } ShaderModuleBase* Device::CreateShaderModule(ShaderModuleBuilder* builder) { - return new ShaderModule(this, builder); + return new ShaderModule(builder); } TextureBase* Device::CreateTexture(TextureBuilder* builder) { - return new Texture(this, builder); + return new Texture(builder); } TextureViewBase* Device::CreateTextureView(TextureViewBuilder* builder) { - return new TextureView(this, builder); + return new TextureView(builder); } void Device::TickImpl() { @@ -108,20 +108,20 @@ namespace opengl { // Bind Group - BindGroup::BindGroup(Device* device, BindGroupBuilder* builder) - : BindGroupBase(builder), device(device) { + BindGroup::BindGroup(BindGroupBuilder* builder) + : BindGroupBase(builder) { } // Bind Group Layout - BindGroupLayout::BindGroupLayout(Device* device, BindGroupLayoutBuilder* builder) - : BindGroupLayoutBase(builder), device(device) { + BindGroupLayout::BindGroupLayout(BindGroupLayoutBuilder* builder) + : BindGroupLayoutBase(builder) { } // Buffer - Buffer::Buffer(Device* device, BufferBuilder* builder) - : BufferBase(builder), device(device) { + Buffer::Buffer(BufferBuilder* builder) + : BufferBase(builder) { glGenBuffers(1, &buffer); glBindBuffer(GL_ARRAY_BUFFER, buffer); glBufferData(GL_ARRAY_BUFFER, GetSize(), nullptr, GL_STATIC_DRAW); @@ -149,14 +149,14 @@ namespace opengl { // BufferView - BufferView::BufferView(Device* device, BufferViewBuilder* builder) - : BufferViewBase(builder), device(device) { + BufferView::BufferView(BufferViewBuilder* builder) + : BufferViewBase(builder) { } // InputState - InputState::InputState(Device* device, InputStateBuilder* builder) - : InputStateBase(builder), device(device) { + InputState::InputState(InputStateBuilder* builder) + : InputStateBase(builder) { glGenVertexArrays(1, &vertexArrayObject); glBindVertexArray(vertexArrayObject); auto& attributesSetMask = GetAttributesSetMask(); @@ -193,14 +193,14 @@ namespace opengl { // Framebuffer - Framebuffer::Framebuffer(Device* device, FramebufferBuilder* builder) - : FramebufferBase(builder), device(device) { + Framebuffer::Framebuffer(FramebufferBuilder* builder) + : FramebufferBase(builder) { } // Queue - Queue::Queue(Device* device, QueueBuilder* builder) - : QueueBase(builder), device(device) { + Queue::Queue(QueueBuilder* builder) + : QueueBase(builder) { } void Queue::Submit(uint32_t numCommands, CommandBuffer* const * commands) { @@ -211,8 +211,8 @@ namespace opengl { // RenderPass - RenderPass::RenderPass(Device* device, RenderPassBuilder* builder) - : RenderPassBase(builder), device(device) { + RenderPass::RenderPass(RenderPassBuilder* builder) + : RenderPassBase(builder) { } } diff --git a/src/backend/opengl/OpenGLBackend.h b/src/backend/opengl/OpenGLBackend.h index 8bf77b6b40..a6ab353533 100644 --- a/src/backend/opengl/OpenGLBackend.h +++ b/src/backend/opengl/OpenGLBackend.h @@ -106,23 +106,17 @@ namespace opengl { class BindGroup : public BindGroupBase { public: - BindGroup(Device* device, BindGroupBuilder* builder); - - private: - Device* device; + BindGroup(BindGroupBuilder* builder); }; class BindGroupLayout : public BindGroupLayoutBase { public: - BindGroupLayout(Device* device, BindGroupLayoutBuilder* builder); - - private: - Device* device; + BindGroupLayout(BindGroupLayoutBuilder* builder); }; class Buffer : public BufferBase { public: - Buffer(Device* device, BufferBuilder* builder); + Buffer(BufferBuilder* builder); GLuint GetHandle() const; @@ -132,53 +126,39 @@ namespace opengl { void UnmapImpl() override; void TransitionUsageImpl(nxt::BufferUsageBit currentUsage, nxt::BufferUsageBit targetUsage) override; - Device* device; GLuint buffer = 0; }; class BufferView : public BufferViewBase { public: - BufferView(Device* device, BufferViewBuilder* builder); - - private: - Device* device; + BufferView(BufferViewBuilder* builder); }; class Framebuffer : public FramebufferBase { public: - Framebuffer(Device* device, FramebufferBuilder* builder); - - private: - Device* device; + Framebuffer(FramebufferBuilder* builder); }; class InputState : public InputStateBase { public: - InputState(Device* device, InputStateBuilder* builder); + InputState(InputStateBuilder* builder); GLuint GetVAO(); private: - Device* device; GLuint vertexArrayObject; }; class Queue : public QueueBase { public: - Queue(Device* device, QueueBuilder* builder); + Queue(QueueBuilder* builder); // NXT API void Submit(uint32_t numCommands, CommandBuffer* const * commands); - - private: - Device* device; }; class RenderPass : public RenderPassBase { public: - RenderPass(Device* device, RenderPassBuilder* builder); - - private: - Device* device; + RenderPass(RenderPassBuilder* builder); }; } diff --git a/src/backend/opengl/PipelineGL.cpp b/src/backend/opengl/PipelineGL.cpp index b27596afaa..ae0edbe421 100644 --- a/src/backend/opengl/PipelineGL.cpp +++ b/src/backend/opengl/PipelineGL.cpp @@ -41,7 +41,7 @@ namespace opengl { } - Pipeline::Pipeline(Device* device, PipelineBuilder* builder) : PipelineBase(builder), device(device) { + Pipeline::Pipeline(PipelineBuilder* builder) : PipelineBase(builder) { auto CreateShader = [](GLenum type, const char* source) -> GLuint { GLuint shader = glCreateShader(type); glShaderSource(shader, 1, &source, nullptr); diff --git a/src/backend/opengl/PipelineGL.h b/src/backend/opengl/PipelineGL.h index eab3f42ae8..89b54e80aa 100644 --- a/src/backend/opengl/PipelineGL.h +++ b/src/backend/opengl/PipelineGL.h @@ -30,7 +30,7 @@ namespace opengl { class Pipeline : public PipelineBase { public: - Pipeline(Device* device, PipelineBuilder* builder); + Pipeline(PipelineBuilder* builder); using GLPushConstantInfo = std::array; using BindingLocations = std::array, kMaxBindGroups>; @@ -47,7 +47,6 @@ namespace opengl { PerStage glPushConstants; std::vector> unitsForSamplers; std::vector> unitsForTextures; - Device* device; }; } diff --git a/src/backend/opengl/PipelineLayoutGL.cpp b/src/backend/opengl/PipelineLayoutGL.cpp index 1f3cb5eece..1ee6b12f9d 100644 --- a/src/backend/opengl/PipelineLayoutGL.cpp +++ b/src/backend/opengl/PipelineLayoutGL.cpp @@ -19,8 +19,8 @@ namespace backend { namespace opengl { - PipelineLayout::PipelineLayout(Device* device, PipelineLayoutBuilder* builder) - : PipelineLayoutBase(builder), device(device) { + PipelineLayout::PipelineLayout(PipelineLayoutBuilder* builder) + : PipelineLayoutBase(builder) { GLuint uboIndex = 0; GLuint samplerIndex = 0; GLuint sampledTextureIndex = 0; diff --git a/src/backend/opengl/PipelineLayoutGL.h b/src/backend/opengl/PipelineLayoutGL.h index fc35099cdb..e285ccdf8d 100644 --- a/src/backend/opengl/PipelineLayoutGL.h +++ b/src/backend/opengl/PipelineLayoutGL.h @@ -26,7 +26,7 @@ namespace opengl { class PipelineLayout : public PipelineLayoutBase { public: - PipelineLayout(Device* device, PipelineLayoutBuilder* builder); + PipelineLayout(PipelineLayoutBuilder* builder); using BindingIndexInfo = std::array, kMaxBindGroups>; const BindingIndexInfo& GetBindingIndexInfo() const; @@ -36,7 +36,6 @@ namespace opengl { size_t GetNumSampledTextures() const; private: - Device* device; BindingIndexInfo indexInfo; size_t numSamplers; size_t numSampledTextures; diff --git a/src/backend/opengl/SamplerGL.cpp b/src/backend/opengl/SamplerGL.cpp index 73d418bab9..c48fc96a15 100644 --- a/src/backend/opengl/SamplerGL.cpp +++ b/src/backend/opengl/SamplerGL.cpp @@ -47,8 +47,8 @@ namespace opengl { } } - Sampler::Sampler(Device* device, SamplerBuilder* builder) - : SamplerBase(builder), device(device) { + Sampler::Sampler(SamplerBuilder* builder) + : SamplerBase(builder) { glGenSamplers(1, &handle); glSamplerParameteri(handle, GL_TEXTURE_MAG_FILTER, MagFilterMode(builder->GetMagFilter())); glSamplerParameteri(handle, GL_TEXTURE_MIN_FILTER, MinFilterMode(builder->GetMinFilter(), builder->GetMipMapFilter())); diff --git a/src/backend/opengl/SamplerGL.h b/src/backend/opengl/SamplerGL.h index c238e8a56e..eeae99d615 100644 --- a/src/backend/opengl/SamplerGL.h +++ b/src/backend/opengl/SamplerGL.h @@ -26,12 +26,11 @@ namespace opengl { class Sampler : public SamplerBase { public: - Sampler(Device* device, SamplerBuilder* builder); + Sampler(SamplerBuilder* builder); GLuint GetHandle() const; private: - Device* device; GLuint handle; }; diff --git a/src/backend/opengl/ShaderModuleGL.cpp b/src/backend/opengl/ShaderModuleGL.cpp index afb5706d2a..80939e291c 100644 --- a/src/backend/opengl/ShaderModuleGL.cpp +++ b/src/backend/opengl/ShaderModuleGL.cpp @@ -43,8 +43,8 @@ namespace opengl { return o.str(); } - ShaderModule::ShaderModule(Device* device, ShaderModuleBuilder* builder) - : ShaderModuleBase(builder), device(device) { + ShaderModule::ShaderModule(ShaderModuleBuilder* builder) + : ShaderModuleBase(builder) { spirv_cross::CompilerGLSL compiler(builder->AcquireSpirv()); spirv_cross::CompilerGLSL::Options options; diff --git a/src/backend/opengl/ShaderModuleGL.h b/src/backend/opengl/ShaderModuleGL.h index d9855273b1..d4f3860a54 100644 --- a/src/backend/opengl/ShaderModuleGL.h +++ b/src/backend/opengl/ShaderModuleGL.h @@ -41,7 +41,7 @@ namespace opengl { class ShaderModule : public ShaderModuleBase { public: - ShaderModule(Device* device, ShaderModuleBuilder* builder); + ShaderModule(ShaderModuleBuilder* builder); using CombinedSamplerInfo = std::vector; @@ -49,7 +49,6 @@ namespace opengl { const CombinedSamplerInfo& GetCombinedSamplerInfo() const; private: - Device* device; CombinedSamplerInfo combinedInfo; std::string glslSource; }; diff --git a/src/backend/opengl/TextureGL.cpp b/src/backend/opengl/TextureGL.cpp index 46d9557616..bd9d1e2f9a 100644 --- a/src/backend/opengl/TextureGL.cpp +++ b/src/backend/opengl/TextureGL.cpp @@ -40,8 +40,8 @@ namespace opengl { // Texture - Texture::Texture(Device* device, TextureBuilder* builder) - : TextureBase(builder), device(device) { + Texture::Texture(TextureBuilder* builder) + : TextureBase(builder) { target = TargetForDimension(GetDimension()); uint32_t width = GetWidth(); @@ -81,8 +81,8 @@ namespace opengl { // TextureView - TextureView::TextureView(Device* device, TextureViewBuilder* builder) - : TextureViewBase(builder), device(device) { + TextureView::TextureView(TextureViewBuilder* builder) + : TextureViewBase(builder) { } } diff --git a/src/backend/opengl/TextureGL.h b/src/backend/opengl/TextureGL.h index 5a66ea07bc..0c46f8d453 100644 --- a/src/backend/opengl/TextureGL.h +++ b/src/backend/opengl/TextureGL.h @@ -32,7 +32,7 @@ namespace opengl { class Texture : public TextureBase { public: - Texture(Device* device, TextureBuilder* builder); + Texture(TextureBuilder* builder); GLuint GetHandle() const; GLenum GetGLTarget() const; @@ -41,17 +41,13 @@ namespace opengl { private: void TransitionUsageImpl(nxt::TextureUsageBit currentUsage, nxt::TextureUsageBit targetUsage) override; - Device* device; GLuint handle; GLenum target; }; class TextureView : public TextureViewBase { public: - TextureView(Device* device, TextureViewBuilder* builder); - - private: - Device* device; + TextureView(TextureViewBuilder* builder); };