[spirv] None (0x0) is an invalid Image Operand. (#1311)

This commit is contained in:
Ehsan 2018-05-28 11:56:36 -04:00 коммит произвёл GitHub
Родитель 7ad425a495
Коммит f28b030c74
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -188,7 +188,8 @@ InstBuilder &InstBuilder::opImageSample(
TheInst.emplace_back(coordinate);
if (dref)
TheInst.emplace_back(dref);
if (image_operands.hasValue()) {
if (image_operands.hasValue() &&
image_operands.getValue() != spv::ImageOperandsMask::MaskNone) {
const auto &val = image_operands.getValue();
encodeImageOperands(val);
}

Просмотреть файл

@ -98,7 +98,7 @@ float4 main(int2 offset: A) : SV_Target {
// Make sure OpImageSparseSampleImplicitLod returns a struct, in which the second member is a vec4.
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// CHECK: [[v4result:%\d+]] = OpImageSampleImplicitLod %v4float {{%\d+}} %float_0_5 None
// CHECK: [[v4result:%\d+]] = OpImageSampleImplicitLod %v4float {{%\d+}} %float_0_5
// CHECK: {{%\d+}} = OpCompositeExtract %float [[v4result]] 0
float val9 = t5.Sample(gSampler, 0.5);