Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVImageOps.td
Show All 36 Lines | let description = [{ | ||||
Sampled Image. | Sampled Image. | ||||
Dref is the depth-comparison reference value. It must be a 32-bit | Dref is the depth-comparison reference value. It must be a 32-bit | ||||
floating-point type scalar. | floating-point type scalar. | ||||
Image Operands encodes what operands follow, as per Image Operands. | Image Operands encodes what operands follow, as per Image Operands. | ||||
<!-- End of AutoGen section --> | <!-- End of AutoGen section --> | ||||
``` | |||||
image-operands ::= `"None"` | `"Bias"` | `"Lod"` | `"Grad"` | |||||
| `"ConstOffset"` | `"Offser"` | `"ConstOffsets"` | |||||
| `"Sample"` | `"MinLod"` | `"MakeTexelAvailable"` | |||||
| `"MakeTexelVisible"` | `"NonPrivateTexel"` | |||||
| `"VolatileTexel"` | `"SignExtend"` | `"ZeroExtend"` | |||||
#### Example: | #### Example: | ||||
``` | |||||
```mlir | ```mlir | ||||
%0 = spv.ImageDrefGather %1 : !spv.sampled_image<!spv.image<i32, Dim2D, NoDepth, NonArrayed, SingleSampled, NoSampler, Unknown>>, %2 : vector<4xf32>, %3 : f32 -> vector<4xi32> | %0 = spv.ImageDrefGather %1 : !spv.sampled_image<!spv.image<i32, Dim2D, NoDepth, NonArrayed, SingleSampled, NoSampler, Unknown>>, %2 : vector<4xf32>, %3 : f32 -> vector<4xi32> | ||||
%0 = spv.ImageDrefGather %1 : !spv.sampled_image<!spv.image<i32, Dim2D, NoDepth, NonArrayed, SingleSampled, NoSampler, Unknown>>, %2 : vector<4xf32>, %3 : f32 ["Bias|Lod"] %4, %5 : f32, f32 -> vector<4xi32> | |||||
``` | ``` | ||||
}]; | }]; | ||||
let availability = [ | let availability = [ | ||||
MinVersion<SPV_V_1_0>, | MinVersion<SPV_V_1_0>, | ||||
MaxVersion<SPV_V_1_5>, | MaxVersion<SPV_V_1_5>, | ||||
Extension<[]>, | Extension<[]>, | ||||
Capability<[SPV_C_Shader]> | Capability<[SPV_C_Shader]> | ||||
]; | ]; | ||||
let arguments = (ins | let arguments = (ins | ||||
SPV_AnySampledImage:$sampledimage, | SPV_AnySampledImage:$sampledimage, | ||||
SPV_ScalarOrVectorOf<SPV_Float>:$coordinate, | SPV_ScalarOrVectorOf<SPV_Float>:$coordinate, | ||||
SPV_Float:$dref | SPV_Float:$dref, | ||||
OptionalAttr<SPV_ImageOperandAttr>:$imageoperands, | |||||
Variadic<SPV_Type>:$operand_arguments | |||||
antiagainst: Nit: `values` is too generic. What about calling it `operand_arguments`? | |||||
); | ); | ||||
let results = (outs | let results = (outs | ||||
SPV_Vector:$result | SPV_Vector:$result | ||||
); | ); | ||||
let assemblyFormat = "attr-dict $sampledimage `:` type($sampledimage) `,` $coordinate `:` type($coordinate) `,` $dref `:` type($dref) `->` type($result)"; | let assemblyFormat = [{$sampledimage `:` type($sampledimage) `,` | ||||
$coordinate `:` type($coordinate) `,` $dref `:` type($dref) | |||||
custom<ImageOperands>($imageoperands) | |||||
( `(` $operand_arguments^ `:` type($operand_arguments) `)`)? | |||||
attr-dict | |||||
`->` type($result)}]; | |||||
let verifier = [{ return ::verify(*this); }]; | let verifier = [{ return ::verify(*this); }]; | ||||
} | } | ||||
// ----- | // ----- | ||||
def SPV_ImageQuerySizeOp : SPV_Op<"ImageQuerySize", [NoSideEffect]> { | def SPV_ImageQuerySizeOp : SPV_Op<"ImageQuerySize", [NoSideEffect]> { | ||||
let summary = "Query the dimensions of Image, with no level of detail."; | let summary = "Query the dimensions of Image, with no level of detail."; | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |
Nit: values is too generic. What about calling it operand_arguments?