[vk] Added support for Stencil component type in texture handling

This commit is contained in:
CamilleLaVey
2025-11-27 20:34:14 -04:00
committed by Caio Oliveira
parent 459b26465e
commit 3117521da9
3 changed files with 21 additions and 4 deletions
@@ -204,8 +204,9 @@ Id TextureColorResultType(EmitContext& ctx, const TextureDefinition& def) {
case SamplerComponentType::Depth:
return ctx.F32[4];
case SamplerComponentType::Sint:
case SamplerComponentType::Stencil:
return ctx.S32[4];
case SamplerComponentType::Stencil:
return ctx.U32[4];
case SamplerComponentType::Uint:
return ctx.U32[4];
}
@@ -218,8 +219,9 @@ Id TextureSampleResultToFloat(EmitContext& ctx, const TextureDefinition& def, Id
case SamplerComponentType::Depth:
return color;
case SamplerComponentType::Sint:
case SamplerComponentType::Stencil:
return ctx.OpConvertSToF(ctx.F32[4], color);
case SamplerComponentType::Stencil:
return ctx.OpConvertUToF(ctx.F32[4], color);
case SamplerComponentType::Uint:
return ctx.OpConvertUToF(ctx.F32[4], color);
}