mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 05:38:31 +09:00
[Fix] (MG_Impl): asking a renderbuffer for more samples than it has is INVALID_OPERATION
ValidateRenderbufferStorageSamples_State answered INVALID_VALUE for a sample count above GL_MAX_SAMPLES. GL 4.6 core 9.2.4 reserves INVALID_VALUE for a negative count: a count that is well formed but larger than the format can deliver is INVALID_OPERATION, because the argument is fine and the format is what cannot honour it. Takes direct_state_access.renderbuffers_storage_multisample_errors from failing to passing on both backends.
This commit is contained in:
@@ -625,8 +625,11 @@ namespace MobileGL::MG_Impl::GLImpl {
|
|||||||
const Int maxSamples = GetMaxRenderbufferSamples_State();
|
const Int maxSamples = GetMaxRenderbufferSamples_State();
|
||||||
if (samples > maxSamples) {
|
if (samples > maxSamples) {
|
||||||
// TODO: Use per-internalformat renderbuffer sample limits once glGetInternalformativ is backed.
|
// TODO: Use per-internalformat renderbuffer sample limits once glGetInternalformativ is backed.
|
||||||
|
// GL 4.6 core 9.2.4 makes asking for more samples than the format supports
|
||||||
|
// INVALID_OPERATION, not INVALID_VALUE - the count is well formed, this format just
|
||||||
|
// cannot deliver it. Only a negative count is INVALID_VALUE.
|
||||||
MG_State::pGLContext->RecordError(
|
MG_State::pGLContext->RecordError(
|
||||||
ErrorCode::InvalidValue,
|
ErrorCode::InvalidOperation,
|
||||||
MakeUnique<GenericErrorInfo>(
|
MakeUnique<GenericErrorInfo>(
|
||||||
"MG_Impl/GLImpl", caller,
|
"MG_Impl/GLImpl", caller,
|
||||||
std::format("Sample count {} exceeds GL_MAX_SAMPLES ({}).", samples, maxSamples)));
|
std::format("Sample count {} exceeds GL_MAX_SAMPLES ({}).", samples, maxSamples)));
|
||||||
|
|||||||
Reference in New Issue
Block a user