wined3d: SM4 immediate constants are typeless.

This commit is contained in:
Henri Verbeet 2010-10-08 13:12:18 +02:00 committed by Alexandre Julliard
parent 3e45fe7488
commit 1fe1676ae9
4 changed files with 13 additions and 19 deletions

View File

@ -1477,11 +1477,11 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register *
case WINED3DSPR_IMMCONST:
switch (reg->immconst_type)
{
case WINED3D_IMMCONST_FLOAT:
case WINED3D_IMMCONST_SCALAR:
sprintf(register_name, "%.8e", *(const float *)reg->immconst_data);
break;
case WINED3D_IMMCONST_FLOAT4:
case WINED3D_IMMCONST_VEC4:
sprintf(register_name, "vec4(%.8e, %.8e, %.8e, %.8e)",
*(const float *)&reg->immconst_data[0], *(const float *)&reg->immconst_data[1],
*(const float *)&reg->immconst_data[2], *(const float *)&reg->immconst_data[3]);

View File

@ -1033,11 +1033,11 @@ static void shader_dump_register(const struct wined3d_shader_register *reg,
TRACE("(");
switch (reg->immconst_type)
{
case WINED3D_IMMCONST_FLOAT:
case WINED3D_IMMCONST_SCALAR:
TRACE("%.8e", *(const float *)reg->immconst_data);
break;
case WINED3D_IMMCONST_FLOAT4:
case WINED3D_IMMCONST_VEC4:
TRACE("%.8e, %.8e, %.8e, %.8e",
*(const float *)&reg->immconst_data[0], *(const float *)&reg->immconst_data[1],
*(const float *)&reg->immconst_data[2], *(const float *)&reg->immconst_data[3]);

View File

@ -90,8 +90,8 @@ enum wined3d_sm4_register_type
enum wined3d_sm4_immconst_type
{
WINED3D_SM4_IMMCONST_FLOAT = 0x1,
WINED3D_SM4_IMMCONST_FLOAT4 = 0x2,
WINED3D_SM4_IMMCONST_SCALAR = 0x1,
WINED3D_SM4_IMMCONST_VEC4 = 0x2,
};
struct wined3d_sm4_data
@ -354,14 +354,14 @@ static void shader_sm4_read_src_param(void *data, const DWORD **ptr, struct wine
switch(immconst_type)
{
case WINED3D_SM4_IMMCONST_FLOAT:
src_param->reg.immconst_type = WINED3D_IMMCONST_FLOAT;
case WINED3D_SM4_IMMCONST_SCALAR:
src_param->reg.immconst_type = WINED3D_IMMCONST_SCALAR;
memcpy(src_param->reg.immconst_data, *ptr, 1 * sizeof(DWORD));
*ptr += 1;
break;
case WINED3D_SM4_IMMCONST_FLOAT4:
src_param->reg.immconst_type = WINED3D_IMMCONST_FLOAT4;
case WINED3D_SM4_IMMCONST_VEC4:
src_param->reg.immconst_type = WINED3D_IMMCONST_VEC4;
memcpy(src_param->reg.immconst_data, *ptr, 4 * sizeof(DWORD));
*ptr += 4;
break;

View File

@ -313,8 +313,8 @@ typedef enum _WINED3DSHADER_PARAM_REGISTER_TYPE
enum wined3d_immconst_type
{
WINED3D_IMMCONST_FLOAT,
WINED3D_IMMCONST_FLOAT4,
WINED3D_IMMCONST_SCALAR,
WINED3D_IMMCONST_VEC4,
};
#define WINED3DSP_NOSWIZZLE (0 | (1 << 2) | (2 << 4) | (3 << 6))
@ -2821,13 +2821,7 @@ static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg)
}
case WINED3DSPR_IMMCONST:
switch(reg->immconst_type)
{
case WINED3D_IMMCONST_FLOAT:
return TRUE;
default:
return FALSE;
}
return reg->immconst_type == WINED3D_IMMCONST_SCALAR;
default:
return FALSE;