mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-12 04:49:02 +08:00
Remove sampler.wrapR parameter(unused tinygltf extension). Fixes #287
Suppress clang `-Wdocumentation-unknown-command` warning.
This commit is contained in:
parent
a159945db9
commit
2c521b3432
@ -610,7 +610,7 @@ void Viewer::buildSamplerDescs() {
|
|||||||
|
|
||||||
samplerDesc.AddressU = toTextureAddressMode(glTFSampler.wrapS);
|
samplerDesc.AddressU = toTextureAddressMode(glTFSampler.wrapS);
|
||||||
samplerDesc.AddressV = toTextureAddressMode(glTFSampler.wrapT);
|
samplerDesc.AddressV = toTextureAddressMode(glTFSampler.wrapT);
|
||||||
samplerDesc.AddressW = toTextureAddressMode(glTFSampler.wrapR);
|
samplerDesc.AddressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP;
|
||||||
samplerDesc.MaxLOD = 256;
|
samplerDesc.MaxLOD = 256;
|
||||||
|
|
||||||
samplerDescs_.push_back(samplerDesc);
|
samplerDescs_.push_back(samplerDesc);
|
||||||
|
18
tiny_gltf.h
18
tiny_gltf.h
@ -613,7 +613,7 @@ struct Sampler {
|
|||||||
int wrapT =
|
int wrapT =
|
||||||
TINYGLTF_TEXTURE_WRAP_REPEAT; // ["CLAMP_TO_EDGE", "MIRRORED_REPEAT",
|
TINYGLTF_TEXTURE_WRAP_REPEAT; // ["CLAMP_TO_EDGE", "MIRRORED_REPEAT",
|
||||||
// "REPEAT"], default "REPEAT"
|
// "REPEAT"], default "REPEAT"
|
||||||
int wrapR = TINYGLTF_TEXTURE_WRAP_REPEAT; // TinyGLTF extension
|
//int wrapR = TINYGLTF_TEXTURE_WRAP_REPEAT; // TinyGLTF extension. currently not used.
|
||||||
|
|
||||||
Value extras;
|
Value extras;
|
||||||
ExtensionMap extensions;
|
ExtensionMap extensions;
|
||||||
@ -626,8 +626,7 @@ struct Sampler {
|
|||||||
: minFilter(-1),
|
: minFilter(-1),
|
||||||
magFilter(-1),
|
magFilter(-1),
|
||||||
wrapS(TINYGLTF_TEXTURE_WRAP_REPEAT),
|
wrapS(TINYGLTF_TEXTURE_WRAP_REPEAT),
|
||||||
wrapT(TINYGLTF_TEXTURE_WRAP_REPEAT),
|
wrapT(TINYGLTF_TEXTURE_WRAP_REPEAT) {}
|
||||||
wrapR(TINYGLTF_TEXTURE_WRAP_REPEAT) {}
|
|
||||||
DEFAULT_METHODS(Sampler)
|
DEFAULT_METHODS(Sampler)
|
||||||
bool operator==(const Sampler &) const;
|
bool operator==(const Sampler &) const;
|
||||||
};
|
};
|
||||||
@ -1256,7 +1255,7 @@ bool FileExists(const std::string &abs_filename, void *);
|
|||||||
|
|
||||||
///
|
///
|
||||||
/// Expand file path(e.g. `~` to home directory on posix, `%APPDATA%` to
|
/// Expand file path(e.g. `~` to home directory on posix, `%APPDATA%` to
|
||||||
/// `C:\Users\tinygltf\AppData`)
|
/// `C:\\Users\\tinygltf\\AppData`)
|
||||||
///
|
///
|
||||||
/// @param[in] filepath File path string. Assume UTF-8
|
/// @param[in] filepath File path string. Assume UTF-8
|
||||||
/// @param[in] userdata User data. Set to `nullptr` if you don't need it.
|
/// @param[in] userdata User data. Set to `nullptr` if you don't need it.
|
||||||
@ -1930,8 +1929,9 @@ bool Sampler::operator==(const Sampler &other) const {
|
|||||||
return this->extensions == other.extensions && this->extras == other.extras &&
|
return this->extensions == other.extensions && this->extras == other.extras &&
|
||||||
this->magFilter == other.magFilter &&
|
this->magFilter == other.magFilter &&
|
||||||
this->minFilter == other.minFilter && this->name == other.name &&
|
this->minFilter == other.minFilter && this->name == other.name &&
|
||||||
this->wrapR == other.wrapR && this->wrapS == other.wrapS &&
|
|
||||||
this->wrapT == other.wrapT;
|
this->wrapT == other.wrapT;
|
||||||
|
|
||||||
|
//this->wrapR == other.wrapR && this->wrapS == other.wrapS &&
|
||||||
}
|
}
|
||||||
bool Scene::operator==(const Scene &other) const {
|
bool Scene::operator==(const Scene &other) const {
|
||||||
return this->extensions == other.extensions && this->extras == other.extras &&
|
return this->extensions == other.extensions && this->extras == other.extras &&
|
||||||
@ -5086,12 +5086,12 @@ static bool ParseSampler(Sampler *sampler, std::string *err, const json &o,
|
|||||||
int magFilter = -1;
|
int magFilter = -1;
|
||||||
int wrapS = TINYGLTF_TEXTURE_WRAP_REPEAT;
|
int wrapS = TINYGLTF_TEXTURE_WRAP_REPEAT;
|
||||||
int wrapT = TINYGLTF_TEXTURE_WRAP_REPEAT;
|
int wrapT = TINYGLTF_TEXTURE_WRAP_REPEAT;
|
||||||
int wrapR = TINYGLTF_TEXTURE_WRAP_REPEAT;
|
//int wrapR = TINYGLTF_TEXTURE_WRAP_REPEAT;
|
||||||
ParseIntegerProperty(&minFilter, err, o, "minFilter", false);
|
ParseIntegerProperty(&minFilter, err, o, "minFilter", false);
|
||||||
ParseIntegerProperty(&magFilter, err, o, "magFilter", false);
|
ParseIntegerProperty(&magFilter, err, o, "magFilter", false);
|
||||||
ParseIntegerProperty(&wrapS, err, o, "wrapS", false);
|
ParseIntegerProperty(&wrapS, err, o, "wrapS", false);
|
||||||
ParseIntegerProperty(&wrapT, err, o, "wrapT", false);
|
ParseIntegerProperty(&wrapT, err, o, "wrapT", false);
|
||||||
ParseIntegerProperty(&wrapR, err, o, "wrapR", false); // tinygltf extension
|
//ParseIntegerProperty(&wrapR, err, o, "wrapR", false); // tinygltf extension
|
||||||
|
|
||||||
// TODO(syoyo): Check the value is alloed one.
|
// TODO(syoyo): Check the value is alloed one.
|
||||||
// (e.g. we allow 9728(NEAREST), but don't allow 9727)
|
// (e.g. we allow 9728(NEAREST), but don't allow 9727)
|
||||||
@ -5100,7 +5100,7 @@ static bool ParseSampler(Sampler *sampler, std::string *err, const json &o,
|
|||||||
sampler->magFilter = magFilter;
|
sampler->magFilter = magFilter;
|
||||||
sampler->wrapS = wrapS;
|
sampler->wrapS = wrapS;
|
||||||
sampler->wrapT = wrapT;
|
sampler->wrapT = wrapT;
|
||||||
sampler->wrapR = wrapR;
|
//sampler->wrapR = wrapR;
|
||||||
|
|
||||||
ParseExtensionsProperty(&(sampler->extensions), err, o);
|
ParseExtensionsProperty(&(sampler->extensions), err, o);
|
||||||
ParseExtrasProperty(&(sampler->extras), o);
|
ParseExtrasProperty(&(sampler->extras), o);
|
||||||
@ -7133,7 +7133,7 @@ static void SerializeGltfSampler(Sampler &sampler, json &o) {
|
|||||||
if (sampler.minFilter != -1) {
|
if (sampler.minFilter != -1) {
|
||||||
SerializeNumberProperty("minFilter", sampler.minFilter, o);
|
SerializeNumberProperty("minFilter", sampler.minFilter, o);
|
||||||
}
|
}
|
||||||
SerializeNumberProperty("wrapR", sampler.wrapR, o);
|
//SerializeNumberProperty("wrapR", sampler.wrapR, o);
|
||||||
SerializeNumberProperty("wrapS", sampler.wrapS, o);
|
SerializeNumberProperty("wrapS", sampler.wrapS, o);
|
||||||
SerializeNumberProperty("wrapT", sampler.wrapT, o);
|
SerializeNumberProperty("wrapT", sampler.wrapT, o);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user