Commit Graph

1771 Commits

Author SHA1 Message Date
John Kessenich
0d628c179d Merge pull request #565 from mre4ce/master
Disabled MSVC 2015 compile warnings.
2016-10-25 00:16:12 -06:00
steve-lunarg
4e3dd2087c WIP: avoid strtok 2016-10-21 14:51:43 -06:00
Jeremy Hayes
c8e60e28b7 WIP: apply unused variable
I happened upon numArgs while hunting for unused variables. I suspect
the intent was to apply it as shown in this patch. However, I am not a
compiler dude. Someone more appropriate should grok this change.
2016-10-21 14:48:46 -06:00
Johannes van Waveren
d1300753f7 update 2016-10-21 17:30:50 +09:00
Johannes van Waveren
2f4c832d47 Merge remote-tracking branch 'upstream/master' 2016-10-21 17:21:46 +09:00
Johannes van Waveren
8e1e717cae fixed MSVC 2015 compile warnings 2016-10-21 17:21:12 +09:00
John Kessenich
3fc1543794 Merge pull request #559 from steve-lunarg/samplecmp-fix
HLSL: fix defect in EOpMethodSampleCmp* texture decomposition
2016-10-20 19:22:57 -06:00
John Kessenich
04e2dc164e Merge pull request #558 from steve-lunarg/image-atomics
HLSL: phase 4 of RWTexture support: add image atomics
2016-10-20 19:09:55 -06:00
John Kessenich
921d315f3c Merge pull request #555 from steve-lunarg/promotion-fixes
HLSL: Fix unary and binary operator type conversion issues
2016-10-20 19:07:27 -06:00
John Kessenich
720e89b314 Merge pull request #556 from dneto0/guard-amd-enums
SPV: Add missing guard to code that uses AMD extensions
2016-10-20 19:04:30 -06:00
steve-lunarg
6b596682c9 HLSL: fix defect in EOpMethodSampleCmp* texture decomposition
HLSL holds the compare value in a separate intrinsic arg, but the AST wants
a vector including the cmp val, except in the 4-dim coord case, where it
doesn't fit and is in fact a separate AST parameter.  This is awkward but
necessary, given AST semantics.  In the process, a new vector is constructed
for the combined result, but this vector was not being given the correct
TType, so was causing some downstream troubles.

Now it is.  A similar defect existed in OpTextureBias, and has also been
fixed.
2016-10-20 14:50:12 -06:00
steve-lunarg
6cb1637f37 Move promote methods to TIntermediate class
A need arose to use capabilities from TIntermediate during
node promotion.  These methods have been moved from virtual
methods on the TIntermUnary and TIntermBinary nodes to methods
on TIntermediate, so it is easy for them construct new nodes
and so on.

This is done as a separate commit to verify that no test results
are changed as a result.
2016-10-19 12:57:22 -06:00
steve-lunarg
22322361d6 HLSL: phase 4 of rwtexture support: add image atomics
This PR will turn Interlocked* intrinsics using rwtexture or rwbuffer
object as the first parameter into the proper OpImageAtomic* operations.
2016-10-19 10:25:23 -06:00
David Neto
bb5c02fd23 Add missing guard to code that uses AMD extensions
Otherwise compilation fails when ENABLED_AMD_EXTENSIONS is off.
2016-10-19 10:17:25 -04:00
steve-lunarg
e5921f1309 HLSL: Fix unary and binary operator type conversion issues
This fixes defects as follows:

1. handleLvalue could be called on a non-L-value, and it shouldn't be.

2. HLSL allows unary negation on non-bool values.  TUnaryOperator::promote
   can now promote other types (e.g, int, float) to bool for this op.

3. HLSL allows binary logical operations (&&, ||) on arbitrary types, similar
   (2).

4. HLSL allows mod operation on arbitrary types, which will be promoted.
   E.g, int % float -> float % float.
2016-10-18 16:56:37 -06:00
John Kessenich
5d45eadedc HLSL: Turn on tests for groupshared. 2016-10-16 12:22:20 -06:00
John Kessenich
b50fd17acb HLSL: Support SV_Coverage and SV_DispatchThreadId; catch SV_GroupIndex. 2016-10-16 12:12:11 -06:00
John Kessenich
4a3467933e Build: Fix unsigned/signed warning. 2016-10-16 11:50:46 -06:00
John Kessenich
1fabc0f697 Merge pull request #548 from baldurk/vs2010-compile-fixes
VS2010 compile fixes
2016-10-15 23:09:31 -06:00
John Kessenich
bf8a6ef750 Merge pull request #551 from steve-lunarg/rwbuffers-fmt
HLSL: phase 3 of rwtexture support: add sub-vec4 capabilities
2016-10-15 23:03:38 -06:00
John Kessenich
c658497846 Merge pull request #539 from schwa423/linux_global_lock
Use pthread_mutex for global lock on Linux.
2016-10-15 22:53:46 -06:00
John Kessenich
1b6daa0401 Merge pull request #550 from amdrexu/bugfix
SPV: Add missing extension declarations for certain AMD extensions.
2016-10-15 22:49:53 -06:00
John Kessenich
062b239d10 Merge pull request #549 from steve-lunarg/multidim-array
HLSL: allow multi-dimensional arrays
2016-10-15 22:43:43 -06:00
Josh Gargus
425af5f6b0 Use a recursive mutex. 2016-10-15 15:19:59 -07:00
steve-lunarg
cce8d48bcc HLSL: phase 3c: add option to use Unknown storage format
This uses the Unknown storage format, instead of deducing the
format from the texture declaration type.
2016-10-14 18:50:37 -06:00
steve-lunarg
8b0227ced9 HLSL: phase 3b: Texture methods remember and return vector size.
Also makes a (correct) test change for global -> temp vars.
2016-10-14 18:44:32 -06:00
steve-lunarg
4f2da27aec HLSL: phase 3a: Add sub-vec4 rwtexture formats (qualifier.layoutFormat)
This PR sets the TQualifier layoutFormat according to the HLSL image type.
For instance:

  RWTexture1D <float2> g_tTex1df2;

becomes ElfRg32f.  Similar on Buffers, e.g, Buffer<float4> mybuffer;

The return type for image and buffer loads is now taken from the storage format.
Also, the qualifier for the return type is now (properly) a temp, not a global.
2016-10-14 18:44:32 -06:00
Rex Xu
17ff343bf4 SPV: Add missing extension declarations for certain AMD extensions. 2016-10-14 17:41:45 +08:00
John Kessenich
f042e407a9 Merge pull request #542 from steve-lunarg/rwbuffers
HLSL: phase 2: add operator[]
2016-10-13 12:49:56 -06:00
John Kessenich
e4ad1bb68a Merge pull request #538 from steve-lunarg/iomap-binding-range-err
Check for out-of-range bindings during IO mapping.
2016-10-13 12:44:16 -06:00
steve-lunarg
7b211a370b HLSL: allow multi-dimensional arrays
All the underpinnings are there; this just parses multiple array dimensions
and passes them through to the existing mechanisms.

Also, minor comment fixes, and add a new test for multi-dim arrays.
2016-10-13 12:32:04 -06:00
baldurk
486d9e44e0 Update HexFloat tests to use non-enum class enum values 2016-10-13 20:05:13 +02:00
baldurk
021dbb4cd4 Change negatable_left_shift and negatable_right_shift to inline funcs
* This avoids an internal compile error on VS2010 possibly related to
  std::enable_if use.
