Update texture sampler config handling

This commit is contained in:
Georg Hagen
2024-08-03 19:16:46 +02:00
parent ccc234b699
commit de06623105
2 changed files with 5 additions and 4 deletions

View File

@@ -8,7 +8,7 @@
namespace OpenVulkano::Scene
{
Texture Texture::PLACEHOLDER = Texture(SamplerConfig::DEFAULT, true);
Texture Texture::PLACEHOLDER = Texture(&SamplerConfig::NEAREST, true);
void Texture::MakePlaceholder(uint32_t width, uint32_t height, Math::Vector4uc color1, Math::Vector4uc color2)
{
@@ -25,5 +25,6 @@ namespace OpenVulkano::Scene
resolution = {width, height, 1};
size = sizeof(Math::Vector4uc) * width * height;
format = DataFormat::B8G8R8A8_UNORM;
m_samplerConfig = &SamplerConfig::NEAREST;
}
}
}

View File

@@ -34,10 +34,10 @@ namespace OpenVulkano::Scene
Math::Vector3ui resolution = {0,0,0};
DataFormat format = DataFormat::B8G8R8A8_UNORM;
UpdateFrequency updateFrequency = UpdateFrequency::Never;
const SamplerConfig& m_samplerConfig;
const SamplerConfig* m_samplerConfig;
bool updated = true;
Texture(const SamplerConfig& samplerConfig = SamplerConfig::DEFAULT, bool placeholder = false)
Texture(const SamplerConfig* samplerConfig = &SamplerConfig::DEFAULT, bool placeholder = false)
: m_samplerConfig(samplerConfig)
{ if (placeholder) MakePlaceholder(); }