1. 16 Nov, 2020 24 commits
  2. 15 Nov, 2020 11 commits
  3. 14 Nov, 2020 5 commits
    • Alejandro Piñeiro's avatar
      v3dv/pipeline: take into account precision for the output_type · 035e21e7
      Alejandro Piñeiro authored
      By default we are using 32bit output type for texture operations,
      16bit for shadow.
      With this commit we also use the precision info from the sampler (that
      is assigned if SPIR-V uses RelaxedPrecision decorator), in order to
      use 16bit.
      This is a first step as only take into account the precision of the
      deref_vars used on the texture operation.
      But the decoration can be also applied to other cases, like the result
      of the operation. That means that there are ways to infer that the
      texture operation can operate at relaxed precision. Those cases would
      be handled on following patches.
          * Add directly the return_size on the descriptor_map, instead of
          * Check relaxed precision for images too (Iago)
          * Handle the return size for the default sampler
          * Handle different output size for the case of not having a sampler.
          * Comment fixes (Iago)
      Reviewed-by: Iago Toral's avatarIago Toral Quiroga <itoral@igalia.com>
      Part-of: <mesa/mesa!7545>
    • Alejandro Piñeiro's avatar
      v3dv: remove combined_idx support · 7da854e1
      Alejandro Piñeiro authored
      Now that the v3d compiler has support for separated texture and
      sampler indices, we can stop to combine them. Again, that's what
      Vulkan allows after all.
      As we are doing this we can't use anymore the texture format (coming
      from the texture) to chose the return size (that is a sampling
      parameter). We default for 32, and just go to 16 for shadow. We plan
      to use SPIR-V RelaxedPrecision to use in more cases 16 bit. We would
      do that on following patches.
      v2 (from Iago feedback):
         * Fix typos/bad grammar on comments.
         * Move tex/sampler number assert to before the loop that fills
           tex/sampler info.
      Reviewed-by: Iago Toral's avatarIago Toral Quiroga <itoral@igalia.com>
      Part-of: <mesa/mesa!7545>
    • Alejandro Piñeiro's avatar
      broadcom/compiler: separate texture/sampler info from v3d_key · 429c3364
      Alejandro Piñeiro authored
      So far the v3d compiler has them combined, as for OpenGL both are the
      same. This change is intended to fit the v3d compiler better with
      Vulkan, where they are separate concepts.
      Note that NIR has them separate for a long time, both on nir_variable
      and on some NIR lowerings.
      v2: (from Iago feedback)
          * Use key->num_tex/sampler_used to iterate through the array
          * Fill up num_samplers_used on v3d, assert that is the same that
            num_tex_used if possible.
      v3: (Iago)
          * Assert num_tex/samplers_used is smaller that tex/sampler array size.
      v4: Update assert mentioned on v3 to use <= instead of < (detected by CI)
      Reviewed-by: Iago Toral's avatarIago Toral Quiroga <itoral@igalia.com>
      squash! broadcom/compiler: separate texture/sampler info from v3d_key
      Part-of: <mesa/mesa!7545>
    • Alejandro Piñeiro's avatar
      v3dv: cleanup/remove support for pre-generated variants · 1fe52af6
      Alejandro Piñeiro authored
      In preparation to the changes that would allow to not need them.
      It is worth to note that it is likely (we have some ideas in mind)
      that we would need to bring back pre-generate variants on the
      future. The approach is slightly different on v3dv_pipeline vs
        * v3dv_pipeline: even after the clean-up, we had code for all the
          functions they have, even if they were doing less things
          (specifically, a second shader variant), so they still make sense
          on their own, and serve as template for adding support of multiple
          pre-generated shader variants in the future.
        * v3dv_cmd_buffer: as we really don't need to fill up the key with
          some after-pipeline data, we would end with some functions empty
          (specifically cmd_buffer_populate_v3d_key). Even as a placeholder,
          that would be odd. Additionally the current code has a lot of
          boilerplate code (functions to fill up vs, cs and fs keys are
          basically the same), and we already have in mind refactor them. So
          it would be better to remove all of them, instead of keeping
          around some code we would not be happy with. If in the future we
          pregenerate more that one variant, hopefully the new code to chose
          between them would be better.
      v2: clarify the commit message, and fix typos on the comments (Iago)
      Reviewed-by: Iago Toral's avatarIago Toral Quiroga <itoral@igalia.com>
      Part-of: <mesa/mesa!7545>
    • Alejandro Piñeiro's avatar
      nir/lower_tex: clarify nir_lower_tex_options indexing · 5169dfd1
      Alejandro Piñeiro authored
      This doesn't matter too much on OpenGL as texture id and sampler id
      are the same, but become relevant if using the lowering for Vulkan.
      Reviewed-by: Iago Toral's avatarIago Toral Quiroga <itoral@igalia.com>
      Part-of: <mesa/mesa!7545>