Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
SamplerDescriptor.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_SAMPLER_DESCRIPTOR_H_
34#define DVD_SAMPLER_DESCRIPTOR_H_
35
37
38namespace Divide {
39
41{
43 F32 _min{ -1000.f };
44 F32 _max{ 1000.f };
46 F32 _bias{ 0 };
47
48 bool operator==( const SamplerLOD& rhs ) const noexcept;
49};
50
54{
55 static constexpr size_t INVALID_SAMPLER_HASH = std::numeric_limits<size_t>::max();
56
74
75 bool operator==( const SamplerDescriptor& rhs ) const = default;
76};
77
78[[nodiscard]] size_t GetHash(SamplerDescriptor descriptor) noexcept;
79
80namespace XMLParser
81{
82 void saveToXML(const SamplerDescriptor& sampler, const std::string& entryName, boost::property_tree::ptree& pt);
83 [[nodiscard]] SamplerDescriptor loadFromXML(const std::string& entryName, const boost::property_tree::ptree& pt);
84};
85
86} //namespace Divide
87
88#endif //DVD_SAMPLER_DESCRIPTOR_H_
89
90#include "SamplerDescriptor.inl"
SamplerDescriptor loadFromXML(const std::string &entryName, const boost::property_tree::ptree &pt)
void saveToXML(const SamplerDescriptor &sampler, const std::string &entryName, boost::property_tree::ptree &pt)
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
uint8_t U8
size_t GetHash(const PropertyDescriptor< T > &descriptor) noexcept
Definition: Resource.inl:40
@ COUNT
Place all properties above this.
TextureFilter _minFilter
Texture filtering mode.
TextureWrap _wrapU
Texture wrap mode (Or S-R-T)
U8 _anisotropyLevel
The value must be in the range [0...255] and is automatically clamped by the max HW supported level.
ComparisonFunction _depthCompareFunc
Used for depth comparison (COUNT = disabled)
static constexpr size_t INVALID_SAMPLER_HASH
TextureBorderColour _borderColour
Used with CLAMP_TO_BORDER as the background colour outside of the texture border.
bool operator==(const SamplerDescriptor &rhs) const =default
TextureMipSampling _mipSampling
UColour4 _customBorderColour
Used with custom border colours.
F32 _min
OpenGL eg: used by TEXTURE_MIN_LOD and TEXTURE_MAX_LOD.
bool operator==(const SamplerLOD &rhs) const noexcept
F32 _bias
OpenGL eg: used by TEXTURE_LOD_BIAS.