src/libANGLE/renderer/vulkan/vk_format_utils.cpp


Log

Author Commit Date CI Message
Jamie Madill beacd8c8 2019-10-17T14:34:02 Vulkan: Rename format fields. Renames 'angleFormat' to 'intendedFormat'. Also renames 'bufferFormat' and 'imageFormat' to 'actualImageFormat' and 'actualBufferFormat'. This renaming should make it clearer to the reader what the meaning of the different format fields are. Intended format is the front-end format and the actual formats are the formats we pass to Vulkan. Also updates the documentation. Bug: angleproject:4009 Change-Id: If61bf7250e88f7ed3d452718574c963d718e27b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1866077 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3a2e01ed 2019-09-16T13:08:39 Vulkan: Require sampling support for attachments. Since Framebuffer attachments can be copied from with CopyTexImage, we must require transfer support. This will affect the amount of formats we can expose correctly for different uses. Bug: angleproject:3876 Change-Id: I0343da94b5f8e05dca946e7029ffb8fdf155bb41 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1803756 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mohan Maiya 6caa2652 2019-09-11T08:06:13 Vulkan: Support float textures and renderbuffers Fixed support in the vulkan backend for legacy GLES2.0 formats (luminance, alpha, luminance_alpha) Correctly exposed the following extensions: OES_texture_float OES_texture_half_float OES_texture_float_linear OES_texture_half_float_linear EXT_color_buffer_float EXT_color_buffer_half_float Some of the above extensions have different requirements depending on other extension support and the context client version, and were incorrectly assuming the most restrictive requirements to be exposed. Implemented end2end tests for: OES_texture_float OES_texture_half_float OES_texture_float_linear OES_texture_half_float_linear EXT_color_buffer_float EXT_color_buffer_half_float Bug: angleproject:2898 Bug: angleproject:2726 Test: ./angle_end2end_tests --gtest_filter='Texture2DFloatTest*' Change-Id: I7024aa1393eadafb5a0fb83c23e9035aae650b67 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1740276 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Courtney Goeltzenleuchter 1f2782e0 2019-08-29T14:19:23 Vulkan: fix unsized internalformat depth sampling Many implementations provide OES_depth_texture behavior if the texture was specified with a non-sized format (e.g. GL_DEPTH_COMPONENT). This change implements that behavior for Vulkan and adds a couple of tests to verify it. Bug: angleproject:3890 Change-Id: I005b1eaa30db033f7d78a5cf2236aab7f442b7f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1764301 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
James Darpinian 7e48c9eb 2019-08-06T17:17:19 Add explicit integer casts WebKit uses the -Wshorten-64-to-32 flag which warns on these cases. Bug: 3439 Change-Id: I8c1de60da0f173ca2036e2120e79b857f5f2775f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1740866 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Tim Van Patten cbabea73 2019-07-11T17:24:17 Vulkan: Desktop ETC/EAC formats support Initial attempt to give desktop ETC/EAC formats support. Bug: angleproject:3676 Change-Id: Id147b0c1808e30df77097d0c7ff6a06534554b93 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1699307 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 08b97da8 2019-07-23T12:07:13 Vulkan: Fix staging buffer alignment for pixel sizes > 4 Previously, all non-compressed formats were satisfied with a 4-byte alignment. The introduction of float formats changes this. This change calculates the necessary alignment using the same code path as compressed formats. Also fixes RGB9E5's pixelByte being calculated as 3 instead of 4. Bug: angleproject:3731 Change-Id: I6abfd1c294e7f863eb99d2468eaac09e5d714039 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1715205 Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill ee21a187 2019-07-04T08:51:34 Store angle::Format in gl::VertexAttribute. Instead of storing type/size/normalized/pureInteger we instead store a pointer to the angle::Format. This makes some code logic simpler and will let us more easily check if a vertex attribute format changes in calls to VertexAttribPointer or VertexAttribFormat. This CL adds extra information to angle::Format to represent the vertex format info needed. It also caches the channel count so that it can be queried faster. Also renames "Int" -> "Sint" in UtilsVk for consistency. Bug: angleproject:3256 Change-Id: I5ef9b983dad8a58c341113c802500b89ce081566 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1684293 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
James Dong 8bb6baa0 2019-06-18T15:30:16 Vulkan: improve handling of RGB texture formats Adds fallback for some RGB textures using the corresponding RGBA formats and modifies fallback calculation to not require filtering/rendering for formats which are not required to support filtering by GL spec. Bug: angleproject:3190 Bug: angleproject:3196 Change-Id: I7beaf9881d63e3c6bd9339faede0333919a4174c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1665894 Commit-Queue: James Dong <dongja@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
James Dong 87748543 2019-06-18T18:45:42 GL/Vulkan: handle depth texture discrepancy In GLES 3.0, depth textures where changed to behave like RED textures, but in GLES 2.0 with ARB/OES_depth_texture, they were treated as luminance textures. This change produces the expected behavior on GLES 2.0 for the GL backend and on GLES 3.0 for the Vulkan backend. Bug: angleproject:3540 Change-Id: Iad6b4e03cf947b27eb97dbb10419bc8bcdb11024 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1666363 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: James Dong <dongja@google.com>
James Dong c6601ec8 2019-06-14T11:07:23 Vulkan: fix texture swizzle Corrects texture swizzle in Vulkan backend. Previously user-supplied swizzle was applied before internal swizzle; this change applies the internal swizzle first, causing the correct behavior. Also recreates image views when swizzle is dirty. Test: ./angle_deqp_gles3_no_gtest --deqp-egl-display-type=angle-vulkan -n 'dEQP-GLES3.functional.texture.swizzle.*' Test: ./angle_end2end_tests --gtest_filter='SwizzleTest.*/ES3_Vulkan' Bug: angleproject:3212 Change-Id: Ie2c44b479da5c19ba744ace7562a73c944f97a49 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1660909 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5993d899 2019-06-03T13:05:38 Vulkan: Use storage buffers for index conversion shader. This allows us to use the shader regardless of driver support for texel buffer views. It also allows us to convert indices on the GPU unconditionally. We add a new internal compute shader that converts pairs of indices into a packed single uint value that stores two 16-bit values. In the future we could add support for converting primitive restart indices. Should speed up benchmarks on systems which didn't have R8_UINT support for compute shader buffers. Bug: angleproject:3490 Change-Id: I56ca0cabb094e97f36ab4edc779e6c8ad2d2601e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1639058 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi b16d69c3 2019-05-13T16:28:27 Vulkan: Add support for surface multisampling A multisample image is created for the surface if multisampling is enabled. Prior to present, this multisample image is resolved into the swapchain image. FramebufferVk::readPixelsImpl similarly has got the ability to resolve the region of interest into a temporary image prior to readback. Tests are added to render a point, line and a triangle on a 4x multisampled surface. Bug: angleproject:3204 Change-Id: I34aca502fa1918b5cbf000ff11521c350372e051 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610188 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Courtney Goeltzenleuchter eaf2d928 2019-04-18T16:31:25 Add support for OES_depth_texture Note: Includes workaround for http://anglebug.com/3452 - some Android devices do not indicate filtering support on VK_FORMAT_D16_UNORM. Bug: angleproject:3103 Test: angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.DepthTexture/* angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.PackedDepthStencil/* angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.DepthTextureRender/ES2_VULKAN Change-Id: Ic325fb94ab0e619a17c2e149e0e0865fa4142f3a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575426 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 776694cd 2019-05-08T10:28:55 Change all ANGLE workarounds to use struct definition with info. Change each workaround from a simple bool to a struct with info including name, workaround set, description, and bug IDs. This will help with future workaround integration with Chrome. Bug: angleproject:1621 Change-Id: Ia27c180abaf845e280060c803e5994cc3152a057 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1593917 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Michael Spang c467f7b5 2019-04-17T20:20:30 Compute usage from format properties cache in glTexStorageMem2DEXT Per issue 13 in the EXT_external_objects spec, we should request all of the usage flags that are supported for the format. Bug: angleproject:3289, angleproject:3389 Change-Id: I5ef9906061af0fd619f580a9f603dd43be162932 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1573218 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Michael Spang <spang@chromium.org>
Jamie Madill 0631e19b 2019-04-18T16:09:12 Vulkan: Rename Vulkan "Texture" format to "Image" Also adds some comments to vk_format_utils.h. Bug: angleproject:3372 Change-Id: I529b9b189e4cdfd400c3c981a47139727d9954ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1565062 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 65d10f3b 2019-03-21T16:30:31 Vulkan: Implement robust resource initialization If a texture or renderbuffer needs to be cleared for robust access or due to having emulated channels, it is immediately cleared. The former relies on a front-end feature that optimizes robust access clears only to levels and layers that are not fully initialized through data upload. Bug: angleproject:2722 Change-Id: Icdab856eb4ffe963f78569b6d80d9ff5cb27ff9b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1535056 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 507e8d30 2019-03-15T16:49:48 Add missing entries in texture load functions map GetLoadFunctionsMap() is expected to cover all possible combinations of texture internalformat and upload data format. Several of these combinations were missing, especially w.r.t to compressed types. This change adds the missing combinations that are hit on any of the configurations being tested. An assert is added to catch missing conversion functions in the future. Bug: angleproject:2670 Change-Id: I793ac2c57f65eeb1cc8da8f1b223f6a9a44c7708 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1524462 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 76bd848c 2019-02-13T13:00:44 Vulkan: Support ETC, S3TC and BPTC compressed textures Fixes the format table so the correct Vulkan format for the types are generated. Additionally, implements CHROMIUM_copy_compressed_texture as well as other functions relevant to initializing compressed textures. Bug: angleproject:2670, angleproject:2904 Change-Id: I682d36574262525027cddf8f329515f38cd77dc0 Reviewed-on: https://chromium-review.googlesource.com/c/1468048 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@google.com>
Geoff Lang 009696c5 2019-01-31T14:47:07 Vulkan: Support EGL_ANDROID_image_native_buffer on Android. BUG=angleproject:2668 BUG=angleproject:3121 Change-Id: I0dfb2ec0737ebd963b0fadb78cf720a90874f00b Reviewed-on: https://chromium-review.googlesource.com/c/1452264 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill dbc605ce 2019-01-04T16:39:14 Vulkan: Optimize VBO state changes. Also has some minor optimizations for the front-end. 12% improvement on the Vulkan VBO change test. Bug: angleproject:3014 Change-Id: I38e1a8194edfc14bfe57424be348cb9688e928f4 Reviewed-on: https://chromium-review.googlesource.com/c/1369286 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi f83a28a6 2018-12-09T03:48:34 Vulkan: Shader path for framebuffer-to-texture copy Part 1 in a series of changes to perform image copies on the GPU. Bug: angleproject:2958 Change-Id: I6264a880865c4738c0866f2dc71af63425fc4118 Reviewed-on: https://chromium-review.googlesource.com/c/1370724 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 611bbaab 2018-12-06T01:59:53 Vulkan: Convert vertex attributes in compute In this commit, VertexArrayVk::convertVertexBuffer() is renamed to VertexArrayVk::convertVertexBufferCpu() to explicitly show it does a CPU readback. A new VertexArrayVk::convertVertexBuffer() function is added that has the same functionality in gpu (with some assumptions, where the CPU fallback is used should those assumptions fail). Currently, the only requirement is that buffer offset/stride are divided by the component size. ConvertVertex.comp is the shader responsible for this conversion, and it implements the functionality in renderer/copyvertex.inc, minus a few functions that are not used in the Vulkan backend. Bug: angleproject:2958, angleproject:3009 Change-Id: I8ec9a5f4672509bcf7b9e352cd27663970ad4653 Reviewed-on: https://chromium-review.googlesource.com/c/1364451 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 8f1b7a66 2018-11-14T16:02:54 Vulkan: Add DispatchUtilsVK This class provides a set of compute-based internal utilities. Currently, buffer clear and copy are implemented. Other possibilities include more efficient mip map generation, or specialized texture operations. VertexArrayVk::updateIndexTranslation() is updated to convert the GL_UNSIGNED_BYTE index buffer to a GL_UNSIGNED_SHORT one using this class to avoid a CPU readback. The vk::Format class is augmented with a few flags (IsInt, IsUnsigned) to be able to select the appropriate shader based on the format (float, int or uint). Bug: angleproject:2958,angleproject:3003 Change-Id: Ie35519deb3c32a3da5ccf74080c70092c9287f0a Reviewed-on: https://chromium-review.googlesource.com/c/1336307 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 96bd8fdf 2018-11-30T14:30:18 Vulkan: Fix format properties queries When querying format properties (in vk::GetFormatProperties), the mandatory feature support table was consulted to check whether a number of texture features are present. If so, the entry from that table was returned. The goal had been to speed up initialization by not issuing device queries if possible. That is, when vk::GetFormatProperties was called on a format, if it supported that select few texture features, the VkFormatProperties entry from the mandatory table would be returned. However, that function found its way to other uses (such as querying buffer format properties, or other image properties beyond the select few). As a result, when the VkFormatProperties from the mandatory table was returned, actual support for these other features was often not tested and assumed false (unless they happened to be mandatory as well). This commit reworks the format feature query functions such that the specific features to be tested are provided when querying the format properties. The mandatory table is consulted as before, and if the entry doesn't contain those features, the device is queried and the results cached. Bug: angleproject:2958 Change-Id: I28d046eb63c3bd5173468aa4cb3e4c63c83e67b1 Reviewed-on: https://chromium-review.googlesource.com/c/1357152 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 092481ad 2018-11-08T00:25:50 Vulkan: prepare for ES3 This makes ES3_VULKAN() pass the instantiability test, allowing it to be specified in end2end tests. Bug: angleproject:2950 Change-Id: Ife70a22fb8193f9eebe64bec491a24b47bc76939 Reviewed-on: https://chromium-review.googlesource.com/c/1325729 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d856ca48 2018-10-31T16:55:12 Vulkan: add clear test for emulated stencil or depth formats S8_UINT and D24_UNORM_X8_UINT are the only formats currently that are single-aspect and are possibly emulated with a packed depth-stencil format if it's not supported. A flag to FeaturesVk has been added as a way to force this behavior for the sake of testing. This test is added to ensure the correct clear algorithm is used for this case. Additionally, this case is detected and the other aspect is forcefully cleared to 0 whenever the original aspect is cleared. Bug: angleproject:2815 Change-Id: Ief3039d66bbf46468213b9e3224f7cc7541c3a2e Reviewed-on: https://chromium-review.googlesource.com/c/1312453 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 115e8a26 2018-09-26T07:51:30 Vulkan: Store "is packed" in buffer formats. This more easily allows us to compute the format alignment for use with the vertex input stage. Bug: angleproject:2797 Change-Id: If15281ce18fbed743b6a0c843cece4626bc4ce72 Reviewed-on: https://chromium-review.googlesource.com/1245841 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Frank Henigman 3b1fe64f 2018-09-04T13:15:35 Vulkan: allow a list of fallback formats. Allow a list of fallback formats as well as a single one in the format map. The first supported format is used. No functional change. BUG=angleproject:2655 Change-Id: Ica312b7899471a7a65184a6921713b79da056f31 Reviewed-on: https://chromium-review.googlesource.com/1214847 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill ba365939 2018-07-18T17:23:46 Rename angle::Format::ID to angle::FormatID. This allow for predeclaring the enum. It solves some include dependency issues. Bug: angleproject:2729 Change-Id: Ibbbab0796e466c62848404ba277c5f454fd9ac62 Reviewed-on: https://chromium-review.googlesource.com/1142299 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Frank Henigman 419acc8f 2018-06-24T19:57:31 Vulkan: Convert streamed vertex data as needed. Add two members to vk::Format: - vertex data copy function - flag indicating if the function converts or not Use the function when streaming vertex data so it gets converted if needed. Add fallbacks for integer formats. These formats will now work everywhere, as long as they are in client memory, not a buffer object. Adjust test expectations accordingly. BUG=angleproject:2405 Change-Id: I677221219d933c35740633a0ab7694293e218177 Reviewed-on: https://chromium-review.googlesource.com/1084328 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Frank Henigman d9618bf4 2018-06-24T19:57:31 Vulkan: prepare for buffer format fallbacks. Generate code for buffer fallbacks as well as texture fallbacks. No functional change. BUG=angleproject:2405 Change-Id: I9f30a2cbb3cd9ba1d18474f99cba434b030b0232 Reviewed-on: https://chromium-review.googlesource.com/1113026 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Frank Henigman 2ad498eb 2018-06-20T13:19:01 Vulkan: get vertex formats from format table. Use the Vulkan format table to look up the Vulkan format for vertex data. This will let us support more vertex formats by adding them to the table. It also eliminates one usage of gl::VertexFormatType. No functional change. BUG=angleproject:2405 BUG=angleproject:2531 Change-Id: I73eb69ccac50d427de3e7d5479f92bb17c49aed3 Reviewed-on: https://chromium-review.googlesource.com/1051028 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Luc Ferron f6e160fa 2018-06-12T10:13:57 Vulkan: Don't use swizzle state when its not needed Enables a bunch of dEQP tests in the functional.fbo.render.* namespace. Bug: angleproject:2597 Change-Id: I1a06b335d5daf2987df52c460903081860887ce9 Reviewed-on: https://chromium-review.googlesource.com/1097596 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov f15f886c 2018-06-04T18:59:41 Differentiate texture and renderbuffer framebuffer attachment capabilities ANGLE used to describe the abitily to attach textures and renderbuffers of a specific format to a framebuffer using a single notion of "renderable". However, for some formats, only one can be supported, but not the other. Split TextureCaps::renderable into textureAttachment and renderbuffer. Also, split InternalFormat::renderSupport into textureAttachmentSupport and renderbufferSupport. The only functional change is in a few places which now explicitly check for texture or renderbuffer attachement support. Information in format support tables was duplicated for the two capabilities, so behavior should remain the same. It should be corrected in future CLs. Note: additional information in those tables may need to be added in order to properly support GenerateMipmap and TexStorage2DMultisample, this is beyond the scope of this CL. Bug: angleproject:2567 Change-Id: I18bce4100525be35709d8bbf4de08ec812aab502 Reviewed-on: https://chromium-review.googlesource.com/1086491 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 05cd6dfc 2018-05-24T15:51:29 Vulkan: generateMipmaps with vkCmdBlitImage when possible Bug: angleproject:2502 Change-Id: Ib32a128a453749c59d751e996017a8a6e2a9972e Reviewed-on: https://chromium-review.googlesource.com/1072550 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Jamie Madill c4f27e4b 2018-03-31T14:19:18 Texture: Pass ImageIndex to relevant methods. The Vulkan back-end will be using this helper struct, so make it available everywhere. This cleans up a lot of the code for D3D. Potentially in the future we could generate these in the entry points if we supported packing multiple arguments into one. Also changes a few parameter types to GLint for compatibility. Also updates the Vulkan Texture implementation check the stored vk::Format on setImage changes. Bug: angleproject:2318 Change-Id: I57cea4a42483ab51859229517d783b58f206b8e7 Reviewed-on: https://chromium-review.googlesource.com/985203 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org>
Jamie Madill 6816d843 2018-03-31T14:19:17 Add two new fields to angle::Format. One field determines if a format is a compressed format (called Block format for angle::Format, but basically the same). The second field is the number of bytes in the format, so we can do calculations on pixel size. Both of these will make life cleaner in the Vulkan back-end. Also solves some TODOs in the vk format table init. Bug: angleproject:2318 Bug: angleproject:2358 Change-Id: I8b021b959c5892c86635e0225012295e5e830256 Reviewed-on: https://chromium-review.googlesource.com/987524 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 0cec82a5 2018-03-14T09:21:07 Vulkan: Implement basic depth/stencil buffers. This implements basic depth/stencil states and clearing. This also implements "fallback" texture formats in the texture generation. Fallback formats are those that are chosen at runtime for replacements for main formats which lack driver support. They are different from override formats, which are always used because we assume there is no driver support. The Vulkan spec only asserts that one of the two of D32 or D24 has mandatory support. In the case of AMD, D24 is not supported fully, and we need the fallback format support emulation. Bug: angleproject:2357 Change-Id: Ic86cede3c69ff9893a06b3a55c3b5d2d897fa55f Reviewed-on: https://chromium-review.googlesource.com/916701 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Luc Ferron 0aa1ffe3 2018-02-08T13:42:36 Vulkan: Autogen mandatory texture caps * This commit includes a JS file to execute on the spec and generate the JSON output of all the mandatory texture caps. Bug: angleproject:2348 Change-Id: I57e969915bdd0e7104e00a73fd3743ff1ecf0a6d Reviewed-on: https://chromium-review.googlesource.com/911615 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron d50537a7 2018-02-07T17:02:08 Vulkan: Texture caps map We are generating the caps map using various bits from the results of vkGetPhysicalDeviceFormatProperties. This contains all the information required to fill out "renderable", "texturable" and "filterable". Later we'll need to read from vkGetPhysicalDeviceImageFormatProperties as well to get the sampleCounts. The tests for now are not very meaningful since they use the same logic as the caps code to build the expected results, however as soon as we'll add the hard-coded list of mandatory texture caps, the test will be a good validator that we are not breaking anything. We only check the optimal set of flags since it is the most restrictive set. isTexturable = flags contain VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT isFilterable = flags contain VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT isRenderable = flags contain VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT OR VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT Bug: angleproject:2348 Change-Id: I9da0712190d2678d7e377d6fcd4ca83d23eefd38 Reviewed-on: https://chromium-review.googlesource.com/908712 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 3c424b48 2018-01-19T12:35:09 Vulkan: Add vk_cache_utils.h. This file contains the Pipeline and RenderPass cache utils. Also renames renderervk_utils.h to vk_utils.h and the format utils file. Refactoring change only. Bug: angleproject:2163 Change-Id: I5113a9a2c6f0b0960d38e6c2d8e391fa2d9f5f6a Reviewed-on: https://chromium-review.googlesource.com/876505 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>