writer/hlsl: Implement interpolate attributes

Bug: tint:746
Change-Id: I3133a756d1fe830c0baf45a1251acea9511d92b1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56246
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2021-06-28 23:04:43 +00:00
parent f8e0b7dbf1
commit 0dd41c62cf
5 changed files with 131 additions and 39 deletions

View File

@@ -1,10 +1,22 @@
SKIP: FAILED
../../src/writer/hlsl/generator_impl.cc:2862 internal compiler error: TINT_UNIMPLEMENTED interpolate decoration
********************************************************************
* The tint shader compiler has encountered an unexpected error. *
* *
* Please help us fix this issue by submitting a bug report at *
* crbug.com/tint with the source program that triggered the bug. *
********************************************************************
struct tint_symbol_1 {
float none : TEXCOORD0;
nointerpolation float flat : TEXCOORD1;
linear float perspective_center : TEXCOORD2;
linear centroid float perspective_centroid : TEXCOORD3;
linear sample float perspective_sample : TEXCOORD4;
noperspective float linear_center : TEXCOORD5;
noperspective centroid float linear_centroid : TEXCOORD6;
noperspective sample float linear_sample : TEXCOORD7;
};
void main(tint_symbol_1 tint_symbol) {
const float none = tint_symbol.none;
const float flat = tint_symbol.flat;
const float perspective_center = tint_symbol.perspective_center;
const float perspective_centroid = tint_symbol.perspective_centroid;
const float perspective_sample = tint_symbol.perspective_sample;
const float linear_center = tint_symbol.linear_center;
const float linear_centroid = tint_symbol.linear_centroid;
const float linear_sample = tint_symbol.linear_sample;
return;
}

View File

@@ -1,10 +1,25 @@
SKIP: FAILED
../../src/writer/hlsl/generator_impl.cc:2862 internal compiler error: TINT_UNIMPLEMENTED interpolate decoration
********************************************************************
* The tint shader compiler has encountered an unexpected error. *
* *
* Please help us fix this issue by submitting a bug report at *
* crbug.com/tint with the source program that triggered the bug. *
********************************************************************
struct In {
float none;
float flat;
float perspective_center;
float perspective_centroid;
float perspective_sample;
float linear_center;
float linear_centroid;
float linear_sample;
};
struct tint_symbol_2 {
float none : TEXCOORD0;
nointerpolation float flat : TEXCOORD1;
linear float perspective_center : TEXCOORD2;
linear centroid float perspective_centroid : TEXCOORD3;
linear sample float perspective_sample : TEXCOORD4;
noperspective float linear_center : TEXCOORD5;
noperspective centroid float linear_centroid : TEXCOORD6;
noperspective sample float linear_sample : TEXCOORD7;
};
void main(tint_symbol_2 tint_symbol_1) {
const In tint_symbol = {tint_symbol_1.none, tint_symbol_1.flat, tint_symbol_1.perspective_center, tint_symbol_1.perspective_centroid, tint_symbol_1.perspective_sample, tint_symbol_1.linear_center, tint_symbol_1.linear_centroid, tint_symbol_1.linear_sample};
return;
}

View File

@@ -1,10 +1,28 @@
SKIP: FAILED
../../src/writer/hlsl/generator_impl.cc:2862 internal compiler error: TINT_UNIMPLEMENTED interpolate decoration
********************************************************************
* The tint shader compiler has encountered an unexpected error. *
* *
* Please help us fix this issue by submitting a bug report at *
* crbug.com/tint with the source program that triggered the bug. *
********************************************************************
struct Out {
float4 pos;
float none;
float flat;
float perspective_center;
float perspective_centroid;
float perspective_sample;
float linear_center;
float linear_centroid;
float linear_sample;
};
struct tint_symbol {
float none : TEXCOORD0;
nointerpolation float flat : TEXCOORD1;
linear float perspective_center : TEXCOORD2;
linear centroid float perspective_centroid : TEXCOORD3;
linear sample float perspective_sample : TEXCOORD4;
noperspective float linear_center : TEXCOORD5;
noperspective centroid float linear_centroid : TEXCOORD6;
noperspective sample float linear_sample : TEXCOORD7;
float4 pos : SV_Position;
};
tint_symbol main() {
const Out tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
const tint_symbol tint_symbol_2 = {tint_symbol_1.none, tint_symbol_1.flat, tint_symbol_1.perspective_center, tint_symbol_1.perspective_centroid, tint_symbol_1.perspective_sample, tint_symbol_1.linear_center, tint_symbol_1.linear_centroid, tint_symbol_1.linear_sample, tint_symbol_1.pos};
return tint_symbol_2;
}