-
-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
D3D12: Support for SHADER_4_COMPONENT_MAPPING macros #2467
base: master
Are you sure you want to change the base?
Conversation
DirectX Shader Compiler
Did you even test this code before you wrote it? |
Sorry for the late replay. I'm actively using it in my renderer. I've also tested DECODE_SHADER_4_COMPONENT_MAPPING and it seems to work ok. What problem did you find? |
ENCODE_SHADER_4_COMPONENT_MAPPING :: proc(Src0, Src1, Src2, Src3: SHADER_COMPONENT_MAPPING) -> u32 { | ||
return (u32(Src0)&SHADER_COMPONENT_MAPPING_MASK)| | ||
((u32(Src1)&SHADER_COMPONENT_MAPPING_MASK)<<SHADER_COMPONENT_MAPPING_SHIFT)| | ||
((u32(Src2)&SHADER_COMPONENT_MAPPING_MASK)<<(SHADER_COMPONENT_MAPPING_SHIFT*2))| | ||
((u32(Src3)&SHADER_COMPONENT_MAPPING_MASK)<<(SHADER_COMPONENT_MAPPING_SHIFT*3))| | ||
SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES | ||
} | ||
DECODE_SHADER_4_COMPONENT_MAPPING :: proc(ComponentToExtract, Mapping: u32) -> SHADER_COMPONENT_MAPPING { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend making these proc "c"
or something that is the default "odin"
calling convention
Added procedures for D3D12 macros:
ENCODE_SHADER_4_COMPONENT_MAPPING
DECODE_SHADER_4_COMPONENT_MAPPING
Added a "runtime constant" for
DEFAULT_SHADER_4_COMPONENT_MAPPING