-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated vertex cache to use ls::utils cache types. Enabled vertex cac…
…hing due to performance improvements.
- Loading branch information
Showing
7 changed files
with
146 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,2 @@ | ||
|
||
#include "softlight/SL_VertexCache.hpp" | ||
|
||
|
||
|
||
/*------------------------------------- | ||
* Copy Constructor | ||
-------------------------------------*/ | ||
SL_PTVCache::SL_PTVCache(const SL_PTVCache& ptv) noexcept : | ||
mParam{ptv.mParam}, | ||
mShader{ptv.mShader} | ||
{ | ||
for (size_t i = 0; i < PTV_CACHE_SIZE; ++i) | ||
{ | ||
mIndices[i] = ptv.mIndices[i]; | ||
mVertices[i] = ptv.mVertices[i]; | ||
} | ||
} | ||
|
||
|
||
|
||
/*------------------------------------- | ||
* Move Constructor | ||
-------------------------------------*/ | ||
SL_PTVCache::SL_PTVCache(SL_PTVCache&& ptv) noexcept : | ||
mParam{ptv.mParam}, | ||
mShader{ptv.mShader} | ||
{ | ||
for (size_t i = 0; i < PTV_CACHE_SIZE; ++i) | ||
{ | ||
mIndices[i] = ptv.mIndices[i]; | ||
mVertices[i] = ptv.mVertices[i]; | ||
} | ||
} | ||
|
||
|
||
|
||
/*------------------------------------- | ||
* Copy Operator | ||
-------------------------------------*/ | ||
SL_PTVCache& SL_PTVCache::operator=(const SL_PTVCache& ptv) noexcept | ||
{ | ||
mParam = ptv.mParam; | ||
mShader = ptv.mShader; | ||
|
||
for (size_t i = 0; i < PTV_CACHE_SIZE; ++i) | ||
{ | ||
mIndices[i] = ptv.mIndices[i]; | ||
mVertices[i] = ptv.mVertices[i]; | ||
} | ||
|
||
return *this; | ||
} | ||
|
||
|
||
|
||
/*------------------------------------- | ||
* Move Operator | ||
-------------------------------------*/ | ||
SL_PTVCache& SL_PTVCache::operator=(SL_PTVCache&& ptv) noexcept | ||
{ | ||
mParam = ptv.mParam; | ||
mShader = ptv.mShader; | ||
|
||
for (size_t i = 0; i < PTV_CACHE_SIZE; ++i) | ||
{ | ||
mIndices[i] = ptv.mIndices[i]; | ||
mVertices[i] = ptv.mVertices[i]; | ||
} | ||
|
||
return *this; | ||
} | ||
|
||
|
||
|
||
/*------------------------------------- | ||
* Reset and Re-initialize | ||
-------------------------------------*/ | ||
void SL_PTVCache::reset(ls::math::vec4_t<float> (*pShader)(SL_VertexParam&), SL_VertexParam& inParam) noexcept | ||
{ | ||
mParam = &inParam; | ||
mShader = pShader; | ||
|
||
for (size_t& index : mIndices) | ||
{ | ||
index = PTV_CACHE_MISS; | ||
} | ||
} |
Oops, something went wrong.