- 17 Jan, 2019 11 commits
-
-
Alexis Hetu authored
A lot of arrays in VertexProgram and PixelProgram have fixed sizes, so programs that have more nested loops or ifs or deeper call stacks can cause OOB accesses, which causes security issues in Chromium. Index clamping was added to prevent any OOB memory accesses here. This could eventually be fixed properly by first verifying these sizes and giving shader compile errors when these limits are exceeded. Bug chromium:915197 chromium:915206 chromium:915218 b/116373662 Change-Id: I2d0710ed0ce6585f139cba49d5b5d8c909ae6391 Reviewed-on: https://swiftshader-review.googlesource.com/c/23568Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Corentin Wallez <cwallez@google.com>
-
Chris Forbes authored
Initial structures to bridge the shader's use of particular builtins to behavior of the "fixed function" logic wrapped around it. Bug: b/120799499 Change-Id: I5cb360909c62615efab2e500f5c24109737e4ab7 Reviewed-on: https://swiftshader-review.googlesource.com/c/23709Tested-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Chris Forbes authored
We're about to remove VertexShader, but we still care about types of vertex attributes. Bug: b/120799499 Change-Id: I80bed181479651e9d2470b81c7223e3381fbf4a7 Reviewed-on: https://swiftshader-review.googlesource.com/c/23708Tested-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Chris Forbes authored
SPIRV objects have arbitrary sizes -- they are not tied to previous shader APIs' vec4-centric view of the world. In order to be able to allocate space for both variables and ssavalues, we need to know how many scalar components are present in each object. Bug: b/120799499 Change-Id: I58551264eba5011be9bd01135cb35d541463993b Reviewed-on: https://swiftshader-review.googlesource.com/c/23168Tested-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Chris Forbes authored
Change-Id: I5241cb398aa294a702c0f70980b80d399dfbc5b0 Reviewed-on: https://swiftshader-review.googlesource.com/c/23689Tested-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Chris Forbes authored
Half.hpp now requires <cmath> Change-Id: Iab086681cfd3ed850ad184c77f88d13b5716e859 Reviewed-on: https://swiftshader-review.googlesource.com/c/23688Tested-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Chris Forbes authored
Many other pieces will need an index of spirv-id to defining instruction. Start building that up. Bug: b/120799499 Change-Id: Ief6583f45c49fce02cb5dc40d12c6ba928e48fd7 Reviewed-on: https://swiftshader-review.googlesource.com/c/23428Tested-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Corentin Wallez <cwallez@google.com>
-
Chris Forbes authored
This will eventually replace Shader and related subclasses. The interesting bit here is the instruction iterator, which allows fairly safe access to the instruction stream without needing the rest of the code to care too much about the physical layout. Bug: b/120799499 Change-Id: Id0d94c4b807ddb1e4325de147ca1f651171779b7 Reviewed-on: https://swiftshader-review.googlesource.com/c/23049Reviewed-by:
Corentin Wallez <cwallez@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Chris Forbes <chrisforbes@google.com>
-
Chris Forbes authored
vkGetPhysicalDeviceImageFormatProperties is required to return VK_ERROR_FORMAT_NOT_SUPPORTED when the format is not supported. CTS (validly) assumes that the format /is/ supported if this function returns VK_SUCCESS. Bug: b/119620767 Change-Id: I1f7d3ff8dbbfbc2dd100af7c3c4d7204f350dd06 Reviewed-on: https://swiftshader-review.googlesource.com/c/23668Reviewed-by:
Corentin Wallez <cwallez@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Chris Forbes <chrisforbes@google.com>
-
Alexis Hetu authored
Shamelessly copied the FP32 -> B10G11R11 and FP32 -> E5B9G9R9 conversion functions from Angle. This allows packing the clear color for these formats into a single 32 bit integer, which can then be used within the fast clear function. Tested using: api.image_clearing.core.clear_color_image.*.b10g11r11_ufloat_pack32 api.image_clearing.core.clear_color_image.*.e5b9g9r9_ufloat_pack32 Bug b/119620767 Change-Id: Ic268da62959582f084245e88181374213734760f Reviewed-on: https://swiftshader-review.googlesource.com/c/23650Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Corentin Wallez <cwallez@google.com>
-
Alexis Hetu authored
Added the missing 5_6_5, 2_10_10_10, 4, 8, 16 and 32 bit formats that have integer based internal representation. Most of these are the same as existing formats or trivial modification of existing formats. This only adds the ability to WRITE to these formats for now, as these codepaths were tested using: dEQP-VK.api.image_clearing.core.clear_color_image If reading these formats becomes exercised by other tests, they will be added at that point. Bug b/119620767 Change-Id: I85317d7cfab6b1e708d6e6500ff44b83065a1d16 Reviewed-on: https://swiftshader-review.googlesource.com/c/23649Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Corentin Wallez <cwallez@google.com>
-
- 16 Jan, 2019 1 commit
-
-
Alexis Hetu authored
A few warnings were causing build errors on Arm 64. Since we don't want to modify the LLVM code itself, the warnings in the LLVM code are now suppressed. Bug chromium:922089 Change-Id: I7e8827cda5117e8817342930dca8d7b7f90d339c Reviewed-on: https://swiftshader-review.googlesource.com/c/23628Tested-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Corentin Wallez <cwallez@google.com> Reviewed-by:
Corentin Wallez <cwallez@google.com>
-
- 14 Jan, 2019 1 commit
-
-
Chris Forbes authored
Change-Id: Idb38063e6d8f7c6345118b2acddba4dcb99d0831 Reviewed-on: https://swiftshader-review.googlesource.com/c/23588Tested-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Corentin Wallez <cwallez@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
- 11 Jan, 2019 1 commit
-
-
Chris Forbes authored
Change-Id: I065e79f9ea676eaec25e89063908cae6f3854e4c Reviewed-on: https://swiftshader-review.googlesource.com/c/23489Tested-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
- 07 Jan, 2019 3 commits
-
-
Sergey Ulanov authored
Added fuchsia-specific versions of allocateExecutable() and markExecutable(). Bug: chromium: 778467 Change-Id: I027f1409f7b0343e102f98fcc34f2e93c2d626e4 Reviewed-on: https://swiftshader-review.googlesource.com/c/23408Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Sergey Ulanov <sergeyu@chromium.org>
-
Tom Tan authored
llvm::parseIR in llvm-7.0\llvm\lib\IRReader\IRReader.cpp calls parseAssembly which is defined in lib/AsmParser/Parser.cpp, but the latter file is not included in swiftshader_llvm which causes unresovled symbol for linking. This CL added the necessary source files under llvm\AsmParser to swiftshader_llvm. This CL also changed __rdtsc() to use Windows ARM64 intrinsic _ReadStatusReg to get cycle counter as alternative of __rdtsc(). Bug: chromium:893460 Change-Id: I269662f2e4249a3ec5495ecad02bc759139e1d4f Reviewed-on: https://swiftshader-review.googlesource.com/c/23508Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Tom Tan <Tom.Tan@microsoft.com>
-
Nico Weber authored
The .def file is already in sources, which means GN will already add this flag automatically (cf `gn help sources`). No intended behavior change. Bug: none Change-Id: Ic8204bbdd9da47f3731d48e62ccfeb880ac9eddc Reviewed-on: https://swiftshader-review.googlesource.com/c/23528Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Tested-by:
Nico Weber <thakis@chromium.org>
-
- 24 Dec, 2018 1 commit
-
-
Milko Leporis authored
Change-Id: I37dfecd8c92f3f34c117432956d169f4b191c849 Reviewed-on: https://swiftshader-review.googlesource.com/c/23248Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Milko Leporis <milko.leporis@mips.com>
-
- 21 Dec, 2018 9 commits
-
-
Alexis Hetu authored
Blitting from a higher bit depth source to a lower bit depth destination was not working properly because Vulkan expects clamping, while the blitter was truncating the values. From section 19.5. Image Copies with Scaling: "Signed and unsigned integers are converted by first clamping to the representable range of the destination format, then casting the value." This fixes all remaining failures in: dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.* Bug b/119620767 Change-Id: Ibd1c1e4be4f5107e7d423781b46021f4c5df1070 Reviewed-on: https://swiftshader-review.googlesource.com/c/23368Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
Alexis Hetu authored
Added support for reading the following formats in the Blitter: - VK_FORMAT_B10G11R11_UFLOAT_PACK32 - VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 Fixes all failures in: [dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color] .b10g11r11_ufloat_pack32.* .e5b9g9r9_ufloat_pack32.* Bug b/119620767 Change-Id: Ie5824b59b0193115cc7d142efc41cc3ac516c05c Reviewed-on: https://swiftshader-review.googlesource.com/c/23348Reviewed-by:
Chris Forbes <chrisforbes@google.com> Tested-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
Implemented Float <-> Half conversion. The conversion is copied from Half.cpp and is the same as the C++ code, converted to Reactor code. The conversion is NOT optimized. Optimizing this code path will be done later, this cl only cares about correctness. Passes all conversion tests to and from half float in the following patterns: [dEQP-VK.api.copy_and_blit.core.blit_image] .all_formats.color.[supported format].r16_sfloat.* .all_formats.color.[supported format].r16g16_sfloat.* .all_formats.color.[supported format].r16g16b16a16_sfloat.* .all_formats.color.r16_sfloat.* .all_formats.color.r16g16_sfloat.* .all_formats.color.r16g16b16a16_sfloat.* Bug b/119620767 Change-Id: Icd725dcd2ddd8c54e6657a2c3210da270210a149 Reviewed-on: https://swiftshader-review.googlesource.com/c/23329Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
Alexis Hetu authored
Added support for VK_FORMAT_A1R5G5B5_UNORM_PACK16 in the Blitter. Passes all tests in: [dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color] .b4g4r4a4_unorm_pack16.a1r5g5b5_unorm_pack16.* .r8g8_snorm.a1r5g5b5_unorm_pack16.* .a8b8g8r8_unorm_pack32.a1r5g5b5_unorm_pack16.* .a8b8g8r8_snorm_pack32.a1r5g5b5_unorm_pack16.* Bug b/119620767 Change-Id: I366cb5697b60b4f0fb51931a6be7b8732cf789ec Reviewed-on: https://swiftshader-review.googlesource.com/c/23328Reviewed-by:
Corentin Wallez <cwallez@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Tested-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
Added enums for mostly implemented format, along with the implementation for 2 new formats: VK_FORMAT_B4G4R4A4_UNORM_PACK16 VK_FORMAT_A2B10G10R10_UINT_PACK32 (as a true integer format) Bug b/119620767 Change-Id: I139408609cdbc35f7d9b0a8220e86a598c70a9e9 Reviewed-on: https://swiftshader-review.googlesource.com/c/23309Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Corentin Wallez <cwallez@google.com>
-
Alexis Hetu authored
Added missing VkFormat entries to the following functions: Surface::hasQuadLayout Surface::isFloatFormat Surface::isUnsignedComponent Surface::isSRGBformat Surface::isCompressed Surface::isSignedNonNormalizedInteger Surface::isUnsignedNonNormalizedInteger Surface::componentCount Surface::selectInternalFormat Bug b/118429780 Change-Id: I46f8fb3f8a14f82a2b6615e129e4de0443666eca Reviewed-on: https://swiftshader-review.googlesource.com/c/23308Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Corentin Wallez <cwallez@google.com>
-
Alexis Hetu authored
First simple implementation of image blitting. Note that layers are not yet taken into account. Passes almost all tests in (There are only 2 failures, which both have an off by 1 error on a single pixel): dEQP-VK.api.copy_and_blit.core.blit_image.simple_tests.* Bug b/118619338 b/119620767 Change-Id: I1e0ac88089d6159924569099ea6345804a219d2c Reviewed-on: https://swiftshader-review.googlesource.com/c/23268Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
Alexis Hetu authored
Added buffer copy command and support for VkBufferCopy regions. Passes all tests in: dEQP-VK.api.copy_and_blit.core.buffer_to_buffer Bug b/118619338 Change-Id: Id69cd3f089b07343a7209290808c11d4c17f1a49 Reviewed-on: https://swiftshader-review.googlesource.com/c/23229Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
Alexis Hetu authored
Added support for image regions and buffer rowLength/imageHeight for Image to Buffer copies or Buffer to Image copies. Passes all tests in: dEQP-VK.api.copy_and_blit.core.image_to_buffer dEQP-VK.api.copy_and_blit.core.buffer_to_image Bug b/119620767 Change-Id: I2b2592c06d52609c3f9c51fa164a0335f58f361f Reviewed-on: https://swiftshader-review.googlesource.com/c/23228Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
- 18 Dec, 2018 2 commits
-
-
Alexis Hetu authored
Added implementation for Depth and Stencil which currently allocates Depth and Stencil as 2 contiguous image planes in memory. Copying to and from depth and stencil planes is now supported which fixes all failures in: dEQP-VK.api.copy_and_blit.core.image_to_image.all_formats.depth_stencil Which were the last remaining failures in: dEQP-VK.api.copy_and_blit.core.image_to_image Bug b/119620767 Change-Id: Ie90737c219c70d9c8a68c024ed33292812a3b7f4 Reviewed-on: https://swiftshader-review.googlesource.com/c/23209Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
Alexis Hetu authored
Added basic support for array layers in Image objects. This allows allocating the memory for multiple layers, copying between a 2D image with multiple layers to and from a 3D image. Passes all tests in: dEQP-VK.api.copy_and_blit.core.image_to_image.3d_images.* Bug b/119620767 Change-Id: I305650ba89f90dcd527b484fc3ed095a309506d1 Reviewed-on: https://swiftshader-review.googlesource.com/c/23208Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
- 13 Dec, 2018 1 commit
-
-
Alexis Hetu authored
This fixes a memory leak in the Queue object. The sw::Renderer object has a non trivial destructor, which means we need to call it before deallocating the Queue objects. Bug b/117974925 Change-Id: I1e13c6108e77d5cdcbea337d572f72fdd32530a1 Reviewed-on: https://swiftshader-review.googlesource.com/c/23188Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
- 12 Dec, 2018 6 commits
-
-
Chris Forbes authored
Change-Id: I5feee7fb928a49762faa8154804fc4b0e86f60b8 Reviewed-on: https://swiftshader-review.googlesource.com/c/23169Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
Piped all the information from the vertex buffers and the pipeline to the renderer to perform a draw. In order for the renderer and the context to have proper lifetimes, they both reside in the Queue object for now. Bug b/118619338 Change-Id: Ifa03acd13ceb065a856b50f2cffadd4ee6b9a163 Reviewed-on: https://swiftshader-review.googlesource.com/c/23111Reviewed-by:
Corentin Wallez <cwallez@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Tested-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
Implemented vkCmdBeginRenderPass and vkCmdEndRenderPass. The RenderPass object begin and end are noop for now, but the framebuffer gets cleared within vkCmdBeginRenderPass. Bug b/119620965 b/118619338 Change-Id: I8e1f2932d9d52b3dcb5c10d4e60cba83b28bb95d Reviewed-on: https://swiftshader-review.googlesource.com/c/23108Reviewed-by:
Corentin Wallez <cwallez@google.com> Tested-by:
Alexis Hétu <sugoi@google.com>
-
Alexis Hetu authored
Adjusted a few checks in the GraphicsPipeline constructor, specifically stages' specialization info and sample mask, which can either be null or default. Also fixed destroying Pipeline objects, making sure there's no confusion between GraphicsPipeline and ComputePipeline's destroy() methods inherited from their 2 base classes (Pipeline::destroy() and ObjectBase::destroy()). Bug b/118386749 Change-Id: I78be9f0bbb735518e07d52f7372dbf08b9834abf Reviewed-on: https://swiftshader-review.googlesource.com/c/23110Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
Alexis Hetu authored
Use the blitter to implement Image::clear. The image can be easily packed into a sw::Surface. For now, the surface is a temporary, but it may become a member in the future if it makes sense. Bug b/119620767 Change-Id: I122a321509dc8cc5b624ddd776bd9059eee0cbc4 Reviewed-on: https://swiftshader-review.googlesource.com/c/23109Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
Alexis Hetu authored
Added VkImageView object. Added "clear" function to illustrate the link between VkFramebuffer attachments, VkImageView and VkImage, along with the minimal set of class members to allows the function arguments to be used properly. Bug b/119620767 b/119621736 Change-Id: I0e7e6017979960bacbdf888d632c83edda3483cf Reviewed-on: https://swiftshader-review.googlesource.com/c/22668Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
- 11 Dec, 2018 4 commits
-
-
Alexis Hetu authored
Implemented Image to Image copy, Image to Buffer copy and Buffer to Image copy commands which are required in order to run the dEQP-VK.api.copy_and_blit.core.image_to_image.* tests. Passes over 99.7% of the 10907 tests in: dEQP-VK.api.copy_and_blit.core.image_to_image.* Bug b/118619338 b/119620767 Change-Id: Id4d3aa5186bed84d0925e4424399716efbd241ee Reviewed-on: https://swiftshader-review.googlesource.com/c/23071Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Corentin Wallez <cwallez@google.com>
-
Alexis Hetu authored
A call to vkBeginCommandBuffer implicitly resets the command buffer. Bug b/118619338 Change-Id: I020a2d15915cbb309dbcd012b2dbbf34ca2f63c6 Reviewed-on: https://swiftshader-review.googlesource.com/c/23148Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Corentin Wallez <cwallez@google.com>
-
Alexis Hetu authored
Image objects now have the ability to copy their content to another image object. They can also copy their content to or from Buffer objects. Bug b\119620767 Change-Id: I047e9ecdcc11e264589de1d9461ef448f22a4d9e Reviewed-on: https://swiftshader-review.googlesource.com/c/23070Tested-by:
Alexis Hétu <sugoi@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com>
-
Chris Forbes authored
Includes only the include/spirv/unified1 subtree. Based on git://github.com/KhronosGroup/spirv-tools revision 17da9f8231f78cf519b4958c2229463a63ead9e2 Bug: b/120799499 Change-Id: Ifb790bf95035d7feb2d54d07e1475013dfd298b1 Reviewed-on: https://swiftshader-review.googlesource.com/c/23048Tested-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Corentin Wallez <cwallez@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
-