Skip to content

Request: Support WARP renderer (with command line argument).. #1

@oscarbg

Description

@oscarbg

Hi,
wanted to test linalg unit tests..
but I'm on Nvidia and not ling alg driver yet..
so tried latest warp supporting linalg..

microsoft.direct3d.warp.1.65535.20-preview
but MiniDXNN samples or unit tests don't support WARP by default..

simple fix:
in gfx.cpp change adapter_score to be 0 or 3 depending on usewarp variable:

so:

 if((adapter_desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) != 0)
     adapter_score = 0;

to:


int usewarp=1;

 if((adapter_desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) != 0)
     adapter_score = usewarp*3;
 else
     switch(adapter_desc.VendorId)
     {
     case 0x1002u:   // AMD
         adapter_score = 2;
         break;
     case 0x10DEu:   // NVIDIA
         adapter_score = 2;
         break;
     default:
         adapter_score = 1;
         break;
     }

also had to disable previous way of selecting adapter:

EnumAdapterByGpuPreference(i, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, IID_PPV_ARGS(&adapter1))))

for this path to take..

so change:

if(&SUCCEEDED(factory->QueryInterface(IID_PPV_ARGS(&factory6)))):
to
if(0&&SUCCEEDED(factory->QueryInterface(IID_PPV_ARGS(&factory6))))

would be better also add command line flag like Microsoft D3D12 samples (/warp -warp) to select warp from command line..

also found some errors in unit tests.. posting in another issue.. but don't know if better report to Microsoft (how?) or ask here if it's a sample bug..

thanks..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions