Skip to content

Commit 8405659

Browse files
lexaknyazevAngle LUCI CQ
authored andcommitted
Ensure ValidateCopyTextureCHROMIUM consistency
Moved ValidImageSizeParameters out of IsValidCopyTextureDestinationLevel to not generate two errors for a single command call. Bug: angleproject:406922380 Change-Id: Ie96e1c51743d5973f258a49aa2613d72b47e1bfb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6433915 Commit-Queue: Alexey Knyazev <[email protected]> Reviewed-by: Shahbaz Youssefi <[email protected]>
1 parent 01d1c7b commit 8405659

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

src/libANGLE/validationES2.cpp

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -237,18 +237,11 @@ bool IsValidCopyTextureSourceLevel(const Context *context, TextureType type, GLi
237237
}
238238

239239
bool IsValidCopyTextureDestinationLevel(const Context *context,
240-
angle::EntryPoint entryPoint,
241240
TextureType type,
242241
GLint level,
243242
GLsizei width,
244-
GLsizei height,
245-
bool isSubImage)
243+
GLsizei height)
246244
{
247-
if (!ValidImageSizeParameters(context, entryPoint, type, level, width, height, 1, isSubImage))
248-
{
249-
return false;
250-
}
251-
252245
const Caps &caps = context->getCaps();
253246
switch (type)
254247
{
@@ -3508,8 +3501,15 @@ bool ValidateCopyTextureCHROMIUM(const Context *context,
35083501
return false;
35093502
}
35103503

3511-
if (!IsValidCopyTextureDestinationLevel(context, entryPoint, dest->getType(), destLevel,
3512-
sourceWidth, sourceHeight, false))
3504+
if (!ValidImageSizeParameters(context, entryPoint, dest->getType(), destLevel, sourceWidth,
3505+
sourceHeight, 1, false))
3506+
{
3507+
// Error already generated.
3508+
return false;
3509+
}
3510+
3511+
if (!IsValidCopyTextureDestinationLevel(context, dest->getType(), destLevel, sourceWidth,
3512+
sourceHeight))
35133513
{
35143514
ANGLE_VALIDATION_ERROR(GL_INVALID_VALUE, kInvalidMipLevel);
35153515
return false;
@@ -3634,8 +3634,14 @@ bool ValidateCopySubTextureCHROMIUM(const Context *context,
36343634
return false;
36353635
}
36363636

3637-
if (!IsValidCopyTextureDestinationLevel(context, entryPoint, dest->getType(), destLevel, width,
3638-
height, true))
3637+
if (!ValidImageSizeParameters(context, entryPoint, dest->getType(), destLevel, width, height, 1,
3638+
true))
3639+
{
3640+
// Error already generated.
3641+
return false;
3642+
}
3643+
3644+
if (!IsValidCopyTextureDestinationLevel(context, dest->getType(), destLevel, width, height))
36393645
{
36403646
ANGLE_VALIDATION_ERROR(GL_INVALID_VALUE, kInvalidMipLevel);
36413647
return false;

0 commit comments

Comments
 (0)