Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/odin-lang/Odin
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerBill committed Jan 10, 2025
2 parents 3d4a209 + 5a259ed commit fd058df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 11 additions & 1 deletion vendor/directx/d3d12/d3d12.odin
Original file line number Diff line number Diff line change
Expand Up @@ -1571,14 +1571,24 @@ VIEW_INSTANCING_DESC :: struct {
Flags: VIEW_INSTANCING_FLAGS,
}

SHADER_COMPONENT_MAPPING :: enum i32 {
SHADER_COMPONENT_MAPPING :: enum u32 {
FROM_MEMORY_COMPONENT_0 = 0,
FROM_MEMORY_COMPONENT_1 = 1,
FROM_MEMORY_COMPONENT_2 = 2,
FROM_MEMORY_COMPONENT_3 = 3,
FORCE_VALUE_0 = 4,
FORCE_VALUE_1 = 5,
}
ENCODE_SHADER_4_COMPONENT_MAPPING :: #force_inline proc "contextless" (Src0, Src1, Src2, Src3: u32) -> u32 {
return (Src0 & SHADER_COMPONENT_MAPPING_MASK) |
((Src1 & SHADER_COMPONENT_MAPPING_MASK) << SHADER_COMPONENT_MAPPING_SHIFT) |
((Src2 & SHADER_COMPONENT_MAPPING_MASK) << (SHADER_COMPONENT_MAPPING_SHIFT * 2)) |
((Src3 & SHADER_COMPONENT_MAPPING_MASK) << (SHADER_COMPONENT_MAPPING_SHIFT * 3)) |
SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES
}
DECODE_SHADER_4_COMPONENT_MAPPING :: #force_inline proc "contextless" (ComponentToExtract, Mapping: u32) -> u32 {
return Mapping >> (SHADER_COMPONENT_MAPPING_SHIFT * ComponentToExtract) & SHADER_COMPONENT_MAPPING_MASK
}

BUFFER_SRV_FLAGS :: distinct bit_set[BUFFER_SRV_FLAG; u32]
BUFFER_SRV_FLAG :: enum u32 {
Expand Down
6 changes: 6 additions & 0 deletions vendor/directx/d3d12/d3d12_constants.odin
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,12 @@ WHQL_DRAW_VERTEX_COUNT_2_TO_EXP :: 25

SHADER_COMPONENT_MAPPING_MASK :: 0x7
SHADER_COMPONENT_MAPPING_SHIFT :: 3
SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES :: 1 << (SHADER_COMPONENT_MAPPING_SHIFT * 4)
DEFAULT_SHADER_4_COMPONENT_MAPPING :: (0 & SHADER_COMPONENT_MAPPING_MASK) |
((1 & SHADER_COMPONENT_MAPPING_MASK) << SHADER_COMPONENT_MAPPING_SHIFT) |
((2 & SHADER_COMPONENT_MAPPING_MASK) << (SHADER_COMPONENT_MAPPING_SHIFT * 2)) |
((3 & SHADER_COMPONENT_MAPPING_MASK) << (SHADER_COMPONENT_MAPPING_SHIFT * 3)) |
SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES

FILTER_REDUCTION_TYPE_MASK :: 0x3
FILTER_REDUCTION_TYPE_SHIFT :: 7
Expand Down

0 comments on commit fd058df

Please sign in to comment.