mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:21:16 +02:00
Change type used for swap chain count
This commit is contained in:
parent
521ae36cbf
commit
fb929da228
1 changed files with 5 additions and 5 deletions
|
@ -15,18 +15,18 @@ namespace gpu {
|
||||||
class SwapChain {
|
class SwapChain {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
SwapChain(size_t size = 2U) : _size{ size } {}
|
SwapChain(uint8_t size = 2U) : _size{ size } {}
|
||||||
virtual ~SwapChain() {}
|
virtual ~SwapChain() {}
|
||||||
|
|
||||||
void advance() {
|
void advance() {
|
||||||
_frontIndex = (_frontIndex + 1) % _size;
|
_frontIndex = (_frontIndex + 1) % _size;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t getSize() const { return _size; }
|
uint8_t getSize() const { return _size; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const size_t _size;
|
const uint8_t _size;
|
||||||
size_t _frontIndex{ 0U };
|
uint8_t _frontIndex{ 0U };
|
||||||
|
|
||||||
};
|
};
|
||||||
typedef std::shared_ptr<SwapChain> SwapChainPointer;
|
typedef std::shared_ptr<SwapChain> SwapChainPointer;
|
||||||
|
@ -43,7 +43,7 @@ namespace gpu {
|
||||||
using TypePointer = std::shared_ptr<R>;
|
using TypePointer = std::shared_ptr<R>;
|
||||||
using TypeConstPointer = std::shared_ptr<const R>;
|
using TypeConstPointer = std::shared_ptr<const R>;
|
||||||
|
|
||||||
ResourceSwapChain(const std::vector<TypePointer>& v) : SwapChain{ std::min<size_t>(v.size(), MAX_SIZE) } {
|
ResourceSwapChain(const std::vector<TypePointer>& v) : SwapChain{ std::min<uint8_t>((uint8_t)v.size(), MAX_SIZE) } {
|
||||||
for (size_t i = 0; i < _size; ++i) {
|
for (size_t i = 0; i < _size; ++i) {
|
||||||
_resources[i] = v[i];
|
_resources[i] = v[i];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue