HLSL: add standard sample position return form of GetSamplePosition method

Multisample textures support a GetSamplePosition() method intended to query
positions given a sample index.  This cannot be truly implemented in SPIR-V,
but #753 requested returning standard positions for the 1..16 cases, which
this PR adds.  Anything besides that returns (0,0).  If the standard positions
are not used, this will be wrong.

This should be revisited when there is a real query available.
This commit is contained in:
steve-lunarg
2017-04-26 08:31:56 -06:00
parent a1cdd13b1c
commit d4d0b29752
4 changed files with 935 additions and 36 deletions

View File

@@ -273,6 +273,9 @@ protected:
// Test method names
bool isStructBufferMethod(const TString& name) const;
// Return standard sample position array
TIntermConstantUnion* getSamplePosArray(int count);
TType* getStructBufferContentType(const TType& type) const;
bool isStructBufferType(const TType& type) const { return getStructBufferContentType(type) != nullptr; }
TIntermTyped* indexStructBufferContent(const TSourceLoc& loc, TIntermTyped* buffer) const;