<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Direct 3D 11</title><link>http://forums.xna.com/forums/76.aspx</link><description>Forum group for discussing DX 11.</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>I can't find the d3dx11 effect framework</title><link>http://forums.xna.com/forums/thread/225483.aspx</link><pubDate>Fri, 11 Sep 2009 22:21:09 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:225483</guid><dc:creator>pisiiki</dc:creator><slash:comments>24</slash:comments><comments>http://forums.xna.com/forums/thread/225483.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=225483</wfw:commentRss><description>I have just updated the sdk to aug09 but it seems that the d3dx11
effect framework is not included with this release (but referenced in
the help files). I am a bit confused, please clarity me what is going
on.&lt;br /&gt;
&lt;br /&gt;
Isaac.</description></item><item><title>IDXGIKeyedMutex is broken</title><link>http://forums.xna.com/forums/thread/246538.aspx</link><pubDate>Mon, 02 Nov 2009 16:25:50 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:246538</guid><dc:creator>tictac</dc:creator><slash:comments>2</slash:comments><comments>http://forums.xna.com/forums/thread/246538.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=246538</wfw:commentRss><description>I am using Direct3D11 / DXGI 1.1 (in feature level 10_0).&lt;br /&gt;
&lt;br /&gt;
I have to create a keyed mutex texture2D to use DirectWrite.&lt;br /&gt;
&lt;br /&gt;
I can do this, and OpenSharedResource and see the texture dimensions in Direct2D.  I can get the IDXGIKeyedMutex on both devices.&lt;br /&gt;
&lt;br /&gt;
However, to illustrate this problem I totally remove the D2D/DirectWrite code, and....&lt;br /&gt;
&lt;br /&gt;
AcquireSync() ReleaseSync() is ok until I do something with the immediate context in d3d11.  &lt;br /&gt;
&lt;br /&gt;
For example, Acquire, ClearRenderTarget, Release will result in this error upon Release...&lt;span style="font-family:consolas;font-size:10px;"&gt;
&lt;p&gt;First-chance exception at 0x75029617 in TestBed.exe: Microsoft C++ exception: _com_error at memory location 0x0a17eeb4..&lt;/p&gt;
&lt;/span&gt;Subsequent attempts to Acquire will result in -2005270527 .. which translates to nothing on Earth.&lt;br /&gt;
&lt;br /&gt;
Another example, OMSetOutputTargets (to totally different textures) before AcquireSync will trigger AcquireSync to return -2147024809.&lt;br /&gt;
&lt;br /&gt;
This is not per frame.  Once it breaks, it breaks.  There are no real signs of the texture working or clearing to any color, ever, while in this keyedMutex mode.  Otherwise its fine??&lt;br /&gt;
&lt;br /&gt;
I dont know what to think???&lt;br /&gt;
Dependency problem???&lt;br /&gt;
&lt;br /&gt;
Why is it being so difficult??&lt;br /&gt;</description></item><item><title>ID3DX11Mesh interface?</title><link>http://forums.xna.com/forums/thread/251307.aspx</link><pubDate>Sat, 14 Nov 2009 12:17:34 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:251307</guid><dc:creator>KawaRacer</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/251307.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=251307</wfw:commentRss><description>I&amp;#39;m unable to find a ID3DX11Mesh interface. Should we use the ID3DX10Mesh interface? Is it fully compatible with Direct3D 11 and xna math? Or do I have to write my own mesh class? thank you!</description></item><item><title>effect files tesselation features</title><link>http://forums.xna.com/forums/thread/250710.aspx</link><pubDate>Thu, 12 Nov 2009 18:52:56 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:250710</guid><dc:creator>albs477</dc:creator><slash:comments>7</slash:comments><comments>http://forums.xna.com/forums/thread/250710.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=250710</wfw:commentRss><description>I created an fx file to try and use the tesselation features as far as I know its correct and compiles but the graphics card locks up everytime I run this effect. I am using the effect framework, so I am not sure if its an issue in the framework or my effect. Anyone have any idea?&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;cbuffer Matrices&lt;br /&gt;
{&lt;br /&gt;
    matrix g_World;&lt;br /&gt;
 matrix g_View;&lt;br /&gt;
 matrix g_Projection;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;cbuffer Data&lt;br /&gt;
{&lt;br /&gt;
 float g_fFar = 0.0;&lt;br /&gt;
 float g_fNear = 0.0;&lt;br /&gt;
 float4 g_LightDirection = (float4)0;&lt;br /&gt;
 float4 g_CamPosition = (float4)0;&lt;br /&gt;
 float4 g_Ambient = float4(0.1,0.1,0.1,1);&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;sampler ColorSampler&lt;br /&gt;
{&lt;br /&gt;
 FILTER = ANISOTROPIC;&lt;br /&gt;
    MaxAnisotropy = 16;&lt;br /&gt;
    AddressU = Wrap;&lt;br /&gt;
    AddressV = Wrap;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;texture2D RingTexture : DIFFUSE;&lt;/p&gt;
&lt;p&gt;struct RingVertexInput&lt;br /&gt;
{&lt;br /&gt;
 float3 Position : SV_POSITION;&lt;br /&gt;
 float3 Normal   : NORMAL;&lt;br /&gt;
 float  UV       : TEXCOORD;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;struct RingVertexOutput&lt;br /&gt;
{&lt;br /&gt;
 float4 Position : WORLDPOS;&lt;br /&gt;
 float3 Normal   : NORMAL;&lt;br /&gt;
 float UV        : TEXCOORD;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;struct ControlPoint&lt;br /&gt;
{&lt;br /&gt;
 float4 Position : WORLDPOS;&lt;br /&gt;
 float3 Normal   : NORMAL;&lt;br /&gt;
 float UV        : TEXCOORD;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;struct RingPixelInput&lt;br /&gt;
{&lt;br /&gt;
 float4 Position   : SV_POSITION;&lt;br /&gt;
 float3 Normal     : NORMAL;&lt;br /&gt;
 float4 WorldPos   : WORLDPOS;&lt;br /&gt;
 //float4 ViewPos    : VIEWPOS;&lt;br /&gt;
 float  RingCoord : TEXCOORD;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;struct DSOutput&lt;br /&gt;
{&lt;br /&gt;
 float4 Position   : SV_POSITION;&lt;br /&gt;
 float3 Normal     : NORMAL;&lt;br /&gt;
 float4 WorldPos   : WORLDPOS;&lt;br /&gt;
 //float4 ViewPos    : VIEWPOS;&lt;br /&gt;
 float  RingCoord : TEXCOORD;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;struct RingPixelOutput&lt;br /&gt;
{&lt;br /&gt;
 float4 Color : SV_TARGET;&lt;br /&gt;
 //float  Depth : SV_DEPTH;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;struct ConstantOutput&lt;br /&gt;
{&lt;br /&gt;
    float Edges[3]        : SV_TessFactor;&lt;br /&gt;
    float Inside          : SV_InsideTessFactor;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;float4 PhongShadeColor(float3 PixelPosition,float3 LightDirection,float3 Normal,float3 Camera,float4 InitialColor)&lt;br /&gt;
{&lt;br /&gt;
 float3 ViewDirection = normalize(PixelPosition - Camera);&lt;br /&gt;
 float4 Diffuse = saturate(dot(Normal,LightDirection));&lt;br /&gt;
 float3 Reflect = normalize(2 * Diffuse.xyz * Normal - LightDirection);&lt;br /&gt;
 float4 Specular = saturate(pow(dot(Reflect,ViewDirection),8));&lt;br /&gt;
 return g_Ambient + InitialColor * saturate(Diffuse + Specular);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;RingVertexOutput VSRingRender(RingVertexInput Input)&lt;br /&gt;
{&lt;br /&gt;
 RingVertexOutput Out;&lt;br /&gt;
 Out.Position = float4(Input.Position,1);&lt;br /&gt;
    Out.Normal = Input.Normal;&lt;br /&gt;
 Out.UV = Input.UV;&lt;br /&gt;
 return Out;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;ConstantOutput ConstantsHS( &lt;br /&gt;
    InputPatch&amp;lt;RingVertexOutput, 3&amp;gt; ip,&lt;br /&gt;
    uint PatchID : SV_PrimitiveID )&lt;br /&gt;
{ &lt;br /&gt;
    ConstantOutput Output;&lt;/p&gt;
&lt;p&gt;    Output.Edges[0] = 2;&lt;br /&gt;
 Output.Edges[1] = 2;&lt;br /&gt;
 Output.Edges[2] = 2;&lt;br /&gt;
 Output.Inside = 2;&lt;br /&gt;
    &lt;br /&gt;
    return Output;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;[domain(&amp;quot;tri&amp;quot;)]&lt;br /&gt;
[partitioning(&amp;quot;integer&amp;quot;)]&lt;br /&gt;
[outputtopology(&amp;quot;triangle_cw&amp;quot;)]&lt;br /&gt;
[outputcontrolpoints(3)]&lt;br /&gt;
[patchconstantfunc(&amp;quot;ConstantsHS&amp;quot;)]&lt;/p&gt;
&lt;p&gt;ControlPoint HSRingRender(&lt;br /&gt;
    InputPatch&amp;lt;RingVertexOutput, 3&amp;gt; ip, &lt;br /&gt;
    uint i : SV_OutputControlPointID,&lt;br /&gt;
    uint PatchID : SV_PrimitiveID )&lt;br /&gt;
{&lt;br /&gt;
    ControlPoint Output;&lt;/p&gt;
&lt;p&gt;    Output.Position = ip[i].Position;&lt;br /&gt;
 Output.Normal = ip[i].Normal;&lt;br /&gt;
 Output.UV = ip[i].UV;&lt;/p&gt;
&lt;p&gt;    &lt;br /&gt;
    return Output;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;[domain(&amp;quot;tri&amp;quot;)]&lt;br /&gt;
DSOutput DSRingRender( ConstantOutput input, &lt;br /&gt;
                    float3 BarycentricCoordinates : SV_DomainLocation,&lt;br /&gt;
                    const OutputPatch&amp;lt;ControlPoint, 3&amp;gt; TrianglePatch )&lt;br /&gt;
{&lt;br /&gt;
    float3 WorldPos = BarycentricCoordinates.x * TrianglePatch[0].Position + BarycentricCoordinates.y * TrianglePatch[1].Position + BarycentricCoordinates.z * TrianglePatch[2].Position;&lt;br /&gt;
 &lt;br /&gt;
    DSOutput Output;&lt;br /&gt;
    Output.WorldPos = mul( float4(WorldPos,1), g_World );&lt;br /&gt;
 Output.Position = mul( Output.WorldPos, g_View );&lt;br /&gt;
 Output.Position = mul( Output.Position, g_Projection );&lt;br /&gt;
    Output.Normal = TrianglePatch[0].Normal;&lt;br /&gt;
    Output.RingCoord = length(WorldPos)/5;&lt;br /&gt;
    return Output;    &lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;[maxvertexcount(3)]&lt;/p&gt;
&lt;p&gt;void GSRingRender(triangle DSOutput Position[3] , inout TriangleStream&amp;lt;RingPixelInput&amp;gt; OutputStream)&lt;br /&gt;
{&lt;br /&gt;
    //todo add LOD&lt;br /&gt;
    //compute required LOD level&lt;br /&gt;
    //if LOD = required LOD level or Split = 0 add to stream&lt;br /&gt;
    RingPixelInput Output;&lt;br /&gt;
    for(int n = 0;n &amp;lt; 3;n++)&lt;br /&gt;
    {&lt;br /&gt;
  Output.Position = Position[n].Position;&lt;br /&gt;
  Output.Normal = Position[n].Normal;&lt;br /&gt;
  Output.WorldPos = Position[n].WorldPos;&lt;br /&gt;
  Output.RingCoord = Position[n].RingCoord;&lt;br /&gt;
  OutputStream.Append(Output);&lt;br /&gt;
 }&lt;br /&gt;
 OutputStream.RestartStrip();&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;RingPixelOutput PSRingRender(DSOutput Input)&lt;br /&gt;
{&lt;br /&gt;
 //Input.RingCoord.x = saturate(length(Input.RingCoord));&lt;br /&gt;
 //RingPixelOutput Out;&lt;br /&gt;
 //Out.Color = RingTexture.Sample(ColorSampler,Input.RingCoord);&lt;br /&gt;
 //float Alpha = Out.Color.a;&lt;br /&gt;
 //Out.Color = PhongShadeColor(Input.WorldPos,g_LightDirection,Input.Normal,g_CamPosition,Out.Color);&lt;br /&gt;
 //Out.Color.a = Alpha;&lt;br /&gt;
 //Out.Depth = ((Input.ViewPos.z - g_fNear)/(g_fFar - g_fNear)) * Input.Position.w;&lt;br /&gt;
 RingPixelOutput Out;&lt;br /&gt;
 Out.Color = float4(1,1,1,1);&lt;br /&gt;
 return Out;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;RasterizerState EnableCulling&lt;br /&gt;
{&lt;br /&gt;
 FillMode = WIREFRAME;&lt;br /&gt;
    CullMode = BACK;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;DepthStencilState DepthEnabling&lt;br /&gt;
{&lt;br /&gt;
 DepthEnable = TRUE;&lt;br /&gt;
    DepthWriteMask = ALL;&lt;br /&gt;
    DepthFunc = LESS_EQUAL;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;BlendState EnableBlend&lt;br /&gt;
{&lt;br /&gt;
 BlendEnable[0] = TRUE;&lt;br /&gt;
 SrcBlend[0] = 5;&lt;br /&gt;
 DestBlend[0] = 6;&lt;br /&gt;
 //BlendOp[0] = 1;&lt;br /&gt;
 //SrcBlendAlpha[0] = 5;&lt;br /&gt;
 //DestBlendAlpha[0] = 6;&lt;br /&gt;
 //BlendOpAlpha[0] = 1;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;technique11 PlanetRing&lt;br /&gt;
{&lt;br /&gt;
 pass Render&lt;br /&gt;
    {&lt;br /&gt;
  SetHullShader( CompileShader( hs_5_0 , HSRingRender() ) );&lt;br /&gt;
  SetDomainShader( CompileShader( ds_5_0 , DSRingRender() ) );&lt;br /&gt;
  SetVertexShader( CompileShader( vs_5_0, VSRingRender() ) );&lt;br /&gt;
        SetGeometryShader( CompileShader( gs_5_0, GSRingRender() ) );&lt;br /&gt;
        SetPixelShader( CompileShader( ps_5_0, PSRingRender() ) );&lt;br /&gt;
                &lt;br /&gt;
        SetRasterizerState(EnableCulling);       &lt;br /&gt;
  SetDepthStencilState(DepthEnabling, 0);&lt;br /&gt;
  SetBlendState(EnableBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF);&lt;br /&gt;
    }&lt;br /&gt;
} &lt;/p&gt;
&lt;p&gt;technique11 PlanetRingImposter&lt;br /&gt;
{&lt;br /&gt;
 pass Render&lt;br /&gt;
    {&lt;br /&gt;
  SetHullShader( CompileShader( hs_5_0 , HSRingRender() ) );&lt;br /&gt;
  SetDomainShader( CompileShader( ds_5_0 , DSRingRender() ) );&lt;br /&gt;
  SetVertexShader( CompileShader( vs_5_0, VSRingRender() ) );&lt;br /&gt;
       SetGeometryShader( CompileShader( gs_5_0, GSRingRender() ) );&lt;br /&gt;
        SetPixelShader( CompileShader( ps_5_0, PSRingRender() ) );&lt;br /&gt;
                &lt;br /&gt;
        SetRasterizerState(EnableCulling);       &lt;br /&gt;
  SetDepthStencilState(DepthEnabling, 0);&lt;br /&gt;
  SetBlendState(EnableBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF);&lt;br /&gt;
    }&lt;br /&gt;
}  &lt;/p&gt;</description></item><item><title>d3dcsx.h compilation error</title><link>http://forums.xna.com/forums/thread/249576.aspx</link><pubDate>Tue, 10 Nov 2009 02:39:16 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:249576</guid><dc:creator>swalloware</dc:creator><slash:comments>1</slash:comments><comments>http://forums.xna.com/forums/thread/249576.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=249576</wfw:commentRss><description>The keyword __range cannot be recognized.&lt;br /&gt;
&lt;br /&gt;
I used the VS 2005 compiler and Windows 7 system.&lt;br /&gt;
&lt;br /&gt;
How can I fix this problem?</description></item><item><title>DX11 problem on Vista</title><link>http://forums.xna.com/forums/thread/225263.aspx</link><pubDate>Fri, 11 Sep 2009 07:58:12 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:225263</guid><dc:creator>GraphicsNinja</dc:creator><slash:comments>16</slash:comments><comments>http://forums.xna.com/forums/thread/225263.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=225263</wfw:commentRss><description>I just got the fancy DX11 SDK for Vista, and installed the beta-platform update (without problems) -- however, DX11 ain&amp;#39;t working. Running any sample says that the components are missing, and I should check the knowledge base, which points me at the update, which is installed ... I tried the D3D11Installer sample, but it says DX11 not installed, and when it tries to do so, it fails.&lt;br /&gt;
&lt;br /&gt;
Anyone else experiencing this problem? That&amp;#39;s quite a show-stopper, as I used to have DX11 with the previous SDK (and yes, I uninstalled the March SDK before installing the August one).&lt;br /&gt;</description></item><item><title>effect files alpha blend states</title><link>http://forums.xna.com/forums/thread/244332.aspx</link><pubDate>Tue, 27 Oct 2009 20:20:16 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:244332</guid><dc:creator>albs477</dc:creator><slash:comments>9</slash:comments><comments>http://forums.xna.com/forums/thread/244332.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=244332</wfw:commentRss><description>Here is my shader code for setting alpha blending on. It is not working at all for some reason. It worked under fx_4_0 but doesn&amp;#39;t work under fx_5_0. &lt;br /&gt;
&lt;br /&gt;
BlendState EnableBlend&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;BlendEnable[0] = TRUE;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;SrcBlendAlpha = 5;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;DestBlendAlpha = 7;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
technique11 GUI&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pass Render&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetVertexShader( CompileShader( vs_4_0, VS() ) );&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetGeometryShader( NULL );&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetPixelShader( CompileShader( ps_4_0, PS() ) );&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SetRasterizerState(DisableCulling);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SetDepthStencilState(DepthEnabling, 0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SetBlendState(EnableBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;</description></item><item><title>How to clear a structured buffer?</title><link>http://forums.xna.com/forums/thread/243497.aspx</link><pubDate>Mon, 26 Oct 2009 05:43:43 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:243497</guid><dc:creator>BarnacleJunior</dc:creator><slash:comments>2</slash:comments><comments>http://forums.xna.com/forums/thread/243497.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=243497</wfw:commentRss><description>There is ClearUnorderedAccessView[Float|Uint] for clearing resources, but I don&amp;#39;t see a convenient way to clear structured buffers.&amp;nbsp; I have a struct with 8 floats (in the shader) and a StructureByteStride of 32.&amp;nbsp; I tried making a UAV with format R32G32B32A32_FLOAT that would span twice the number of elements, so I could Clear it, but D3D returned E_INVALIDARG.&lt;br /&gt;
&lt;br /&gt;
Must I write a Clear compute shader for every structured buffer type and run Dispatch on it?&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
.sean&lt;br /&gt;
&lt;br /&gt;</description></item><item><title>Append/Consume Types</title><link>http://forums.xna.com/forums/thread/219344.aspx</link><pubDate>Wed, 26 Aug 2009 22:56:26 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:219344</guid><dc:creator>Seth H</dc:creator><slash:comments>7</slash:comments><comments>http://forums.xna.com/forums/thread/219344.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=219344</wfw:commentRss><description>I think the new append/consume types for structured buffers and byte buffers are very cool.&amp;nbsp; However, I do have a question about something.&lt;br /&gt;
&lt;br /&gt;
It looks like the AppendByteAddressBuffer type has an IncrementCounter method, which I like.&amp;nbsp; This way, I know exactly how many items are in the buffer at the time of insertion.&amp;nbsp; However, for AppendStructuredBuffer, the counter is hidden and the Append method does not return anything (such as the total number of items in the buffer).&lt;br /&gt;
&lt;br /&gt;
I can&amp;#39;t really append something and then call GetDimensions, as a parallel copy of the shader could be inserting something before I call GetDimensions in the other copy, which would result in a potentially incorrect count.&amp;nbsp; Wouldn&amp;#39;t it be better to also have an IncrementCounter method on the structured buffer type so the programmer knows exactly how many items are in it at the time of insertion?&amp;nbsp; Or does the byte address buffer type use an atomic operation on an integer, while the structured buffer type uses a special instruction that HW people can optimize for?&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Seth&lt;br /&gt;</description></item><item><title>Help with Direct3D 11.</title><link>http://forums.xna.com/forums/thread/243242.aspx</link><pubDate>Sun, 25 Oct 2009 16:25:04 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:243242</guid><dc:creator>Razvan Aguridan</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/243242.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=243242</wfw:commentRss><description>&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt;Hello.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt;I have a little problem with D3D11. After I downloaded the SDK I modified a program that worked on the beta SDK and tried to run it. Unfortunately the program produces an unexpected output. Instead of drawing a 2D red triangle on the screen all I get is a red dot in the middle of my window. Can anyone help me with this?&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is the source code for the shader:&lt;/div&gt;&lt;div&gt;&lt;a href="http://razvan1024.pastebin.com/f3d85c384" style="color:#e16d2e;text-decoration:none;"&gt;http://razvan1024.pastebin.com/f3d85c384&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The source code for the program:&lt;/div&gt;&lt;div&gt;&lt;a href="http://razvan1024.pastebin.com/f45c50a85" style="color:#e16d2e;text-decoration:none;"&gt;http://razvan1024.pastebin.com/f45c50a85&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://razvan1024.pastebin.com/f45c50a85" style="color:#e16d2e;text-decoration:none;"&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;	&lt;/span&gt;Thanks in advance for the help.&lt;/div&gt;</description></item><item><title>compensated summation and precise qualifier</title><link>http://forums.xna.com/forums/thread/241896.aspx</link><pubDate>Thu, 22 Oct 2009 17:05:11 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:241896</guid><dc:creator>BarnacleJunior</dc:creator><slash:comments>1</slash:comments><comments>http://forums.xna.com/forums/thread/241896.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=241896</wfw:commentRss><description>I&amp;#39;m trying to use Kahan summation to add up a bunch of numbers inside a compute shader - it&amp;#39;s good for large matrix mul or force interactions and things like that.&amp;nbsp; You don&amp;#39;t have to use a double for accumulation, as the lost residuals are kept in a temp and added back in during the next increment: &lt;br /&gt;
http://en.wikipedia.org/wiki/Kahan_summation&lt;br /&gt;
&lt;br /&gt;
Unfortunately the HLSL compiler is totally optimizing out this operation:&lt;br /&gt;
&lt;br /&gt;
void Accumulate(inout float4 sum, float4 source, inout float4 compensation) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;float4 y = source - compensation;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;float4 t = sum + y;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;compensation = (t - sum) - y;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;sum = t;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Buffer&amp;lt;float4&amp;gt; input;&lt;br /&gt;
RWBuffer&amp;lt;float4&amp;gt; output;&lt;br /&gt;
&lt;br /&gt;
[numthreads(1, 1, 1)]&lt;br /&gt;
void AddThemUp(uint3 groupID : SV_GroupID) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;float4 sum = float4(0, 0, 0, 0);&lt;br /&gt;
#ifdef ACCUMULATE_KAHAN&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;float4 compensation = float4(0, 0, 0, 0);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;[loop]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;for(uint i = groupID.x; i &amp;lt; 16384; ++i) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;float4 add = input[i];&lt;br /&gt;
#ifdef ACCUMULATE_KAHAN&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Accumulate(sum, add, compensation);&lt;br /&gt;
#else&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;sum += add;&lt;br /&gt;
#endif&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;output[groupID.x] = sum;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unless I compile with /Od, the same assembler is generated for both with and without ACCUMULATE_KAHAN:&lt;br /&gt;
&lt;br /&gt;
cs_5_0&lt;br /&gt;
dcl_globalFlags refactoringAllowed&lt;br /&gt;
dcl_resource_buffer (float,float,float,float) t0&lt;br /&gt;
dcl_uav_typed_buffer (float,float,float,float) u0&lt;br /&gt;
dcl_input vThreadGroupID.x&lt;br /&gt;
dcl_temps 3&lt;br /&gt;
dcl_thread_group 1, 1, 1&lt;br /&gt;
mov r0.xyzw, l(0,0,0,0)&lt;br /&gt;
mov r1.x, vThreadGroupID.x&lt;br /&gt;
loop &lt;br /&gt;
&amp;nbsp; uge r1.y, r1.x, l(0x00004000)&lt;br /&gt;
&amp;nbsp; breakc_nz r1.y&lt;br /&gt;
&amp;nbsp; ld_indexable(buffer)(float,float,float,float) r2.xyzw, r1.xxxx, t0.xyzw&lt;br /&gt;
&amp;nbsp; add r0.xyzw, r0.xyzw, r2.xyzw&lt;br /&gt;
&amp;nbsp; iadd r1.x, r1.x, l(1)&lt;br /&gt;
endloop &lt;br /&gt;
store_uav_typed u0.xyzw, vThreadGroupID.xxxx, r0.xyzw&lt;br /&gt;
ret &lt;br /&gt;
// Approximately 11 instruction slots used&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I tried using the precise qualifier, but it appears that even a single use of that qualifier anywhere infects the entire shader, eliminating all MADs and replacing them with MULs and ADDs.&amp;nbsp; It doesn&amp;#39;t simply turn off algebraic optimization.&amp;nbsp; When I use precise on the float4 t term inside the Accumulate scope, fxc generates this:&lt;br /&gt;
&lt;br /&gt;
cs_5_0&lt;br /&gt;
dcl_globalFlags refactoringAllowed&lt;br /&gt;
dcl_resource_buffer (float,float,float,float) t0&lt;br /&gt;
dcl_uav_typed_buffer (float,float,float,float) u0&lt;br /&gt;
dcl_input vThreadGroupID.x&lt;br /&gt;
dcl_temps 6&lt;br /&gt;
dcl_thread_group 1, 1, 1&lt;br /&gt;
mov [precise] r0.xyzw, l(0,0,0,0)&lt;br /&gt;
mov [precise] r1.xyzw, l(0,0,0,0)&lt;br /&gt;
mov [precise(x)] r2.x, vThreadGroupID.x&lt;br /&gt;
loop &lt;br /&gt;
&amp;nbsp; uge [precise(y)] r2.y, r2.x, l(0x00004000)&lt;br /&gt;
&amp;nbsp; breakc_nz r2.y&lt;br /&gt;
&amp;nbsp; ld_indexable [precise](buffer)(float,float,float,float) r3.xyzw, r2.xxxx, t0.xyzw&lt;br /&gt;
&amp;nbsp; add [precise] r3.xyzw, -r1.xyzw, r3.xyzw&lt;br /&gt;
&amp;nbsp; add [precise] r4.xyzw, r0.xyzw, r3.xyzw&lt;br /&gt;
&amp;nbsp; add [precise] r5.xyzw, -r0.xyzw, r4.xyzw&lt;br /&gt;
&amp;nbsp; add [precise] r1.xyzw, -r3.xyzw, r5.xyzw&lt;br /&gt;
&amp;nbsp; iadd [precise(x)] r2.x, r2.x, l(1)&lt;br /&gt;
&amp;nbsp; mov [precise] r0.xyzw, r4.xyzw&lt;br /&gt;
endloop &lt;br /&gt;
store_uav_typed u0.xyzw, vThreadGroupID.xxxx, r0.xyzw&lt;br /&gt;
ret &lt;br /&gt;
// Approximately 16 instruction slots used&lt;br /&gt;
&lt;br /&gt;
Even the loop iterator is marked [precise].&amp;nbsp; This really doesn&amp;#39;t agree with the description of the qualifier in the chm.&amp;nbsp; In my actual code (a force accumulation shader), using precise just inside the Accumulate function grows the instruction slot count from 994 to 1326, since all the fused MADs go to MUL, ADD.&lt;br /&gt;
&lt;br /&gt;
It would be really useful if there was maybe a function modifier [fullalgebra] or something that turned off algebraic optimizations just for the scope of one function, without using precise or removing MADs.&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
&lt;br /&gt;
.sean&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description></item><item><title>D3D_DRIVER_TYPE_UNKNOWN question</title><link>http://forums.xna.com/forums/thread/241532.aspx</link><pubDate>Wed, 21 Oct 2009 22:11:07 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:241532</guid><dc:creator>BarnacleJunior</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/241532.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=241532</wfw:commentRss><description>I just got caught up (for an hour) on the D3D_DRIVER_TYPE_UNKNOWN argument for D3D11CreateDevice.&amp;nbsp; I guess I should have read the notes at the bottom of the SDK page.&amp;nbsp; If I pass the IDXGIAdapter interface to that function, along with D3D_DRIVER_TYPE_UNKNOWN, I can be sure that an actual HAL device has been created for that adapter, and D3D hasn&amp;#39;t simply backpedaled to WARP or REF?&lt;br /&gt;
&lt;br /&gt;
If I want to figure out which feature level an adapter supports in hardware, do I have to just try calling D3D11CreateDevice on it (and possibly not passing out pointers for device and context), and checking the returned feature level?&amp;nbsp; I was looking through the DXUT code, and it appears broken in this respect.&amp;nbsp; CD3D11Enumeration::EnumerateDevices is called on every adapter returned from IDXGIFactory1::EnumAdapters, but that IDXGIAdapter handle is never actually used, since D3D11CreateDevice passes NULL for the adapter handle.&amp;nbsp; Does DXUT11 even support multiple adapters at this point?&amp;nbsp; Looks like it wants to, but the operative statements were commented out:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //if( devTypeArray[iDeviceType] == D3D_DRIVER_TYPE_HARDWARE )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp; pAdapter = pAdapterInfo-&amp;gt;m_pAdapter;&lt;br /&gt;
&lt;br /&gt;
Maybe just a point for clarification in the next SDK..&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
.sean&lt;br /&gt;
&lt;br /&gt;</description></item><item><title>Compute Shader samples</title><link>http://forums.xna.com/forums/thread/240461.aspx</link><pubDate>Mon, 19 Oct 2009 20:18:46 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:240461</guid><dc:creator>BarnacleJunior</dc:creator><slash:comments>2</slash:comments><comments>http://forums.xna.com/forums/thread/240461.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=240461</wfw:commentRss><description>Is there a schedule for the next SDK release, or even minor release with just a bug-fixed fxc?&lt;br /&gt;
&lt;br /&gt;
More importantly, when can we expect useful Compute Shader samples?&amp;nbsp; I&amp;#39;ve spent all weekend trying to write a radix sort for cs_5_0, mostly going off the Garland or Harris papers, and drawing more and more on the CUDPP library.&amp;nbsp; But it&amp;#39;s a lot of intricate code in the sometimes-hard-to-follow CUDA idiom.&amp;nbsp; As discussions of bank conflicts and the like make up a big part of the CUDA literature, can we hope for some documentation that has at least rules-of-thumb for dealing with R800 and GT300 architectures in D3D11 in specific?&lt;br /&gt;
&lt;br /&gt;
.sean&lt;br /&gt;
&lt;br /&gt;</description></item><item><title>Windows DirectX API Code Pack...Compute Shaders?</title><link>http://forums.xna.com/forums/thread/240300.aspx</link><pubDate>Mon, 19 Oct 2009 15:01:42 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:240300</guid><dc:creator>LKeene</dc:creator><slash:comments>3</slash:comments><comments>http://forums.xna.com/forums/thread/240300.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=240300</wfw:commentRss><description>Hello all, I&amp;#39;m posting this question here in hopes that someone may know the answer. I&amp;#39;ve had no luck in other forums.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;d like to use the managed api in the API Code Pack to add some DirectX functionality to my windows forms app. I&amp;#39;m specifically interested in using the compute shader functionality. Does anyone know if a compute shaders wrapper is included in the code pack (the documentation didn&amp;#39;t say one way or another, it just said &amp;quot;most of DirectX 11 is included&amp;quot;) and, if so, are there any examples? Thanks in advance.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-L&lt;/div&gt;</description></item><item><title>Help! DirectCompute on Server 2008 X64</title><link>http://forums.xna.com/forums/thread/236295.aspx</link><pubDate>Fri, 09 Oct 2009 13:53:18 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:236295</guid><dc:creator>OpenCL</dc:creator><slash:comments>2</slash:comments><comments>http://forums.xna.com/forums/thread/236295.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=236295</wfw:commentRss><description>Hi, everyone&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;ve worked on an workstation equiped with a GF8800GTX(G80) graphics card recently.&lt;br /&gt;
I want to use D11 API on this platform, so I installed a Windows server2008 SP2 64bit( X64 english version ) and then installed the kb971644 package sucessfully (I found I got the D3D11.dll). &lt;br /&gt;
After that, everything goes OK except the DirectCompute samples(in DX SDK, cs_4.0 )&lt;br /&gt;
The program just told me that no hardware CS capable device installed and then ran the samples on a ref device. But in fact, I think my 8800GTX card is capable with cs 4.0 and I had already install the NVIDIA 190.62 driver( which supports directcompute ). I even tried the newest 191.07 driver, it still doesn&amp;#39;t work.&lt;br /&gt;
I wonder why this happened and I need help!&lt;br /&gt;
&lt;br /&gt;
Thanks to all! &lt;br /&gt;</description></item><item><title>D3D11 + DXGI 1.1 + Win7 x64 -&gt; Debug Output flooded with _com_error and DXGI Warning</title><link>http://forums.xna.com/forums/thread/240028.aspx</link><pubDate>Sun, 18 Oct 2009 20:10:55 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:240028</guid><dc:creator>pablo24</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/240028.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=240028</wfw:commentRss><description>As I already posted in &lt;a href="http://forums.xna.com/forums/p/39302/240026.aspx#240026"&gt;this thead&lt;/a&gt;, D3D11 and DXGI seems to be causing some strange warnings and exceptions in the debug output on Win7 x64.&lt;br /&gt;
&lt;br /&gt;
Does anyone know why this is happening and how/when it will be fixed, or if it&amp;#39;s harmless?&lt;br /&gt;
&lt;br /&gt;
Basically during the SetFullscreenState call the debug output gets flooded with _com_error&amp;#39;s and after that it shows the DXGI warning about Fullscreen Presentation inefficiencies, which is afaik only supposed to happen when DX is unable to flip the backbuffer and has to BitBlt.&lt;br /&gt;</description></item><item><title>Does 10level9 slow?</title><link>http://forums.xna.com/forums/thread/209841.aspx</link><pubDate>Thu, 06 Aug 2009 04:58:21 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:209841</guid><dc:creator>daVinci</dc:creator><slash:comments>3</slash:comments><comments>http://forums.xna.com/forums/thread/209841.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=209841</wfw:commentRss><description>I has rewrite my image processing engine from D3D9 to D3D11.&lt;br /&gt;
With &lt;span style="font-size:13px;"&gt;D3D_FEATURE_LEVEL_9_3 it works much slower then D3D_FEATURE_LEVEL_10_0.&lt;/span&gt;&lt;br /&gt;
How slow 10level9 can be?</description></item><item><title>What is meaning of ID3D11Device being free-threaded?</title><link>http://forums.xna.com/forums/thread/190474.aspx</link><pubDate>Tue, 16 Jun 2009 05:38:10 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:190474</guid><dc:creator>Nirav Shah</dc:creator><slash:comments>2</slash:comments><comments>http://forums.xna.com/forums/thread/190474.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=190474</wfw:commentRss><description>Hi,&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Quoting from D3D11 Tech Preview Documentation for C++ from November 2008 SDK,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;quot;All ID3D11Device interface methods arefree-threaded (meaning it is safe to attempt to have multiple threads call thefunctions at the same time)&amp;quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What is meaning of free-threaded?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Does it mean that more than one threads can invoke rendering function calls like Draw on the same render target without waiting for any call to be returned?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Kindly clarify.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks &amp;amp; Regards,&lt;/div&gt;&lt;div&gt;Nirav Shah.&lt;/div&gt;</description></item><item><title>Where is math function ?</title><link>http://forums.xna.com/forums/thread/236196.aspx</link><pubDate>Fri, 09 Oct 2009 05:53:38 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:236196</guid><dc:creator>Shinonome</dc:creator><slash:comments>2</slash:comments><comments>http://forums.xna.com/forums/thread/236196.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=236196</wfw:commentRss><description>Where is math function for DX11 ?&lt;br /&gt;
(D3DXVECTOR3 is treated as an error.)&lt;br /&gt;
There is not a description in document.&lt;br /&gt;
Should I use math function for DX10 ?&lt;br /&gt;</description></item><item><title>fxc not emitting texture load instruction</title><link>http://forums.xna.com/forums/thread/234835.aspx</link><pubDate>Tue, 06 Oct 2009 01:58:04 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:234835</guid><dc:creator>BarnacleJunior</dc:creator><slash:comments>1</slash:comments><comments>http://forums.xna.com/forums/thread/234835.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=234835</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve been fooling around with a large matrix multiplication routine for cs_5_0.  Usually correct-looking code is generated, but in my latest iteration, the groupshared array for the right hand side is not actually sampling the texture.  You can see by the resource binding that m2 is not even listed:&lt;br /&gt;
// Name                                 Type  Format         Dim Slot Elements&lt;br /&gt;
// ------------------------------ ---------- ------- ----------- ---- --------&lt;br /&gt;
// m1                                texture  float4          2d    0        1&lt;br /&gt;
// result                                UAV  float4          2d    0        1&lt;br /&gt;
// cb0                               cbuffer      NA          NA    0        1&lt;br /&gt;
&lt;br /&gt;
Assigning from groupshared b[][] into c[] does cause a sample operation.  I&amp;#39;m pasting the full source just to show that I&amp;#39;m doing enough operations on the b array so that it really should be sampled, not just assigned zero.  Is this a SM5 compiler bug?  I&amp;#39;m not using doubles or doing anything very sophisticated.  Would love to get this working.  BTW, same result if I use .Load() instead of operator[] to sample m2.  Thanks!&lt;br /&gt;
&lt;br /&gt;
.sean&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cbuffer cb0 {&lt;br /&gt;
    // Extent = W1 / 4 = H1 / 4&lt;br /&gt;
    uint H1, Extent, W2;&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;Texture2D&amp;lt;float4&amp;gt; m1, m2;&lt;br /&gt;
RWTexture2D&amp;lt;float4&amp;gt; result;&lt;/p&gt;
&lt;p&gt;groupshared float4 b[16][4];&lt;/p&gt;
&lt;p&gt;void Accumulate(inout float4 c[4], in float a, in float4 b[4]) {&lt;br /&gt;
    [unroll]&lt;br /&gt;
    for(uint j = 0; j &amp;lt; 4; ++j)&lt;br /&gt;
        c[j] += a * b[j];&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;[numthreads(4, 16, 1)]&lt;br /&gt;
void MMul3(uint3 threadID : SV_GroupThreadID, uint3 groupID : SV_GroupID) {&lt;br /&gt;
    uint linearID = threadID.x + 4 * threadID.y;&lt;br /&gt;
    &lt;br /&gt;
    uint2 cOffset = uint2(4 * groupID.x, 64 * groupID.y + linearID);&lt;br /&gt;
    uint2 aOffset = uint2(0, cOffset.y);&lt;br /&gt;
    uint2 bOffset = uint2(cOffset.x, 0) + threadID.xy;&lt;/p&gt;
&lt;p&gt;    // c is a 64x16 block.  this thread processes the linearID&amp;#39;th row.&lt;br /&gt;
    float4 c[4] = {&lt;br /&gt;
        float4(0, 0, 0, 0), float4(0, 0, 0, 0), &lt;br /&gt;
        float4(0, 0, 0, 0), float4(0, 0, 0, 0)&lt;br /&gt;
    };&lt;br /&gt;
    &lt;br /&gt;
    for(uint progress = 0; progress &amp;lt; Extent; progress += 4) {&lt;br /&gt;
    &lt;br /&gt;
        // sample m2 - note that fxc isn&amp;#39;t actually generating a load instruction here!&lt;br /&gt;
        b[threadID.y][threadID.x] = m2[bOffset];&lt;br /&gt;
       &lt;br /&gt;
        // uncommenting this line forces a sampling of m2 in the disassembly&lt;br /&gt;
     //   c[0] = b[threadID.y][threadID.x];&lt;br /&gt;
        &lt;br /&gt;
        GroupMemoryBarrier();&lt;br /&gt;
        &lt;br /&gt;
        // process every column in the 64x16 block&lt;br /&gt;
        [unroll]&lt;br /&gt;
        for(uint i = 0; i &amp;lt; 4; ++i) {&lt;br /&gt;
            float4 a = m1[aOffset + uint2(i, 0)];&lt;br /&gt;
            &lt;br /&gt;
            Accumulate(c, a.x, b[4 * i + 0]);&lt;br /&gt;
            Accumulate(c, a.y, b[4 * i + 1]);&lt;br /&gt;
            Accumulate(c, a.z, b[4 * i + 2]);&lt;br /&gt;
            Accumulate(c, a.w, b[4 * i + 3]);&lt;br /&gt;
        }&lt;br /&gt;
    &lt;br /&gt;
        aOffset.x += 4;&lt;br /&gt;
        bOffset.y += 16;&lt;br /&gt;
        &lt;br /&gt;
        GroupMemoryBarrierWithGroupSync();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // output the linearID row of the 64x16 target output block c to result.&lt;br /&gt;
    [unroll]&lt;br /&gt;
    for(uint i = 0; i &amp;lt; 4; ++i)&lt;br /&gt;
        result[cOffset + uint2(i, 0)] = c[i];&lt;br /&gt;
}&lt;/p&gt;</description></item><item><title>fxc is crasharoni on cs_5_0 matrix mul with double precision</title><link>http://forums.xna.com/forums/thread/233316.aspx</link><pubDate>Thu, 01 Oct 2009 22:01:21 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:233316</guid><dc:creator>BarnacleJunior</dc:creator><slash:comments>1</slash:comments><comments>http://forums.xna.com/forums/thread/233316.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=233316</wfw:commentRss><description>I downloaded the Aug SDK and quickly wrote up a large matrix mul shader (multiplies by blocks), and tried to compile for cs_5_0.&amp;nbsp; It works fine, and generates nice-looking ASM for cs_5_0 when using floats exclusively.&amp;nbsp; But when I try to accumulate into a local double variable (just one per thread), the fxc process crashes.&amp;nbsp; Also, when I try to compile for the cs_4_x profiles, fxc bails with &amp;quot;error X3531: Can&amp;#39;t unroll loops marked with loop attribute&amp;quot; and refers to the i &amp;lt; Extent; loop.&lt;br /&gt;
&lt;br /&gt;
cbuffer cb0 {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; uint H1, Extent, W2;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
Texture2D&amp;lt;float&amp;gt; m1, m2;&lt;br /&gt;
RWTexture2D&amp;lt;float&amp;gt; result;&lt;br /&gt;
&lt;br /&gt;
#define M 16&lt;br /&gt;
&lt;br /&gt;
groupshared float left[M][M], right[M][M];&lt;br /&gt;
&lt;br /&gt;
float RowDot(float4 L[M/4], float4 R[M/4]) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; float sum = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [unroll]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; for(int i = 0; i &amp;lt; M / 4; ++i)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum += dot(L[i], R[i]);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return sum;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
[numthreads(M, M, 1)]&lt;br /&gt;
void MMul(uint3 groupID : SV_GroupID, uint3 threadID : SV_GroupThreadID) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; double total = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; uint2 section = M * groupID.xy;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [loop]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; for(uint i = 0; i &amp;lt; Extent; i += M) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // gather the MxM block from m1 and m2 and cache in left and right.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // transpose the data in the right array to allow accelerated dot4 &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // operations.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; left[threadID.y][threadID.x] = m1[uint2(i + threadID.x, section.y + threadID.y)];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; right[threadID.x][threadID.y] = m2[uint2(section.x + threadID.x, i + threadID.y)];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait until the entire blocks have been marshalled into groupshared memory&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GroupMemoryBarrier();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // cast the row and column of the blocks to float4 and run the dot product&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; float sum = RowDot((float4[M/4])(left[threadID.y]), (float4[M/4])(right[threadID.x]));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; total += (double)sum;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GroupMemoryBarrierWithGroupSync();&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; result[section + threadID.xy] = (float)total;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks bros,&lt;br /&gt;
.sean&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description></item><item><title>does dx10 too modern?or dx9 becomes old.</title><link>http://forums.xna.com/forums/thread/217269.aspx</link><pubDate>Fri, 21 Aug 2009 16:24:52 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:217269</guid><dc:creator>matrix06</dc:creator><slash:comments>3</slash:comments><comments>http://forums.xna.com/forums/thread/217269.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=217269</wfw:commentRss><description>hello every body,&lt;br /&gt;
i am new on this site.so you know what you have to do.&lt;br /&gt;
&lt;br /&gt;
let me go inside my subject.nearly i finished my high school study.but no college interest in game programming here in iraq.that bad news.&lt;br /&gt;
the good news is i got a gift which is collection on dx9 and c++ books.&lt;br /&gt;
&lt;br /&gt;
i started to learn c++ and  its amazing language.but do you think that dx9 is become too old to learn?&lt;br /&gt;
or its not big problem to learn dx10 after dx9.&lt;br /&gt;
&lt;br /&gt;
how is dx10 similar to dx9?&lt;br /&gt;
&lt;br /&gt;
Do you prefer to:&lt;br /&gt;
 1.learn dx9 and go throw dx10&lt;br /&gt;
 2. start only with dx10 .&lt;br /&gt;
 3.change my destination and learn opengl.&lt;br /&gt;
 4.go and learn anathor scince.&lt;br /&gt;
&lt;br /&gt;
i dont want to learn c#/xna because i want to learn more than one platform.may be PS3.&lt;br /&gt;
&lt;br /&gt;
cheers&lt;br /&gt;
Ali Mohammed Ismaeel</description></item><item><title>Hull shader issue</title><link>http://forums.xna.com/forums/thread/230817.aspx</link><pubDate>Sat, 26 Sep 2009 04:24:06 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:230817</guid><dc:creator>Seth H</dc:creator><slash:comments>1</slash:comments><comments>http://forums.xna.com/forums/thread/230817.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=230817</wfw:commentRss><description>I am instance rendering patches and I am unable to use SV_InstanceID in the hull shader.&amp;nbsp; The shader compiler gives this error:&lt;br /&gt;
&lt;br /&gt;
error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Invalid operand type for operand #1 of opcode #18 (counts are 1-based). &lt;br /&gt;
error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Can&amp;#39;t continue validation - aborting.&lt;br /&gt;
&lt;br /&gt;
This strikes me as more of a compiler bug than a semantic limitation -- or do I need to pass over the instance ID from the vertex shader, per-control point?&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Seth&lt;br /&gt;</description></item><item><title>Direct3D 11 interoporate with Direct2D</title><link>http://forums.xna.com/forums/thread/226552.aspx</link><pubDate>Tue, 15 Sep 2009 10:39:39 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:226552</guid><dc:creator>swalloware</dc:creator><slash:comments>5</slash:comments><comments>http://forums.xna.com/forums/thread/226552.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=226552</wfw:commentRss><description>In the Direct2D samples, Direct2D supports interoperation with Direct3D 10.1 devices. Since Direct3D 11 do not support font rendering, I plan to use Direct2D as the font renderer. But when I migrate the Direct3D 10.1 code into Direct3D 11, a E_NOINTERFACE error returns. So does anyone help me to solve this issue?</description></item><item><title>where are D3DX11CreateFFT and similar?</title><link>http://forums.xna.com/forums/thread/228913.aspx</link><pubDate>Mon, 21 Sep 2009 18:17:09 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:228913</guid><dc:creator>RobyDX</dc:creator><slash:comments>4</slash:comments><comments>http://forums.xna.com/forums/thread/228913.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=76&amp;PostID=228913</wfw:commentRss><description>Hi, I&amp;#39;m working on DirectX11 these day (I&amp;#39;m developing a DirectX11 wrapper for .Net that I count to release this week-end on my website) but I&amp;#39;ve a little problem with new ID3DX11FFT object,&lt;br /&gt;
the library D3DCSX doesn&amp;#39;t contain function to create this object (D3DX11CreateFFT for example) so is impossible to create this object. &lt;br /&gt;
Have anyone found the location of this function?&lt;br /&gt;
&lt;br /&gt;
Thanks to all&lt;br /&gt;</description></item></channel></rss>