|
|
|
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
|
|