Commit 5f388c24 by Tim Van Patten Committed by Commit Bot

Vulkan: dEQP-EGL.functional.image.modify.*

Determine the destination internalFormat correctly. dEQP-EGL.functional.image.modify.renderbuffer_rgb565_tex_subimage_rgb8 dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.tex_rgb565_tex_subimage_rgb8 dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.tex_rgba8_tex_subimage_rgba5_a1 dEQP-EGL.functional.image.modify.tex_rgba8_tex_subimage_rgba4 dEQP-EGL.functional.image.modify.tex_rgba5_a1_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.tex_rgba5_a1_tex_subimage_rgba4 dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba5_a1 dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba5_a1 dEQP-EGL.functional.image.modify.renderbuffer_rgb5_a1_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.renderbuffer_rgb5_a1_tex_subimage_rgba4 Bug: angleproject:3170 Change-Id: Ic9870390b2d4a0dcbe561efd3fb1597faadb7d79 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1524404 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent b9a71427
......@@ -14,9 +14,9 @@
"ANGLE load functions table:src/libANGLE/renderer/gen_load_functions_table.py":
"2dcc3aa0cd700165b588cf53441e243b",
"ANGLE load functions table:src/libANGLE/renderer/load_functions_data.json":
"5f26e468153a98121f7a9c03eea9999e",
"816be111bf4d1995589350dceb367315",
"ANGLE load functions table:src/libANGLE/renderer/load_functions_table_autogen.cpp":
"28991ca4bb52f7cce520d2fb4882eb0d",
"e6d34c18d41d3a9259f6a3e3ff6e40ff",
"D3D11 blit shader selection:src/libANGLE/renderer/d3d/d3d11/Blit11Helper_autogen.inc":
"f69cf03a3d868a977fad9e9c0eb0652a",
"D3D11 blit shader selection:src/libANGLE/renderer/d3d/d3d11/d3d11_blit_shaders_autogen.gni":
......
......@@ -438,6 +438,7 @@ MSG kStrideExceedsWebGLLimit = "Stride is over the maximum stride allowed by Web
MSG kStrideMustBeMultipleOfType = "Stride must be a multiple of the passed in datatype.";
MSG kSyncMissing = "Sync object does not exist.";
MSG kTargetMustBeTexture2DMultisampleArrayOES = "Target must be TEXTURE_2D_MULTISAMPLE_ARRAY_OES.";
MSG kTextureFormatMismatch = "Passed in texture target and format must match the one originally used to define the texture.";
MSG kTextureIsImmutable = "Texture is immutable.";
MSG kTextureIsNotImmutable = "Texture is not immutable.";
MSG kTextureNotBound = "A texture must be bound.";
......@@ -447,6 +448,7 @@ MSG kTextureSizeTooSmall = "Texture dimensions must all be greater than zero.";
MSG kTextureTargetMismatch = "Textarget must match the texture target type.";
MSG kTextureTargetRequiresES31 = "Texture target requires at least OpenGL ES 3.1.";
MSG kTextureTypeConflict = "Two textures of different types use the same sampler location.";
MSG kTextureTypeMismatch = "Passed in texture type must match the one originally used to define the texture.";
MSG kTextureWidthOrHeightOutOfRange = "Width and height must be less than or equal to GL_MAX_TEXTURE_SIZE.";
MSG kTransfomFeedbackAlreadyActive = "Transform feedback is already active.";
MSG kTransformFeedbackActiveDelete = "Attempt to delete an active transform feedback.";
......@@ -462,7 +464,6 @@ MSG kTransformFeedbackProgramBinary = "Cannot change program binary while progra
MSG kTransformFeedbackTargetActive = "Target is TRANSFORM_FEEDBACK_BUFFER and transform feedback is currently active.";
MSG kTransformFeedbackUseProgram = "Cannot change active program while transform feedback is unpaused.";
MSG kTransformFeedbackVaryingIndexOutOfRange = "Index must be less than the transform feedback varying count in the program.";
MSG kTypeMismatch = "Passed in texture target and format must match the one originally used to define the texture.";
MSG kTypeNotUnsignedShortByte = "Only UNSIGNED_SHORT and UNSIGNED_BYTE types are supported.";
MSG kUniformBufferBoundForTransformFeedback = "It is undefined behavior to use an uniform buffer that is bound for transform feedback.";
MSG kUniformBufferOffsetAlignment = "Offset must be multiple of value of UNIFORM_BUFFER_OFFSET_ALIGNMENT.";
......
......@@ -638,6 +638,7 @@
},
"GL_RGB565": {
"R5G6B5_UNORM" : {
"GL_UNSIGNED_BYTE": "LoadRGB8ToBGR565",
"GL_UNSIGNED_SHORT_5_6_5": "LoadToNative<GLushort, 1>"
},
"R8G8B8A8_UNORM": {
......
......@@ -2134,6 +2134,8 @@ LoadImageFunctionInfo RGB565_to_R5G6B5_UNORM(GLenum type)
{
switch (type)
{
case GL_UNSIGNED_BYTE:
return LoadImageFunctionInfo(LoadRGB8ToBGR565, true);
case GL_UNSIGNED_SHORT_5_6_5:
return LoadImageFunctionInfo(LoadToNative<GLushort, 1>, false);
default:
......
......@@ -179,8 +179,12 @@ angle::Result TextureVk::setSubImage(const gl::Context *context,
const uint8_t *pixels)
{
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(format, type);
ContextVk *contextVk = vk::GetImpl(context);
const gl::ImageDesc &levelDesc = mState.getImageDesc(index);
const vk::Format &vkFormat =
contextVk->getRenderer()->getFormat(levelDesc.format.info->sizedInternalFormat);
return setSubImageImpl(context, index, area, formatInfo, type, unpack, pixels);
return setSubImageImpl(context, index, area, formatInfo, type, unpack, pixels, vkFormat);
}
angle::Result TextureVk::setCompressedImage(const gl::Context *context,
......@@ -206,8 +210,13 @@ angle::Result TextureVk::setCompressedSubImage(const gl::Context *context,
{
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(format, GL_UNSIGNED_BYTE);
ContextVk *contextVk = vk::GetImpl(context);
const gl::ImageDesc &levelDesc = mState.getImageDesc(index);
const vk::Format &vkFormat =
contextVk->getRenderer()->getFormat(levelDesc.format.info->sizedInternalFormat);
return setSubImageImpl(context, index, area, formatInfo, GL_UNSIGNED_BYTE, unpack, pixels);
return setSubImageImpl(context, index, area, formatInfo, GL_UNSIGNED_BYTE, unpack, pixels,
vkFormat);
}
angle::Result TextureVk::setImageImpl(const gl::Context *context,
......@@ -232,7 +241,7 @@ angle::Result TextureVk::setImageImpl(const gl::Context *context,
}
return setSubImageImpl(context, index, gl::Box(0, 0, 0, size.width, size.height, size.depth),
formatInfo, type, unpack, pixels);
formatInfo, type, unpack, pixels, vkFormat);
}
angle::Result TextureVk::setSubImageImpl(const gl::Context *context,
......@@ -241,7 +250,8 @@ angle::Result TextureVk::setSubImageImpl(const gl::Context *context,
const gl::InternalFormat &formatInfo,
GLenum type,
const gl::PixelUnpackState &unpack,
const uint8_t *pixels)
const uint8_t *pixels,
const vk::Format &vkFormat)
{
ContextVk *contextVk = vk::GetImpl(context);
......@@ -249,7 +259,7 @@ angle::Result TextureVk::setSubImageImpl(const gl::Context *context,
{
ANGLE_TRY(mImage->stageSubresourceUpdate(
contextVk, getNativeImageIndex(index), gl::Extents(area.width, area.height, area.depth),
gl::Offset(area.x, area.y, area.z), formatInfo, unpack, type, pixels));
gl::Offset(area.x, area.y, area.z), formatInfo, unpack, type, pixels, vkFormat));
// Create a new graph node to store image initialization commands.
mImage->finishCurrentCommands(contextVk->getRenderer());
......
......@@ -189,7 +189,8 @@ class TextureVk : public TextureImpl
const gl::InternalFormat &formatInfo,
GLenum type,
const gl::PixelUnpackState &unpack,
const uint8_t *pixels);
const uint8_t *pixels,
const vk::Format &vkFormat);
angle::Result copyImageDataToBuffer(ContextVk *contextVk,
size_t sourceLevel,
......
......@@ -1811,7 +1811,8 @@ angle::Result ImageHelper::stageSubresourceUpdate(ContextVk *contextVk,
const gl::InternalFormat &formatInfo,
const gl::PixelUnpackState &unpack,
GLenum type,
const uint8_t *pixels)
const uint8_t *pixels,
const vk::Format &vkFormat)
{
GLuint inputRowPitch = 0;
ANGLE_VK_CHECK_MATH(contextVk, formatInfo.computeRowPitch(type, extents.width, unpack.alignment,
......@@ -1830,9 +1831,6 @@ angle::Result ImageHelper::stageSubresourceUpdate(ContextVk *contextVk,
formatInfo.computeSkipBytes(type, inputRowPitch, inputDepthPitch, unpack,
applySkipImages, &inputSkipBytes));
RendererVk *renderer = contextVk->getRenderer();
const vk::Format &vkFormat = renderer->getFormat(formatInfo.sizedInternalFormat);
const angle::Format &storageFormat = vkFormat.textureFormat();
size_t outputRowPitch;
......@@ -1868,13 +1866,13 @@ angle::Result ImageHelper::stageSubresourceUpdate(ContextVk *contextVk,
}
else
{
ASSERT(storageFormat.pixelBytes != 0);
outputRowPitch = storageFormat.pixelBytes * extents.width;
outputDepthPitch = outputRowPitch * extents.height;
bufferRowLength = extents.width;
bufferImageHeight = extents.height;
ASSERT(storageFormat.pixelBytes != 0);
}
VkBuffer bufferHandle = VK_NULL_HANDLE;
......
......@@ -653,7 +653,8 @@ class ImageHelper final : public CommandGraphResource
const gl::InternalFormat &formatInfo,
const gl::PixelUnpackState &unpack,
GLenum type,
const uint8_t *pixels);
const uint8_t *pixels,
const vk::Format &vkFormat);
angle::Result stageSubresourceUpdateAndGetData(ContextVk *contextVk,
size_t allocationSize,
......
......@@ -1646,12 +1646,18 @@ bool ValidateES2TexImageParameters(Context *context,
return false;
}
if (format != GL_NONE)
if (format != textureInternalFormat.format)
{
context->validationError(GL_INVALID_OPERATION, err::kTextureFormatMismatch);
return false;
}
if (context->getExtensions().webglCompatibility)
{
if (GetInternalFormatInfo(format, type).sizedInternalFormat !=
textureInternalFormat.sizedInternalFormat)
{
context->validationError(GL_INVALID_OPERATION, kTypeMismatch);
context->validationError(GL_INVALID_OPERATION, kTextureTypeMismatch);
return false;
}
}
......
......@@ -140,7 +140,7 @@ ANGLE_INLINE bool ValidateBindTexture(Context *context, TextureType target, GLui
Texture *textureObject = context->getTexture(texture);
if (textureObject && textureObject->getType() != target)
{
context->validationError(GL_INVALID_OPERATION, err::kTypeMismatch);
context->validationError(GL_INVALID_OPERATION, err::kTextureTargetMismatch);
return false;
}
......
......@@ -77,19 +77,6 @@
1340 WIN : dEQP-EGL.functional.render.multi_context.gles3.rgba5551_pbuffer = FAIL
1340 WIN : dEQP-EGL.functional.render.multi_context.gles2_gles3.rgba5551_window = FAIL
1340 WIN : dEQP-EGL.functional.render.multi_context.gles2_gles3.rgba5551_pbuffer = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.tex_rgb8_tex_subimage_rgb565 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.tex_rgb565_tex_subimage_rgb8 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.tex_rgba8_tex_subimage_rgba5_a1 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.tex_rgba8_tex_subimage_rgba4 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.tex_rgba5_a1_tex_subimage_rgba8 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.tex_rgba5_a1_tex_subimage_rgba4 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba8 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba5_a1 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba8 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba5_a1 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.renderbuffer_rgb5_a1_tex_subimage_rgba8 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.renderbuffer_rgb5_a1_tex_subimage_rgba4 = FAIL
1340 WIN : dEQP-EGL.functional.image.modify.renderbuffer_rgb565_tex_subimage_rgb8 = FAIL
1340 WIN : dEQP-EGL.functional.negative_api.choose_config = SKIP
1340 WIN : dEQP-EGL.functional.negative_api.get_display = FAIL
1340 WIN : dEQP-EGL.functional.negative_api.surface_attrib = SKIP
......@@ -180,10 +167,6 @@
// Android GLES-only failues
2567 ANDROID GLES : dEQP-EGL.functional.image.api.create_image_gles2_tex2d_red = FAIL
2567 ANDROID GLES : dEQP-EGL.functional.image.api.create_image_gles2_tex2d_rg = FAIL
2507 ANDROID GLES : dEQP-EGL.functional.image.modify.renderbuffer_rgb565_tex_subimage_rgb8 = FAIL
2507 ANDROID GLES : dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba8 = FAIL
2507 ANDROID GLES : dEQP-EGL.functional.image.modify.tex_rgb565_tex_subimage_rgb8 = FAIL
2507 ANDROID GLES : dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba8 = FAIL
2716 ANDROID GLES : dEQP-EGL.functional.preserve_swap.preserve.* = FAIL
// Seems to crash on the 5x. Possibly other Android devices.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment