Skip to content

Commit

Permalink
Properly fix the R_UInt32 texture type unit test for Vulkan and Metal
Browse files Browse the repository at this point in the history
Reviewed By: pixelperfect3, rokuz

Differential Revision: D68960942

fbshipit-source-id: dd9637f9044df49b5f9ff00a68dd75852b44f618
  • Loading branch information
Yijie Wang (FRLR) authored and facebook-github-bot committed Jan 31, 2025
1 parent 9bf9c55 commit aacd7c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/igl/metal/DeviceFeatureSet.mm
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static size_t getGPUFamily(id<MTLDevice> device) {
return sampled | storage | attachment | sampledAttachment |
(supports32BitFloatFiltering_ ? sampledFiltered : 0);
case TextureFormat::R_UInt32:
return sampled | storage | sampledAttachment;
return sampled | storage | attachment | sampledAttachment;

// 64 bpp
case TextureFormat::RGBA_F16:
Expand Down
1 change: 1 addition & 0 deletions src/igl/tests/data/ShaderData.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ const char MTL_SIMPLE_SHADER_USHORT[] = MTL_SIMPLE_SHADER_DEF(ushort, r);
const char MTL_SIMPLE_SHADER_USHORT2[] = MTL_SIMPLE_SHADER_DEF(ushort2, rg);
const char MTL_SIMPLE_SHADER_USHORT4[] = MTL_SIMPLE_SHADER_DEF(ushort4, rgba);
const char MTL_SIMPLE_SHADER_UINT4[] = MTL_SIMPLE_SHADER_DEF(uint4, rgba);
const char MTL_SIMPLE_SHADER_UINT[] = MTL_SIMPLE_SHADER_DEF(uint4, r);
const char MTL_SIMPLE_SHADER[] = MTL_SIMPLE_SHADER_DEF(float4, rgba);

// Simple Metal Shader for 1D Texture
Expand Down
4 changes: 4 additions & 0 deletions src/igl/tests/util/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ void createSimpleShaderStages(const std::shared_ptr<IDevice>& dev,
shader = igl::tests::data::shader::MTL_SIMPLE_SHADER_USHORT4;
} else if (outputFormat == TextureFormat::RGBA_UInt32) {
shader = igl::tests::data::shader::MTL_SIMPLE_SHADER_UINT4;
} else if (outputFormat == TextureFormat::R_UInt32) {
shader = igl::tests::data::shader::MTL_SIMPLE_SHADER_UINT;
} else if (outputFormat != TextureFormat::Invalid) {
auto components = TextureFormatProperties::fromTextureFormat(outputFormat).componentsPerPixel;
switch (components) {
Expand Down Expand Up @@ -133,6 +135,8 @@ void createSimpleShaderStages(const std::shared_ptr<IDevice>& dev,
fragShader = igl::tests::data::shader::VULKAN_SIMPLE_FRAG_SHADER_UINT4;
} else if (outputFormat == TextureFormat::RGBA_UInt32) {
fragShader = igl::tests::data::shader::VULKAN_SIMPLE_FRAG_SHADER_UINT4;
} else if (outputFormat == TextureFormat::R_UInt32) {
fragShader = igl::tests::data::shader::VULKAN_SIMPLE_FRAG_SHADER_UINT;
} else if (outputFormat != TextureFormat::Invalid) {
auto components = TextureFormatProperties::fromTextureFormat(outputFormat).componentsPerPixel;
switch (components) {
Expand Down

0 comments on commit aacd7c8

Please sign in to comment.