0

error X8000: Validation Error: Declared output vertex count (348) multiplied by the total number of declared scalar components of output data (4) equals 1392. This value cannot be greater than 1024.

The above error is given while I code my 3D cylinder in HLSL file in DirectX

  • Would you please add the code of the shader? https://stackoverflow.com/help/minimal-reproducible-example – kefren Jul 21 '20 at 16:29
  • `#define SEGMENTS 10 cbuffer MatrixBuffer { matrix worldMatrix; matrix viewMatrix; matrix projectionMatrix; }; struct GeometryInputType { float4 position : POSITION; float2 tex:TEXCOORD0; float3 normal:NORMAL; }; struct PixelInputType { float4 position : SV_POSITION; float2 tex:TEXCOORD0; float3 normal:NORMAL; }; struct coords { float x,y,z; }; [maxvertexcount(6 * SEGMENTS+(2*(3* (SEGMENTS-2))))]` – Danish Mohammad Jul 30 '20 at 06:59

1 Answers1

1

This is one of the known limits for Geometry Shaders per the Direct3D specification. Section 13.3 Geometry Shader Output:

The Geometry Shader must declare the maximum number of vertices an invocation of the Shader will output. The total amount of data that a Geometry Shader invocation can produce is 1024 32-bit values. The calculation of the Stream Output record with one or more streams is as follows: Given that each stream declares its outputs in its own clean slate view of the full output register set, the total output record size is the number of scalars in the union of all the stream declarations. This size multiplied by the max output vertex count must not exceed 1024. When Geometry Shader instancing is used, the Stream Output record size restriction applies to each instance individually

There are a number of such constants declared in the d3d11.h header:

#define D3D11_GS_INPUT_REGISTER_COUNT   ( 32 )

#define D3D11_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT    ( 1024 )

These apply to Feature Level 11.0 Direct3D hardware. The limits for Direct3D hardware feature level 10.0 are in the d3d10.h header. Primarily #define D3D10_GS_INPUT_REGISTER_COUNT ( 16 ) vs. #define D3D11_GS_OUTPUT_REGISTER_COUNT ( 32 ).

The overall limit is still 1024 32-bit values per invocation: D3D10_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT ( 1024 ).

Chuck Walbourn
  • 38,259
  • 2
  • 58
  • 81