Jump to content

  • Log In with Google      Sign In   
  • Create Account


limit on the how many bytes that can be passed across shaders


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 lomateron   Members   -  Reputation: 300

Like
0Likes
Like

Posted 27 April 2014 - 02:10 AM

In a structure that receives the pixel shader from the vertex shader

what are the limits to the amount of bytes that can be passed?

Any links to a place that describes this?

 

I am asking this because I had this structure

 

struct PS_PAIReduc
{
    float4 Pos : SV_POSITION;
uint MVP[4][3][3] : MASKVALUEPOINTS;
uint Loct : LOCATION;
};
 
But "MVP" could not be created by the compiler so I transformed it to this:
 
struct PS_PAIReduc
{
    float4 Pos : SV_POSITION;
uint3 MVPa[4] : MASKVALUEPOINTSA;
uint3 MVPb[4] : MASKVALUEPOINTSB;
uint3 MVPc[4] : MASKVALUEPOINTSC;
uint Loct : LOCATION;
};
 
but now the compiler is throwing me this error:
 
Error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Mask <and if pixel shader,also interpolation mode> on all input registers in an index range must be identical. Input registers [4] does not match with others in the index range from 1 to 4.
 
I don't understand this,can someone explain me this error?
 

Edited by lomateron, 27 April 2014 - 02:26 AM.


Sponsor:

#2 ankhd   Members   -  Reputation: 1094

Like
0Likes
Like

Posted 27 April 2014 - 07:55 AM

loct needs to be a float 4 too or how it is and padded may be???



#3 Gavin Williams   Members   -  Reputation: 642

Like
1Likes
Like

Posted 27 April 2014 - 09:12 PM

Have a look here for the limits:

 

http://msdn.microsoft.com/en-us/library/windows/desktop/ff819065%28v=vs.85%29.aspx

 

So, the register limit looks to be 32 for shader inputs/outputs. You are creating 4x3x3+2 = 38 registers. So even with your a 'fix' for the alignment / padding, you will still be breaching the register limit. You will need another solution.

 

Edit: I agree with spazzarama below. I took a second look at it.


Edited by Gavin Williams, 29 April 2014 - 03:42 AM.


#4 spazzarama   Members   -  Reputation: 556

Like
1Likes
Like

Posted 28 April 2014 - 11:29 PM

The D3D11 p_s_50 shader model supports up to 32 registers (four 32-bit components each). I don't think you are going over the limit (in your second example), I think instead the compiler doesn't know what interpolation mode to use for the uint3[4].

 

From http://msdn.microsoft.com/en-us/library/windows/desktop/bb509668(v=vs.85).aspx

 

1. When using an int/uint type, the only valid option is nointerpolation.

 

I can't test anything at the moment, but perhaps prefixing the uints with nointerpolation will help?


Edited by spazzarama, 28 April 2014 - 11:51 PM.

Justin Stenning | Blog | Book - Direct3D Rendering Cookbook (using C# and SharpDX)

Projects: Direct3D Hook, EasyHookAfterglow, C#raft

@spazzarama

 

#5 spazzarama   Members   -  Reputation: 556

Like
0Likes
Like

Posted 28 April 2014 - 11:35 PM

Also, perhaps use MASKVALUEPOINTS0 for the first, and then MASKVALUEPOINTS4 for the second and MASKVALUEPOINTS8 on the third. I seem to remember hitting a similar problem once when passing an array of items to a hull or domain shader.

struct PS_PAIReduc{
    float4 Pos : SV_POSITION;
uint3 MVPa[4] : MASKVALUEPOINTS0;
uint3 MVPb[4] : MASKVALUEPOINTS4;
uint3 MVPc[4] : MASKVALUEPOINTS8;
uint Loct : LOCATION;
};

Edited by spazzarama, 28 April 2014 - 11:35 PM.

Justin Stenning | Blog | Book - Direct3D Rendering Cookbook (using C# and SharpDX)

Projects: Direct3D Hook, EasyHookAfterglow, C#raft

@spazzarama

 




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS