VirtualBox

Changeset 81360 in vbox


Ignore:
Timestamp:
Oct 18, 2019 3:58:52 PM (5 years ago)
Author:
vboxsync
Message:

Devices/Graphics: Direct3D backend support for UYVY, YUY2 and A8B8G8R8 formats

Location:
trunk/src/VBox/Devices
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h

    r77114 r81360  
    607607    AVLU32TREE              pSharedObjectTree;
    608608    bool                    fStencilAsTexture;
     609    D3DFORMAT               d3dfmtRequested;
     610    union
     611    {
     612        IDirect3DTexture9          *pTexture;
     613        IDirect3DCubeTexture9      *pCubeTexture;
     614        IDirect3DVolumeTexture9    *pVolumeTexture;
     615    } emulated;
    609616#endif
    610617} VMSVGA3DSURFACE;
     
    957964    bool                    fSupportedSurfaceINTZ;
    958965    bool                    fSupportedSurfaceNULL;
     966    bool                    fSupportedFormatUYVY : 1;
     967    bool                    fSupportedFormatYUY2 : 1;
     968    bool                    fSupportedFormatA8B8G8R8 : 1;
    959969# endif
    960970    /** Window Thread. */
     
    12651275                                 const char *pszPath, const char *pszNamePrefix, const char *pszNameSuffix);
    12661276
     1277#ifdef VMSVGA3D_DIRECT3D
     1278#define D3D_RELEASE(ptr) do { \
     1279    if (ptr)                  \
     1280    {                         \
     1281        (ptr)->Release();     \
     1282        (ptr) = 0;            \
     1283    }                         \
     1284} while (0)
     1285
     1286HRESULT D3D9UpdateTexture(PVMSVGA3DCONTEXT pContext,
     1287                          PVMSVGA3DSURFACE pSurface);
     1288HRESULT D3D9GetRenderTargetData(PVMSVGA3DCONTEXT pContext,
     1289                                PVMSVGA3DSURFACE pSurface,
     1290                                uint32_t uFace,
     1291                                uint32_t uMipmap);
     1292HRESULT D3D9GetSurfaceLevel(PVMSVGA3DSURFACE pSurface,
     1293                            uint32_t uFace,
     1294                            uint32_t uMipmap,
     1295                            bool fBounce,
     1296                            IDirect3DSurface9 **ppD3DSurface);
     1297D3DFORMAT D3D9GetActualFormat(PVMSVGA3DSTATE pState,
     1298                              D3DFORMAT d3dfmt);
     1299bool D3D9CheckDeviceFormat(IDirect3D9 *pD3D9,
     1300                           DWORD Usage,
     1301                           D3DRESOURCETYPE RType,
     1302                           D3DFORMAT CheckFormat);
     1303#endif
     1304
    12671305#endif /* !VBOX_INCLUDED_SRC_Graphics_DevVGA_SVGA3d_internal_h */
    12681306
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp

    r81291 r81360  
    159159*********************************************************************************************************************************/
    160160static void vmsvgaDumpD3DCaps(D3DCAPS9 *pCaps, D3DADAPTER_IDENTIFIER9 const *pai9);
    161 
    162 
    163 #define D3D_RELEASE(ptr) do { \
    164     if (ptr)                  \
    165     {                         \
    166         (ptr)->Release();     \
    167         (ptr) = 0;            \
    168     }                         \
    169 } while (0)
    170161
    171162
     
    228219    vmsvgaDumpD3DCaps(&pState->caps, &ai9);
    229220
    230     /* Check if INTZ is supported. */
    231     hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT,
    232                                           D3DDEVTYPE_HAL,
    233                                           D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
    234                                           0,
    235                                           D3DRTYPE_TEXTURE,
    236                                           FOURCC_INTZ);
    237     if (hr != D3D_OK)
     221    if (!D3D9CheckDeviceFormat(pState->pD3D9, 0, D3DRTYPE_TEXTURE, FOURCC_INTZ))
    238222    {
    239223        /* INTZ support is essential to support depth surfaces used as textures. */
     
    243227        pState->fSupportedSurfaceINTZ = true;
    244228
    245     /* Check if NULL is supported. */
    246     hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT,
    247                                           D3DDEVTYPE_HAL,
    248                                           D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
    249                                           D3DUSAGE_RENDERTARGET,
    250                                           D3DRTYPE_SURFACE,
    251                                           FOURCC_NULL);
    252     if (hr != D3D_OK)
     229    if (!D3D9CheckDeviceFormat(pState->pD3D9, D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, FOURCC_NULL))
    253230    {
    254231        /* NULL is a dummy surface which can be used as a render target to save memory. */
     
    258235        pState->fSupportedSurfaceNULL = true;
    259236
    260 
    261     /*  Check if DX9 depth stencil textures are supported */
    262     hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT,
    263                                           D3DDEVTYPE_HAL,
    264                                           D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
    265                                           D3DUSAGE_DEPTHSTENCIL,
    266                                           D3DRTYPE_TEXTURE,
    267                                           D3DFMT_D16);
    268     if (hr != D3D_OK)
     237    /* Check if DX9 depth stencil textures are supported */
     238    if (!D3D9CheckDeviceFormat(pState->pD3D9, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, D3DFMT_D16))
    269239    {
    270240        LogRel(("VMSVGA: texture format D3DFMT_D16 not supported\n"));
    271241    }
    272242
    273     hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT,
    274                                           D3DDEVTYPE_HAL,
    275                                           D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
    276                                           D3DUSAGE_DEPTHSTENCIL,
    277                                           D3DRTYPE_TEXTURE,
    278                                           D3DFMT_D24X8);
    279     if (hr != D3D_OK)
     243    if (!D3D9CheckDeviceFormat(pState->pD3D9, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, D3DFMT_D24X8))
    280244    {
    281245        LogRel(("VMSVGA: texture format D3DFMT_D24X8 not supported\n"));
    282246    }
    283     hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT,
    284                                           D3DDEVTYPE_HAL,
    285                                           D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
    286                                           D3DUSAGE_DEPTHSTENCIL,
    287                                           D3DRTYPE_TEXTURE,
    288                                           D3DFMT_D24S8);
    289     if (hr != D3D_OK)
     247
     248    if (!D3D9CheckDeviceFormat(pState->pD3D9, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, D3DFMT_D24S8))
    290249    {
    291250        LogRel(("VMSVGA: texture format D3DFMT_D24S8 not supported\n"));
    292251    }
     252
     253    /* Check some formats must be emulated. */
     254    if (D3D9CheckDeviceFormat(pState->pD3D9, 0, D3DRTYPE_TEXTURE, D3DFMT_UYVY))
     255    {
     256        /* Native UYVY support has better performance. */
     257        LogRel(("VMSVGA: texture format D3DFMT_UYVY supported\n"));
     258        pState->fSupportedFormatUYVY = true;
     259    }
     260
     261    if (D3D9CheckDeviceFormat(pState->pD3D9, 0, D3DRTYPE_TEXTURE, D3DFMT_YUY2))
     262    {
     263        /* Native YUY2 support has better performance. */
     264        LogRel(("VMSVGA: texture format D3DFMT_YUY2 supported\n"));
     265        pState->fSupportedFormatYUY2 = true;
     266    }
     267
     268    if (D3D9CheckDeviceFormat(pState->pD3D9, D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, D3DFMT_A8B8G8R8))
     269    {
     270        /* Native A8B8G8R8 support is good for OpenGL application in the guest. */
     271        LogRel(("VMSVGA: texture format D3DFMT_A8B8G8R8 supported\n"));
     272        pState->fSupportedFormatA8B8G8R8 = true;
     273    }
     274
    293275    return VINF_SUCCESS;
    294276}
     
    406388               |  SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET;
    407389        break;
    408 
     390    /* These formats can't be used as textures on AMD drivers (Intel works).
     391     * Still report them as textures to the guest and emulate them in the device.
     392     */
     393    case SVGA3D_DEVCAP_SURFACEFMT_UYVY:
     394    case SVGA3D_DEVCAP_SURFACEFMT_YUY2:
     395        result |= SVGA3DFORMAT_OP_TEXTURE;
     396        break;
    409397    }
    410398    Log(("CAPS: %s =\n%s\n", vmsvga3dGetCapString(idx3dCaps), vmsvga3dGet3dFormatString(result)));
     
    11251113        D3D_RELEASE(pSurface->u.pTexture);
    11261114        D3D_RELEASE(pSurface->bounce.pTexture);
     1115        D3D_RELEASE(pSurface->emulated.pTexture);
    11271116        break;
    11281117
     
    11301119        D3D_RELEASE(pSurface->u.pCubeTexture);
    11311120        D3D_RELEASE(pSurface->bounce.pCubeTexture);
     1121        D3D_RELEASE(pSurface->emulated.pCubeTexture);
    11321122        break;
    11331123
     
    11351125        D3D_RELEASE(pSurface->u.pVolumeTexture);
    11361126        D3D_RELEASE(pSurface->bounce.pVolumeTexture);
     1127        D3D_RELEASE(pSurface->emulated.pVolumeTexture);
    11371128        break;
    11381129
     
    15191510        && pSurfaceDest->u.pSurface)
    15201511    {
     1512        /// @todo should use the src context because only the shared hardware surface is required from the dst context,
     1513        //        while the src context may be also needed to copy data to the source bounce texture.
    15211514        const uint32_t cidDst = pSurfaceDest->idAssociatedContext;
    15221515
     
    15831576                    && (pSurfaceSrc->fUsageD3D & D3DUSAGE_RENDERTARGET))
    15841577                {
     1578#if 1
     1579                    /* Copy the source texture mipmap level to the bounce texture.
     1580                     * Get the data using the surface associated context.
     1581                     */
     1582                    PVMSVGA3DCONTEXT pContextSrc;
     1583                    rc = vmsvga3dContextFromCid(pState, pSurfaceSrc->idAssociatedContext, &pContextSrc);
     1584                    if (RT_SUCCESS(rc))
     1585                    {
     1586                        hr = D3D9GetRenderTargetData(pContextSrc, pSurfaceSrc, src.face, src.mipmap);
     1587                        AssertMsg(hr == D3D_OK, ("D3D9GetRenderTargetData failed with %x\n", hr));
     1588                        if (hr == D3D_OK)
     1589                        {
     1590                            /* Copy the source bounce texture to the destination surface. */
     1591                            IDirect3DSurface9 *pBounceSurf;
     1592                            rc = vmsvga3dGetD3DSurface(pState, pContextDst, pSurfaceSrc, src.face, src.mipmap, true, &pBounceSurf);
     1593                            if (RT_SUCCESS(rc))
     1594                            {
     1595                                POINT pointDest;
     1596                                pointDest.x = clipBox.x;
     1597                                pointDest.y = clipBox.y;
     1598
     1599                                hr = pContextDst->pDevice->UpdateSurface(pBounceSurf, &RectSrc, pDest, &pointDest);
     1600                                Assert(hr == D3D_OK);
     1601
     1602                                D3D_RELEASE(pBounceSurf);
     1603                            }
     1604                            else
     1605                            {
     1606                                AssertRC(rc);
     1607                                hr = E_INVALIDARG;
     1608                            }
     1609                        }
     1610                    }
     1611                    else
     1612                    {
     1613                        AssertRC(rc);
     1614                        hr = E_INVALIDARG;
     1615                    }
     1616#else
    15851617                    /* Copy the texture mipmap level to the bounce texture. */
    15861618
     
    16071639                        D3D_RELEASE(pBounceSurf);
    16081640                    }
     1641#endif
    16091642                }
    16101643                else if (   (pSurfaceSrc->fUsageD3D & D3DUSAGE_RENDERTARGET) == 0
     
    17991832
    18001833            /* Copy the new content to the actual texture object. */
     1834#if 1
     1835            HRESULT hr2 = D3D9UpdateTexture(pContext, pSurfaceDest);
     1836#else
    18011837            IDirect3DBaseTexture9 *pSourceTexture;
    18021838            IDirect3DBaseTexture9 *pDestinationTexture;
     
    18121848            }
    18131849            HRESULT hr2 = pContext->pDevice->UpdateTexture(pSourceTexture, pDestinationTexture);
     1850#endif
    18141851            AssertMsg(hr2 == D3D_OK, ("UpdateTexture failed with %x\n", hr2)); RT_NOREF(hr2);
    18151852        }
     
    20102047                                                      NULL);
    20112048                AssertMsgReturn(hr == D3D_OK, ("CreateTexture (systemmem) failed with %x\n", hr), VERR_INTERNAL_ERROR);
     2049
     2050                if (pSurface->formatD3D != pSurface->d3dfmtRequested)
     2051                {
     2052                    /* Create a staging texture/render target for format conversion. */
     2053                    hr = pContext->pDevice->CreateTexture(cWidth,
     2054                                                          cHeight,
     2055                                                          numMipLevels,
     2056                                                          pSurface->fUsageD3D | D3DUSAGE_RENDERTARGET,
     2057                                                          pSurface->formatD3D,
     2058                                                          D3DPOOL_DEFAULT,
     2059                                                          &pSurface->emulated.pTexture,
     2060                                                          NULL);
     2061                    AssertMsgReturn(hr == D3D_OK, ("CreateTexture (emulated) failed with %x\n", hr), VERR_INTERNAL_ERROR);
     2062                }
    20122063            }
    20132064            else
     
    21452196        }
    21462197    }
    2147     else
    2148     {
    2149         IDirect3DTexture9 *pTexture = pSurface->bounce.pTexture ? pSurface->bounce.pTexture : pSurface->u.pTexture;
     2198    else if (pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_TEXTURE)
     2199    {
     2200        IDirect3DTexture9 *pTexture;
     2201        if (pSurface->bounce.pTexture)
     2202            pTexture = pSurface->bounce.pTexture;
     2203        else if (pSurface->formatD3D != pSurface->d3dfmtRequested)
     2204            pTexture = pSurface->emulated.pTexture;
     2205        else
     2206            pTexture = pSurface->u.pTexture;
    21502207
    21512208        for (uint32_t i = 0; i < numMipLevels; ++i)
     
    21782235        }
    21792236    }
     2237    else
     2238    {
     2239        AssertMsgFailedReturn(("enmD3DResType not expected %d\n", pSurface->enmD3DResType), VERR_INTERNAL_ERROR);
     2240    }
    21802241
    21812242    if (pSurface->bounce.pTexture)
    21822243    {
    21832244        Log(("vmsvga3dBackCreateTexture: sync dirty texture from bounce buffer\n"));
    2184 
    21852245        if (pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_VOLUME_TEXTURE)
    21862246            hr = pContext->pDevice->UpdateTexture(pSurface->bounce.pVolumeTexture, pSurface->u.pVolumeTexture);
    2187         else if (pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_CUBE_TEXTURE)
    2188             hr = pContext->pDevice->UpdateTexture(pSurface->bounce.pCubeTexture, pSurface->u.pCubeTexture);
    21892247        else
    2190             hr = pContext->pDevice->UpdateTexture(pSurface->bounce.pTexture, pSurface->u.pTexture);
     2248            hr = D3D9UpdateTexture(pContext, pSurface);
    21912249        AssertMsgReturn(hr == D3D_OK, ("UpdateTexture failed with %x\n", hr), VERR_INTERNAL_ERROR);
    21922250
     
    23182376{
    23192377    HRESULT hr = D3D_OK;
    2320     const uint32_t u32SurfHints = pSurface->surfaceFlags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK;
    23212378    const DWORD dwFlags = transfer == SVGA3D_READ_HOST_VRAM ? D3DLOCK_READONLY : 0;
    2322     // if (u32SurfHints != 0x18 && u32SurfHints != 0x60) ASMBreakpoint();
    23232379
    23242380    AssertReturn(pSurface->enmD3DResType != VMSVGA3D_D3DRESTYPE_VOLUME_TEXTURE, VERR_NOT_IMPLEMENTED);
     
    23372393        AssertRCReturn(rc, rc);
    23382394
    2339         /** @todo inefficient for VRAM buffers!! */
    2340         if (fTexture)
    2341         {
    2342             if (pSurface->bounce.pTexture)
     2395        if (transfer == SVGA3D_READ_HOST_VRAM)
     2396        {
     2397            /* Texture data is copied to the host VRAM.
     2398             * Update the 'bounce' texture if necessary.
     2399             */
     2400            if (   fTexture
     2401                && pSurface->bounce.pTexture
     2402                && iBox == 0 /* only the first time */)
    23432403            {
    2344                 if (   transfer == SVGA3D_READ_HOST_VRAM
    2345                     && RT_BOOL(u32SurfHints & SVGA3D_SURFACE_HINT_RENDERTARGET)
    2346                     && iBox == 0 /* only the first time */)
     2404                /** @todo inefficient for VRAM buffers!! */
     2405                if (RT_BOOL(pSurface->surfaceFlags & SVGA3D_SURFACE_HINT_RENDERTARGET))
    23472406                {
    23482407                    /* Copy the texture mipmap level to the bounce texture. */
    2349 
    2350                     /* Source is the texture, destination is the bounce texture. */
    2351                     IDirect3DSurface9 *pSrc;
    2352                     rc = vmsvga3dGetD3DSurface(pState, pContext, pSurface, uHostFace, uHostMipmap, false, &pSrc);
    2353                     AssertRCReturn(rc, rc);
    2354 
    2355                     Assert(pSurf != pSrc);
    2356 
    2357                     hr = pContext->pDevice->GetRenderTargetData(pSrc, pSurf);
    2358                     AssertMsgReturn(hr == D3D_OK, ("GetRenderTargetData failed with %x\n", hr), VERR_INTERNAL_ERROR);
    2359 
    2360                     D3D_RELEASE(pSrc);
     2408                    hr = D3D9GetRenderTargetData(pContext, pSurface, uHostFace, uHostMipmap);
     2409                    AssertMsgReturn(hr == D3D_OK, ("D3D9GetRenderTargetData failed with %x\n", hr), VERR_INTERNAL_ERROR);
    23612410                }
    23622411            }
     
    24222471        AssertMsgReturn(hr == D3D_OK, ("UnlockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
    24232472
    2424         if (fTexture)
    2425         {
    2426             if (pSurface->bounce.pTexture)
     2473        if (transfer == SVGA3D_WRITE_HOST_VRAM)
     2474        {
     2475            /* Data is copied to the texture. Copy updated 'bounce' texture to the actual if necessary.
     2476             */
     2477            /// @todo for the last iBox only.
     2478            if (   fTexture
     2479                && pSurface->bounce.pTexture)
    24272480            {
    2428                 if (transfer == SVGA3D_WRITE_HOST_VRAM)
    2429                 {
    2430                     LogFunc(("Sync texture from bounce buffer\n"));
    2431 
    2432                     /* Copy the new contents to the actual texture object. */
    2433                     hr = pContext->pDevice->UpdateTexture(pSurface->bounce.pTexture, pSurface->u.pTexture);
    2434                     AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceDMA: UpdateTexture failed with %x\n", hr), VERR_INTERNAL_ERROR);
    2435 
    2436                     /* Track the copy operation. */
    2437                     vmsvga3dSurfaceTrackUsage(pState, pContext, pSurface);
    2438                 }
     2481                LogFunc(("Sync texture from bounce buffer\n"));
     2482
     2483                /* Copy the new contents to the actual texture object. */
     2484                hr = D3D9UpdateTexture(pContext, pSurface);
     2485                AssertMsgReturn(hr == D3D_OK, ("UpdateTexture failed with %x\n", hr), VERR_INTERNAL_ERROR);
     2486
     2487                /* Track the copy operation. */
     2488                vmsvga3dSurfaceTrackUsage(pState, pContext, pSurface);
    24392489            }
    24402490        }
     
    25202570    else
    25212571    {
    2522         AssertMsgFailed(("Unsupported surface hint 0x%08X, type %d\n", u32SurfHints, pSurface->enmD3DResType));
     2572        AssertMsgFailed(("Unsupported surface flags 0x%08X, type %d\n", pSurface->surfaceFlags, pSurface->enmD3DResType));
    25232573    }
    25242574
     
    53615411    if (!pVertexSurface->u.pVertexBuffer)
    53625412    {
    5363         LogFunc(("Create vertex buffer fDirty=%d\n", pVertexSurface->fDirty));
     5413        LogFunc(("Create vertex buffer sid=%x fDirty=%d\n", pVertexSurface->id, pVertexSurface->fDirty));
    53645414
    53655415        const DWORD Usage = D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY; /* possible severe performance penalty otherwise (according to d3d debug output */
     
    57895839        int rc2 = vmsvga3dSurfaceFromSid(pState, pContext->state.aRenderTargets[SVGA3D_RT_COLOR0], &pSurface);
    57905840        if (RT_SUCCESS(rc2))
    5791             vmsvga3dInfoSurfaceToBitmap(NULL, pSurface, "bmp", "rt", "-post");
     5841            vmsvga3dInfoSurfaceToBitmap(NULL, pSurface, "bmpd3d", "rt", "-post");
    57925842    }
    57935843#endif
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.cpp

    r76553 r81360  
    229229#ifdef VMSVGA3D_DIRECT3D
    230230    /* Translate the format and usage flags to D3D. */
    231     pSurface->formatD3D         = vmsvga3dSurfaceFormat2D3D(format);
     231    pSurface->d3dfmtRequested   = vmsvga3dSurfaceFormat2D3D(format);
     232    pSurface->formatD3D         = D3D9GetActualFormat(pState, pSurface->d3dfmtRequested);
    232233    pSurface->multiSampleTypeD3D= vmsvga3dMultipeSampleCount2D3D(multisampleCount);
    233234    pSurface->fUsageD3D         = 0;
     
    245246    /* pSurface->u.pSurface = NULL; */
    246247    /* pSurface->bounce.pTexture = NULL; */
     248    /* pSurface->emulated.pTexture = NULL; */
    247249#else
    248250    vmsvga3dSurfaceFormat2OGL(pSurface, format);
  • trunk/src/VBox/Devices/Makefile.kmk

    r81250 r81360  
    297297  if  "$(KBUILD_TARGET)" == "win" && !defined(VBOX_WITH_VMSVGA3D_USE_OPENGL)
    298298   VBoxDD_DEFS          += VMSVGA3D_DIRECT3D
    299    VBoxDD_SOURCES       += Graphics/DevVGA-SVGA3d-win.cpp
     299   VBoxDD_SOURCES       += \
     300       Graphics/DevVGA-SVGA3d-win.cpp \
     301       Graphics/DevVGA-SVGA3d-win-d3d9.cpp
    300302   VBoxDD_LIBS.win      += d3d9.lib $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
    301303   VBoxDD_LDFLAGS.win   += /DELAYLOAD:d3d9.dll
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette