   SetPixelShaderConstantI (setting register values to ints) is not working [solved]
  Hi,I'm trying to send integer values to my pixel shader using a call like the following:int values[4] = { 1, 2, 3, 4 };pDXDevice->SetPixelShaderConstantI(4, values, 1);So I'm trying to set a vector4 of int values on register c4 (or starting at register c4). In my HLSL shader I have declared an int4 that corresponds to register c4.int4 testval : register(c4);When I debug a pixel with PIX for Windows, I check the value of "testval" (shows up as the register "c4") and it shows { 0.000, 0.000, 0.000, 0.000 }. Does anyone know why it doesn't receive the values I'm sending it (1,2,3,4) ? Maybe I'm not understanding what SetPixelShaderConstantI does... or how to call it... (but I do get an S_OK return value)... Any help is appreciated!Thanks[Edited by - gsamour on October 12, 2009 5:16:04 PM]
  Have you set dev->SetPixelShader() prior to the call?;  Yes, I'm calling SetPixelShader() before calling SetPixelShaderConstantI(). If I call SetPixelShaderConstantF() (the float4 version) it works... it's just the int4 version that doesn't work...   ;  c1 is a Constant Float Register.  To set a those registers you have to use SetPixelShaderConstantF.  SetPixelShaderConstantI will set Constant Integer Registers.   ;  I'm trying to find a list of gpu registers, but haven't been successful. If c1 is not an integer register, could you give me an example of an integer register?   ;Quote:Original post by gsamourI'm trying to find a list of gpu registers, but haven't been successful. If c1 is not an integer register, could you give me an example of an integer register?There's a list for each shader profile.  The links I gave you came from the list of ps_3_0 registers.;  Thanks for the information! I tried using the "i%" registers before but got an HLSL compile error:invalid register semantic 'i0', or variable must be bound to multiple register banks (c register binding required)I didn't understand what it was before, and thought that "i%" registers didn't exist (which is why I tried with the c's) but after searching for the error I found that apparently integer registers can only be used for looping and not for arithmetic operations.   