|
原始的HLSL Shader Code(AmbientTexture.fx)如下:
//AmbientTexture.fx/////////////////////
float4x4 World : WORLD;float4x4 View;float4x4 Projection;float4 AmbientColor : COLOR0;float4x4 WorldViewProjection : WORLDVIEWPROJECTION;texture Texture;sampler TextureSampler = sampler_state{ texture = <Texture>; magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = mirror; AddressV = mirror;};struct VertexInput{ float4 Position : POSITION; float2 TexCoord : TEXCOORD0;};struct VertexOutput{ float4 Position : POSITION; float2 TexCoord : TEXCOORD0;};VertexOutput vertexShader(VertexInput input){ VertexOutput output; WorldViewProjection = mul(mul(World, View), Projection); output.Position = mul(input.Position, WorldViewProjection); output.TexCoord = input.TexCoord; return( output );}struct PixelInput{ float2 TexCoord : TEXCOORD0; };float4 pixelShader(PixelInput input) : COLOR{ return( tex2D(TextureSampler, input.TexCoord) * AmbientColor);}technique Default{ pass P0 { VertexShader = compile vs_1_1 vertexShader(); PixelShader = compile ps_1_1 pixelShader(); }}
我想要??Q??ssembly Shade Code如下:
???fxc.exe可以?到????等绾蜗履?
//////output.fx///////////////////////
technique Default{ pass P0 { vertexshader = asm { // // Generated by Microsoft (R) D3DX9 Shader Compiler // // Parameters: // // float4x4 Projection; // float4x4 View; // float4x4 World; // // // Registers: // // Name Reg Size // ------------ ----- ---- // World c0 4 // View c4 4 // Projection c8 4 // preshader mul r0, c4.x, c0 mul r1, c4.y, c1 add r2, r0, r1 mul r0, c4.z, c2 add r1, r2, r0 mul r0, c4.w, c3 add r2, r1, r0 mul r0, c8.x, r2 mul r1, c5.x, c0 mul r3, c5.y, c1 add r4, r1, r3 mul r1, c5.z, c2 add r3, r4, r1 mul r1, c5.w, c3 add r4, r3, r1 mul r1, c8.y, r4 add r3, r0, r1 mul r0, c6.x, c0 mul r1, c6.y, c1 add r5, r0, r1 mul r0, c6.z, c2 add r1, r5, r0 mul r0, c6.w, c3 add r5, r1, r0 mul r0, c8.z, r5 add r1, r3, r0 mul r0, c7.x, c0 mul r3, c7.y, c1 add r6, r0, r3 mul r0, c7.z, c2 add r3, r6, r0 mul r0, c7.w, c3 add r6, r3, r0 mul r0, c8.w, r6 add c0, r1, r0 mul r0, c9.x, r2 mul r1, c9.y, r4 add r3, r0, r1 mul r0, c9.z, r5 add r1, r3, r0 mul r0, c9.w, r6 add c1, r1, r0 mul r0, c10.x, r2 mul r1, c11.x, r2 mul r2, c10.y, r4 mul r3, c11.y, r4 add r4, r0, r2 mul r0, c10.z, r5 mul r2, c11.z, r5 add r5, r4, r0 mul r0, c10.w, r6 mul r4, c11.w, r6 add c2, r5, r0 add r0, r1, r3 add r1, r2, r0 add c3, r4, r1 // approximately 56 instructions used // // Generated by Microsoft (R) D3DX9 Shader Compiler vs_2_0 dcl_position v0 dcl_texcoord v1 dp4 oPos.x, v0, c0 dp4 oPos.y, v0, c1 dp4 oPos.z, v0, c2 dp4 oPos.w, v0, c3 mov oT0.xy, v1 // approximately 5 instruction slots used }; pixelshader = asm { // // Generated by Microsoft (R) D3DX9 Shader Compiler // // Parameters: // // float4 AmbientColor; // sampler2D TextureSampler; // // // Registers: // // Name Reg Size // -------------- ----- ---- // AmbientColor c0 1 // TextureSampler s0 1 // ps_2_0 dcl t0.xy dcl_2d s0 texld r0, t0, s0 mul r0, r0, c0 mov oC0, r0 // approximately 3 instruction slots used (1 texture, 2 arithmetic) }; }} |
|