Граф коммитов

2366 Коммитов

Автор SHA1 Сообщение Дата
Greg Roth ddde1217c9
Exec test - WAR SM feature check on older runtime (#3603)
An earlier version of the D3D runtime doesn't handle CheckFeatureSupport
for FEATURE_SHADER_MODEL when the corresponding struct is set to a
unrecognized shader model. Instead of returning the highest supported
shader model that is less than the one provided as documented, the call
fails. In practice, this only occurred for 6.6 tests where the SDK had
6.6 capability, but the installed runtime did not.

To work around this, we don't verify that the call succeeds. Instead,
a failing return result is interpretted the same way as a highest shader
model value that is lower than that requested.
2021-03-18 11:03:11 -07:00
Adam Yang e8372b9b9a
Fixed arg pairs not correct for old source in module pdbs (#3599) 2021-03-18 01:33:06 -07:00
Greg Roth 30e306f326
ShaderOpTest limit commandlist6 to where supported (#3600)
Because version 6 of the command list pointer was being created whenever
the available SDK supported it, sometimes the test would try to create
version 6 where it wasn't supported.

Instead, this just stores the base pointer type and casts it up where we
know support is available.
2021-03-17 21:25:31 -07:00
Tex Riddell 2bda44fc06
Add constant evaluation for clamp() (#3581) 2021-03-17 17:46:23 -07:00
Vishal Sharma 63ce61aee5
Fix constexpr cast involving matrix type (#3593) 2021-03-17 15:36:14 -07:00
Adam Yang 640c9af748
Added way for caller to replace args in PDB utils (#3595) 2021-03-17 12:38:11 -07:00
Tex Riddell de00b014ac
Fix const error check for object subscript operator (#3580) 2021-03-17 11:40:48 -07:00
Tex Riddell 3f6589a30b
Fix coverage bing used to init dx.ishelper when only discard is used (#3589) 2021-03-16 08:26:56 -07:00
Tex Riddell 92fa2508c4
Filecheck: Allow empty stderr input; replace last couple errs() uses (#3588) 2021-03-16 08:22:34 -07:00
Vishal Sharma 6ad56561e2
Fix a misfiring assert due to unused static const involving matrix type (#3582) 2021-03-15 11:01:55 -07:00
Xiang Li de09119850
Add -link to dxc. (#3577)
* Add -link to dxc.
2021-03-15 09:09:58 -07:00
Tex Riddell fd07613a95
Texture2DMS fixes: missing ResProp data; reflection default NumSamples = 0 (#3578)
- Fix missing component type and count for Texture2DMS in ResProps
- Fix reflection for Texture2DMS with default NumSamples
2021-03-15 01:14:05 -07:00
Tex Riddell 0b686f347b
FileChecker improvements: VFS, %dxl, FileCheck -D, error reporting (#3576)
- VFS captures output files for duration of test, enabling:
- %dxl test IDxcLinker
- add -D to FileCheck args to supply defined variables
- report failing RUN command when not consumed by FileCheck or XFail
2021-03-14 22:13:26 -07:00
Michael Haidl 1db765ea9c
DXC extension for DXR Payload Access Qualifiers (#3171)
This extension adds qualifiers for payload structures accompanied with semantic checks and code generation. This feature is opt-in for SM 6.6 libraries.  The information added by the developer is stored in the DXIL type system and a new metadata node is emitted during code generation. The metadata is not necessary for correct translation of DXIL, so it may be safely ignored, but it provides hints to unlock potential optimizations in payload storage between DXR shader stages.
2021-03-14 18:31:40 -07:00
Adam Yang acceedb905
Fixed version header potentially missing in some configs (#3574) 2021-03-14 00:12:40 -08:00
Adam Yang 92e3f2a6be
Fixed a bug reading version string from PDB. Implemented IDxcVersionInfo3 for DxcCompiler. (#3570) 2021-03-12 19:35:15 -08:00
Adam Yang b2c85528e7
Fixed some potential O0 failures (#3569) 2021-03-12 19:34:09 -08:00
Xiang Li 48b2c4611a
Support -export-shaders-only for linker. (#3571)
* Support -export-shaders-only for linker.
2021-03-11 23:49:28 -08:00
Greg Roth 028fa6d51f
Rename 64-bit atomic heap resource support bit (#3567)
Technically, the test matched the spec, but the D3D header didn't. I'm
more interested in making this work than who was right though ;)
2021-03-10 16:43:28 -08:00
Atte Seppälä 13b12d6b51
[spirv] Generate RelaxedPrecision decorations also for arrays of minimum precision variables (#3546)
Currently, arrays of min16float etc. types don't get a RelaxedPrecision decoration for the OpVariable. This has some real performance implications since at least some hardware can fit more RelaxedPrecision variables into registers, and maybe also groupshared memory.

This pull request add the missing RelaxedPrecision decoration for OpVariables of array types in a similar way vector and matrix minimum precision types are already handled.
2021-03-10 16:44:57 -05:00
Greg Roth 5f76047313
ComputeSampleTest: reset test between runs (#3561) 2021-03-10 12:40:41 -08:00
Adam Yang 95850daf8f
Made -Zs the flag for slim PDB. Added -Qpdb_in_private. (#3541) 2021-03-09 19:06:52 -08:00
Xiang Li b6258c65b6
Take care case dynamic indexing on vector start with offset. (#3558)
* Take care case dynamic indexing on vector start with offset.
2021-03-09 16:19:36 -08:00
Preston Hamlin a607ce605e
Add missing RTV to QuadReadTest XML (#3554)
The mesh shader path for QuadReadTest expects at least one render target. Without, the test framework attempts to clear a nonexistent RTV resource:

D3D12 ERROR: ID3D12CommandList::ClearRenderTargetView: Specified CPU descriptor handle ptr=0xCCCCCCCCCCCCCCCC does not refer to a location in a descriptor heap.

The commit in this PR simply adds an RTV, and will proceed through to test completion.
2021-03-09 11:16:17 -08:00
Greg Roth 26188ef485
Fix unbound arrays flattened type compare (#3544)
Comparing two unbound arrays where one was initilizing the other
resulted in infinitely incrementing both and never reaching a
conclusion.

This adds detection to FlattenedTypeIterator for the situation whereupon
the comparison is terminated and the result returned.

A simple test of the assignment is added expecting the correct error.
2021-03-08 14:35:52 -08:00
Greg Roth 1351ab9ee7
Infer wave-sensitivity of cyclic dependencies (#3543)
Cycles in the dependency graph can result in phis and other instructions
failing to get a wave sensitivity result after analysis. This can only
happen when nothing in the loop has wave sensitive operations.

By collecting phis that are unknown and marking them as non-sensitive
after analyze is complete and rerunning it, we can correctly evaluate
their dependants too.

Because incompletely processed blocks might still be wave-sensitive,
unknown phis are only added to be reprocessed when their preds have all
be processed fully.

In addition to cycles preventing wave sensitivity determination on
dependant operations, they can prevent entering blocks that depend on
values with cyclic dependencies. Even when reprocessing all unknown
phis, this can result in not all values getting a determination.

To resolve this, all blocks are added to the block list from the start
to ensure that they are all processed eventually. Since instruction
processing is more intelligent and targetted, this change is accompanied
by a change that only processes a single block from the worklist before
attempting to address queued instructions again.

To catch wave-sensitive instructions sooner, when visiting an
instruction, all arguments are checked for wave sensitivity even after
an unknown argument is found whereas before an unknown argument ended
the search.

Add some tricky loop tests that failed in ToT and various intermediate
stages of the change. Add a more aggressive assert to check for failures
to find the wave-sensitivity.

Fixed #2556 (again)
2021-03-08 14:34:25 -08:00
Justin Holewinski 7e1a660ae9
Check for Resource Binding Tier 3 before running DynamicResources test (#3545) 2021-03-08 07:09:44 -08:00
Greg Roth bb5dc9fdb0
Return Scatterer object for argument values (#3540)
An unrelated earlier change mistakenly removed the return on a line
calling the Scatterer constructor for an argument value. As a result,
the constructor is called, but the resulting object which would insert
new extraction ops in the entry block is not used at all. Instead,
the default case is encountered where the vector PHI op is used as an
insertion point, which places the extractions after the new scalar PHIs
that use them. This is caught in the loop case by an assert because the
assumptions that caused LCSSA to be skipped for this BB are faulty.
2021-03-05 08:40:27 -07:00
Jeff Sooknarine 62abe160d1
Add CHECK_HR around CreatePipelineState (#3539)
ShaderOpTest::CreatePipelineState needs to check the return code from ID3D12Device2::CreatePipelineState so failures immediately stop here.

Otherwise we might get a failure in a subsequent call like when CommandListRefs::CreateForDevice() calls ID3D12Device::CreateCommandQueue() - this one will fail with return code 0x887a0005 - The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action.
2021-03-04 15:12:13 -08:00
Tex Riddell 5bdf3574bc
Revert "Report error for unsupported types of SV semantics (#3043)" (#3532)
This reverts commit bece3d4faf.

Revert system value type checking code due to regressions.
Will re-merge once it's fully verified fixed.
2021-03-02 21:24:25 -08:00
Greg Roth 3bd5f9ccfa
Errors on non-immediate load/gather offsets (#3283)
Gather operations that take four separate offsets are meant to allow for
programmable, non-immediate values. This removes them from the immediate
and range validations by giving the immediate versions their own opcodes
For these intrinsics and loads, errors are generated when offsets are non-literal
or out of range. These largely use the slightly altered validation paths that the
sample intrinsics use.

Reword error when texture access offsets are not immediates to be
more all encompassing and grammatical.

Incidentally remove duplicate shaders being used for the validation
test from the old directory while identical copies in the validation
directory went unused. Redirected validation test to the appropriate
copies. This is consistent with the test shader re-org's stated intent

Sample operations have a maximum of 3 args, but gather has a maximum of
two since it always operates on 2D images. So gather operations only
pass in two offset args to the offset validation, which resulted in an
invalid access.

Rather than adding a specialized condition to evade this, just iterate
over the number of elements in the array. For sample it will be 3 and
for gather 2 and it will still check for expected undefined args
appropriately.

For the offset legalization pass, the opcode is used to determine the
start and end of the offset args

Only produce the loop unroll suggestion when within a loop

Base error line on call instruction instead of source of the offset

Sort by location in source when possible and remove duplicates

Adapt tests to verify and match these changes

Fixes #2590
Fixes #2713
2021-03-02 18:42:09 -08:00
Tex Riddell 19360a8fa6
Validate CBuffer size to max of 65536 bytes (#3507) 2021-03-02 16:34:35 -08:00
Adam Yang a7770e66eb
Added IDxcVersionInfo3 for custom version string (#3517) 2021-03-02 15:19:04 -08:00
Adam Yang c7d8ac5793
Added recompile function on PdbUtils that just hands back compilation result. (#3529) 2021-03-02 15:18:44 -08:00
Greg Roth 83d6fd5628
Split atomics tests into heap/root types (#3526)
To test the flag indicating support for 64-bit atomics on heap
resources, the groupshared and raw tests are here altered to use root
descriptors. An nearly identical raw buffer test is kept for heap
testing and the typed resources, requiring heap support implicitly, is
unaltered. 32-bit testing, encompassing typed resources and all else,
are kept in the typed variants

Renamed a few things to make the names less confusing.
2021-03-02 07:55:56 -08:00
Vishal Sharma 43279b35c9
Fix crashes related to handling of constexpr cast involving vector types (#3524) 2021-03-01 19:07:25 -08:00
Xiang Li ae834522b3
Use vector size from vector type when dynamic indexing cb vector. (#3530) 2021-03-01 18:00:47 -08:00
seppala2 03cc4f8663
[spirv] Add vk::image_format attribute for Buffers, RWBuffers and RWTextures (#3395)
According to Vulkan specification when using `OpImageRead/OpImageWrite`, the `OpTypeImage` (`Buffers`, `RWBuffers`, `RWTextures`) must have a format that matches the format on the API side, unless the StorageImageReadWithoutFormat/StorageImageWriteWithoutFormat is added and `Unknown` is used as the format.

This pull request addressess #2498 for the format part by adding an attribute `[[vk::image_format("<image format as spelled in SPIR-V spec>")]].` Example of the syntax:

```
[[vk::image_format("rgba8")]]
RWBuffer<float4> Buf;

[[vk::image_format("rg16f")]]
RWTexture2D<float2> Tex;

RWTexture2D<float2> Tex2; // Works like before
```

The `image_format` only applies to **global variables** of type `Buffer`, `RWBuffer`, `RWTexture`. For variables and function parameters it is propagated by the inlining pass in legalization. This required a small change to one of the passes in SPIRV-Tools, that should be also checked by someone more familiar with the codebase: https://github.com/KhronosGroup/SPIRV-Tools/pull/4126

Note that this does not fix the handling of unspecified format (that case still works like before, using `R32f`, etc. based on the type in shader), although it should be still fixed to add the
StorageImageReadWithoutFormat and/or StorageImageWriteWithoutFormat and use Undefined. But I think the ability to specify the format is more urgent.

Design note from Jaebaek:
Since the `image_format` attribute only applies to **global variables**, under the DXC architecture
only `DeclResultIdMapper` can check the attribute when it handles `VarDecl`s. It means
we have to pass the `image_format` information to `LowerTypeVisitor` because it cannot access to
`VarDecl`. In order to pass the `image_format`, we use `SpirvContext` that can be accessed by
`SpirvEmitter` and all visitors. We use `SpirvVariable` to `spv::ImageFormat` mapping because the
attribute only applies to **global variables** (not to image types).
See how we use `llvm::DenseMap<const SpirvVariable *, spv::ImageFormat> spvVarToImageFormat`.
2021-03-01 10:07:40 -05:00
Greg Roth 1ca779732f
Correct atomics on heap usage for libs (#3525)
The previous shader flag code failed to account for the library-specific
handle creation function
2021-02-28 16:02:44 -08:00
Greg Roth 62f390cb58
Set shader flags for dynamic resources (#3521)
Set shader flags for resource and sampler descriptor heap indexing based
on the CreateHandleFromHeap call and its ShaderHeap argument
2021-02-27 10:37:57 -07:00
Greg Roth 3f9db446e7
Correct 64-bit atomics on heap resource flags (#3520)
Left a few out
2021-02-26 22:58:33 -08:00
Greg Roth c3f9997709
64-bit atomics usage resource flags (#3518)
When a resource comes from a binding, we can't determine if it is on a
heap or not, so we set a flag on it to let the runtime sort it out.

When a resource comes from the heap directly, we know it's on the heap
so we set the shader flag to check for platform support.
2021-02-26 19:55:59 -08:00
Vishal Sharma 7240c251cf
Remove unneeded asserts (#3514) 2021-02-26 13:28:05 -08:00
Greg Roth 6482ac9413
DerivativesTest: quad2D layout and refactor (#3506)
Refactor Derivatives test to be clearer, more correct, and more in
keeping with the original intent. Center index is now nearer the center.
Conversion of 2D index to 1D is now correct for the quad layout.
Dispatch sizes are separated by CS, Mesh, and undefined results to make
testing easier and more complete.

Also adds the 2D quad formats while adapting 1D variants to be correct
with the latest spec
2021-02-26 11:44:17 -08:00
David Peixotto 58163b04cf
Add support for specifying overload arg index in extension function (#3510)
Any extension function that includes the specical string "$o" in its name
needs to have the $o replaced with the type name of the overload. Previously
we used a default heuristic to select the overload type from a function
argument.

This commit adds support for explicitly setting the argument to use for the
overload name by appending a ":<ArgIndex>" to the overload marker. For example,
using a name like "my_special_function.$o:3" would take the overload type from
the third function argument.
2021-02-25 19:52:09 -08:00
Xiang Li 9eb7f4f40e
Don't replace readfirstlane in GVN::propagateEquality. (#3504) 2021-02-25 17:23:40 -08:00
Vishal Sharma bece3d4faf
Report error for unsupported types of SV semantics (#3043) 2021-02-25 16:38:12 -08:00
Tex Riddell 97b0b1a3ee
Fix Dynamic Resources when used with -Od (#3499)
- SROA was not skipping handle type, now present with dynamic resources
  changes, or ConstantBuffer<> / TextureBuffer<> types, as it should.
- Updated unit tests to add combinations of -Od and -Zi.
2021-02-25 14:10:22 -08:00
Greg Roth 4a8b91ebfd
Resolve groupshared test order reporting issue (#3502)
The order of globals() is inconsistent. Since this test depends on that
order, it fails sometimes. By removing the individual characterists of
the errors, the issue is resolved.
2021-02-25 10:40:38 -08:00
Vishal Sharma c3ffca66af
Respect matrix orientation when doing store op in RWByteAddressBuffer (#3484) 2021-02-24 21:38:49 -08:00