mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/ir: Allocate SSA registers to temps.
This commit is contained in:
committed by
Henri Verbeet
parent
7b9d04fff8
commit
288020bce8
Notes:
Henri Verbeet
2025-06-23 20:18:01 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1485
@@ -3531,21 +3531,7 @@ static void dump_deref(struct vkd3d_string_buffer *buffer, const struct hlsl_der
|
||||
|
||||
const char *debug_hlsl_writemask(unsigned int writemask)
|
||||
{
|
||||
static const char components[] = {'x', 'y', 'z', 'w'};
|
||||
char string[5];
|
||||
unsigned int i = 0, pos = 0;
|
||||
|
||||
VKD3D_ASSERT(!(writemask & ~VKD3DSP_WRITEMASK_ALL));
|
||||
|
||||
while (writemask)
|
||||
{
|
||||
if (writemask & 1)
|
||||
string[pos++] = components[i];
|
||||
writemask >>= 1;
|
||||
i++;
|
||||
}
|
||||
string[pos] = '\0';
|
||||
return vkd3d_dbg_sprintf(".%s", string);
|
||||
return debug_vsir_writemask(writemask);
|
||||
}
|
||||
|
||||
const char *debug_hlsl_swizzle(uint32_t swizzle, unsigned int size)
|
||||
|
@@ -59,8 +59,7 @@ static inline unsigned int hlsl_swizzle_get_component(uint32_t swizzle, unsigned
|
||||
|
||||
static inline void hlsl_swizzle_set_component(uint32_t *swizzle, unsigned int idx, unsigned int component)
|
||||
{
|
||||
*swizzle &= ~(VKD3D_SHADER_SWIZZLE_MASK << VKD3D_SHADER_SWIZZLE_SHIFT(idx));
|
||||
*swizzle |= component << VKD3D_SHADER_SWIZZLE_SHIFT(idx);
|
||||
vsir_swizzle_set_component(swizzle, idx, component);
|
||||
}
|
||||
|
||||
enum hlsl_type_class
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1852,6 +1852,8 @@ static inline uint32_t vsir_write_mask_32_from_64(uint32_t write_mask64)
|
||||
}
|
||||
}
|
||||
|
||||
const char *debug_vsir_writemask(unsigned int writemask);
|
||||
|
||||
static inline uint32_t vsir_swizzle_64_from_32(uint32_t swizzle32)
|
||||
{
|
||||
switch (swizzle32)
|
||||
@@ -1901,6 +1903,12 @@ static inline unsigned int vsir_swizzle_get_component(uint32_t swizzle, unsigned
|
||||
return (swizzle >> VKD3D_SHADER_SWIZZLE_SHIFT(idx)) & VKD3D_SHADER_SWIZZLE_MASK;
|
||||
}
|
||||
|
||||
static inline void vsir_swizzle_set_component(uint32_t *swizzle, unsigned int idx, unsigned int component)
|
||||
{
|
||||
*swizzle &= ~(VKD3D_SHADER_SWIZZLE_MASK << VKD3D_SHADER_SWIZZLE_SHIFT(idx));
|
||||
*swizzle |= component << VKD3D_SHADER_SWIZZLE_SHIFT(idx);
|
||||
}
|
||||
|
||||
static inline unsigned int vkd3d_compact_swizzle(uint32_t swizzle, uint32_t write_mask)
|
||||
{
|
||||
unsigned int i, compacted_swizzle = 0;
|
||||
|
Reference in New Issue
Block a user