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

1564 Коммитов

Автор SHA1 Сообщение Дата
Ehsan d0008e6a41
[linux-port] Add definition of strnicmp for Linux. (#1567)
Usage of strnicmp was recently added to the code base, and causes the
Linux builds to fail. This should fix it.
2018-09-25 17:24:59 -04:00
Vishal Sharma d36eb1731c
Fix lit function (#1565) 2018-09-25 12:20:49 -07:00
Vishal Sharma 953ba46999
Implement Fxc's mul-only code gen pattern for pow function (#1564) 2018-09-24 21:08:31 -07:00
Helena Kotas 7f6667cd88
Support obsolete semantics with -Gec flag (#1552)
* Support obsolete semantics with -Gec flag

Shaders with obsoleted semantics now compile with -Gec flag. Each
semantic will trigger a warning and be remapped to the current name.

The obsolete semantics & remappings introduced in this change are:

POSITION -> SV_Position (VS output)
VPOS     -> SV_Position (PS input)
COLOR    -> SV_Target   (PS output)
DEPTH    -> SV_Depth    (PS output)

* Switch to case insensitive compare; add tests

* Address code review feedback
2018-09-21 17:19:32 -07:00
Helena Kotas 582d26bc28
Support mul on vectors and scalars (#1561)
Fixes #1538
2018-09-21 16:25:06 -07:00
Xiang Li 419b4a8557
Fix warnings caused by not add traverse for HLSLBufferDecl/DiscardStmt/ExtMatrixElementExpr/HLSLVectorElementExpr. (#1562) 2018-09-21 15:19:38 -07:00
Tex Riddell 91152d0a25
Merge pull request #1556 from tex3d/lib-unused-pcfunc
Don't export unused patch constant functions or candidates.
2018-09-21 12:12:07 -07:00
Xiang Li 98e3d19d7c
Don't add nested loop for HLSL when loop has multiple back edge. (#1557) 2018-09-21 11:56:05 -07:00
Lei Zhang 0c2d69720c Revert "Fix various Clang compiler warnings (#1558)"
This reverts commit 958ec32c06.
2018-09-21 14:18:28 -04:00
Lei Zhang 958ec32c06
Fix various Clang compiler warnings (#1558) 2018-09-21 13:00:48 -04:00
Tex Riddell 6e9ba84de2 Don't export unused patch constant functions or candidates.
- also don't try to export unused patch constant functions when default
  is ExternalLinkage, when function is not compatible with linking.
2018-09-20 16:33:49 -07:00
Lei Zhang de2736fe9a
[spirv] Enable loop unrolling in legalization (#1553) 2018-09-20 10:18:15 -04:00
Tex Riddell 9e101a036d
Merge pull request #1547 from tex3d/dxr-master
Merge dxr-master to master
2018-09-19 11:55:53 -07:00
Tex Riddell da5c6ac202 Fix nested DxilSigPoint macros in way compatible with generated table 2018-09-18 23:49:31 -07:00
Tex Riddell 82337009a4 Revert "[linux-port] Fix nested macro expansion issue."
This reverts commit 8ea0608ed5.
2018-09-18 20:11:32 -07:00
Lei Zhang 1d850724c3
[spirv] Update external projects (#1546) 2018-09-18 15:47:41 -04:00
Ehsan Nasiri 2bfa749226 [linux-port] Address comments. Use uintXX_t instead of unsigned __intXX. 2018-09-18 12:06:55 -04:00
Ehsan Nasiri 21847b0656 [linux-port] Update the golden dxil files for linux smoke test. 2018-09-18 11:49:50 -04:00
Ehsan Nasiri 2642330b3a [linux-port] Disable (on Uinux) unit tests that rely on d3d12shader.h
Since we don't have d3d12shader.h on Linux/macOS, I am disabling the
unit tests that depend on it.

I am currently disabling entire files that depend on this header.
It is possible to have a more fine-grained change to only disable
specific tests within these files, although that would be a more intrusive
change and not necessary at the moment.
2018-09-18 10:45:19 -04:00
Ehsan Nasiri b86e5efe1b [linux-port] 'auto' not allowed in lambda parameter.
It is allowed starting C++14, but C++11 is assumed currently.
2018-09-18 10:44:36 -04:00
Ehsan Nasiri be1b8b36e4 [linux-port] define__int32 and __int64 for linux/macOS. 2018-09-18 10:44:36 -04:00
Ehsan Nasiri 8ea0608ed5 [linux-port] Fix nested macro expansion issue. 2018-09-18 10:44:35 -04:00
Ehsan Nasiri 55f42531a2 [linux-port] include file name is case-sensitive 2018-09-18 10:44:35 -04:00
Ehsan Nasiri 60c5972f78 [linux-port] use std::unique_ptr and llvm::make_unique. 2018-09-18 10:44:34 -04:00
Ehsan Nasiri 1d3ea98327 [linux-port] Use 'override' keyword instead of __override. 2018-09-18 10:44:34 -04:00
Ehsan f6bbfdf4d8
[spirv] Use uint rather than bool for stage IO vars (#1550) 2018-09-17 15:44:13 -04:00
Tex Riddell 38ccd9ad60 Merge remote-tracking branch 'origin/fix-dxc-batch' into dxr-master 2018-09-14 20:05:07 -07:00
Tex Riddell 1e8be037dc Update test to match new mangled function names.
- mangling changed in PR #1492 to fix collision between half and float
- also, name $Globals_buffer changed to $Globals_cbuffer
2018-09-14 19:49:49 -07:00
Tex Riddell 6436db6230 Merge remote-tracking branch 'ms/master' into dxr-master 2018-09-14 19:18:44 -07:00
Lei Zhang e4ab074143
[spirv] Fix ModuleBuilder initializer waring on Unix systems (#1545) 2018-09-14 09:47:04 -04:00
Ehsan ce1ad0b507
[spirv] Remove unused instructions. (#1543) 2018-09-13 16:28:41 -04:00
Helena Kotas 92a94dfc34 Propagate EnableBackCompatMode flag in DxcRewriter (#1542)
Fixes failing RewriterTests

The EnableBackCompatMode flag was not initialized when the compiler
was used via DxcRewriter.

The flag is new and has been introduced shortly after the DxcRewriter
change PR. The tests failures were caused by unfortunate merge timing
of the two changes.
2018-09-13 15:02:55 -04:00
Tex Riddell 89697bbad5 Merge branch 'master' into dxr-master
# Conflicts:
#	include/dxc/HLSL/DxilUtil.h
#	lib/DxcSupport/HLSLOptions.cpp
#	lib/HLSL/DxilUtil.cpp
#	tools/clang/lib/CodeGen/CGHLSLMS.cpp
#	tools/clang/unittests/HLSL/DxilContainerTest.cpp
2018-09-12 22:28:35 -07:00
Lei Zhang 8425998506
Fix declaration of IDxcRewriter2 cross-platform uuidof (#1541) 2018-09-12 17:01:20 -04:00
Lei Zhang df1ee0c331
[spirv] Fix DX layout struct base alignment (#1523)
For cbuffer/tbuffer, struct type's base alignment should be
rounded up to 16.
2018-09-12 10:24:22 -04:00
Helena Kotas 4afbc6897d
IDxcRewriter2 interface; change RewriterTest to report errors (#1529)
* IDxcRewriter2 interface; change RewriterTest to report errors

Added IDxcRewriter2 interface with method RewriteWithOptions that allows
setting compiler flags for the rewrite. The current IDxcRewrite methods
use HLSL Version 2015 only. RewriteWithOptions allows changing that
and other compiler options.

Modified RewriterTest to report compilation errors. Changed data of existing
tests that started failing because of this change.

Fixed DeadLoopFail test.
2018-09-11 12:31:52 -07:00
Lei Zhang d0fcff32fd
[spirv] Fix doc about half translation (#1539) 2018-09-11 14:49:20 -04:00
Vishal Sharma f51a284a7a
Exclude certain globals when enable write in /Gec mode (#1535) 2018-09-10 16:06:55 -07:00
Vishal Sharma afff6a3c51
Enable write to global vars with /Gec flag and HLSLVersion <= 2016 (#1526) 2018-09-07 19:51:39 -07:00
Ehsan a2085d4491
[linux-port] Do not use llvm DynamicLibrary in dxcapi.use.h (#1527)
Fixes #1525

This CL changes dxcapi.use.h back to what it was before the Linux-port work. It does, however, add a snippet into it to redirect FreeLibrary to dlcose, LoadLibraryW to dlopen, and GetProcAddress to dlsym for non-Windows platforms.
2018-09-06 10:20:10 -04:00
Lei Zhang 1152cdeddd
[spirv] Stop emitting commit count (#1524)
The commit hash should suffice to pinpoint in Git history.
2018-09-05 10:15:11 -04:00
Helena Kotas f45c576627
Implement Length property on constant arrays (FXC regression) (#1517)
Implement Length property on constant arrays (FXC regression)

The FXC compiler supports Length property on arrays. This change adds it
to the DXC compiler for backwards compatibility. However, it is marked
obsolete and in HLSL Version 2016 will report a warning. On higher versions
it will result in an error to prompt the developer to either change the code 
or to use the -HV flag for backwards compatibility.

Fix HLSLVersion not initialized by default

Adds RewriterTest::RunArrayLength tests which is currently disabled until we have 
a way to set HLSLVersion on RewriterTests.
2018-08-31 18:15:17 -07:00
Lei Zhang 14bcc3f6a7
[spirv] Add option to ignore emulated feature warnings (#1522)
Some HLSL features does not have direct mapping to SPIR-V, instead
we emulate them using lots of SPIR-V instructions. Because they
can cause performance hit, the compiler warns by default. This
commit add an option, -Wno-vk-emulated-features, to let developers
turn off such warnings.
2018-08-30 16:54:34 -04:00
Ehsan a2bb5d400e
[spirv] Cleanup of cl option handling for SPIRV. (#1521) 2018-08-30 13:58:19 -04:00
Vishal Sharma f534450689
Fix crash issue with Matrix index expressions (#1519) 2018-08-29 10:43:36 -07:00
Lei Zhang 81b3451b4a
[spirv] Add mechanism for fine-grained control of debug info (#1518)
Added a new command-line option: -fspv-debug=<category>, where
category can be file, source, line, and tool, to give developers
fine-grained control of what debug information they want in
the generated SPIR-V code.
2018-08-29 11:11:30 -04:00
Xiang Li 300c128cc7
Disable LICM in frontend for not consider register pressure. (#1511)
* Disable LICM in the pipeline.
2018-08-28 10:02:54 -07:00
Ehsan 339bf4fffc
[spirv] Add cl options into the emitted SPIRV. (#1515) 2018-08-28 10:53:53 -04:00
Lei Zhang 4d6e2cfc64
[spirv] Fix array index out of bound in doc (#1516) 2018-08-27 19:40:11 -04:00
Lei Zhang d1531ece22 [spirv] Emit Git commit info when debug information requested
If targeting Vulkan 1.1 & requesting debug information with -Zi,
two new OpModuleProcessed instruction will be emitted to contain
"dxc-commit-hash" & "dxc-commit-count".
2018-08-27 15:11:25 -04:00