33 for (
k = 0;
k < dst_type->
dimx; ++
k)
71 if (
x >= 4294967296.0f)
82 if (
x <= -2147483648.0f)
85 if (
x >= 2147483648.0f)
96 if (
x >= 4294967296.0)
107 if (
x <= -2147483648.0)
110 if (
x >= 2147483648.0)
124 for (
k = 0;
k < dst_type->
dimx; ++
k)
151 if (dst_type->
dimx !=
src->node.data_type->dimx
152 || dst_type->
dimy !=
src->node.data_type->dimy)
159 for (
k = 0;
k < dst_type->
dimx; ++
k)
161 switch (
src->node.data_type->e.numeric.type)
167 f =
src->value.u[
k].f;
174 f =
src->value.u[
k].d;
179 u =
src->value.u[
k].i;
180 i =
src->value.u[
k].i;
181 f =
src->value.u[
k].i;
186 u =
src->value.u[
k].u;
187 i =
src->value.u[
k].u;
188 f =
src->value.u[
k].u;
193 u = !!
src->value.u[
k].u;
194 i = !!
src->value.u[
k].u;
195 f = !!
src->value.u[
k].u;
239 for (
k = 0;
k < dst_type->
dimx; ++
k)
265 for (
k = 0;
k < dst_type->
dimx; ++
k)
291 for (
k = 0;
k < dst_type->
dimx; ++
k)
318 for (
k = 0;
k < dst_type->
dimx; ++
k)
344 for (
k = 0;
k < dst_type->
dimx; ++
k)
350 if (
ctx->profile->major_version >= 4 &&
src->value.u[
k].f < 0.0f)
353 "Indefinite logarithm result.");
359 "Infinities and NaNs are not allowed by the shader model.");
364 if (
src->value.u[
k].d < 0.0)
367 "Indefinite logarithm result.");
389 for (
k = 0;
k < dst_type->
dimx; ++
k)
423 for (
k = 0;
k < dst_type->
dimx; ++
k)
447 for (
k = 0;
k < dst_type->
dimx; ++
k)
453 if (
ctx->profile->major_version >= 4 &&
src->value.u[
k].f == 0.0f)
456 "Floating point division by zero.");
458 dst->u[
k].f = 1.0f /
src->value.u[
k].f;
462 "Infinities and NaNs are not allowed by the shader model.");
467 if (
src->value.u[
k].d == 0.0)
470 "Floating point division by zero.");
472 dst->u[
k].d = 1.0 /
src->value.u[
k].d;
492 for (
k = 0;
k < dst_type->
dimx; ++
k)
498 if (
ctx->profile->major_version >= 4)
500 if (
src->value.u[
k].f < 0.0f)
502 "Imaginary square root result.");
503 else if (
src->value.u[
k].f == 0.0f)
505 "Floating point division by zero.");
511 "Infinities and NaNs are not allowed by the shader model.");
532 for (
k = 0;
k < dst_type->
dimx; ++
k)
558 for (
k = 0;
k < dst_type->
dimx; ++
k)
564 if (
ctx->profile->major_version >= 4 &&
src->value.u[
k].f < 0.0f)
567 "Imaginary square root result.");
573 "Infinities and NaNs are not allowed by the shader model.");
578 if (
src->value.u[
k].d < 0.0)
581 "Imaginary square root result.");
604 for (
k = 0;
k < dst_type->
dimx; ++
k)
641 for (
k = 0;
k < dst_type->
dimx; ++
k)
668 for (
k = 0;
k < dst_type->
dimx; ++
k)
695 for (
k = 0;
k < dst_type->
dimx; ++
k)
723 for (
k = 0;
k < src1->
node.data_type->dimx; ++
k)
753 for (
k = 0;
k < src1->
node.data_type->dimx; ++
k)
780 for (
k = 0;
k < dst_type->
dimx; ++
k)
786 if (
ctx->profile->major_version >= 4 && src2->
value.u[
k].f == 0)
789 "Floating point division by zero.");
795 "Infinities and NaNs are not allowed by the shader model.");
800 if (src2->
value.u[
k].d == 0)
803 "Floating point division by zero.");
809 if (src2->
value.u[
k].i == 0)
812 "Division by zero.");
822 if (src2->
value.u[
k].u == 0)
825 "Division by zero.");
847 for (
k = 0;
k < dst_type->
dimx; ++
k)
849 switch (src1->
node.data_type->e.numeric.type)
883 for (
k = 0;
k < dst_type->
dimx; ++
k)
885 switch (src1->
node.data_type->e.numeric.type)
922 for (
k = 0;
k < dst_type->
dimx; ++
k)
924 switch (src1->
node.data_type->e.numeric.type)
961 for (
k = 0;
k < dst_type->
dimx; ++
k)
965 switch (src1->
node.data_type->e.numeric.type)
992 for (
k = 0;
k < dst_type->
dimx; ++
k)
1030 for (
k = 0;
k < dst_type->
dimx; ++
k)
1069 for (
k = 0;
k < dst_type->
dimx; ++
k)
1074 if (src2->
value.u[
k].i == 0)
1086 if (src2->
value.u[
k].u == 0)
1111 for (
k = 0;
k < dst_type->
dimx; ++
k)
1145 for (
k = 0;
k < dst_type->
dimx; ++
k)
1147 switch (src1->
node.data_type->e.numeric.type)
1182 for (
k = 0;
k < dst_type->
dimx; ++
k)
1196 for (
k = 0;
k < dst_type->
dimx; ++
k)
1200 switch (src1->
node.data_type->e.numeric.type)
1221 struct hlsl_constant_value
res = {0};
1230 if (!
expr->operands[0].node)
1238 if (
expr->operands[
i].node)
1246 if (
expr->operands[1].node)
1248 if (
expr->operands[2].node)
1410 if (const_arg->
value.u[
k].f != 0.0f)
1415 if (const_arg->
value.u[
k].d != 0.0)
1422 if (const_arg->
value.u[
k].u != 0)
1444 if (const_arg->
value.u[
k].f != 1.0f)
1449 if (const_arg->
value.u[
k].d != 1.0)
1455 if (const_arg->
value.u[
k].u != 1)
1460 if (const_arg->
value.u[
k].u != ~0)
1489 if (!!
expr->operands[
i].node != (
i < 2))
1496 mut_arg =
expr->operands[1].node;
1500 mut_arg =
expr->operands[0].node;
1523 res_node = &const_arg->
node;
1532 res_node = &const_arg->
node;
1549 struct hlsl_constant_value
value;
1562 for (
i = 0;
i <
swizzle->node.data_type->dimx; ++
i)
_ACRTIMP double __cdecl sqrt(double)
_ACRTIMP double __cdecl fabs(double)
_ACRTIMP double __cdecl log2(double)
_ACRTIMP double __cdecl fmin(double, double)
_ACRTIMP double __cdecl fmax(double, double)
_ACRTIMP float __cdecl fmaxf(float, float)
_ACRTIMP float __cdecl fabsf(float)
_ACRTIMP float __cdecl log2f(float)
_ACRTIMP float __cdecl modff(float, float *)
_ACRTIMP float __cdecl exp2f(float)
_ACRTIMP float __cdecl fminf(float, float)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLuint GLuint arg1
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
enum wined3d_data_type data_type
struct hlsl_ir_node * hlsl_new_constant(struct hlsl_ctx *ctx, struct hlsl_type *type, const struct hlsl_constant_value *value, const struct vkd3d_shader_location *loc)
const char * debug_hlsl_type(struct hlsl_ctx *ctx, const struct hlsl_type *type)
void hlsl_error(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc, enum vkd3d_shader_error error, const char *fmt,...)
void hlsl_warning(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc, enum vkd3d_shader_error error, const char *fmt,...)
void hlsl_replace_node(struct hlsl_ir_node *old, struct hlsl_ir_node *new)
const char * debug_hlsl_expr_op(enum hlsl_ir_expr_op op)
static unsigned int hlsl_swizzle_get_component(uint32_t swizzle, unsigned int idx)
static bool fold_rsq(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src, const struct vkd3d_shader_location *loc)
static bool fold_equal(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_nequal(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_lshift(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_floor(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src)
static bool fold_rshift(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_ceil(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src)
static bool constant_is_one(struct hlsl_ir_constant *const_arg)
static bool fold_bit_xor(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_sqrt(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src, const struct vkd3d_shader_location *loc)
static bool fold_cast(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src)
static bool fold_not(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src)
static bool constant_is_zero(struct hlsl_ir_constant *const_arg)
static bool fold_fract(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src)
static int32_t float_to_int(float x)
static bool fold_mod(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2, const struct vkd3d_shader_location *loc)
static bool fold_min(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_sat(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src)
static int32_t double_to_int(double x)
bool hlsl_fold_constant_swizzles(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context)
static bool fold_ternary(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2, const struct hlsl_ir_constant *src3)
static bool fold_dp2add(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2, const struct hlsl_ir_constant *src3)
static bool fold_gequal(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_less(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_bit_not(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src)
static bool fold_max(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_mul(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_div(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2, const struct vkd3d_shader_location *loc)
bool hlsl_fold_constant_exprs(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context)
static bool fold_log2(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src, const struct vkd3d_shader_location *loc)
static uint32_t float_to_uint(float x)
static bool fold_dot(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_neg(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src)
static bool fold_and(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_or(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static bool fold_add(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
static uint32_t double_to_uint(double x)
static bool fold_exp2(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src)
bool hlsl_fold_constant_identities(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context)
static bool fold_rcp(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src, const struct vkd3d_shader_location *loc)
static bool fold_abs(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, const struct hlsl_ir_constant *src)
__WINE_SERVER_LIST_INLINE void list_add_before(struct list *elem, struct list *to_add)
struct hlsl_ir_constant::hlsl_constant_value value
enum hlsl_ir_node_type type
struct hlsl_type * data_type
struct vkd3d_shader_location loc
struct hlsl_type::@5997::@5998 numeric
#define vkd3d_unreachable()
#define VKD3D_ASSERT(cond)
@ VKD3D_SHADER_ERROR_HLSL_DIVISION_BY_ZERO
@ VKD3D_SHADER_ERROR_HLSL_NON_FINITE_RESULT
@ VKD3D_SHADER_WARNING_HLSL_IMAGINARY_NUMERIC_RESULT
@ VKD3D_SHADER_WARNING_HLSL_DIVISION_BY_ZERO
@ VKD3D_SHADER_WARNING_HLSL_NON_FINITE_RESULT
#define success(from, fromstr, to, tostr)