On 19/09/16 18:02, Jason Ekstrand wrote:

This looks good to me.

Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net <mailto:ja...@jlekstrand.net>>

Do we have tests for this? If not, we should write some. I know there are other image atomic tests in the CTS. They shouldn't be hard to extend.


Not that I saw. I'll add some.



On Sep 19, 2016 9:36 AM, "Lionel Landwerlin" <llandwer...@gmail.com <mailto:llandwer...@gmail.com>> wrote:

    OpAtomicLoad/Store should have pointer to images just like the
    rest of the
    atomic operators. These couple of lines were poorly copied from the
    ssbo/shared_vars cases (the only ones currently tests by the CTS).

    Fixes 2afb950161f847d9b0a7 "spirv/nir: Add support for
    OpAtomicLoad/Store"
    Cc: Timothy Arceri <timothy.arc...@collabora.com
    <mailto:timothy.arc...@collabora.com>>
    Cc: Jason Ekstrand <ja...@jlekstrand.net
    <mailto:ja...@jlekstrand.net>>
    ---
     src/compiler/spirv/spirv_to_nir.c | 13 +++----------
     1 file changed, 3 insertions(+), 10 deletions(-)

    diff --git a/src/compiler/spirv/spirv_to_nir.c
    b/src/compiler/spirv/spirv_to_nir.c
    index 49338b2..12b43ee 100644
    --- a/src/compiler/spirv/spirv_to_nir.c
    +++ b/src/compiler/spirv/spirv_to_nir.c
    @@ -1671,6 +1671,7 @@ vtn_handle_image(struct vtn_builder *b,
    SpvOp opcode,
        case SpvOpAtomicIDecrement:
        case SpvOpAtomicIAdd:
        case SpvOpAtomicISub:
    +   case SpvOpAtomicLoad:
        case SpvOpAtomicSMin:
        case SpvOpAtomicUMin:
        case SpvOpAtomicSMax:
    @@ -1681,17 +1682,9 @@ vtn_handle_image(struct vtn_builder *b,
    SpvOp opcode,
           image = *vtn_value(b, w[3],
    vtn_value_type_image_pointer)->image;
           break;

    -   case SpvOpAtomicLoad: {
    -      image.image =
    -         vtn_value(b, w[3],
    vtn_value_type_access_chain)->access_chain;
    -      break;
    -   }
    -
    -   case SpvOpAtomicStore: {
    -      image.image =
    -         vtn_value(b, w[1],
    vtn_value_type_access_chain)->access_chain;
    +   case SpvOpAtomicStore:
    +      image = *vtn_value(b, w[1],
    vtn_value_type_image_pointer)->image;
           break;
    -   }

        case SpvOpImageQuerySize:
           image.image =
    --
    2.9.3


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to