writer/hlsl: Add some comments to pack_level_in_coords
This behavior was confusing in an earlier code review. Change-Id: I1a8551d890f98d40e25f02d69bff88cf0c2356ac Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56542 Auto-Submit: Ben Clayton <bclayton@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Ben Clayton <bclayton@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
51b9da45c8
commit
863e285013
|
@ -1663,7 +1663,12 @@ bool GeneratorImpl::EmitTextureCall(std::ostream& out,
|
|||
if (!EmitExpression(out, texture))
|
||||
return false;
|
||||
|
||||
// If pack_level_in_coords is true, then the mip level will be appended as the
|
||||
// last value of the coordinates argument. If the WGSL intrinsic overload does
|
||||
// not have a level parameter and pack_level_in_coords is true, then a zero
|
||||
// mip level will be inserted.
|
||||
bool pack_level_in_coords = false;
|
||||
|
||||
uint32_t hlsl_ret_width = 4u;
|
||||
|
||||
switch (intrinsic->Type()) {
|
||||
|
@ -1689,6 +1694,7 @@ bool GeneratorImpl::EmitTextureCall(std::ostream& out,
|
|||
break;
|
||||
case sem::IntrinsicType::kTextureLoad:
|
||||
out << ".Load(";
|
||||
// Multisampled textures do not support mip-levels.
|
||||
if (!texture_type->Is<sem::MultisampledTexture>()) {
|
||||
pack_level_in_coords = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue