Move sampler border parameter to renderer gl
This commit is contained in:
@@ -44,6 +44,7 @@ constexpr std::uint32_t gl_texture_min_filter = 0x2801U;
|
||||
constexpr std::uint32_t gl_texture_wrap_s = 0x2802U;
|
||||
constexpr std::uint32_t gl_texture_wrap_t = 0x2803U;
|
||||
constexpr std::uint32_t gl_texture_wrap_r = 0x8072U;
|
||||
constexpr std::uint32_t gl_texture_border_color = 0x1004U;
|
||||
constexpr std::uint32_t gl_clamp_to_edge = 0x812FU;
|
||||
|
||||
[[nodiscard]] bool contains(std::string_view text, std::string_view needle) noexcept
|
||||
@@ -237,4 +238,9 @@ std::array<OpenGlTextureParameter, 2> sampler_filter_parameters(
|
||||
};
|
||||
}
|
||||
|
||||
std::uint32_t sampler_border_color_parameter_name() noexcept
|
||||
{
|
||||
return gl_texture_border_color;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -51,5 +51,6 @@ struct OpenGlTextureParameter {
|
||||
[[nodiscard]] std::array<OpenGlTextureParameter, 2> sampler_filter_parameters(
|
||||
std::uint32_t filter_min,
|
||||
std::uint32_t filter_mag) noexcept;
|
||||
[[nodiscard]] std::uint32_t sampler_border_color_parameter_name() noexcept;
|
||||
|
||||
}
|
||||
|
||||
@@ -332,7 +332,10 @@ void Sampler::set_border(glm::vec4 rgba)
|
||||
App::I->render_task([this, rgba]
|
||||
{
|
||||
#if USE_SAMPLER && !defined(__GLES__)
|
||||
glSamplerParameterfv(id, GL_TEXTURE_BORDER_COLOR, glm::value_ptr(rgba));
|
||||
glSamplerParameterfv(
|
||||
id,
|
||||
static_cast<GLenum>(pp::renderer::gl::sampler_border_color_parameter_name()),
|
||||
glm::value_ptr(rgba));
|
||||
#endif // USE_SAMPLER
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user