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_OPENGL_COMMANDBUFFERGL_H_ 16 #define DAWNNATIVE_OPENGL_COMMANDBUFFERGL_H_ 17 18 #include "dawn_native/CommandBuffer.h" 19 20 namespace dawn_native { 21 struct BeginRenderPassCmd; 22 } // namespace dawn_native 23 24 namespace dawn_native { namespace opengl { 25 26 class Device; 27 struct OpenGLFunctions; 28 29 class CommandBuffer final : public CommandBufferBase { 30 public: 31 CommandBuffer(CommandEncoder* encoder, const CommandBufferDescriptor* descriptor); 32 33 MaybeError Execute(); 34 35 private: 36 MaybeError ExecuteComputePass(); 37 MaybeError ExecuteRenderPass(BeginRenderPassCmd* renderPass); 38 }; 39 40 // Like glTexSubImage*, the "data" argument is either a pointer to image data or 41 // an offset if a PBO is bound. 42 void DoTexSubImage(const OpenGLFunctions& gl, 43 const TextureCopy& destination, 44 const void* data, 45 const TextureDataLayout& dataLayout, 46 const Extent3D& copySize); 47 }} // namespace dawn_native::opengl 48 49 #endif // DAWNNATIVE_OPENGL_COMMANDBUFFERGL_H_ 50