{"id":1457,"date":"2019-09-26T09:40:55","date_gmt":"2019-09-26T15:40:55","guid":{"rendered":"https:\/\/www.lunarg.com\/?p=1457"},"modified":"2025-01-15T18:08:53","modified_gmt":"2025-01-16T01:08:53","slug":"new-automatic-relaxed-precision-white-paper-for-spir-v","status":"publish","type":"post","link":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/","title":{"rendered":"New Automatic Relaxed Precision White Paper for SPIR-V"},"content":{"rendered":"<p>LunarG releases new RelaxedPrecision white paper for SPIR-V developers. This functionality is available along with the Vulkan 1.1.122.0 SDK release.\u00a0 Read on for more information about this new feature or read the details in the <strong><a href=\"https:\/\/www.lunarg.com\/wp-content\/uploads\/2019\/09\/Automatic-RelaxedPrecision-Decoration-and-Conversion-in-Spirv-Opt_r1.pdf\">Automatic Relaxed Precision Decoration and Conversion in Spirv-opt white paper.<\/a><\/strong><\/p>\n<p><!--more--><\/p>\n<p><span style=\"font-weight: 400;\">Two new passes have been added to spirv-opt to automatically convert SPIR-V shaders to utilize RelaxedPrecision semantics. These passes allow the developer to take advantage of lower precision computations without having to make changes to the shader source. The first pass can be used to automatically convert a whole SPIR-V shader to use RelaxedPrecision<\/span><span style=\"font-weight: 400;\">, which can be advantageous on both mobile and desktop GPUs. <\/span><span style=\"font-weight: 400;\">The second pass can be used to automatically convert a RelaxedPrecision-decorated shader to explicitly use 16-bit precision on devices which do not support RelaxedPrecision, but do support the V<\/span><span style=\"font-weight: 400;\">K_KHR_shader_float16_int8<\/span><span style=\"font-weight: 400;\"> extension, such as iOS\/MoltenVK.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When a 32-bit floating point (float32) SPIR-V executable instruction is decorated with RelaxedPrecision, the result is still a float32 value, but the driver has permission to only compute 16-bits of precision. This can improve performance and\/or reduce power consumption if the application does not require the full precision for that instruction.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, some Vulkan drivers such as MoltenVK ignore the RelaxedPrecision directive, usually because the underlying implementation (in the case of MoltenVK, Metal), does not support the RelaxedPrecision semantics.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If it is the situation, however, that the underlying implementation does support a true 16-bit floating point type (as it is with Metal), benefits of RelaxedPrecision semantics can be achieved by emulating the RelaxedPrecision instructions using the true 16-bit instructions.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To this end, the <\/span><span style=\"font-weight: 400;\">&#8211;convert-relaxed-to-half<\/span><span style=\"font-weight: 400;\"> pass has been added to <\/span><span style=\"font-weight: 400;\">spirv-opt<\/span><span style=\"font-weight: 400;\">. This pass translates all arithmetic float32 instructions decorated with RelaxedPrecision to 16-bit floating point (float16) instructions, adding additional conversion instructions for operands and results where needed.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The &#8211;relax-float-ops pass was also added to allow the user to quickly and easily apply the RelaxPrecision decoration to all float32 instructions in a SPIR-V file.<\/span><\/p>\n<h2 data-fontsize=\"20\" data-lineheight=\"27\"><strong>Info about LunarG, Inc.<\/strong><\/h2>\n<p>LunarG\u2019s software engineering experts create software solutions\u00a0for open source and commercial customers using leading-edge 3D graphics and compute technologies, including Vulkan, OpenXR, SPIR-V, and OpenGL. We have strengths in performance analysis and tuning, runtime and tools development, shader optimizations, driver development, new feature development, and porting engines and applications to Vulkan. Our software engineering team is based in Fort Collins, Colorado. LunarG was founded by software experts who are passionate about 3D graphics.<\/p>\n<p>For more information about LunarG, check out our\u00a0<strong><a href=\"https:\/\/www.lunarg.com\/\">website<\/a><\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LunarG releases new RelaxedPrecision white paper for SPIR-V developers. This functionality is available along with the Vulkan 1.1.122.0 SDK release.\u00a0 Read on for more information about this new feature or read the details in the Automatic Relaxed Precision Decoration and Conversion in Spirv-opt white paper.<\/p>\n","protected":false},"author":14,"featured_media":1959,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[131],"tags":[9,6],"class_list":["post-1457","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-white-papers","tag-spir-v","tag-vulkan"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>New Automatic Relaxed Precision White Paper for SPIR-V - LunarG<\/title>\n<meta name=\"description\" content=\"LunarG releases new RelaxedPrecision white paper for SPIR-V developers.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New Automatic Relaxed Precision White Paper for SPIR-V - LunarG\" \/>\n<meta property=\"og:description\" content=\"LunarG releases new RelaxedPrecision white paper for SPIR-V developers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/\" \/>\n<meta property=\"og:site_name\" content=\"LunarG\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-26T15:40:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-16T01:08:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.lunarg.com\/wp-content\/uploads\/2019\/09\/iStock-1155410378-2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"755\" \/>\n\t<meta property=\"og:image:height\" content=\"395\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Dave Desormeaux\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dave Desormeaux\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/\"},\"author\":{\"name\":\"Dave Desormeaux\",\"@id\":\"https:\/\/www.lunarg.com\/#\/schema\/person\/493f4ece901c822208cfda3feb80420a\"},\"headline\":\"New Automatic Relaxed Precision White Paper for SPIR-V\",\"datePublished\":\"2019-09-26T15:40:55+00:00\",\"dateModified\":\"2025-01-16T01:08:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/\"},\"wordCount\":426,\"publisher\":{\"@id\":\"https:\/\/www.lunarg.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.lunarg.com\/wp-content\/uploads\/2019\/09\/iStock-1155410378-2.jpg\",\"keywords\":[\"spir-v\",\"Vulkan\"],\"articleSection\":[\"White Papers\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/\",\"url\":\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/\",\"name\":\"New Automatic Relaxed Precision White Paper for SPIR-V - LunarG\",\"isPartOf\":{\"@id\":\"https:\/\/www.lunarg.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.lunarg.com\/wp-content\/uploads\/2019\/09\/iStock-1155410378-2.jpg\",\"datePublished\":\"2019-09-26T15:40:55+00:00\",\"dateModified\":\"2025-01-16T01:08:53+00:00\",\"description\":\"LunarG releases new RelaxedPrecision white paper for SPIR-V developers.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#primaryimage\",\"url\":\"https:\/\/www.lunarg.com\/wp-content\/uploads\/2019\/09\/iStock-1155410378-2.jpg\",\"contentUrl\":\"https:\/\/www.lunarg.com\/wp-content\/uploads\/2019\/09\/iStock-1155410378-2.jpg\",\"width\":755,\"height\":395,\"caption\":\"Creative concept of shape fluid mixed blue, red and green paints\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.lunarg.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New Automatic Relaxed Precision White Paper for SPIR-V\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.lunarg.com\/#website\",\"url\":\"https:\/\/www.lunarg.com\/\",\"name\":\"LunarG\",\"description\":\"3D Graphics Software Solutions\",\"publisher\":{\"@id\":\"https:\/\/www.lunarg.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.lunarg.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.lunarg.com\/#organization\",\"name\":\"LunarG\",\"url\":\"https:\/\/www.lunarg.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.lunarg.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.lunarg.com\/wp-content\/uploads\/2020\/05\/logo.png\",\"contentUrl\":\"https:\/\/www.lunarg.com\/wp-content\/uploads\/2020\/05\/logo.png\",\"width\":767,\"height\":304,\"caption\":\"LunarG\"},\"image\":{\"@id\":\"https:\/\/www.lunarg.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.lunarg.com\/#\/schema\/person\/493f4ece901c822208cfda3feb80420a\",\"name\":\"Dave Desormeaux\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.lunarg.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/89944424b10c09db4e6c6e62b6ef1722?s=96&d=retro&r=pg\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/89944424b10c09db4e6c6e62b6ef1722?s=96&d=retro&r=pg\",\"caption\":\"Dave Desormeaux\"},\"sameAs\":[\"http:\/\/www.lunarg.com\"],\"url\":\"https:\/\/www.lunarg.com\/author\/dave-d\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New Automatic Relaxed Precision White Paper for SPIR-V - LunarG","description":"LunarG releases new RelaxedPrecision white paper for SPIR-V developers.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/","og_locale":"en_US","og_type":"article","og_title":"New Automatic Relaxed Precision White Paper for SPIR-V - LunarG","og_description":"LunarG releases new RelaxedPrecision white paper for SPIR-V developers.","og_url":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/","og_site_name":"LunarG","article_published_time":"2019-09-26T15:40:55+00:00","article_modified_time":"2025-01-16T01:08:53+00:00","og_image":[{"width":755,"height":395,"url":"https:\/\/www.lunarg.com\/wp-content\/uploads\/2019\/09\/iStock-1155410378-2.jpg","type":"image\/jpeg"}],"author":"Dave Desormeaux","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Dave Desormeaux","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#article","isPartOf":{"@id":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/"},"author":{"name":"Dave Desormeaux","@id":"https:\/\/www.lunarg.com\/#\/schema\/person\/493f4ece901c822208cfda3feb80420a"},"headline":"New Automatic Relaxed Precision White Paper for SPIR-V","datePublished":"2019-09-26T15:40:55+00:00","dateModified":"2025-01-16T01:08:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/"},"wordCount":426,"publisher":{"@id":"https:\/\/www.lunarg.com\/#organization"},"image":{"@id":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#primaryimage"},"thumbnailUrl":"https:\/\/www.lunarg.com\/wp-content\/uploads\/2019\/09\/iStock-1155410378-2.jpg","keywords":["spir-v","Vulkan"],"articleSection":["White Papers"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/","url":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/","name":"New Automatic Relaxed Precision White Paper for SPIR-V - LunarG","isPartOf":{"@id":"https:\/\/www.lunarg.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#primaryimage"},"image":{"@id":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#primaryimage"},"thumbnailUrl":"https:\/\/www.lunarg.com\/wp-content\/uploads\/2019\/09\/iStock-1155410378-2.jpg","datePublished":"2019-09-26T15:40:55+00:00","dateModified":"2025-01-16T01:08:53+00:00","description":"LunarG releases new RelaxedPrecision white paper for SPIR-V developers.","breadcrumb":{"@id":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#primaryimage","url":"https:\/\/www.lunarg.com\/wp-content\/uploads\/2019\/09\/iStock-1155410378-2.jpg","contentUrl":"https:\/\/www.lunarg.com\/wp-content\/uploads\/2019\/09\/iStock-1155410378-2.jpg","width":755,"height":395,"caption":"Creative concept of shape fluid mixed blue, red and green paints"},{"@type":"BreadcrumbList","@id":"https:\/\/www.lunarg.com\/new-automatic-relaxed-precision-white-paper-for-spir-v\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lunarg.com\/"},{"@type":"ListItem","position":2,"name":"New Automatic Relaxed Precision White Paper for SPIR-V"}]},{"@type":"WebSite","@id":"https:\/\/www.lunarg.com\/#website","url":"https:\/\/www.lunarg.com\/","name":"LunarG","description":"3D Graphics Software Solutions","publisher":{"@id":"https:\/\/www.lunarg.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lunarg.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.lunarg.com\/#organization","name":"LunarG","url":"https:\/\/www.lunarg.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lunarg.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.lunarg.com\/wp-content\/uploads\/2020\/05\/logo.png","contentUrl":"https:\/\/www.lunarg.com\/wp-content\/uploads\/2020\/05\/logo.png","width":767,"height":304,"caption":"LunarG"},"image":{"@id":"https:\/\/www.lunarg.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.lunarg.com\/#\/schema\/person\/493f4ece901c822208cfda3feb80420a","name":"Dave Desormeaux","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lunarg.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/89944424b10c09db4e6c6e62b6ef1722?s=96&d=retro&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/89944424b10c09db4e6c6e62b6ef1722?s=96&d=retro&r=pg","caption":"Dave Desormeaux"},"sameAs":["http:\/\/www.lunarg.com"],"url":"https:\/\/www.lunarg.com\/author\/dave-d\/"}]}},"_links":{"self":[{"href":"https:\/\/www.lunarg.com\/wp-json\/wp\/v2\/posts\/1457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lunarg.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lunarg.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lunarg.com\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lunarg.com\/wp-json\/wp\/v2\/comments?post=1457"}],"version-history":[{"count":0,"href":"https:\/\/www.lunarg.com\/wp-json\/wp\/v2\/posts\/1457\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lunarg.com\/wp-json\/wp\/v2\/media\/1959"}],"wp:attachment":[{"href":"https:\/\/www.lunarg.com\/wp-json\/wp\/v2\/media?parent=1457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lunarg.com\/wp-json\/wp\/v2\/categories?post=1457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lunarg.com\/wp-json\/wp\/v2\/tags?post=1457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}