Sync SamplerInfo definition & use default values (#2901)

This commit is contained in:
minggo
2020-10-14 09:42:05 +08:00
committed by GitHub
parent 132e3cced1
commit 822cca2112
7 changed files with 14 additions and 21 deletions
+13 -14
View File
@@ -561,16 +561,16 @@ enum class VsyncMode : uint8_t {
};
struct Offset {
int x;
int y;
int z;
int x = 0;
int y = 0;
int z = 0;
};
struct Rect {
int x = 0;
int y = 0;
uint width = 0u;
uint height = 0u;
uint width = 1u;
uint height = 1u;
bool operator==(const Rect &rs) {
if (x == rs.x &&
@@ -588,9 +588,9 @@ struct Rect {
};
struct Extent {
uint width;
uint height;
uint depth;
uint width = 0;
uint height = 0;
uint depth = 1;
};
struct TextureSubres {
@@ -601,17 +601,17 @@ struct TextureSubres {
struct TextureCopy {
TextureSubres srcSubres;
Offset srcOffset = {0, 0, 0};
Offset srcOffset;
TextureSubres dstSubres;
Offset dstOffset = {0, 0, 0};
Extent extent = {0, 0, 1};
Offset dstOffset;
Extent extent;
};
struct BufferTextureCopy {
uint buffStride = 0;
uint buffTexHeight = 0;
Offset texOffset = {0, 0, 0};
Extent texExtent = {0, 0, 1};
Offset texOffset;
Extent texExtent;
TextureSubres texSubres;
};
typedef cc::vector<BufferTextureCopy> BufferTextureCopyList;
@@ -756,7 +756,6 @@ struct TextureViewInfo {
};
struct SamplerInfo {
String name;
Filter minFilter = Filter::LINEAR;
Filter magFilter = Filter::LINEAR;
Filter mipFilter = Filter::NONE;
@@ -16,7 +16,6 @@ public:
virtual void destroy() = 0;
CC_INLINE Device *getDevice() const { return _device; }
CC_INLINE const String &getName() const { return _name; }
CC_INLINE Filter getMinFilter() const { return _minFilter; }
CC_INLINE Filter getMagFilter() const { return _magFilter; }
CC_INLINE Filter getMipFilter() const { return _mipFilter; }
@@ -32,7 +31,6 @@ public:
protected:
Device *_device = nullptr;
String _name;
Filter _minFilter = Filter::NONE;
Filter _magFilter = Filter::NONE;
Filter _mipFilter = Filter::NONE;
@@ -13,7 +13,6 @@ GLES2Sampler::~GLES2Sampler() {
}
bool GLES2Sampler::initialize(const SamplerInfo &info) {
_name = info.name;
_minFilter = info.minFilter;
_magFilter = info.magFilter;
_mipFilter = info.mipFilter;
@@ -13,7 +13,6 @@ GLES3Sampler::~GLES3Sampler() {
}
bool GLES3Sampler::initialize(const SamplerInfo &info) {
_name = info.name;
_minFilter = info.minFilter;
_magFilter = info.magFilter;
_mipFilter = info.mipFilter;
@@ -13,7 +13,6 @@ CCMTLSampler::CCMTLSampler(Device *device) : Sampler(device) {}
CCMTLSampler::~CCMTLSampler() { destroy(); }
bool CCMTLSampler::initialize(const SamplerInfo &info) {
_name = info.name;
_minFilter = info.minFilter;
_magFilter = info.magFilter;
_mipFilter = info.mipFilter;
@@ -15,7 +15,6 @@ CCVKSampler::~CCVKSampler() {
}
bool CCVKSampler::initialize(const SamplerInfo &info) {
_name = info.name;
_minFilter = info.minFilter;
_magFilter = info.magFilter;
_mipFilter = info.mipFilter;
+1 -1
View File
@@ -75,7 +75,7 @@ getter_setter = Device::[gfxAPI deviceName width height nativeWidth nativeHeight
Context::[sharedContext/sharedContext vsyncMode colorFormat depthStencilFormat],
Framebuffer::[renderPass colorTextures depthStencilTexture],
Buffer::[usage memUsage stride count size flags],
Sampler::[name minFilter magFilter mipFilter addressU addressV addressW maxAnisotropy cmpFunc borderColor minLOD maxLOD mipLODBias],
Sampler::[minFilter magFilter mipFilter addressU addressV addressW maxAnisotropy cmpFunc borderColor minLOD maxLOD mipLODBias],
GFXObject::[gfxType/getType]
rename_functions =