Skip to content

TextureSlice mess vulkan backend copyTexture implement. #110

Description

@HuazyYang
struct TextureSlice
    {
        uint32_t x = 0;
        uint32_t y = 0;
        uint32_t z = 0;
        // -1 means the entire dimension is part of the region
        // resolve() below will translate these values into actual dimensions
        uint32_t width = uint32_t(-1);
        uint32_t height = uint32_t(-1);
        uint32_t depth = uint32_t(-1);
};

TextureSlice confuse texture subresource dimmension info and texture copy box concept completely. For GAPI concept, copy texture can use different destination texel coordinate (x, y, z) and source box region (left, top, front, right, bottom, back), but TextureSlice just confuse this two different concept when using width, height, depth field as box region dimensions and texture subresource dimension.

Image

For API desgin decision, copyTexture API should not use TextureSlice as an input parameter. copyTexture need 6 parameters:

  • destination resource handle;
  • destination subresource indices (mipSlice, arraySlice);
  • destination texel coordinate inside subresource (dstX, dstY, dstZ)
  • source resource handle;
  • source subresource indices (mipSlice, arraySlice);
  • copied texel box region inside the subresource (left, top, front, right, bottom, back)

Wrap parameters to a common structure is a choise but not a better practise.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions