41 ERR(
"Invalid material color source %#x.\n",
mcs);
93 for (
unsigned int i = 0;
i <
settings->point_light_count; ++
i)
125 for (
unsigned int i = 0;
i <
settings->spot_light_count; ++
i)
151 shader_addline(
buffer,
" else att = pow((t - cos_hphi) / (cos_htheta - cos_hphi), falloff);\n");
164 for (
unsigned int i = 0;
i <
settings->directional_light_count; ++
i)
177 for (
unsigned int i = 0;
i <
settings->parallel_point_light_count; ++
i)
279 for (
unsigned int i = 0;
i <
settings->vertexblends; ++
i)
283 for (
unsigned int i = 0;
i <
settings->vertexblends + 1; ++
i)
284 shader_addline(
buffer,
" ec_pos += i.blend_weight[%u] * mul(c.modelview_matrices[%u], float4(i.pos.xyz, 1.0));\n",
i,
i);
302 for (
unsigned int i = 0;
i <
settings->vertexblends + 1; ++
i)
308 " * mul((float3x3)c.modelview_matrices[%u], i.normal);\n",
i,
i);
323 switch (
settings->texgen[
i] & 0xffff0000)
368 " + c.point_params.y * length(ec_pos.xyz)"
369 " + c.point_params.z * dot(ec_pos.xyz, ec_pos.xyz));\n",
370 settings->per_vertex_point_size ?
"i.point_size" :
"c.point_params.w");
378 unsigned int argnum,
unsigned int stage,
unsigned int arg)
383 return "<unused arg>";
398 case 0:
ret =
"tex0";
break;
399 case 1:
ret =
"tex1";
break;
400 case 2:
ret =
"tex2";
break;
401 case 3:
ret =
"tex3";
break;
402 case 4:
ret =
"tex4";
break;
403 case 5:
ret =
"tex5";
break;
404 case 6:
ret =
"tex6";
break;
405 case 7:
ret =
"tex7";
break;
407 ret =
"<invalid texture>";
413 ret =
"c.texture_factor";
427 case 0:
ret =
"c.texture_constants[0]";
break;
428 case 1:
ret =
"c.texture_constants[1]";
break;
429 case 2:
ret =
"c.texture_constants[2]";
break;
430 case 3:
ret =
"c.texture_constants[3]";
break;
431 case 4:
ret =
"c.texture_constants[4]";
break;
432 case 5:
ret =
"c.texture_constants[5]";
break;
433 case 6:
ret =
"c.texture_constants[6]";
break;
434 case 7:
ret =
"c.texture_constants[7]";
break;
436 ret =
"<invalid constant>";
442 return "<unhandled arg>";
450 else if (argnum == 1)
452 else if (argnum == 2)
461 else if (argnum == 1)
463 else if (argnum == 2)
471 bool alpha,
bool tmp_dst,
unsigned int op,
unsigned int dw_arg0,
unsigned int dw_arg1,
unsigned int dw_arg2)
473 const char *dstmask, *dstreg, *arg0, *
arg1, *
arg2;
482 dstreg = tmp_dst ?
"temp_reg" :
"ret";
507 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
512 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
517 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
522 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
527 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
532 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
537 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask,
arg1, dstmask);
543 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
549 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
555 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
561 dstreg, dstmask,
arg2, dstmask, arg0,
arg1, dstmask);
567 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
601 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask, arg0, dstmask);
607 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0, dstmask);
611 FIXME(
"Unhandled operation %#x.\n",
op);
635 || (
i == 0 &&
settings->color_key_enabled))
664 const char *sampler_type;
666 if (!(tex_map & (1u <<
i)))
681 sampler_type =
"CUBE";
729 if (tex_map & (1u <<
i))
742 const char *texture_function, *coord_mask;
745 if (!(tex_map & (1u <<
i)))
759 FIXME(
"Unexpected projection mode %d.\n",
settings->op[
i].projected);
766 texture_function =
"tex1D";
770 texture_function =
"tex2D";
774 texture_function =
"tex3D";
778 texture_function =
"texCUBE";
783 texture_function =
"";
796 shader_addline(
buffer,
"ret.xy = mul(transpose((float2x2)c.bumpenv_matrices[%u]), tex%u.xy);\n",
i - 1,
i - 1);
820 i, texture_function, proj ?
"proj" :
"",
i, coord_mask);
824 shader_addline(
buffer,
"tex%u *= saturate(tex%u.z * c.bumpenv_lscale[%u][%u] + c.bumpenv_loffset[%u][%u]);\n",
825 i,
i - 1, (
i - 1) / 4, (
i - 1) % 4, (
i - 1) / 4, (
i - 1) % 4);
831 i, texture_function, proj ?
"proj" :
"",
i,
i);
836 i, texture_function, proj ?
"proj" :
"",
i,
i, coord_mask);
918 compile_info.
next = &hlsl_source_info;
926 FIXME(
"Shader log:\n");
937 ERR(
"Failed to compile HLSL, ret %d.\n",
ret);
struct mke2fs_defaults settings[]
static struct myctx * mcs
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void string_buffer_clear(struct wined3d_string_buffer *buffer)
void string_buffer_free(struct wined3d_string_buffer *buffer)
BOOL string_buffer_init(struct wined3d_string_buffer *buffer)
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
_ACRTIMP size_t __cdecl strlen(const char *)
static const char * get_fragment_op_arg(struct wined3d_string_buffer *buffer, unsigned int argnum, unsigned int stage, unsigned int arg)
static void generate_fragment_op(struct wined3d_string_buffer *buffer, unsigned int stage, bool color, bool alpha, bool tmp_dst, unsigned int op, unsigned int dw_arg0, unsigned int dw_arg1, unsigned int dw_arg2)
static void generate_lighting(struct wined3d_string_buffer *buffer, const struct wined3d_ffp_vs_settings *settings, bool legacy_lighting)
static bool compile_hlsl_shader(const struct wined3d_string_buffer *hlsl, struct vkd3d_shader_code *sm1, const char *profile)
static bool ffp_hlsl_generate_pixel_shader(const struct ffp_frag_settings *settings, struct wined3d_string_buffer *buffer)
bool ffp_hlsl_compile_ps(const struct ffp_frag_settings *settings, struct wined3d_shader_desc *shader_desc)
static const char * get_material_colour_source(enum wined3d_material_color_source mcs, const char *material)
bool ffp_hlsl_compile_vs(const struct wined3d_ffp_vs_settings *settings, struct wined3d_shader_desc *shader_desc, struct wined3d_device *device)
static bool ffp_hlsl_generate_vertex_shader(const struct wined3d_ffp_vs_settings *settings, struct wined3d_string_buffer *buffer, bool legacy_lighting)
static void generate_lighting_footer(struct wined3d_string_buffer *buffer, const struct wined3d_ffp_vs_settings *settings, unsigned int idx, bool legacy_lighting)
GLclampf GLclampf GLclampf alpha
GLuint GLuint GLuint GLuint arg1
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
struct vkd3d_shader_code source
enum vkd3d_shader_log_level log_level
enum vkd3d_shader_structure_type type
enum vkd3d_shader_source_type source_type
enum vkd3d_shader_target_type target_type
enum vkd3d_shader_structure_type type
unsigned int content_size
@ VKD3D_SHADER_SOURCE_HLSL
@ VKD3D_SHADER_LOG_WARNING
@ VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO
@ VKD3D_SHADER_STRUCTURE_TYPE_HLSL_SOURCE_INFO
VKD3D_SHADER_API int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out, char **messages)
@ VKD3D_SHADER_TARGET_D3D_BYTECODE
VKD3D_SHADER_API void vkd3d_shader_free_messages(char *messages)
#define WINED3DTA_SPECULAR
#define WINED3DTA_COMPLEMENT
wined3d_material_color_source
#define WINED3DTA_SELECTMASK
#define WINED3DTA_TFACTOR
#define WINED3DTSS_TCI_PASSTHRU
#define WINED3DTA_CURRENT
@ WINED3D_TOP_SELECT_ARG1
@ WINED3D_TOP_BLEND_DIFFUSE_ALPHA
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM
@ WINED3D_TOP_BLEND_CURRENT_ALPHA
@ WINED3D_TOP_ADD_SIGNED_2X
@ WINED3D_TOP_MODULATE_INVCOLOR_ADD_ALPHA
@ WINED3D_TOP_MULTIPLY_ADD
@ WINED3D_TOP_MODULATE_INVALPHA_ADD_COLOR
@ WINED3D_TOP_BUMPENVMAP_LUMINANCE
@ WINED3D_TOP_MODULATE_COLOR_ADD_ALPHA
@ WINED3D_TOP_MODULATE_4X
@ WINED3D_TOP_SELECT_ARG2
@ WINED3D_TOP_MODULATE_ALPHA_ADD_COLOR
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA
@ WINED3D_TOP_DOTPRODUCT3
@ WINED3D_TOP_MODULATE_2X
@ WINED3D_TOP_BLEND_FACTOR_ALPHA
#define WINED3DTA_ALPHAREPLICATE
#define WINED3D_LEGACY_FFP_LIGHTING
#define WINED3DTA_DIFFUSE
#define WINED3D_MAX_FFP_TEXTURES
#define WINED3DTA_CONSTANT
#define WINED3DTA_TEXTURE
#define WINED3D_MAX_ACTIVE_LIGHTS
static const char * wined3d_get_line(const char **ptr, const char *end)
@ WINED3D_GL_RES_TYPE_TEX_3D
@ WINED3D_GL_RES_TYPE_TEX_CUBE
@ WINED3D_GL_RES_TYPE_TEX_2D
@ WINED3D_GL_RES_TYPE_TEX_1D
@ WINED3D_FFP_VS_FOG_FOGCOORD
@ WINED3D_FFP_VS_FOG_DEPTH
@ WINED3D_FFP_VS_FOG_RANGE
#define MAX_VERTEX_BLENDS
@ WINED3D_PROJECTION_COUNT3
@ WINED3D_PROJECTION_NONE
@ WINED3D_PROJECTION_COUNT4