Skip to content

[SPIR-V] fatal error: generated SPIR-V is invalid: The Base <id> '35[%35]' in OpAccessChain instruction must be a pointer #3677

@EugeneGribovich

Description

@EugeneGribovich

Hello

Have an error when compiling into SPIR-V:

dxc.exe ps.hlsl -spirv -T ps_6_6 -E ps_main -fvk-use-dx-layout -fspv-target-env=vulkan1.1 -Fo ps.out

fatal error: generated SPIR-V is invalid: The Base '35[%35]' in OpAccessChain instruction must be a pointer.
%36 = OpAccessChain %_ptr_Function_type_2d_image %35 %int_0

note: please file a bug report on https://github.com/Microsoft/DirectXShaderCompiler/issues with source code if possible

Repro Code:

SamplerState SS_OVERLAY;

Texture2D<float4> g_albedo0;
Texture2D<float4> g_albedo1;
Texture2D<float4> g_albedo2;
Texture2D<float4> g_albedo3;


float4 ps_main() : SV_Target
{
  Texture2D<float4> amTextures[4] = { g_albedo0, g_albedo1, g_albedo2, g_albedo3 };

  float4 result = 0;
  [unroll] for (int layerId = 0; layerId < 4; ++layerId)
  {
    result +=  amTextures[layerId].Sample(SS_OVERLAY, float2(0.0, 0.0));
  }

  return result;
}

Thank you

Metadata

Metadata

Assignees

Labels

spirvWork related to SPIR-V

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions