Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Tue, 19 Feb 2008 18:04:17 -0800 (PST),    group: microsoft.public.win32.programmer.directx.graphics.shaders        back       


FXC and disable optimizations not working?   
I've got some vertex shader code from ATI's rendermonkey program that
I'm trying to tweak for an experiment. If I compile it on the command
line via:

fxc /T vs_2_0 /Od /Cc /Zi /E main shader.vsh

The output is as expected. I make one change by inserting a dummy
operation and get radically different code. The reason it seems is
that the compiler is optimizing out a bunch of stuff, since, this
stupid operation would effectively override the previous operations
and they'd be useless. But I'm specifying DISABLE OPTIMIZATIONS on the
command line.....I would expect that that'd not optimize anything.
It's a long explanation why I'm trying to do this operation but
basically it's for debugging via PIX. Anyways, what's up with /Od not
seeming to have any effect? I tried it with /O0, same thing.
Furthermore, if I compile the code in my C++ files via
D3DXCompileShaderFromFile, and use the flags D3DXSHADER_DEBUG |
D3DXSHADER_SKIPOPTIMIZATION, the same thing happens: it still
optimizes the code.

How the heck can I get my shader to compile verbatim, unoptimized???
Thanks for the help, this is driving me insane.

PS I'm using DX SDK August 2007 but I tried it with the latest, Nov.
2007 and the same thing happens.
date: Tue, 19 Feb 2008 18:04:17 -0800 (PST)   author:   Architekt

RE: FXC and disable optimizations not working?   
There are a few types of optimization that still take place even when the /Od 
flag is present.  You could always post or send me a snippit of the this code 
and I can double check if that is the case in this instance.

FXC and D3DXCompile use the same compiler so the results will not change 
between command line and runtime compilation.

Dieter

"Architekt" wrote:

> I've got some vertex shader code from ATI's rendermonkey program that
> I'm trying to tweak for an experiment. If I compile it on the command
> line via:
> 
> fxc /T vs_2_0 /Od /Cc /Zi /E main shader.vsh
> 
> The output is as expected. I make one change by inserting a dummy
> operation and get radically different code. The reason it seems is
> that the compiler is optimizing out a bunch of stuff, since, this
> stupid operation would effectively override the previous operations
> and they'd be useless. But I'm specifying DISABLE OPTIMIZATIONS on the
> command line.....I would expect that that'd not optimize anything.
> It's a long explanation why I'm trying to do this operation but
> basically it's for debugging via PIX. Anyways, what's up with /Od not
> seeming to have any effect? I tried it with /O0, same thing.
> Furthermore, if I compile the code in my C++ files via
> D3DXCompileShaderFromFile, and use the flags D3DXSHADER_DEBUG |
> D3DXSHADER_SKIPOPTIMIZATION, the same thing happens: it still
> optimizes the code.
> 
> How the heck can I get my shader to compile verbatim, unoptimized???
> Thanks for the help, this is driving me insane.
> 
> PS I'm using DX SDK August 2007 but I tried it with the latest, Nov.
> 2007 and the same thing happens.
>
date: Fri, 28 Mar 2008 15:36:00 -0700   author:   Dieter Van Wassenhove Dieter Van

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us