2016-10-13 19:39:24 +02:00
baldurk
cabba60abf Change {} constructor brackets to () 2016-10-13 19:32:37 +02:00
baldurk
7cac9e7245 Change "using x = y;" to "typedef y x;" statements 2016-10-13 19:31:15 +02:00
baldurk
a227d27227 Explicitly implement default constructors 2016-10-13 19:30:27 +02:00
baldurk
1a65fc269c Add std::isnan and std::isinf wrappers for VS2010 that doesn't have them 2016-10-13 19:28:54 +02:00
baldurk
033d3ef22c Change enum class to plain enum 2016-10-13 19:28:20 +02:00
baldurk
31d5d48812 Change constructor to use ()s instead of {}s 2016-10-13 19:25:52 +02:00
baldurk
ff160f15ef Add #include <cstdint> for std::uint32_t usage 2016-10-13 19:24:42 +02:00
baldurk
75c3bf68e9 Add strtoull wrapper for VS2010, pointing to MS implementation 2016-10-13 19:24:23 +02:00
baldurk
54a28de4a9 Give all complex lambdas an explicit return type 2016-10-13 19:23:39 +02:00
steve-lunarg
b3da8a9cb3 HLSL: phase 2e: introduce lower level addBinaryNode/UnaryNode fns
- hlsl.struct.frag variable changed to static, assignment replacd.

- Created new low level functions addBinaryNode and addUnaryNode.  These are
  used by higher level functions such as addAssignment, and do not do any
  argument promotion or conversion of any sort.

- Two functions above are now used in RWTexture lvalue conversions.  Also,
  other direction creations of unary or binary nodes now use them, e.g, addIndex.
  This cleans up some existing code.

- removed handling of EOpVectorTimesScalar from promote()

- removed comment from ParseHelper.cpp
2016-10-12 12:39:44 -06:00
steve-lunarg
07830e805b HLSL: phase 2d: minor cleanup, & allow operator[] on non-rw textures
Improve comments.
A few tweaked lines allow [] on non-rw tx.  Add test case for this.
Improve VectorTimesScalar handling.
2016-10-12 12:39:44 -06:00
steve-lunarg
0de16da2c0 HLSL: phase 2c: use lValueErrorCheck in HLSL FE
This commit splits lValueErrorCheck into machine dependent and independent
parts.  The GLSL form in TParseContext inherits from and invokes the
machine dependent part in TParseContextBase.  The base form checks language
independent things.  This split does not change the set of errors tested
for: the test results are identical.

The new base class interface is now used from the HLSL FE to test lvalues.
There was one test diff due to this, where the test was writing to a uniform.
It still does the same indirections, but does not attempt a uniform write.
2016-10-12 12:39:44 -06:00
steve-lunarg
90707966ea HLSL: phase 2b: add l-value operator[] for RWTexture/RWBuffer
This commit adds l-value support for RW texture and buffer objects.
Supported are:

- pre and post inc/decrement
- function out parameters
- op-assignments, such as *=, +-, etc.
- result values from op-assignments.  e.g, val=(MyRwTex[loc] *= 2);

Not supported are:
- Function inout parameters
- multiple post-inc/decrement operators.  E.g, MyRWTex[loc]++++;
2016-10-12 12:39:44 -06:00
steve-lunarg
6b43d274e7 HLSL: phase 2a: add r-value operator[] for RWTexture/RWBuffer
This commit adds r-value support for RW textures and buffers.
Supported is:

- Function in parameter conversions
- conversion of rvalue use to imageLoad
2016-10-12 12:39:44 -06:00
John Kessenich
e3aa654c4b Merge pull request #546 from yavn/OpImageQueryLod-with-SampledImage
SPV: Use SampledImage with OpImageQueryLod
2016-10-12 09:05:07 -06:00
Maciej Jesionowski
7208a974aa SPV: Use SampledImage with OpImageQueryLod
Khronos SPIR-V issue #74
2016-10-12 16:16:24 +02:00
John Kessenich
631f223b1b Merge pull request #543 from slime73/compilerwarnings
Address some compiler warnings.
2016-10-11 15:31:31 -06:00