<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Using a single-plane imageview from a multi-plane image is broken"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=105496">105496</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Using a single-plane imageview from a multi-plane image is broken
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>git
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Drivers/Vulkan/intel
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>atomnuker@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jason@jlekstrand.net
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,

As the title suggests, creating a VkImageView with a format of
VK_FORMAT_R8_UNORM out of a VkImage with format
VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM (and the mutable flag enabled too) and then
using the image as a storage image (e.g. layout (set = 0, binding = 0, rgba8)
uniform readonly image2D input_img; inside a GLSL shader) will result in
vec4(0.0f) actually being read instead of the pixel values inside the image.
Writing to such images however seems to be successful.

I've uploaded some code to replicate this, though I'm afraid its not a small
example. The repo is <a href="https://github.com/atomnuker/FFmpeg/tree/exp_vulkan">https://github.com/atomnuker/FFmpeg/tree/exp_vulkan</a>. To
compile run ./configure with --enable-vulkan. The shader is in
libavfilter/vulkan/unsharp.comp and the code which creates the imageviews is in
libavfilter/vf_unsharp_vulkan. To run, "./ffmpeg_g -init_hw_device
"vulkan=vk:0" -i <some sane video or image> -filter_hw_device vk -vf
format=yuv420p,scale=1280x720,hwupload,unsharp_vulkan,hwdownload,format=yuv420p
-y out.mkv". I don't have glslang hooked up to the build system yet so you need
to regenerate the .h file with "glslangValidator -V unsharp.comp
--variable-name "unsharp_vulkan_comp_spv" -o unsharp.comp.h".</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>