1 // Copyright 2017 The Dawn Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef DAWNNATIVE_PIPELINE_H_ 16 #define DAWNNATIVE_PIPELINE_H_ 17 18 #include "dawn_native/Forward.h" 19 #include "dawn_native/ObjectBase.h" 20 #include "dawn_native/PerStage.h" 21 #include "dawn_native/PipelineLayout.h" 22 #include "dawn_native/ShaderModule.h" 23 24 #include "dawn_native/dawn_platform.h" 25 26 #include <array> 27 #include <bitset> 28 29 namespace dawn_native { 30 31 MaybeError ValidatePipelineStageDescriptor(const DeviceBase* device, 32 const PipelineStageDescriptor* descriptor, 33 const PipelineLayoutBase* layout, 34 ShaderStage stage); 35 36 class PipelineBase : public ObjectBase { 37 public: 38 dawn::ShaderStageBit GetStageMask() const; 39 PipelineLayoutBase* GetLayout(); 40 const PipelineLayoutBase* GetLayout() const; 41 42 protected: 43 PipelineBase(DeviceBase* device, PipelineLayoutBase* layout, dawn::ShaderStageBit stages); 44 PipelineBase(DeviceBase* device, ObjectBase::ErrorTag tag); 45 46 private: 47 dawn::ShaderStageBit mStageMask; 48 Ref<PipelineLayoutBase> mLayout; 49 }; 50 51 } // namespace dawn_native 52 53 #endif // DAWNNATIVE_PIPELINE_H_ 54