gfx/shader: Increase size limit and function to get base size

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-06-21 18:42:05 +02:00
parent 411b716402
commit b4250a74f5
2 changed files with 22 additions and 8 deletions

View file

@ -373,16 +373,16 @@ std::uint32_t gfx::shader::shader::width()
case shader_mode::Source:
switch (_width_type) {
case size_type::Pixel:
return std::clamp(static_cast<uint32_t>(_width_value), 1u, 8192u);
return std::clamp(static_cast<uint32_t>(_width_value), 1u, 16384u);
case size_type::Percent:
return std::clamp(static_cast<uint32_t>(_width_value * _base_width), 1u, 8192u);
return std::clamp(static_cast<uint32_t>(_width_value * _base_width), 1u, 16384u);
}
case shader_mode::Filter:
switch (_width_type) {
case size_type::Pixel:
return std::clamp(static_cast<uint32_t>(_width_value), 1u, 8192u);
return std::clamp(static_cast<uint32_t>(_width_value), 1u, 16384u);
case size_type::Percent:
return std::clamp(static_cast<uint32_t>(_width_value * _base_width), 1u, 8192u);
return std::clamp(static_cast<uint32_t>(_width_value * _base_width), 1u, 16384u);
}
default:
return 0;
@ -397,22 +397,32 @@ std::uint32_t gfx::shader::shader::height()
case shader_mode::Source:
switch (_height_type) {
case size_type::Pixel:
return std::clamp(static_cast<uint32_t>(_height_value), 1u, 8192u);
return std::clamp(static_cast<uint32_t>(_height_value), 1u, 16384u);
case size_type::Percent:
return std::clamp(static_cast<uint32_t>(_height_value * _base_height), 1u, 8192u);
return std::clamp(static_cast<uint32_t>(_height_value * _base_height), 1u, 16384u);
}
case shader_mode::Filter:
switch (_height_type) {
case size_type::Pixel:
return std::clamp(static_cast<uint32_t>(_height_value), 1u, 8192u);
return std::clamp(static_cast<uint32_t>(_height_value), 1u, 16384u);
case size_type::Percent:
return std::clamp(static_cast<uint32_t>(_height_value * _base_height), 1u, 8192u);
return std::clamp(static_cast<uint32_t>(_height_value * _base_height), 1u, 16384u);
}
default:
return 0;
}
}
std::uint32_t gfx::shader::shader::base_width()
{
return _base_width;
}
std::uint32_t gfx::shader::shader::base_height()
{
return _base_height;
}
bool gfx::shader::shader::tick(float_t time)
{
_shader_file_tick = static_cast<float_t>(static_cast<double_t>(_shader_file_tick) + static_cast<double_t>(time));

View file

@ -101,6 +101,10 @@ namespace gfx {
std::uint32_t height();
std::uint32_t base_width();
std::uint32_t base_height();
bool tick(float_t time);
void prepare_render();