glsl: Fix bindings, add some CC ops

This commit is contained in:
ameerj 2021-05-27 22:28:33 -04:00
parent e6a0f0f384
commit c797a0c5a5
8 changed files with 92 additions and 58 deletions

View file

@ -32,14 +32,13 @@ void EmitImageSampleImplicitLod([[maybe_unused]] EmitContext& ctx, [[maybe_unuse
if (info.has_lod_clamp) {
throw NotImplementedException("Lod clamp samples");
}
if (!offset.IsEmpty()) {
throw NotImplementedException("Offset");
}
if (info.type != TextureType::Color2D) {
throw NotImplementedException("Texture type: {}", info.type.Value());
}
const auto texture{Texture(ctx, info, index)};
ctx.AddF32x4("{}=texture({},{});", inst, texture, coords);
if (!offset.IsEmpty()) {
ctx.AddF32x4("{}=textureOffset({},{},ivec2({}));", inst, texture, coords,
ctx.reg_alloc.Consume(offset));
} else {
ctx.AddF32x4("{}=texture({},{});", inst, texture, coords);
}
}
void EmitImageSampleExplicitLod([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,