Implement textureGather, textureGatherCompare

All writers implemented, along with resolving and validation.

TODO: SPIR-V Reader.

Bug: tint:1330
Change-Id: I8ba2f6023749474f80efb8a5422ac187e6c73a69
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/71820
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-12-08 19:54:08 +00:00
committed by Tint LUCI CQ
parent 2f7730a16e
commit 3703522d41
235 changed files with 13068 additions and 3580 deletions

View File

@@ -50,6 +50,8 @@ bool IsFloatClassificationIntrinsic(IntrinsicType i) {
bool IsTextureIntrinsic(IntrinsicType i) {
return IsImageQueryIntrinsic(i) || i == IntrinsicType::kTextureLoad ||
i == IntrinsicType::kTextureGather ||
i == IntrinsicType::kTextureGatherCompare ||
i == IntrinsicType::kTextureSample ||
i == IntrinsicType::kTextureSampleLevel ||
i == IntrinsicType::kTextureSampleBias ||

View File

@@ -261,6 +261,12 @@ IntrinsicType ParseIntrinsicType(const std::string& name) {
if (name == "textureDimensions") {
return IntrinsicType::kTextureDimensions;
}
if (name == "textureGather") {
return IntrinsicType::kTextureGather;
}
if (name == "textureGatherCompare") {
return IntrinsicType::kTextureGatherCompare;
}
if (name == "textureNumLayers") {
return IntrinsicType::kTextureNumLayers;
}
@@ -488,6 +494,10 @@ const char* str(IntrinsicType i) {
return "workgroupBarrier";
case IntrinsicType::kTextureDimensions:
return "textureDimensions";
case IntrinsicType::kTextureGather:
return "textureGather";
case IntrinsicType::kTextureGatherCompare:
return "textureGatherCompare";
case IntrinsicType::kTextureNumLayers:
return "textureNumLayers";
case IntrinsicType::kTextureNumLevels:

View File

@@ -111,6 +111,8 @@ enum class IntrinsicType {
kUnpack4x8unorm,
kWorkgroupBarrier,
kTextureDimensions,
kTextureGather,
kTextureGatherCompare,
kTextureNumLayers,
kTextureNumLevels,
kTextureNumSamples,

View File

@@ -35,6 +35,8 @@ const char* str(ParameterUsage usage) {
return "array_index";
case ParameterUsage::kBias:
return "bias";
case ParameterUsage::kComponent:
return "component";
case ParameterUsage::kCoords:
return "coords";
case ParameterUsage::kDdx:

View File

@@ -34,6 +34,7 @@ enum class ParameterUsage {
kNone = -1,
kArrayIndex,
kBias,
kComponent,
kCoords,
kDdx,
kDdy,