mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
@@ -19,8 +19,8 @@ class CC_CORE_API GFXBindingLayout : public Object {
|
||||
void bindTextureView(uint binding, GFXTextureView* texView);
|
||||
void bindSampler(uint binding, GFXSampler* sampler);
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE const GFXBindingUnitList& bindingUnits() const { return _bindingUnits; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE const GFXBindingUnitList& getBindingUnits() const { return _bindingUnits; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -16,14 +16,14 @@ class CC_CORE_API GFXBuffer : public Object {
|
||||
virtual void resize(uint size) = 0;
|
||||
virtual void update(void* buffer, uint offset = 0, uint size = 0) = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE GFXBufferUsage usage() const { return _usage; }
|
||||
CC_INLINE GFXMemoryUsage memUsage() const { return _memUsage; }
|
||||
CC_INLINE uint stride() const { return _stride; }
|
||||
CC_INLINE uint count() const { return _count; }
|
||||
CC_INLINE uint size() const { return _size; }
|
||||
CC_INLINE GFXBufferFlags flags() const { return _flags; }
|
||||
CC_INLINE uint8_t* bufferView() const { return _buffer; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE GFXBufferUsage getUsage() const { return _usage; }
|
||||
CC_INLINE GFXMemoryUsage getMemUsage() const { return _memUsage; }
|
||||
CC_INLINE uint getStride() const { return _stride; }
|
||||
CC_INLINE uint getCount() const { return _count; }
|
||||
CC_INLINE uint getSize() const { return _size; }
|
||||
CC_INLINE GFXBufferFlags getFlags() const { return _flags; }
|
||||
CC_INLINE uint8_t* getBufferView() const { return _buffer; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
virtual bool initialize(const GFXCommandAllocatorInfo& info) = 0;
|
||||
virtual void destroy() = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -33,11 +33,11 @@ public:
|
||||
virtual void copyBufferToTexture(GFXBuffer* src, GFXTexture* dst, GFXTextureLayout layout, const GFXBufferTextureCopyList& regions) = 0;
|
||||
virtual void execute(const std::vector<GFXCommandBuffer*>& cmd_buffs, uint32_t count) = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE GFXCommandAllocator* allocator() const { return _allocator; }
|
||||
CC_INLINE GFXCommandBufferType type() const { return _type; }
|
||||
CC_INLINE uint numDrawCalls() const { return _numDrawCalls; }
|
||||
CC_INLINE uint numTris() const { return _numTriangles; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE GFXCommandAllocator* getAllocator() const { return _allocator; }
|
||||
CC_INLINE GFXCommandBufferType getType() const { return _type; }
|
||||
CC_INLINE uint getNumDrawCalls() const { return _numDrawCalls; }
|
||||
CC_INLINE uint getNumTris() const { return _numTriangles; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -15,11 +15,11 @@ class CC_CORE_API GFXContext : public Object {
|
||||
virtual void destroy() = 0;
|
||||
virtual void present() = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE GFXContext* sharedContext() const { return _sharedContext; }
|
||||
CC_INLINE GFXVsyncMode vsyncMode() const { return _vsyncMode; }
|
||||
CC_INLINE GFXFormat colorFormat() const { return _colorFmt; }
|
||||
CC_INLINE GFXFormat detphStencilFormat() const { return _depthStencilFmt; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE GFXContext* getSharedContext() const { return _sharedContext; }
|
||||
CC_INLINE GFXVsyncMode getVsyncMode() const { return _vsyncMode; }
|
||||
CC_INLINE GFXFormat getColorFormat() const { return _colorFmt; }
|
||||
CC_INLINE GFXFormat getDetphStencilFormat() const { return _depthStencilFmt; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -32,20 +32,20 @@ class CC_CORE_API GFXDevice : public Object {
|
||||
virtual GFXPipelineLayout* createPipelineLayout(const GFXPipelineLayoutInfo& info) = 0;
|
||||
virtual void copyBuffersToTexture(const GFXDataArray& buffers, GFXTexture* dst, const GFXBufferTextureCopyList& regions) = 0;
|
||||
|
||||
CC_INLINE GFXAPI gfxAPI() const { return _api; }
|
||||
CC_INLINE uint width() { return _width; }
|
||||
CC_INLINE uint height() { return _height; }
|
||||
CC_INLINE uint nativeWidth() { return _nativeWidth; }
|
||||
CC_INLINE uint nativeHeight() { return _nativeHeight; }
|
||||
CC_INLINE GFXMemoryStatus& memoryStatus() { return _memoryStatus; }
|
||||
CC_INLINE GFXContext* context() const { return _context; }
|
||||
CC_INLINE GFXWindow* mainWindow() const { return _window; }
|
||||
CC_INLINE GFXQueue* queue() const { return _queue; }
|
||||
CC_INLINE GFXCommandAllocator* commandAllocator() const { return _cmdAllocator; }
|
||||
CC_INLINE const String& renderer() const { return _renderer; }
|
||||
CC_INLINE const String& vendor() const { return _vendor; }
|
||||
CC_INLINE uint numDrawCalls() const { return _numDrawCalls; }
|
||||
CC_INLINE uint numTris() const { return _numTriangles; }
|
||||
CC_INLINE GFXAPI getAPI() const { return _api; }
|
||||
CC_INLINE uint getWidth() { return _width; }
|
||||
CC_INLINE uint getHeight() { return _height; }
|
||||
CC_INLINE uint getNativeWidth() { return _nativeWidth; }
|
||||
CC_INLINE uint getNativeHeight() { return _nativeHeight; }
|
||||
CC_INLINE GFXMemoryStatus& getMemoryStatus() { return _memoryStatus; }
|
||||
CC_INLINE GFXContext* getContext() const { return _context; }
|
||||
CC_INLINE GFXWindow* getMainWindow() const { return _window; }
|
||||
CC_INLINE GFXQueue* getQueue() const { return _queue; }
|
||||
CC_INLINE GFXCommandAllocator* getCommandAllocator() const { return _cmdAllocator; }
|
||||
CC_INLINE const String& getRenderer() const { return _renderer; }
|
||||
CC_INLINE const String& getVendor() const { return _vendor; }
|
||||
CC_INLINE uint getNumDrawCalls() const { return _numDrawCalls; }
|
||||
CC_INLINE uint getNumTris() const { return _numTriangles; }
|
||||
CC_INLINE bool hasFeature(GFXFeature feature) const { return _features[static_cast<uint8_t>(feature)]; }
|
||||
|
||||
protected:
|
||||
|
||||
@@ -14,10 +14,10 @@ class CC_CORE_API GFXFramebuffer : public Object {
|
||||
virtual bool initialize(const GFXFramebufferInfo& info) = 0;
|
||||
virtual void destroy() = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE GFXRenderPass* renderPass() const { return _renderPass; }
|
||||
CC_INLINE const GFXTextureViewList& colorViews() const { return _colorViews; }
|
||||
CC_INLINE GFXTextureView* depthStencilView() const { return _depthStencilView; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE GFXRenderPass* getRenderPass() const { return _renderPass; }
|
||||
CC_INLINE const GFXTextureViewList& getColorViews() const { return _colorViews; }
|
||||
CC_INLINE GFXTextureView* getDepthStencilView() const { return _depthStencilView; }
|
||||
CC_INLINE bool isOffscreen() const { return _isOffscreen; }
|
||||
|
||||
protected:
|
||||
|
||||
@@ -14,18 +14,18 @@ class CC_CORE_API GFXInputAssembler : public Object {
|
||||
virtual bool initialize(const GFXInputAssemblerInfo& info) = 0;
|
||||
virtual void destroy() = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE const GFXAttributeList& attributes() const { return _attributes; }
|
||||
CC_INLINE const GFXBufferList& vertexBuffers() const { return _vertexBuffers; }
|
||||
CC_INLINE GFXBuffer* indexBuffer() const { return _indexBuffer; }
|
||||
CC_INLINE GFXBuffer* indirectBuffer() const { return _indirectBuffer; }
|
||||
CC_INLINE uint vertexCount() const { return _vertexCount; }
|
||||
CC_INLINE uint firstVertex() const { return _firstVertex; }
|
||||
CC_INLINE uint indexCount() const { return _indexCount; }
|
||||
CC_INLINE uint firstIndex() const { return _firstIndex; }
|
||||
CC_INLINE uint vertexOffset() const { return _vertexOffset; }
|
||||
CC_INLINE uint instanceCount() const { return _instanceCount; }
|
||||
CC_INLINE uint firstInstance() const { return _firstInstance; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE const GFXAttributeList& getAttributes() const { return _attributes; }
|
||||
CC_INLINE const GFXBufferList& getVertexBuffers() const { return _vertexBuffers; }
|
||||
CC_INLINE GFXBuffer* getIndexBuffer() const { return _indexBuffer; }
|
||||
CC_INLINE GFXBuffer* getIndirectBuffer() const { return _indirectBuffer; }
|
||||
CC_INLINE uint getVertexCount() const { return _vertexCount; }
|
||||
CC_INLINE uint getFirstVertex() const { return _firstVertex; }
|
||||
CC_INLINE uint getIndexCount() const { return _indexCount; }
|
||||
CC_INLINE uint getFirstIndex() const { return _firstIndex; }
|
||||
CC_INLINE uint getVertexOffset() const { return _vertexOffset; }
|
||||
CC_INLINE uint getInstanceCount() const { return _instanceCount; }
|
||||
CC_INLINE uint getFirstInstance() const { return _firstInstance; }
|
||||
|
||||
CC_INLINE void setVertexCount(uint count) { _vertexCount = count; }
|
||||
CC_INLINE void setFirstVertex(uint first) { _firstVertex = first; }
|
||||
|
||||
@@ -14,9 +14,9 @@ public:
|
||||
virtual bool initialize(const GFXPipelineLayoutInfo& info) = 0;
|
||||
virtual void destroy() = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE const GFXPushConstantRangeList& pushConstantsRanges() const { return _pushConstantsRanges; }
|
||||
CC_INLINE const GFXBindingLayoutList& layouts() const { return _layouts; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE const GFXPushConstantRangeList& getPushConstantsRanges() const { return _pushConstantsRanges; }
|
||||
CC_INLINE const GFXBindingLayoutList& getLayouts() const { return _layouts; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -14,16 +14,16 @@ public:
|
||||
virtual bool initialize(const GFXPipelineStateInfo& info) = 0;
|
||||
virtual void destroy() = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE GFXShader* shader() const { return _shader; }
|
||||
CC_INLINE GFXPrimitiveMode primitive() const { return _primitive; }
|
||||
CC_INLINE const GFXInputState& inputState() const { return _inputState; }
|
||||
CC_INLINE const GFXRasterizerState& rasterizerState() const { return _rasterizerState; }
|
||||
CC_INLINE const GFXDepthStencilState& depthStencilState() const { return _depthStencilState; }
|
||||
CC_INLINE const GFXBlendState& blendState() const { return _blendState; }
|
||||
CC_INLINE const GFXDynamicStateList& dynamicStates() const { return _dynamicStates; }
|
||||
CC_INLINE const GFXPipelineLayout* pipelineLayout() const { return _layout; }
|
||||
CC_INLINE const GFXRenderPass* renderPass() const { return _renderPass; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE GFXShader* getShader() const { return _shader; }
|
||||
CC_INLINE GFXPrimitiveMode getPrimitive() const { return _primitive; }
|
||||
CC_INLINE const GFXInputState& getInputState() const { return _inputState; }
|
||||
CC_INLINE const GFXRasterizerState& getRasterizerState() const { return _rasterizerState; }
|
||||
CC_INLINE const GFXDepthStencilState& getDepthStencilState() const { return _depthStencilState; }
|
||||
CC_INLINE const GFXBlendState& getBlendState() const { return _blendState; }
|
||||
CC_INLINE const GFXDynamicStateList& getDynamicStates() const { return _dynamicStates; }
|
||||
CC_INLINE const GFXPipelineLayout* getPipelineLayout() const { return _layout; }
|
||||
CC_INLINE const GFXRenderPass* getRenderPass() const { return _renderPass; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -15,8 +15,8 @@ public:
|
||||
virtual void destroy() = 0;
|
||||
virtual void submit(const std::vector<GFXCommandBuffer*>& cmd_buffs) = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE GFXQueueType type() const { return _type; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE GFXQueueType getType() const { return _type; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -14,10 +14,10 @@ class CC_CORE_API GFXRenderPass : public Object {
|
||||
virtual bool initialize(const GFXRenderPassInfo& info) = 0;
|
||||
virtual void destroy() = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE const GFXColorAttachmentList& colorAttachments() const { return _colorAttachments; }
|
||||
CC_INLINE const GFXDepthStencilAttachment& depthStencilAttachment() const { return _depthStencilAttachment; }
|
||||
CC_INLINE const GFXSubPassList& subPasses() const { return _subPasses; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE const GFXColorAttachmentList& getColorAttachments() const { return _colorAttachments; }
|
||||
CC_INLINE const GFXDepthStencilAttachment& getDepthStencilAttachment() const { return _depthStencilAttachment; }
|
||||
CC_INLINE const GFXSubPassList& getSubPasses() const { return _subPasses; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -14,20 +14,20 @@ class CC_CORE_API GFXSampler : public Object {
|
||||
virtual bool initialize(const GFXSamplerInfo& info) = 0;
|
||||
virtual void destroy() = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE const String& name() const { return _name; }
|
||||
CC_INLINE GFXFilter minFilter() const { return _minFilter; }
|
||||
CC_INLINE GFXFilter magFilter() const { return _magFilter; }
|
||||
CC_INLINE GFXFilter mipFilter() const { return _mipFilter; }
|
||||
CC_INLINE GFXAddress addressU() const { return _addressU; }
|
||||
CC_INLINE GFXAddress addressV() const { return _addressV; }
|
||||
CC_INLINE GFXAddress addressW() const { return _addressW; }
|
||||
CC_INLINE uint maxAnisotropy() const { return _maxAnisotropy; }
|
||||
CC_INLINE GFXComparisonFunc cmpFunc() const { return _cmpFunc; }
|
||||
CC_INLINE const GFXColor& borderColor() const { return _borderColor; }
|
||||
CC_INLINE uint minLOD() const { return _minLOD; }
|
||||
CC_INLINE uint maxLOD() const { return _maxLOD; }
|
||||
CC_INLINE float mipLODBias() const { return _mipLODBias; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE const String& getName() const { return _name; }
|
||||
CC_INLINE GFXFilter getMinFilter() const { return _minFilter; }
|
||||
CC_INLINE GFXFilter getMagFilter() const { return _magFilter; }
|
||||
CC_INLINE GFXFilter getMipFilter() const { return _mipFilter; }
|
||||
CC_INLINE GFXAddress getAddressU() const { return _addressU; }
|
||||
CC_INLINE GFXAddress getAddressV() const { return _addressV; }
|
||||
CC_INLINE GFXAddress getAddressW() const { return _addressW; }
|
||||
CC_INLINE uint getMaxAnisotropy() const { return _maxAnisotropy; }
|
||||
CC_INLINE GFXComparisonFunc getCmpFunc() const { return _cmpFunc; }
|
||||
CC_INLINE const GFXColor& getBorderColor() const { return _borderColor; }
|
||||
CC_INLINE uint getMinLOD() const { return _minLOD; }
|
||||
CC_INLINE uint getMaxLOD() const { return _maxLOD; }
|
||||
CC_INLINE float getMipLODBias() const { return _mipLODBias; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -14,13 +14,13 @@ class CC_CORE_API GFXShader : public Object {
|
||||
virtual bool initialize(const GFXShaderInfo& info) = 0;
|
||||
virtual void destroy() = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
// Can not rename to `id` as JS code, because `id` is a keyword in objective-c.
|
||||
CC_INLINE uint hash() const { return _hash; }
|
||||
CC_INLINE const String& name() const { return _name; }
|
||||
CC_INLINE const GFXShaderStageList& stages() const { return _stages; }
|
||||
CC_INLINE const GFXUniformBlockList& blocks() const { return _blocks; }
|
||||
CC_INLINE const GFXUniformSamplerList& samplers() const { return _samplers; }
|
||||
CC_INLINE uint getHash() const { return _hash; }
|
||||
CC_INLINE const String& getName() const { return _name; }
|
||||
CC_INLINE const GFXShaderStageList& getStages() const { return _stages; }
|
||||
CC_INLINE const GFXUniformBlockList& getBlocks() const { return _blocks; }
|
||||
CC_INLINE const GFXUniformSamplerList& getSamplers() const { return _samplers; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -15,18 +15,18 @@ class CC_CORE_API GFXTexture : public Object {
|
||||
virtual void destroy() = 0;
|
||||
virtual void resize(uint width, uint height) = 0;
|
||||
|
||||
CC_INLINE GFXTextureType type() const { return _type; }
|
||||
CC_INLINE GFXTextureUsage usage() const { return _usage; }
|
||||
CC_INLINE GFXFormat format() const { return _format; }
|
||||
CC_INLINE uint width() const { return _width; }
|
||||
CC_INLINE uint height() const { return _height; }
|
||||
CC_INLINE uint depth() const { return _depth; }
|
||||
CC_INLINE uint arrayLayer() const { return _arrayLayer; }
|
||||
CC_INLINE uint mipLevel() const { return _mipLevel; }
|
||||
CC_INLINE uint size() const { return _size; }
|
||||
CC_INLINE GFXSampleCount samples() const { return _samples; }
|
||||
CC_INLINE GFXTextureFlags flags() const { return _flags; }
|
||||
CC_INLINE uint8_t* buffer() const { return _buffer; }
|
||||
CC_INLINE GFXTextureType getType() const { return _type; }
|
||||
CC_INLINE GFXTextureUsage getUsage() const { return _usage; }
|
||||
CC_INLINE GFXFormat getFormat() const { return _format; }
|
||||
CC_INLINE uint getWidth() const { return _width; }
|
||||
CC_INLINE uint getHeight() const { return _height; }
|
||||
CC_INLINE uint getDepth() const { return _depth; }
|
||||
CC_INLINE uint getArrayLayer() const { return _arrayLayer; }
|
||||
CC_INLINE uint getMipLevel() const { return _mipLevel; }
|
||||
CC_INLINE uint getSize() const { return _size; }
|
||||
CC_INLINE GFXSampleCount getSamples() const { return _samples; }
|
||||
CC_INLINE GFXTextureFlags getFlags() const { return _flags; }
|
||||
CC_INLINE uint8_t* getBuffer() const { return _buffer; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -14,14 +14,14 @@ class CC_CORE_API GFXTextureView : public Object {
|
||||
virtual bool initialize(const GFXTextureViewInfo& info) = 0;
|
||||
virtual void destroy() = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE GFXTexture* texture() const { return _texture; }
|
||||
CC_INLINE GFXTextureViewType type() const { return _type; }
|
||||
CC_INLINE GFXFormat format() const { return _format; }
|
||||
CC_INLINE uint baseLevel() const { return _baseLevel; }
|
||||
CC_INLINE uint levelCount() const { return _levelCount; }
|
||||
CC_INLINE uint baseLayer() const { return _baseLayer; }
|
||||
CC_INLINE uint layerCount() const { return _layerCount; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE GFXTexture* getTexture() const { return _texture; }
|
||||
CC_INLINE GFXTextureViewType getType() const { return _type; }
|
||||
CC_INLINE GFXFormat getFormat() const { return _format; }
|
||||
CC_INLINE uint getBaseLevel() const { return _baseLevel; }
|
||||
CC_INLINE uint getLevelCount() const { return _levelCount; }
|
||||
CC_INLINE uint getBaseLayer() const { return _baseLayer; }
|
||||
CC_INLINE uint getLayerCount() const { return _layerCount; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -15,23 +15,23 @@ class CC_CORE_API GFXWindow : public Object {
|
||||
virtual void destroy() = 0;
|
||||
virtual void resize(uint width, uint height) = 0;
|
||||
|
||||
CC_INLINE GFXDevice* device() const { return _device; }
|
||||
CC_INLINE const String& title() const { return _title; }
|
||||
CC_INLINE int left() const { return _left; }
|
||||
CC_INLINE int top() const { return _top; }
|
||||
CC_INLINE uint width() const { return _width; }
|
||||
CC_INLINE uint height() const { return _height; }
|
||||
CC_INLINE uint nativeWidth() const { return _nativeWidth; }
|
||||
CC_INLINE uint nativeHeight() const { return _nativeHeight; }
|
||||
CC_INLINE GFXFormat colorFormat() const { return _colorFmt; }
|
||||
CC_INLINE GFXFormat detphStencilFormat() const { return _depthStencilFmt; }
|
||||
CC_INLINE GFXDevice* getDevice() const { return _device; }
|
||||
CC_INLINE const String& getTitle() const { return _title; }
|
||||
CC_INLINE int getLeft() const { return _left; }
|
||||
CC_INLINE int getTop() const { return _top; }
|
||||
CC_INLINE uint getWidth() const { return _width; }
|
||||
CC_INLINE uint getHeight() const { return _height; }
|
||||
CC_INLINE uint getNativeWidth() const { return _nativeWidth; }
|
||||
CC_INLINE uint getNativeHeight() const { return _nativeHeight; }
|
||||
CC_INLINE GFXFormat getColorFormat() const { return _colorFmt; }
|
||||
CC_INLINE GFXFormat getDetphStencilFormat() const { return _depthStencilFmt; }
|
||||
CC_INLINE bool isOffscreen() const { return _isOffscreen; }
|
||||
CC_INLINE GFXRenderPass* renderPass() const { return _renderPass; }
|
||||
CC_INLINE GFXTexture* colorTexture() const { return _colorTex; }
|
||||
CC_INLINE GFXTextureView* colorTexView() const { return _colorTexView; }
|
||||
CC_INLINE GFXTexture* depthStencilTexture() const { return _depthStencilTex; }
|
||||
CC_INLINE GFXTextureView* depthStencilTexView() const { return _depthStencilTexView; }
|
||||
CC_INLINE GFXFramebuffer* framebuffer() const { return _framebuffer; }
|
||||
CC_INLINE GFXRenderPass* getRenderPass() const { return _renderPass; }
|
||||
CC_INLINE GFXTexture* getColorTexture() const { return _colorTex; }
|
||||
CC_INLINE GFXTextureView* getColorTexView() const { return _colorTexView; }
|
||||
CC_INLINE GFXTexture* getDepthStencilTexture() const { return _depthStencilTex; }
|
||||
CC_INLINE GFXTextureView* getDepthStencilTexView() const { return _depthStencilTexView; }
|
||||
CC_INLINE GFXFramebuffer* getFramebuffer() const { return _framebuffer; }
|
||||
|
||||
protected:
|
||||
GFXDevice* _device = nullptr;
|
||||
|
||||
@@ -22,7 +22,7 @@ bool GLES2Buffer::initialize(const GFXBufferInfo& info) {
|
||||
|
||||
if ((_flags & GFXBufferFlagBit::BAKUP_BUFFER) && _size > 0) {
|
||||
_buffer = (uint8_t*)CC_MALLOC(_size);
|
||||
_device->memoryStatus().bufferSize += _size;
|
||||
_device->getMemoryStatus().bufferSize += _size;
|
||||
}
|
||||
|
||||
_gpuBuffer = CC_NEW(GLES2GPUBuffer);
|
||||
@@ -37,7 +37,7 @@ bool GLES2Buffer::initialize(const GFXBufferInfo& info) {
|
||||
}
|
||||
|
||||
GLES2CmdFuncCreateBuffer((GLES2Device*)_device, _gpuBuffer);
|
||||
_device->memoryStatus().bufferSize += _size;
|
||||
_device->getMemoryStatus().bufferSize += _size;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -45,14 +45,14 @@ bool GLES2Buffer::initialize(const GFXBufferInfo& info) {
|
||||
void GLES2Buffer::destroy() {
|
||||
if (_gpuBuffer) {
|
||||
GLES2CmdFuncDestroyBuffer((GLES2Device*)_device, _gpuBuffer);
|
||||
_device->memoryStatus().bufferSize -= _size;
|
||||
_device->getMemoryStatus().bufferSize -= _size;
|
||||
CC_DELETE(_gpuBuffer);
|
||||
_gpuBuffer = nullptr;
|
||||
}
|
||||
|
||||
if (_buffer) {
|
||||
CC_FREE(_buffer);
|
||||
_device->memoryStatus().bufferSize -= _size;
|
||||
_device->getMemoryStatus().bufferSize -= _size;
|
||||
_buffer = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ void GLES2Buffer::resize(uint size) {
|
||||
_size = size;
|
||||
_count = _size / _stride;
|
||||
|
||||
GFXMemoryStatus& status = _device->memoryStatus();
|
||||
GFXMemoryStatus& status = _device->getMemoryStatus();
|
||||
_gpuBuffer->size = _size;
|
||||
_gpuBuffer->count = _count;
|
||||
GLES2CmdFuncResizeBuffer((GLES2Device*)_device, _gpuBuffer);
|
||||
|
||||
@@ -200,19 +200,19 @@ void GLES2CommandBuffer::draw(GFXInputAssembler* ia) {
|
||||
switch (_curGPUPipelineState->glPrimitive) {
|
||||
case GL_TRIANGLES:
|
||||
{
|
||||
if (ia->indexBuffer() == nullptr)
|
||||
if (ia->getIndexBuffer() == nullptr)
|
||||
{
|
||||
_numTriangles += ia->vertexCount() / 3 * std::max(ia->instanceCount(), 1U);
|
||||
_numTriangles += ia->getVertexCount() / 3 * std::max(ia->getInstanceCount(), 1U);
|
||||
}
|
||||
else
|
||||
{
|
||||
_numTriangles += ia->indexCount() / 3 * std::max(ia->instanceCount(), 1U);
|
||||
_numTriangles += ia->getIndexCount() / 3 * std::max(ia->getInstanceCount(), 1U);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GL_TRIANGLE_STRIP:
|
||||
case GL_TRIANGLE_FAN: {
|
||||
_numTriangles += (ia->vertexCount() - 2) * std::max(ia->instanceCount(), 1U);
|
||||
_numTriangles += (ia->getVertexCount() - 2) * std::max(ia->getInstanceCount(), 1U);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -297,8 +297,8 @@ void GLES2CommandBuffer::execute(const std::vector<GFXCommandBuffer*>& cmd_buffs
|
||||
}
|
||||
_cmdPackage->cmds.concat(cmd_buff->_cmdPackage->cmds);
|
||||
|
||||
_numDrawCalls += cmd_buff->numDrawCalls();
|
||||
_numTriangles += cmd_buff->numTris();
|
||||
_numDrawCalls += cmd_buff->getNumDrawCalls();
|
||||
_numTriangles += cmd_buff->getNumTris();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -192,8 +192,8 @@ bool GLES2Context::initialize(const GFXContextInfo &info) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint width = _device->width();
|
||||
uint height = _device->height();
|
||||
uint width = _device->getWidth();
|
||||
uint height = _device->getHeight();
|
||||
ANativeWindow_setBuffersGeometry((ANativeWindow*)_windowHandle, width, height, n_fmt);
|
||||
#endif
|
||||
|
||||
@@ -248,8 +248,8 @@ bool GLES2Context::initialize(const GFXContextInfo &info) {
|
||||
_eglDisplay = sharedCtx->egl_display();
|
||||
_eglConfig = sharedCtx->egl_config();
|
||||
_eglSharedContext = sharedCtx->egl_shared_ctx();
|
||||
_colorFmt = sharedCtx->colorFormat();
|
||||
_depthStencilFmt = sharedCtx->detphStencilFormat();
|
||||
_colorFmt = sharedCtx->getColorFormat();
|
||||
_depthStencilFmt = sharedCtx->getDetphStencilFormat();
|
||||
|
||||
EGLint pbuff_attribs[] =
|
||||
{
|
||||
|
||||
@@ -114,8 +114,8 @@ bool GLES2Device::initialize(const GFXDeviceInfo& info)
|
||||
CC_LOG_INFO("COMPRESSED_FORMATS: %s", compressed_fmts.c_str());
|
||||
|
||||
GFXWindowInfo window_info;
|
||||
window_info.colorFmt = _context->colorFormat();
|
||||
window_info.depthStencilFmt = _context->detphStencilFormat();
|
||||
window_info.colorFmt = _context->getColorFormat();
|
||||
window_info.depthStencilFmt = _context->getDetphStencilFormat();
|
||||
window_info.isOffscreen = false;
|
||||
_window = createWindow(window_info);
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ bool GLES2Framebuffer::initialize(const GFXFramebufferInfo &info) {
|
||||
#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS)
|
||||
else
|
||||
{
|
||||
_gpuFBO->glFramebuffer = static_cast<GLES2Context*>(_device->context())->getDefaultFramebuffer();
|
||||
_gpuFBO->glFramebuffer = static_cast<GLES2Context*>(_device->getContext())->getDefaultFramebuffer();
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
|
||||
@@ -20,9 +20,9 @@ bool GLES2InputAssembler::initialize(const GFXInputAssemblerInfo &info) {
|
||||
_indirectBuffer = info.indirectBuffer;
|
||||
|
||||
if (_indexBuffer) {
|
||||
_indexCount = _indexBuffer->count();
|
||||
_indexCount = _indexBuffer->getCount();
|
||||
} else if (_vertexBuffers.size()) {
|
||||
_vertexCount = _vertexBuffers[0]->count();
|
||||
_vertexCount = _vertexBuffers[0]->getCount();
|
||||
}
|
||||
|
||||
_gpuInputAssembler = CC_NEW(GLES2GPUInputAssembler);
|
||||
|
||||
@@ -27,7 +27,7 @@ bool GLES2Texture::initialize(const GFXTextureInfo &info) {
|
||||
|
||||
if (_flags & GFXTextureFlags::BAKUP_BUFFER) {
|
||||
_buffer = (uint8_t*)CC_MALLOC(_size);
|
||||
_device->memoryStatus().textureSize += _size;
|
||||
_device->getMemoryStatus().textureSize += _size;
|
||||
}
|
||||
|
||||
_gpuTexture = CC_NEW(GLES2GPUTexture);
|
||||
@@ -78,7 +78,7 @@ bool GLES2Texture::initialize(const GFXTextureInfo &info) {
|
||||
_gpuTexture->isPowerOf2 = math::IsPowerOfTwo(_width) && math::IsPowerOfTwo(_height);
|
||||
|
||||
GLES2CmdFuncCreateTexture((GLES2Device*)_device, _gpuTexture);
|
||||
_device->memoryStatus().textureSize += _size;
|
||||
_device->getMemoryStatus().textureSize += _size;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -86,14 +86,14 @@ bool GLES2Texture::initialize(const GFXTextureInfo &info) {
|
||||
void GLES2Texture::destroy() {
|
||||
if (_gpuTexture) {
|
||||
GLES2CmdFuncDestroyTexture((GLES2Device*)_device, _gpuTexture);
|
||||
_device->memoryStatus().textureSize -= _size;
|
||||
_device->getMemoryStatus().textureSize -= _size;
|
||||
CC_DELETE(_gpuTexture);
|
||||
_gpuTexture = nullptr;
|
||||
}
|
||||
|
||||
if (_buffer) {
|
||||
CC_FREE(_buffer);
|
||||
_device->memoryStatus().textureSize -= _size;
|
||||
_device->getMemoryStatus().textureSize -= _size;
|
||||
_buffer = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void GLES2Texture::resize(uint width, uint height) {
|
||||
_height = height;
|
||||
_size = size;
|
||||
|
||||
GFXMemoryStatus& status = _device->memoryStatus();
|
||||
GFXMemoryStatus& status = _device->getMemoryStatus();
|
||||
_gpuTexture->width = _width;
|
||||
_gpuTexture->height = _height;
|
||||
_gpuTexture->size = _size;
|
||||
|
||||
@@ -22,7 +22,7 @@ bool GLES3Buffer::initialize(const GFXBufferInfo& info) {
|
||||
|
||||
if ((_flags & GFXBufferFlagBit::BAKUP_BUFFER) && _size > 0) {
|
||||
_buffer = (uint8_t*)CC_MALLOC(_size);
|
||||
_device->memoryStatus().bufferSize += _size;
|
||||
_device->getMemoryStatus().bufferSize += _size;
|
||||
}
|
||||
|
||||
_gpuBuffer = CC_NEW(GLES3GPUBuffer);
|
||||
@@ -37,7 +37,7 @@ bool GLES3Buffer::initialize(const GFXBufferInfo& info) {
|
||||
}
|
||||
|
||||
GLES3CmdFuncCreateBuffer((GLES3Device*)_device, _gpuBuffer);
|
||||
_device->memoryStatus().bufferSize += _size;
|
||||
_device->getMemoryStatus().bufferSize += _size;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -45,14 +45,14 @@ bool GLES3Buffer::initialize(const GFXBufferInfo& info) {
|
||||
void GLES3Buffer::destroy() {
|
||||
if (_gpuBuffer) {
|
||||
GLES3CmdFuncDestroyBuffer((GLES3Device*)_device, _gpuBuffer);
|
||||
_device->memoryStatus().bufferSize -= _size;
|
||||
_device->getMemoryStatus().bufferSize -= _size;
|
||||
CC_DELETE(_gpuBuffer);
|
||||
_gpuBuffer = nullptr;
|
||||
}
|
||||
|
||||
if (_buffer) {
|
||||
CC_FREE(_buffer);
|
||||
_device->memoryStatus().bufferSize -= _size;
|
||||
_device->getMemoryStatus().bufferSize -= _size;
|
||||
_buffer = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ void GLES3Buffer::resize(uint size) {
|
||||
_size = size;
|
||||
_count = _size / _stride;
|
||||
|
||||
GFXMemoryStatus& status = _device->memoryStatus();
|
||||
GFXMemoryStatus& status = _device->getMemoryStatus();
|
||||
_gpuBuffer->size = _size;
|
||||
_gpuBuffer->count = _count;
|
||||
GLES3CmdFuncResizeBuffer((GLES3Device*)_device, _gpuBuffer);
|
||||
|
||||
@@ -199,12 +199,12 @@ void GLES3CommandBuffer::draw(GFXInputAssembler* ia) {
|
||||
if(_curGPUPipelineState) {
|
||||
switch (_curGPUPipelineState->glPrimitive) {
|
||||
case GL_TRIANGLES: {
|
||||
_numTriangles += ia->indexCount() / 3 * std::max(ia->instanceCount(), 1U);
|
||||
_numTriangles += ia->getIndexCount() / 3 * std::max(ia->getInstanceCount(), 1U);
|
||||
break;
|
||||
}
|
||||
case GL_TRIANGLE_STRIP:
|
||||
case GL_TRIANGLE_FAN: {
|
||||
_numTriangles += (ia->indexCount() - 2) * std::max(ia->instanceCount(), 1U);
|
||||
_numTriangles += (ia->getIndexCount() - 2) * std::max(ia->getInstanceCount(), 1U);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -289,8 +289,8 @@ void GLES3CommandBuffer::execute(const std::vector<GFXCommandBuffer*>& cmd_buffs
|
||||
}
|
||||
_cmdPackage->cmds.concat(cmd_buff->_cmdPackage->cmds);
|
||||
|
||||
_numDrawCalls += cmd_buff->numDrawCalls();
|
||||
_numTriangles += cmd_buff->numTris();
|
||||
_numDrawCalls += cmd_buff->getNumDrawCalls();
|
||||
_numTriangles += cmd_buff->getNumTris();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -192,8 +192,8 @@ bool GLES3Context::initialize(const GFXContextInfo &info) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint width = _device->width();
|
||||
uint height = _device->height();
|
||||
uint width = _device->getWidth();
|
||||
uint height = _device->getHeight();
|
||||
ANativeWindow_setBuffersGeometry((ANativeWindow*)_windowHandle, width, height, n_fmt);
|
||||
#endif
|
||||
|
||||
@@ -256,8 +256,8 @@ bool GLES3Context::initialize(const GFXContextInfo &info) {
|
||||
_eglDisplay = sharedCtx->egl_display();
|
||||
_eglConfig = sharedCtx->egl_config();
|
||||
_eglSharedContext = sharedCtx->egl_shared_ctx();
|
||||
_colorFmt = sharedCtx->colorFormat();
|
||||
_depthStencilFmt = sharedCtx->detphStencilFormat();
|
||||
_colorFmt = sharedCtx->getColorFormat();
|
||||
_depthStencilFmt = sharedCtx->getDetphStencilFormat();
|
||||
|
||||
EGLint pbuff_attribs[] =
|
||||
{
|
||||
|
||||
@@ -107,8 +107,8 @@ bool GLES3Device::initialize(const GFXDeviceInfo& info)
|
||||
CC_LOG_INFO("COMPRESSED_FORMATS: %s", compressed_fmts.c_str());
|
||||
|
||||
GFXWindowInfo window_info;
|
||||
window_info.colorFmt = _context->colorFormat();
|
||||
window_info.depthStencilFmt = _context->detphStencilFormat();
|
||||
window_info.colorFmt = _context->getColorFormat();
|
||||
window_info.depthStencilFmt = _context->getDetphStencilFormat();
|
||||
window_info.isOffscreen = false;
|
||||
_window = createWindow(window_info);
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ bool GLES3Framebuffer::initialize(const GFXFramebufferInfo &info) {
|
||||
#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS)
|
||||
else
|
||||
{
|
||||
_gpuFBO->glFramebuffer = static_cast<GLES3Context*>(_device->context())->getDefaultFramebuffer();
|
||||
_gpuFBO->glFramebuffer = static_cast<GLES3Context*>(_device->getContext())->getDefaultFramebuffer();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ bool GLES3InputAssembler::initialize(const GFXInputAssemblerInfo &info) {
|
||||
_indirectBuffer = info.indirectBuffer;
|
||||
|
||||
if (_indexBuffer) {
|
||||
_indexCount = _indexBuffer->count();
|
||||
_indexCount = _indexBuffer->getCount();
|
||||
} else if (_vertexBuffers.size()) {
|
||||
_vertexCount = _vertexBuffers[0]->count();
|
||||
_vertexCount = _vertexBuffers[0]->getCount();
|
||||
}
|
||||
|
||||
_gpuInputAssembler = CC_NEW(GLES3GPUInputAssembler);
|
||||
|
||||
@@ -27,7 +27,7 @@ bool GLES3Texture::initialize(const GFXTextureInfo &info) {
|
||||
|
||||
if (_flags & GFXTextureFlags::BAKUP_BUFFER) {
|
||||
_buffer = (uint8_t*)CC_MALLOC(_size);
|
||||
_device->memoryStatus().textureSize += _size;
|
||||
_device->getMemoryStatus().textureSize += _size;
|
||||
}
|
||||
|
||||
_gpuTexture = CC_NEW(GLES3GPUTexture);
|
||||
@@ -78,7 +78,7 @@ bool GLES3Texture::initialize(const GFXTextureInfo &info) {
|
||||
_gpuTexture->isPowerOf2 = math::IsPowerOfTwo(_width) && math::IsPowerOfTwo(_height);
|
||||
|
||||
GLES3CmdFuncCreateTexture((GLES3Device*)_device, _gpuTexture);
|
||||
_device->memoryStatus().textureSize += _size;
|
||||
_device->getMemoryStatus().textureSize += _size;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -86,14 +86,14 @@ bool GLES3Texture::initialize(const GFXTextureInfo &info) {
|
||||
void GLES3Texture::destroy() {
|
||||
if (_gpuTexture) {
|
||||
GLES3CmdFuncDestroyTexture((GLES3Device*)_device, _gpuTexture);
|
||||
_device->memoryStatus().textureSize -= _size;
|
||||
_device->getMemoryStatus().textureSize -= _size;
|
||||
CC_DELETE(_gpuTexture);
|
||||
_gpuTexture = nullptr;
|
||||
}
|
||||
|
||||
if (_buffer) {
|
||||
CC_FREE(_buffer);
|
||||
_device->memoryStatus().textureSize -= _size;
|
||||
_device->getMemoryStatus().textureSize -= _size;
|
||||
_buffer = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void GLES3Texture::resize(uint width, uint height) {
|
||||
_height = height;
|
||||
_size = size;
|
||||
|
||||
GFXMemoryStatus& status = _device->memoryStatus();
|
||||
GFXMemoryStatus& status = _device->getMemoryStatus();
|
||||
_gpuTexture->width = _width;
|
||||
_gpuTexture->height = _height;
|
||||
_gpuTexture->size = _size;
|
||||
|
||||
@@ -40,7 +40,7 @@ bool CCMTLBuffer::initialize(const GFXBufferInfo& info)
|
||||
if ((_flags & GFXBufferFlagBit::BAKUP_BUFFER) && _size > 0)
|
||||
{
|
||||
_buffer = (uint8_t*)CC_MALLOC(_size);
|
||||
_device->memoryStatus().bufferSize += _size;
|
||||
_device->getMemoryStatus().bufferSize += _size;
|
||||
}
|
||||
|
||||
switch (info.usage) {
|
||||
@@ -62,7 +62,7 @@ bool CCMTLBuffer::initialize(const GFXBufferInfo& info)
|
||||
CCASSERT(false, "CCMTLBuffer: failed to create memory for transfer buffer.");
|
||||
return false;
|
||||
}
|
||||
_device->memoryStatus().bufferSize += _size;
|
||||
_device->getMemoryStatus().bufferSize += _size;
|
||||
break;
|
||||
|
||||
case GFXBufferUsage::STORAGE:
|
||||
@@ -80,7 +80,7 @@ bool CCMTLBuffer::initialize(const GFXBufferInfo& info)
|
||||
if (!_buffer)
|
||||
CCLOG("CCMTLBuffer: failed to create backup memory.");
|
||||
else
|
||||
_device->memoryStatus().bufferSize += _size;
|
||||
_device->getMemoryStatus().bufferSize += _size;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -98,13 +98,13 @@ void CCMTLBuffer::destroy()
|
||||
{
|
||||
CC_FREE(_transferBuffer);
|
||||
_transferBuffer = nullptr;
|
||||
_device->memoryStatus().bufferSize -= _size;
|
||||
_device->getMemoryStatus().bufferSize -= _size;
|
||||
}
|
||||
|
||||
if (_buffer)
|
||||
{
|
||||
CC_FREE(_buffer);
|
||||
_device->memoryStatus().bufferSize -= _size;
|
||||
_device->getMemoryStatus().bufferSize -= _size;
|
||||
_buffer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,10 +201,10 @@ void CCMTLCommandBuffer::draw(GFXInputAssembler* ia)
|
||||
{
|
||||
switch (_currentGPUPipelineState->primitiveType) {
|
||||
case MTLPrimitiveTypeTriangle:
|
||||
_numTriangles += ia->indexCount() / 3 * std::max(ia->indexCount(), 1U);
|
||||
_numTriangles += ia->getIndexCount() / 3 * std::max(ia->getIndexCount(), 1U);
|
||||
break;
|
||||
case MTLPrimitiveTypeTriangleStrip:
|
||||
_numTriangles += (ia->indexCount() - 2) * std::max(ia->instanceCount(), 1U);
|
||||
_numTriangles += (ia->getIndexCount() - 2) * std::max(ia->getInstanceCount(), 1U);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -17,9 +17,9 @@ bool CCMTLInputAssembler::initialize(const GFXInputAssemblerInfo& info)
|
||||
_indirectBuffer = info.indirectBuffer;
|
||||
|
||||
if (_indexBuffer)
|
||||
_indexCount = _indexBuffer->count();
|
||||
_indexCount = _indexBuffer->getCount();
|
||||
else if (_vertexBuffers.size())
|
||||
_vertexCount = _vertexBuffers[0]->count();
|
||||
_vertexCount = _vertexBuffers[0]->getCount();
|
||||
|
||||
_GPUInputAssembler = CC_NEW(CCMTLGPUInputAssembler);
|
||||
if (!_GPUInputAssembler)
|
||||
|
||||
@@ -55,7 +55,7 @@ void CCMTLPipelineState::updateBindingBlocks(const GFXBindingLayout* bl)
|
||||
if (!bl)
|
||||
return;
|
||||
|
||||
for (const auto& bindingUnit : bl->bindingUnits() )
|
||||
for (const auto& bindingUnit : bl->getBindingUnits() )
|
||||
{
|
||||
for (auto& block : _vertexUniformBlocks)
|
||||
{
|
||||
@@ -250,7 +250,7 @@ void CCMTLPipelineState::setFormats(MTLRenderPipelineDescriptor* descriptor)
|
||||
{
|
||||
int i = 0;
|
||||
MTLPixelFormat mtlPixelFormat;
|
||||
for (const auto& colorAttachment : _renderPass->colorAttachments())
|
||||
for (const auto& colorAttachment : _renderPass->getColorAttachments())
|
||||
{
|
||||
mtlPixelFormat = mu::toMTLPixelFormat(colorAttachment.format);
|
||||
if (mtlPixelFormat != MTLPixelFormatInvalid)
|
||||
@@ -259,11 +259,11 @@ void CCMTLPipelineState::setFormats(MTLRenderPipelineDescriptor* descriptor)
|
||||
++i;
|
||||
}
|
||||
|
||||
mtlPixelFormat = mu::toMTLPixelFormat(_renderPass->depthStencilAttachment().format);
|
||||
mtlPixelFormat = mu::toMTLPixelFormat(_renderPass->getDepthStencilAttachment().format);
|
||||
if (mtlPixelFormat != MTLPixelFormatInvalid)
|
||||
descriptor.depthAttachmentPixelFormat = mtlPixelFormat;
|
||||
|
||||
mtlPixelFormat = mu::toMTLPixelFormat(_renderPass->depthStencilAttachment().format);
|
||||
mtlPixelFormat = mu::toMTLPixelFormat(_renderPass->getDepthStencilAttachment().format);
|
||||
if (mtlPixelFormat != MTLPixelFormatInvalid)
|
||||
descriptor.stencilAttachmentPixelFormat = mtlPixelFormat;
|
||||
}
|
||||
@@ -375,7 +375,7 @@ std::tuple<uint,uint> CCMTLPipelineState::getBufferBinding(MTLArgument* argument
|
||||
for (MTLStructMember* member in argument.bufferStructType.members)
|
||||
{
|
||||
const char* memberName = [member.name UTF8String];
|
||||
for (const auto& block : _shader->blocks() )
|
||||
for (const auto& block : _shader->getBlocks() )
|
||||
{
|
||||
for (const auto& uniform : block.uniforms)
|
||||
{
|
||||
@@ -394,9 +394,9 @@ void CCMTLPipelineState::bindTextureAndSampler(MTLArgument* argument, bool isVer
|
||||
return;
|
||||
|
||||
const char* argumentName = [argument.name UTF8String];
|
||||
for (auto bindingLayout : _layout->layouts() )
|
||||
for (auto bindingLayout : _layout->getLayouts() )
|
||||
{
|
||||
for (const auto& bindingUnit : bindingLayout->bindingUnits() )
|
||||
for (const auto& bindingUnit : bindingLayout->getBindingUnits() )
|
||||
{
|
||||
if (bindingUnit.sampler)
|
||||
{
|
||||
@@ -418,9 +418,9 @@ bool CCMTLPipelineState::matchSamplerName(const char* argumentName, const std::s
|
||||
|
||||
void CCMTLPipelineState::bindTexture(MTLArgument* argument, uint originBinding, bool isVertex)
|
||||
{
|
||||
for (auto bindingLayout : _layout->layouts() )
|
||||
for (auto bindingLayout : _layout->getLayouts() )
|
||||
{
|
||||
for (const auto& bindingUnit : bindingLayout->bindingUnits() )
|
||||
for (const auto& bindingUnit : bindingLayout->getBindingUnits() )
|
||||
{
|
||||
if (bindingUnit.binding == originBinding)
|
||||
{
|
||||
@@ -447,9 +447,9 @@ void CCMTLPipelineState::bindTexture(MTLArgument* argument, uint originBinding,
|
||||
|
||||
void CCMTLPipelineState::bindSamplerState(MTLArgument* argument, uint originBinding, bool isVertex)
|
||||
{
|
||||
for (auto bindingLayout : _layout->layouts() )
|
||||
for (auto bindingLayout : _layout->getLayouts() )
|
||||
{
|
||||
for (const auto& bindingUnit : bindingLayout->bindingUnits() )
|
||||
for (const auto& bindingUnit : bindingLayout->getBindingUnits() )
|
||||
{
|
||||
if (bindingUnit.sampler && bindingUnit.binding == originBinding)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ void CCMTLQueue::executeCommands(const CCMTLCommandPackage* commandPackage)
|
||||
if (!cmdBeginRenderPass->frameBuffer->isOffscreen() )
|
||||
mtlRenderPassDescriptor = mtkView.currentRenderPassDescriptor;
|
||||
else
|
||||
mtlRenderPassDescriptor = static_cast<CCMTLRenderPass*>(cmdBeginRenderPass->frameBuffer->renderPass() )->getMTLRenderPassDescriptor();
|
||||
mtlRenderPassDescriptor = static_cast<CCMTLRenderPass*>(cmdBeginRenderPass->frameBuffer->getRenderPass() )->getMTLRenderPassDescriptor();
|
||||
|
||||
if (cmdBeginRenderPass->clearFlags & GFXClearFlagBit::COLOR)
|
||||
mtlRenderPassDescriptor.colorAttachments[0].clearColor = mu::toMTLClearColor(cmdBeginRenderPass->clearColors[0]);
|
||||
@@ -163,13 +163,13 @@ void CCMTLQueue::executeCommands(const CCMTLCommandPackage* commandPackage)
|
||||
if (gpuInputAssembler->mtlIndexBuffer && cmd->drawInfo.indexCount >= 0)
|
||||
{
|
||||
uint8_t* offset = 0;
|
||||
offset += cmd->drawInfo.firstIndex * inputAssembler->indexBuffer()->stride();
|
||||
offset += cmd->drawInfo.firstIndex * inputAssembler->getIndexBuffer()->getStride();
|
||||
if (cmd->drawInfo.instanceCount == 0)
|
||||
{
|
||||
[encoder drawIndexedPrimitives:primitiveType
|
||||
indexCount:cmd->drawInfo.indexCount
|
||||
// TODO: remove static_cast<>.
|
||||
indexType:static_cast<CCMTLBuffer*>(inputAssembler->indexBuffer() )->getIndexType()
|
||||
indexType:static_cast<CCMTLBuffer*>(inputAssembler->getIndexBuffer() )->getIndexType()
|
||||
indexBuffer:gpuInputAssembler->mtlIndexBuffer
|
||||
indexBufferOffset:0];
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ bool CCMTLTexture::initialize(const GFXTextureInfo& info)
|
||||
if (_flags & GFXTextureFlags::BAKUP_BUFFER)
|
||||
{
|
||||
_buffer = (uint8_t*)CC_MALLOC(_size);
|
||||
_device->memoryStatus().textureSize += _size;
|
||||
_device->getMemoryStatus().textureSize += _size;
|
||||
}
|
||||
|
||||
_convertedFormat = mu::convertGFXPixelFormat(_format);
|
||||
@@ -90,7 +90,7 @@ bool CCMTLTexture::initialize(const GFXTextureInfo& info)
|
||||
_mtlTexture = [mtlDevice newTextureWithDescriptor:descriptor];
|
||||
|
||||
if (_mtlTexture)
|
||||
_device->memoryStatus().textureSize += _size;
|
||||
_device->getMemoryStatus().textureSize += _size;
|
||||
|
||||
return _mtlTexture != nil;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ void CCMTLTexture::destroy()
|
||||
if (_buffer)
|
||||
{
|
||||
CC_FREE(_buffer);
|
||||
_device->memoryStatus().textureSize -= _size;
|
||||
_device->getMemoryStatus().textureSize -= _size;
|
||||
_buffer = nullptr;
|
||||
}
|
||||
|
||||
|
||||
+16
-16
@@ -63,22 +63,22 @@ skip = GFXBindingLayout::[GFXBindingLayout],
|
||||
GFXDevice::[copyBuffersToTexture],
|
||||
GFXBlendState::[targets]
|
||||
|
||||
getter_setter = GFXDevice::[width/width height/height nativeWidth/nativeWidth nativeHeight/nativeHeight memoryStatus/memoryStatus context/context mainWindow/mainWindow queue/queue commandAllocator/commandAllocator renderer/renderer vendor/vendor numDrawCalls/numDrawCalls numTris/numTris],
|
||||
GFXWindow::[device/device title/title left/left top/top width/width height/height nativeWidth/nativeWidth nativeHeight/nativeHeight colorFormat/colorFormat isOffscreen/isOffscreen renderPass/renderPass colorTexture/colorTexture colorTexView/colorTexView depthStencilTexture/depthStencilTexture depthStencilTexView/depthStencilTexView framebuffer/framebuffer],
|
||||
GFXShader::[device/device name/name hash/hash stages/stages blocks/blocks samplers/samplers],
|
||||
GFXTextureView::[device/device texture/texture type/type format/format baseLevel/baseLevel levelCount/levelCount baseLayer/baseLayer layerCount/layerCount],
|
||||
GFXTexture::[type/type usage/usage format/format width/width height/height depth/depth arrayLayer/arrayLayer mipLevel/mipLevel size/size samples/samples flags/flags buffer/buffer],
|
||||
GFXBindingLayout::[device/device bindingUnits/bindingUnits],
|
||||
GFXQueue::[device/device type/type],
|
||||
GFXRenderPass::[device/device colorAttachments/colorAttachments depthStencilAttachment/depthStencilAttachment subPasses/subPasses],
|
||||
GFXPipelineLayout::[device/device],
|
||||
GFXPipelineState::[device/device shader/shader primitive/primitive inputState/inputState rasterizerState/rasterizerState depthStencilState/depthStencilState blendState/blendState pipelineLayout/pipelineLayout renderPass/renderPass],
|
||||
GFXInputAssembler::[device/device attributes/attributes vertexBuffers/vertexBuffers indexBuffer/indexBuffer indirectBuffer/indirectBuffer vertexCount/vertexCount firstVertex/firstVertex indexCount/indexCount firstIndex/firstIndex vertexOffset/vertexOffset instanceCount/instanceCount firstInstance/firstInstance],
|
||||
GFXCommandBuffer::[device/device allocator/allocator type/type numDrawCalls/numDrawCalls numTris/numTris],
|
||||
GFXContext::[device/device sharedContext/sharedContext vsyncMode/vsyncMode colorFormat/colorFormat depthStencilFormat/depthStencilFormat],
|
||||
GFXFrameBuffer::[device/device renderPass/renderPass colorViews/colorViews depthStencilView/depthStencilView isOffscreen/isOffscreen],
|
||||
GFXBuffer::[device/device usage/usage memUsage/memUsage stride/stride count/count size/size flags/flags bufferView/bufferView],
|
||||
GFXSampler::[device/device name/name minFilter/minFilter magFilter/magFilter mipFilter/mipFilter addressU/addressU addressV/addressV addressW/addressW maxAnisotropy/maxAnisotropy cmpFunc/cmpFunc borderColor/borderColor minLOD/minLOD maxLOD/maxLOD mipLODBias/mipLODBias]
|
||||
getter_setter = GFXDevice::[width height nativeWidth nativeHeight memoryStatus context mainWindow queue commandAllocator renderer vendor numDrawCalls numTris],
|
||||
GFXWindow::[device title left top width height nativeWidth nativeHeight colorFormat isOffscreen/isOffscreen renderPass colorTexture colorTexView depthStencilTexture depthStencilTexView framebuffer],
|
||||
GFXShader::[device name hash stages blocks samplers],
|
||||
GFXTextureView::[device texture type format baseLevel levelCount baseLayer layerCount],
|
||||
GFXTexture::[type usage format width height depth arrayLayer mipLevel size samples flags buffer],
|
||||
GFXBindingLayout::[device bindingUnits],
|
||||
GFXQueue::[device type],
|
||||
GFXRenderPass::[device colorAttachments depthStencilAttachment subPasses],
|
||||
GFXPipelineLayout::[device],
|
||||
GFXPipelineState::[device shader primitive inputState rasterizerState depthStencilState blendState pipelineLayout renderPass],
|
||||
GFXInputAssembler::[device attributes vertexBuffers indexBuffer indirectBuffer vertexCount firstVertex indexCount firstIndex vertexOffset instanceCount firstInstance],
|
||||
GFXCommandBuffer::[device allocator type numDrawCalls numTris],
|
||||
GFXContext::[device sharedContext/sharedContext vsyncMode colorFormat depthStencilFormat],
|
||||
GFXFrameBuffer::[device renderPass colorViews depthStencilView isOffscreen/isOffscreen],
|
||||
GFXBuffer::[device usage memUsage stride count size flags bufferView],
|
||||
GFXSampler::[device name minFilter magFilter mipFilter addressU addressV addressW maxAnisotropy cmpFunc borderColor minLOD maxLOD mipLODBias]
|
||||
|
||||
rename_functions =
|
||||
|
||||
|
||||
Reference in New Issue
Block a user