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

181 Коммитов

Автор SHA1 Сообщение Дата
Young Kim 6f2aaa6ab3
Preserve denorms for frc on half inputs, and fix sqrt(-denorm) for float (#1042) 2018-01-30 16:52:58 -08:00
Young Kim 1e97116e9f
Fix countbits, reversebits, firstbitlow intrinsics for int16 types (#1037)
Fix countbits, reversebits, firstbitlow intrinsics for int16 types
2018-01-30 14:29:10 -08:00
Young Kim d5d3d8d49a
Fix Shader Model 6.2 tests (#1036)
Fixing a bunch of SM 6.2 Tests
- BinaryHalfOp tests reading input2 instead of input1
- Fixed converting signed zero from float to float16
- Fixed compiler options for float16 min,max test
- Fixed expected results for following float16 operations
- cos(0), sin(314), sin(-314)
- frc(-7.39)
- rsqrt(65504)
- int16 subtraction
- int16 unsigned multiplication
- sqrt, rsqrt, round_pi, round_ni, fmad treat denorm as it is
2018-01-30 14:28:49 -08:00
Lei Zhang fa1e7cddd0
[spirv] Add SubpassInput(MS) and vk::input_attachment_index (#1000)
Two new Vulkan specific intrinsic resource types, SubpassInput and
SubpassInputMS, are introduced to provide a way to use subpass inputs
in Vulkan. Their signatures:

template<typename T>
class SubpassInput {
  T SubpassLoad();
};

template<typename T>
class SubpassInputMS {
  T SubpassLoad(int sample);
};

T can be a scalar or vector type.

If compiled without ENABLE_SPIRV_CODEGEN, the compiler will report
unknown type name for SubpassInput(MS). If compiled with SPIR-V
CodeGen and trying to use SubpassInput(MS) in DXIL CodeGen, the
compiler will report an error saying the type is Vulkan-specific.

A new Vulkan-specific attribute, vk::input_attachment_index is
introduced to provide a way to set the input attachment index for
SubpassInput(MS) objects.
2018-01-20 17:16:39 -05:00
Jeff Noyle ad3e51b1dd
New pass for PIX "shader access tracking" (#998)
* py changes

* checkpoint

* wrong overloads for a couple ops

* Correct out-of-range checking

* test

* RTV

* Add shader access tracking and reportage of dynamically indexed registers

* Uniquify and encode proper register index!

* remove unncessary noise

* rename a var
2018-01-19 14:47:06 -08:00
Young Kim a43147de94
Add validation for Quad operations against non pixel shaders (#986) 2018-01-16 10:33:47 -08:00
Xiang Li b816c124f1
Support resource select for lib profile. (#940) 2017-12-20 10:47:29 -08:00
Young Kim 6c998fda25
- Add int16, uint16 execution tests (#920)
- Add enable-16-bit-types argument to half test shaders
2017-12-14 11:33:59 -08:00
Young Kim bf911b1d22
Add 16bit integers to Any IntrinsicCompTypes and for existing UInt3264 comp types. (#913) 2017-12-13 13:44:10 -08:00
Xiang Li 0790e03364
Remove stacksave and stackstore. (#914) 2017-12-12 18:50:01 -08:00
Young Kim ecf0307963
Half tests (#911)
- Adding half tests for unary,binary,tertiary math operations
- Add 'exec-future' option for hcttest
2017-12-12 15:12:19 -08:00
Young Kim fdadc6d718
Denorm float tests (#899)
-Execution tests for Shader Model 6.2 denorm mode
-'FAdd', 'FSub', 'FMul', 'FDiv', 'FMad' instructions are used for testings
-Code cleanup
2017-12-08 18:18:32 -08:00
Young Kim 09c7c17dac
Fix exec tests (#888)
- TAEF is unable to recognize negative values in hex representation in x64 released build. So use decimal values instead
- Add 'Shl', 'LShr', 'And', 'Or', 'Xor' execution tests
- Update Warp Version for test cases known to fail
2017-12-06 19:04:01 -08:00
Young Kim 4904266822
Code Cleanup for Execution Tests (#879)
- Cleaning up execution test
- Generating xml test file from the script and hctdb
- Fixing hctdb categories for unsigned int
- Adding more execution tests (Fadd, FSub, FMul, FDiv, Add, Sub, SDiv)
2017-12-05 15:17:50 -08:00
Lei Zhang bbddc280c9
[appveyor] Stop installing TAEF (#862)
Appveyor already has WDK for Windows 10, version 1709 installed:
https://www.appveyor.com/docs/build-environment/
2017-11-29 15:38:21 -05:00
Lei Zhang 8903528e88 Allow CMake 3.9.0 shipped with Visual Studio 2017 (#850) 2017-11-25 10:55:37 -08:00
Young Kim 77594e8624
Change rangeID parameter for CreateHandle to const (#833) 2017-11-20 20:04:54 -08:00
Young Kim 289d09e700
Bitcast for 16bit types (#817)
This change adds bitcast intrinsics for 16bit types (asfloat16, asint, asuint)
2017-11-16 11:38:56 -08:00
Young Kim 3cad152a90
Template argument for byteaddressbuffer load store (#804)
This change removes new Load variations (LoadHalf, LoadFloat, etc) for RWByteAddressBuffer/ByteAddressBuffer methods and add templated Load intrinsics. This templated Load only works on scalar or vector types, and its variations (Load2, Load3, Load4, etc) do not work with templates and work as it did before (only storing uints). For Store operation, you can store any scalar or vector types of up to 16 bytes, while prior to 2018 Store only supported storing uint scalar.
2017-11-15 18:47:12 -08:00
Young Kim a48d81fcac
New scalar types (#792)
This change is to add fixed width scalar types in HLSL 2018.
These types are: int16_t, uint16_t, int32_t, uint32_t, float16_t, float32_t, and float64_t.
Prior HLSL versions do not support these fixed width types.

This change also renames /no-min-precision command line option to /enable-16bit-types. int16_t and uint16_t are only allowed with this mode.
2017-11-13 15:03:19 -08:00
Young Kim 44db464c32
Native Int16 and Uint16 types (#783)
This change is to introduce native precision types for shader model 6.2. With native half (float16) types, we will introduce native int16/uint16 types with same command line option. This means that one option will disable all min precision types. For now, int16/uint16 types will be exposed on HLSL level as int16_t and uint16_t.

This change also includes some constant buffer fixes for 16 bit types, as well as int64 types.
2017-11-09 10:03:27 -08:00
Young Kim 2c140f795c
RawBufferLoad and new methods for ByteAddressBuffer (#762)
This change is an extension of float16 support. We are adding LoadHalf, LoadFloat, and LoadDouble method to byte address buffer so that users can access data from byte address buffer by these types. Also starting shader model 6.2, we are mapping byte address buffer and structure buffer load/store operations to RawBufferLoad/Store to differentiate raw buffer load from typed buffer load. Unlike BufferLoad for typed buffers, RawBufferLoad for min precision types will not have its min precision values as its return types, but their actual scalar size in buffer (i.e rawBufferLoad.i32 for min16int and rawBufferLoad.f32 for min16float). RawBufferLoad/Store contains additional parameters, where mask was required for correct status behavior for CheckAccessFullyMapped, and alignment is for relative alignment for future potential benefit for backend.
2017-11-07 18:15:19 -08:00
Young Kim 8c55bbbe6d
Denorm to function attribute (#764)
- Denorm mode to function attribute not function annotation
- Adding validation rule for fp32-denorm-mode



* Fix from comments
2017-11-06 18:09:14 -08:00
Xiang Li d8cefeb1ba
Make sure status only used by CheckAccessFullyMapped. (#763)
* Make sure status only used by CheckAccessFullyMapped.
2017-11-03 18:12:15 -07:00
Tex Riddell 1608deb16a Update hctstart for new SDK version: 16299 (#705) 2017-10-13 15:13:45 -07:00
Marcelo Lopez Ruiz 64f3b34995 Adds support for pipeline restart (#683)
* Adds support for pause/resume in pipeline.
* Adds 0.0 as the validator version to indicate no validation should occur.
* Moves module parsing from dxcompiler down to HLSL library.
* Adds support for optimizer to process a DXIL part.
* Adds a form with designer support for the interactive optimizer.
2017-10-11 14:04:24 -07:00
Xiang Li e26728ba5f Use float for tex coord instead of float_like. (#688)
* Use float for tex coord instead of float_like.

* Support min prec for GetDim.
2017-10-10 18:53:50 -07:00
Jeff Noyle b06a8153ff Shader debug instrumentation (#680)
See the comment in DxilDebugInstrumentation.cpp for a summary of how this-all works. Basically: instrument all instructions to output "trace" info to a UAV so that a debugger can reconstruct the execution of the shader and offer a debugger-like experience.
2017-10-09 15:30:29 -07:00
Tex Riddell f227c5f9d6 Target 6.0 in DXL.exe test to avoid failing validation with older dxil.dll (#650) 2017-09-26 09:44:38 -07:00
Jeff Noyle f169e6f238 PIX pixel-hit instrumentation: Re-emit type system, fix several issues with the UAV (#635)
* Add SV_Position index parameter, various minor tweaks to UAV setup

* Convert to raw buffer

* fix up unit tests, add a few names to variables

* CR feedback: check for pre-existing type; typo
2017-09-25 15:22:05 -07:00
Young Kim fb33d62978 Restrict no min precision option to shader model 6.2 (#615) 2017-09-12 16:05:08 -07:00
Young Kim 223a885613 Group Signature Elements by Element Width (#610)
This change is to enforce the new constraint on signature packing: pack signature elements by data width. Before we introduce fp16 type, every element was assumed to reserve 32 bits. Since we are introducing a new 16 bit data type, we need a new way to enforce signature rules.

After discussions we decided that it would be nice to pack elements based on data width. However, we are still enforcing the rule that each row contains up to 4 elements, regardless of the size. This way, depending on the hardware support drivers can optimize packing signatures, while on DXIL level we maintain the assumption that there are 4 elements per row. We are also still constraining on the total number of rows to be 32 for now. This can be changed in the future if people find this limit to be an issue.
2017-09-06 11:04:33 -07:00
Lei Zhang 13adee8411 [spirv] Support output disassembly in dxc (#603)
* [spirv] Support output disassembly in dxc

* Use normal pointers in DisassembleSpirv() and add tests

* keep script_dir under setlocal
2017-08-30 08:53:29 -07:00
Xiang Li 99af88f63b Update oprand name for BFI. 2017-08-18 15:12:49 -07:00
Xiang Li eb0894c913 Support static const field with initializer (#520)
* Support static const field of struct.
* Revert "Revert "Add nodup attribute for barrier.""

This reverts commit e435f63b02.
2017-08-04 13:40:31 -07:00
Xiang Li e435f63b02 Revert "Add nodup attribute for barrier."
This reverts commit 30b7f5cd4d.
2017-08-03 23:14:22 -07:00
Xiang Li 00351f3f94 Add nodup attribute for barrier. 2017-08-03 23:14:22 -07:00
Xiang Li 459b5998a4 Support same resource declared in different lib.
1. Add debug code in CompileFromBlob to help debug in release build.
2. Add dxl to help debug linker.
3. Check type match for resource when link.
2017-08-03 14:24:14 -07:00
Tex Riddell 705c3348e4 Add operand index enum and set methods to instruction helpers (#430)
* Add operand index enum and set methods to instruction helpers

* hctdb_instrhelp.py: Use namedtuple for llvm_type_map values.
2017-07-31 13:33:51 -07:00
Xiang Li 36ba7ac534 Add HLDeadFunctionEliminationPass. 2017-07-29 10:27:18 -07:00
Xiang Li 46e47f01e5 Refactoring DxilEmitMetadata pass. 2017-07-29 10:27:18 -07:00
Tex Riddell c9beb84c51 Fix ViewID state for flow control and consistent ViewID detection (#484)
* Fix ViewID state for flow control and consistent ViewID detection

1. Different ways of determining ViewID usage led to assert or crash.
Use DxilModule flag to guarantee consistency.  But this required
splitting DxilEmitMetadata pass into two passes, one that finalizes
the module and computes flags run before ComputeViewIdState, and one
that simply writes the metadata.

2. storeOutput in flow control with values not dependent on that flow,
such as literals, would not pick up control flow dependence.
Fix by picking up control flow dependence on storeOutput instructions,
not just the value being written.

* Fix control depenence computation

There was a bug in the implementation of the control dependence algorithm.
We were incorrectly iterating over all descendents in the postdom tree where
the algorithm should only iterate over immediate children.
2017-07-28 11:51:15 -07:00
Young Kim b0f5918d5b skip -denorm command line test when validator is present. (#482) 2017-07-27 19:52:38 -07:00
Marcelo Lopez Ruiz 60a67e6563 Fix unused var warning in release, better logging for command line tests. (#479) 2017-07-27 14:22:16 -07:00
Jeff Noyle d3f53b7f3e "Dr PIX": Force early Z (#467)
PIX has the ability to turn on early z and show you the performance difference with and without.
This pass implements the DXIL side of it.
2017-07-27 13:34:54 -07:00
Young Kim 55667043c3 Support denorm option (#446)
This change is to support preserve denorm operations. We do this by creating dxc options and propagate them all the way to dxil metadata so that drivers can see how it should handle floats.
Currently we support three modes: any(default), preserve, and ftz

Denorm option will be of per function flag. We store this information at function annotation metadata. This means that for DXIL 1.2 we have a new structure for function annotation. The change in structure is documented on DXIL.rst
2017-07-27 10:08:14 -07:00
Jeff Noyle 47226d0422 PIX: Pixel count/cost pass (#457)
The pass implements functionality for PIX for the "pixel cost", "depth complexity" and "overdraw" visualizers. You can probably infer what the pass does from the names "overdraw" and "depth complexity": For each pixel rendered it increments a corresponding counter in a UAV of a buffer that is the same size as the render target. The "pixel cost" pass does the same thing, only the increment is a weight value calculated from the total cost of the draw call, as derived from PIX's GPU-side profiling system.
2017-07-25 16:08:31 -07:00
Xiang Li 9db715523f Fix arg flatten issue caused by load before init. (#447)
* Fix arg flatten issue caused by load before init.
* Refine ShaderCompatSuite.
* Remove HLFunctions has body early.
2017-07-24 18:31:45 -07:00
Marcelo Lopez Ruiz bc55cacce2 improve help message in hcttest (#437) 2017-07-24 13:31:12 -07:00
Xiang Li edbf1b971c Support include and macro when lib share compile. (#441) 2017-07-19 15:55:43 -07:00