Is it possible to call an ASM shader technique under HLSL?

Started by
2 comments, last by Cypher19 20 years ago
I'm using a HLSL vertex shader in my program, but still need to use vertex lighting, and of course I can't use the FF lighting in D3D9. I want to use the Lighting VS from the *surprise surprise* LightingVS example to integrate into my HLSL shader. However, it is not a HLSL, but an ASM shader. Is it possible in any way to incorporate the ASM code into the HLSL shader, or even better, call the ASM technique like a HLSL function in the HLSL shader? [edited by - Cypher19 on April 15, 2004 12:28:10 AM]
Advertisement
Not really. Look up the shader fragment linker in the D3DX docs and see what they say, but in general you can''t simply call an asm function from HLSL code. The compiler doesn''t support mixing of asm and HLSL.

Your best bet by far is to understand what the asm shader is doing, rewrite it yoruself in HLSL and have it work on any target. You''ll get the benefit of target-agnostic shader code, and you might gain some good shader experience.

I like pie.
[sub]My spoon is too big.[/sub]
Okay, thanks for the response. I was studying the MSDN library a bit to see an answer, and was starting to come to the conclusion that I''d have to translate.

It shouldn''t be that hard to disassemble the ASM shader though, right? A lot of the HLSL functions are like many ASM instructions. Plus, since the LightingVS has a #define for EVERY constant, that''s made wayy easier, huh?
Shouldn''t be too hard. Some of the tricks you can do with the ASM aren''t obvious at first, but it just takes some digging. It''s actually pretty fascinating, if you''re me.

I like pie.
[sub]My spoon is too big.[/sub]

This topic is closed to new replies.

Advertisement