[spv, vk] reworked texture view handling and added layer count overrides

This commit is contained in:
CamilleLaVey 2025-11-29 01:29:41 -04:00 committed by Caio Oliveira
parent 93f4cccb76
commit 7b78b2dd1f
No known key found for this signature in database
GPG key ID: AAAE6C7FD4186B0C
3 changed files with 99 additions and 26 deletions

View file

@ -221,7 +221,12 @@ Id TextureSampleResultToFloat(EmitContext& ctx, const TextureDefinition& def, Id
case SamplerComponentType::Sint:
return ctx.OpConvertSToF(ctx.F32[4], color);
case SamplerComponentType::Stencil:
return ctx.OpConvertUToF(ctx.F32[4], color);
{
const Id converted{ctx.OpConvertUToF(ctx.F32[4], color)};
const Id inv255{ctx.Const(1.0f / 255.0f)};
const Id scale{ctx.ConstantComposite(ctx.F32[4], inv255, inv255, inv255, inv255)};
return ctx.OpFMul(ctx.F32[4], converted, scale);
}
case SamplerComponentType::Uint:
return ctx.OpConvertUToF(ctx.F32[4], color);
}