91 case ARB_ZERO:
return "ps_helper_const.x";
92 case ARB_ONE:
return "ps_helper_const.y";
93 case ARB_TWO:
return "coefmul.x";
94 case ARB_0001:
return "ps_helper_const.xxxy";
95 case ARB_EPS:
return "ps_helper_const.z";
103 case ARB_ZERO:
return "helper_const.x";
104 case ARB_ONE:
return "helper_const.y";
105 case ARB_TWO:
return "helper_const.z";
106 case ARB_EPS:
return "helper_const.w";
107 case ARB_0001:
return "helper_const.xxxy";
111 FIXME(
"Unmanaged %s shader helper constant requested: %u.\n",
118 case ARB_0001:
return "{0.0, 0.0, 0.0, 1.0}";
120 default:
return "bad";
126 return context->lowest_disabled_stage < 7;
338 if (reg_maps->
fog)
return TRUE;
345 unsigned int ret = 1;
365 unsigned int ret,
i,
j;
369 for (
i = 0;
i < max_constants; ++
i)
371 if (!dirty_consts[
i])
386 for (;
i <
min(8, max_constants); ++
i)
388 if (!dirty_consts[
i])
395 lcl_const[0] = -1.0f;
402 lcl_const[1] = -1.0f;
409 lcl_const[2] = -1.0f;
416 lcl_const[3] = -1.0f;
439 for (;
i < max_constants; ++
i)
441 if (!dirty_consts[
i])
447 for (++
i; (
i < max_constants) && dirty_consts[
i]; ++
i)
457 for (;
i < max_constants; ++
i)
469 if (
shader->load_local_constsF)
476 TRACE_(d3d_constants)(
"Loading local constants %i: %f, %f, %f, %f\n", lconst->
idx,
484 dirty_consts[lconst->
idx] = 1;
507 for (
i = 0; active; active >>= 1, ++
i)
511 GLfloat *tex_dim = &np2fixup_constants[(
idx >> 1) * 4];
518 ERR(
"Nonexistent texture is flagged for NP2 texcoord fixup.\n");
534 for (
i = 0;
i < fixup->
super.num_consts; ++
i)
537 fixup->
offset +
i, &np2fixup_constants[
i * 4]));
580 val[1] =
context->render_offscreen ? 1.0f : -1.0f;
610 float position_fixup[4];
647 BOOL usePixelShader,
BOOL useVertexShader,
BOOL from_shader_select)
652 if (!from_shader_select)
658 && (vshader->
reg_maps.boolean_constants
660 && (vshader->
reg_maps.integer_constants & ~vshader->
reg_maps.local_int_consts))))
662 TRACE(
"bool/integer vertex shader constants potentially modified, forcing shader reselection.\n");
666 && (pshader->
reg_maps.boolean_constants
668 && (pshader->
reg_maps.integer_constants & ~pshader->
reg_maps.local_int_consts))))
670 TRACE(
"bool/integer pixel shader constants potentially modified, forcing shader reselection.\n");
703 UINT rt_height =
state->fb->render_targets[0]->height;
772 unsigned max_constantsF;
787 max_constantsF = gl_info->
limits.arb_ps_native_constants;
789 if (max_constantsF < 24)
790 max_constantsF = gl_info->
limits.arb_ps_float_constants;
795 max_constantsF = gl_info->
limits.arb_vs_native_constants;
799 if (max_constantsF < 96)
800 max_constantsF = gl_info->
limits.arb_vs_float_constants;
804 DWORD highest_constf = 0, clip_limit;
810 for (
i = 0;
i <
shader->limits->constant_float; ++
i)
820 if(
ctx->cur_vs_args->super.clip_enabled)
821 clip_limit = gl_info->
limits.user_clip_distances;
827 unsigned int mask =
ctx->cur_vs_args->clip.boolclip.clipplane_mask;
830 *num_clipplanes =
min(clip_limit, max_constantsF - highest_constf - 1);
831 max_constantsF -= *num_clipplanes;
832 if(*num_clipplanes < clip_limit)
834 WARN(
"Only %u clip planes out of %u enabled.\n", *num_clipplanes,
835 gl_info->
limits.user_clip_distances);
840 if (
ctx->target_version >= NV2)
841 *num_clipplanes = gl_info->
limits.user_clip_distances;
843 *num_clipplanes =
min(gl_info->
limits.user_clip_distances, 4);
865 if (!
shader->load_local_constsF)
882 max_constantsF =
min(max_constantsF, gl_info->
limits.arb_ps_float_constants);
886 max_constantsF =
min(max_constantsF, gl_info->
limits.arb_vs_float_constants);
890 max_constantsF =
min(max_constantsF,
shader->limits->constant_float);
902 max_constantsF, max_constantsF - 1);
906 for (
i = 0;
i < max_constantsF; ++
i)
938 char *
ptr = write_mask;
957 const char *swizzle_chars = fixup ?
"zyxw" :
"xyzw";
958 char *
ptr = swizzle_str;
972 if (swizzle_x == swizzle_y && swizzle_x == swizzle_z && swizzle_x == swizzle_w) {
973 *
ptr++ = swizzle_chars[swizzle_x];
975 *
ptr++ = swizzle_chars[swizzle_x];
976 *
ptr++ = swizzle_chars[swizzle_y];
977 *
ptr++ = swizzle_chars[swizzle_z];
978 *
ptr++ = swizzle_chars[swizzle_w];
1003 static const char *
const rastout_reg_names[] = {
"TMP_OUT",
"TMP_FOGCOORD",
"result.pointsize"};
1014 sprintf(register_name,
"R%u",
reg->idx[0].offset);
1022 if (!
reg->idx[0].offset)
1023 strcpy(register_name,
"fragment.color.primary");
1025 strcpy(register_name,
"fragment.color.secondary");
1029 if (
reg->idx[0].rel_addr)
1043 ERR(
"Pixel shader input register out of bounds: %u\n",
idx);
1044 sprintf(register_name,
"out_of_bounds_%u",
idx);
1059 FIXME(
"Relative input register addressing with more than 8 registers\n");
1062 sprintf(register_name,
"fragment.texcoord[%s + %u]",
rel_reg,
reg->idx[0].offset);
1073 FIXME(
"Non-vertex shader varying input with indirect addressing\n");
1074 sprintf(register_name,
"fragment.texcoord[%s + %u]",
rel_reg,
reg->idx[0].offset);
1081 sprintf(register_name,
"fragment.texcoord[%s + %u]",
rel_reg,
reg->idx[0].offset);
1088 strcpy(register_name,
ctx->ps_input[
reg->idx[0].offset]);
1092 ERR(
"Pixel shader input register out of bounds: %u\n",
reg->idx[0].offset);
1093 sprintf(register_name,
"out_of_bounds_%u",
reg->idx[0].offset);
1100 if (
ctx->cur_vs_args->super.swizzle_map & (1u <<
reg->idx[0].offset))
1102 sprintf(register_name,
"vertex.attrib[%u]",
reg->idx[0].offset);
1107 if (!pshader &&
reg->idx[0].rel_addr)
1120 if (
ctx->target_version == ARB)
1132 sprintf(register_name,
"C[%u]",
ctx->aL +
reg->idx[0].offset);
1141 sprintf(register_name,
"C[%u]",
reg->idx[0].offset);
1143 sprintf(register_name,
"C%u",
reg->idx[0].offset);
1156 sprintf(register_name,
"T%u",
reg->idx[0].offset);
1159 sprintf(register_name,
"fragment.texcoord[%u]",
reg->idx[0].offset);
1164 sprintf(register_name,
"A%u",
reg->idx[0].offset);
1166 sprintf(register_name,
"A%u_SHADOW",
reg->idx[0].offset);
1171 if (
ctx->ps_post_process && !
reg->idx[0].offset)
1173 strcpy(register_name,
"TMP_COLOR");
1177 if (
ctx->cur_ps_args->super.srgb_correction)
1178 FIXME(
"sRGB correction on higher render targets.\n");
1180 sprintf(register_name,
"result.color[%u]",
reg->idx[0].offset);
1182 strcpy(register_name,
"result.color");
1187 if (
reg->idx[0].offset == 1)
1188 sprintf(register_name,
"%s",
ctx->fog_output);
1190 sprintf(register_name,
"%s", rastout_reg_names[
reg->idx[0].offset]);
1194 strcpy(register_name,
"result.depth");
1200 sprintf(register_name,
"oD[%u]",
reg->idx[0].offset);
1202 strcpy(register_name,
ctx->color_output[
reg->idx[0].offset]);
1207 sprintf(register_name,
"oT[%u]",
reg->idx[0].offset);
1209 strcpy(register_name,
ctx->texcrd_output[
reg->idx[0].offset]);
1211 strcpy(register_name,
ctx->vs_output[
reg->idx[0].offset]);
1215 if(
ctx->target_version >= NV2)
1218 if(pshader)
sprintf(register_name,
"A0.x");
1219 else sprintf(register_name,
"aL.y");
1229 sprintf(register_name,
"**aL_emul**");
1235 sprintf(register_name,
"I%u",
reg->idx[0].offset);
1239 if (!
reg->idx[0].offset)
1240 sprintf(register_name,
"vpos");
1241 else if (
reg->idx[0].offset == 1)
1242 sprintf(register_name,
"fragment.facing.x");
1244 FIXME(
"Unknown MISCTYPE register index %u.\n",
reg->idx[0].offset);
1248 FIXME(
"Unhandled register type %#x[%u].\n",
reg->type,
reg->idx[0].offset);
1249 sprintf(register_name,
"unrecognized_register[%u]",
reg->idx[0].offset);
1257 char register_name[255];
1270 switch(channel_source)
1279 FIXME(
"Unhandled channel source %#x\n", channel_source);
1309 masks.source &= dst_mask;
1311 if (fixup.x_sign_fixup)
1313 if (fixup.y_sign_fixup)
1315 if (fixup.z_sign_fixup)
1317 if (fixup.w_sign_fixup)
1319 masks.sign &= dst_mask;
1325 const char *
src,
const char *
one,
const char *
two,
1328 const char *sign_fixup_src =
dst;
1333 sign_fixup_src =
"TA";
1339 else if (
masks.sign)
1341 sign_fixup_src =
src;
1347 char *
ptr = reg_mask;
1373 mod = ins->
dst[0].modifiers;
1380 FIXME(
"Unhandled modifier WINED3DSPDM_MSAMPCENTROID\n");
1381 mod &= ~WINED3DSPDM_MSAMPCENTROID;
1399 FIXME(
"Unknown modifiers 0x%08x\n",
mod);
1407#define TEX_DERIV 0x10
1410 const char *dst_str,
const char *coord_reg,
WORD flags,
const char *dsx,
const char *dsy)
1422 const char *tex_dst = dst_str;
1428 switch (resource_type)
1437 gl_info = &
device->adapter->gl_info;
1439 if (pshader && priv->
cur_ps_args->super.np2_fixup & (1u << sampler_idx)
1448 if (
flags)
FIXME(
"Only ordinary sampling from NP2 textures is supported.\n");
1449 else np2_fixup =
TRUE;
1463 ERR(
"Unexpected resource type %#x.\n", resource_type);
1482 ins->
dst[0].write_mask);
1492 shader_addline(
buffer,
"TXD%s %s, %s, %s, %s, texture[%u], %s;\n",
mod, tex_dst, coord_reg,
1519 (
idx % 2) ?
"zwxy" :
"xyzw", coord_reg);
1555 switch (
src->modifiers)
1558 sprintf(outregstr,
"%s%s", regstr, swzstr);
1559 insert_line =
FALSE;
1562 sprintf(outregstr,
"-%s%s", regstr, swzstr);
1563 insert_line =
FALSE;
1595 if(
ctx->target_version >=
NV2) {
1596 sprintf(outregstr,
"|%s%s|", regstr, swzstr);
1597 insert_line =
FALSE;
1603 if(
ctx->target_version >=
NV2) {
1604 sprintf(outregstr,
"-|%s%s|", regstr, swzstr);
1607 sprintf(outregstr,
"-T%c%s",
'A' + tmpreg, swzstr);
1609 insert_line =
FALSE;
1612 sprintf(outregstr,
"%s%s", regstr, swzstr);
1613 insert_line =
FALSE;
1618 sprintf(outregstr,
"T%c%s",
'A' + tmpreg, swzstr);
1625 DWORD sampler_code =
dst->reg.idx[0].offset;
1627 char src_name[2][50];
1666 FIXME(
"Unknown modifier %u\n",
mod);
1675 char src_name[3][50];
1677 ins->
ctx->reg_maps->shader_version.minor);
1699 dst_name, src_name[1], src_name[2]);
1708 char src_name[3][50];
1718 dst_name, src_name[0], src_name[2], src_name[1]);
1728 char src_name[3][50];
1735 if(
ctx->target_version >=
NV3)
1740 dst_name, src_name[0], src_name[1], src_name[2]);
1742 else if(
ctx->target_version >=
NV2)
1761 dst_name, src_name[2], src_name[0], src_name[1]);
1781 char arguments[256], dst_str[50];
1812 arguments[0] =
'\0';
1819 strcat(arguments, operand);
1828 return ((
swizzle >> 2 * component) & 0x3) * 0x55;
1842 char src0_param[256];
1850 if(
ctx->target_version >= NV2) {
1886 src0_param[0] =
'\0';
1908 if (
ctx->ps_post_process &&
shader->u.ps.color0_mov)
1932 if (ins->
ctx->reg_maps->shader_version.major >= 2)
1934 const char *kilsrc =
"TA";
1948 char x =
'0',
y =
'0',
z =
'0',
w =
'0';
1953 shader_addline(
buffer,
"SWZ TA, %s, %c, %c, %c, %c;\n", reg_dest,
x,
y,
z,
w);
1965 if (ins->
ctx->reg_maps->shader_version.minor <= 3)
1966 sprintf(reg_dest,
"fragment.texcoord[%u]",
dst->reg.idx[0].offset);
1979 ins->
ctx->reg_maps->shader_version.minor);
1984 DWORD reg_sampler_code;
1994 reg_sampler_code =
dst->reg.idx[0].offset;
1996 reg_sampler_code = ins->
src[1].reg.idx[0].offset;
2001 sprintf(reg_coord,
"fragment.texcoord[%u]", reg_sampler_code);
2024 swizzle_coord =
TRUE;
2032 swizzle_coord =
TRUE;
2058 ins->
ctx->reg_maps->shader_version.minor);
2081 DWORD reg1 = ins->
dst[0].reg.idx[0].offset;
2103 DWORD reg1 = ins->
dst[0].reg.idx[0].offset;
2117 DWORD reg1 = ins->
dst[0].reg.idx[0].offset;
2132 char reg_coord[40], dst_reg[50], src_reg[50];
2133 DWORD reg_dest_code;
2138 reg_dest_code =
dst->reg.idx[0].offset;
2141 sprintf(reg_coord,
"fragment.texcoord[%u]", reg_dest_code);
2177 src_reg, reg_dest_code, reg_dest_code);
2186 char src0_name[50], dst_name[50];
2194 tmp_reg.
idx[0].offset =
reg + 1;
2225 char src0_name[50], dst_name[50];
2250 char src0_name[50], dst_name[50];
2382 DWORD sampler_idx = ins->
dst[0].reg.idx[0].offset;
2415 char dst_str[50], dst_name[50];
2435 char src0[50], dst_name[50];
2459 int nComponents = 0;
2464 memset(&tmp_ins, 0,
sizeof(tmp_ins));
2469 tmp_ins.
dst = &tmp_dst;
2471 tmp_ins.
src = tmp_src;
2500 tmp_dst = ins->
dst[0];
2501 tmp_src[0] = ins->
src[0];
2502 tmp_src[1] = ins->
src[1];
2503 for (
i = 0;
i < nComponents; ++
i)
2507 ++tmp_src[1].
reg.idx[0].offset;
2531 FIXME(
"Unknown modifier %u\n",
mod);
2550 if (ins->
ctx->reg_maps->shader_version.major < 2)
2644 char src_name[3][50];
2659 dst_name, src_name[0], src_name[2]);
2672 char src_name0[50], src_name1[50], src_name2[50];
2780 if(
ctx->target_version >=
NV2) {
2797 if(
strstr(src_name,
"TA"))
2831 char src0[50], src1[50],
dst[50];
2978 ERR(
"Could not find loop for break\n");
3009 FIXME(
"Unrecognized operator %#x.\n",
op);
3025 FIXME(
"Unrecognized operator %#x.\n",
op);
3134 DWORD sampler_idx = ins->
src[1].reg.idx[0].offset;
3136 char reg_src[3][40];
3152 DWORD sampler_idx = ins->
src[1].reg.idx[0].offset;
3217 if (
args->super.clip_enabled)
3225 else if (
args->clip.boolclip.clip_texcoord)
3227 static const char component[4] = {
'x',
'y',
'z',
'w'};
3228 unsigned int cur_clip = 0;
3231 for (
i = 0;
i < gl_info->
limits.user_clip_distances; ++
i)
3233 if (
args->clip.boolclip.clipplane_mask & (1u <<
i))
3236 component[cur_clip++],
i);
3255 args->clip.boolclip.clip_texcoord - 1);
3333 FIXME_(d3d_shader)(
"Program error at position %d: %s\n\n",
pos,
3337 FIXME_(d3d_shader)(
"\n");
3348 WARN_(d3d_perf)(
"Program exceeds native resource limits.\n");
3355 const char *tmp1,
const char *tmp2,
const char *tmp3,
const char *tmp4,
BOOL condcode)
3415 static const char *
const texcoords[8] =
3417 "fragment.texcoord[0]",
"fragment.texcoord[1]",
"fragment.texcoord[2]",
"fragment.texcoord[3]",
3418 "fragment.texcoord[4]",
"fragment.texcoord[5]",
"fragment.texcoord[6]",
"fragment.texcoord[7]"
3425 switch(
args->super.vp_mode)
3437 for (
i = 0;
i <
shader->input_signature.element_count; ++
i)
3447 priv->
ps_input[
input->register_idx] =
"fragment.color.primary";
3449 priv->
ps_input[
input->register_idx] =
"fragment.color.secondary";
3476 TRACE(
"v%u, semantic %s%u is %s\n",
input->register_idx,
3485 for(
i = 0;
i < 8;
i++)
3489 priv->
ps_input[8] =
"fragment.color.primary";
3490 priv->
ps_input[9] =
"fragment.color.secondary";
3496 const char *fragcolor,
const char *tmp)
3511 DWORD next_local = 0;
3521 unsigned int i, found = 0;
3526 || (
shader->u.ps.color0_mov &&
i ==
shader->u.ps.color0_reg)
3532 if (found == 4)
break;
3560 memset(&priv_ctx, 0,
sizeof(priv_ctx));
3582 want_nv_prog =
TRUE;
3601 ERR(
"The shader requires instructions that are not available in plain GL_ARB_fragment_program\n");
3614 switch (
args->super.fog)
3621 custom_linear_fog =
TRUE;
3657 if (
shader->u.ps.color0_mov)
3664 strcpy(fragcolor,
"TMP_COLOR");
3667 strcpy(fragcolor,
"result.color");
3671 if (
args->super.srgb_correction)
3686 unsigned char bump_const;
3688 if (!(
map & 1))
continue;
3728 control_values[0], control_values[1], control_values[2]);
3768 unsigned char cur_fixup_sampler = 0;
3772 const UINT max_lconsts = gl_info->
limits.arb_ps_local_constants;
3774 fixup->
offset = next_local;
3775 fixup->
super.active = 0;
3779 if (!(
map & (1u <<
i)))
3782 if (fixup->
offset + (cur_fixup_sampler >> 1) < max_lconsts)
3784 fixup->
super.active |= (1u <<
i);
3785 fixup->
super.idx[
i] = cur_fixup_sampler++;
3789 FIXME(
"No free constant found to load NP2 fixup data into shader. "
3790 "Sampling from this texture will probably look wrong.\n");
3795 fixup->
super.num_consts = (cur_fixup_sampler + 1) >> 1;
3796 if (fixup->
super.num_consts) {
3811 if(
args->super.srgb_correction) {
3816 if (custom_linear_fog)
3819 if(
strcmp(fragcolor,
"result.color")) {
3827 TRACE(
"Creating a hw pixel shader, prg=%d\n", retval);
3830 TRACE(
"Created hw pixel shader, prg=%d\n", retval);
3872 return e1->
mask < e2->
mask ? -1 : 1;
3888 if (!
new->elements[
i].semantic_name)
3894 new->elements[
i].semantic_name =
name;
3906 TRACE(
"Found existing signature %u\n", found_sig->
idx);
3907 return found_sig->
idx;
3909 found_sig = heap_alloc_zero(
sizeof(*found_sig));
3912 TRACE(
"New signature stored and assigned number %u\n", found_sig->
idx);
3915 ERR(
"Failed to insert program entry.\n");
3917 return found_sig->
idx;
3925 static const char *
const texcoords[8] =
3927 "result.texcoord[0]",
"result.texcoord[1]",
"result.texcoord[2]",
"result.texcoord[3]",
3928 "result.texcoord[4]",
"result.texcoord[5]",
"result.texcoord[6]",
"result.texcoord[7]"
3933 static const char *
const decl_idx_to_string[
MAX_REG_INPUT] =
3935 "result.texcoord[0]",
"result.texcoord[1]",
"result.texcoord[2]",
"result.texcoord[3]",
3936 "result.texcoord[4]",
"result.texcoord[5]",
"result.texcoord[6]",
"result.texcoord[7]",
3937 "result.color.primary",
"result.color.secondary"
3942 TRACE(
"Pixel shader uses builtin varyings\n");
3944 for(
i = 0;
i < 8;
i++)
3953 for (
i = 0;
i <
shader->output_signature.element_count; ++
i)
4009 TRACE(
"Pixel shader uses declared varyings\n");
4012 for(
i = 0;
i < 8;
i++)
4024 if (!
input->semantic_name)
4035 if (
input->semantic_idx < 8)
4040 if (
input->semantic_idx < 2)
4045 if (!
input->semantic_idx)
4053 if (!
strcmp(decl_idx_to_string[
input->register_idx],
"result.color.primary")
4054 || !
strcmp(decl_idx_to_string[
input->register_idx],
"result.color.secondary"))
4061 for (
i = 0;
i <
shader->output_signature.element_count; ++
i)
4086 if (!
input->semantic_name)
4114 DWORD next_local = 0;
4118 memset(&priv_ctx, 0,
sizeof(priv_ctx));
4176 control_values[0], control_values[1], control_values[2]);
4226 shader_data,
args, reg_maps, gl_info,
buffer);
4233 TRACE(
"Creating a hw vertex shader, prg=%d\n",
ret);
4236 TRACE(
"Created hw vertex shader, prg=%d\n",
ret);
4257 if (!
shader->backend_data)
4261 shader->backend_data = heap_alloc_zero(
sizeof(*shader_data));
4262 shader_data =
shader->backend_data;
4265 if (
shader->reg_maps.shader_version.major < 3)
4274 d3d_info->
limits.ffp_blend_stages - 1);
4278 shader_data =
shader->backend_data;
4290 TRACE(
"No matching GL shader found, compiling a new shader\n");
4296 new_size *
sizeof(*shader_data->
gl_shaders));
4300 new_array = heap_alloc_zero(
sizeof(*shader_data->
gl_shaders));
4305 ERR(
"Out of memory\n");
4318 ERR(
"Failed to initialize shader buffer.\n");
4332 if((stored->
super.swizzle_map & use_map) !=
new->super.swizzle_map)
return FALSE;
4333 if(stored->
super.clip_enabled !=
new->super.clip_enabled)
return FALSE;
4334 if(stored->
super.fog_src !=
new->super.fog_src)
return FALSE;
4338 if(skip_int)
return TRUE;
4354 if (!
shader->backend_data)
4358 shader->backend_data = heap_alloc_zero(
sizeof(*shader_data));
4359 shader_data =
shader->backend_data;
4366 FIXME(
"The difference between the minimum and maximum relative offset is > 127.\n");
4367 FIXME(
"Which this OpenGL implementation does not support. Try using GLSL.\n");
4376 shader_data =
shader->backend_data;
4390 TRACE(
"No matching GL shader found, compiling a new shader\n");
4397 new_size *
sizeof(*shader_data->
gl_shaders));
4401 new_array = heap_alloc_zero(
sizeof(*shader_data->
gl_shaders));
4406 ERR(
"Out of memory\n");
4417 ERR(
"Failed to initialize shader buffer.\n");
4442 args->bools =
shader->reg_maps.local_bool_consts;
4446 if (
state->ps_consts_b[
i])
4447 args->bools |= ( 1u <<
i);
4462 int_skip = ~
shader->reg_maps.integer_constants |
shader->reg_maps.local_int_consts;
4471 if (int_skip & (1u <<
i))
4473 args->loop_ctrl[
i][0] = 0;
4474 args->loop_ctrl[
i][1] = 0;
4475 args->loop_ctrl[
i][2] = 0;
4499 args->clip.boolclip_compare = 0;
4510 args->ps_signature = ~0;
4516 if (
args->clip.boolclip.clip_texcoord)
4524 args->clip.boolclip.bools =
shader->reg_maps.local_bool_consts;
4528 if (
state->vs_consts_b[
i])
4529 args->clip.boolclip.bools |= (1u <<
i);
4535 args->vertex.samplers[3] = 0;
4538 int_skip =
~shader->reg_maps.integer_constants |
shader->reg_maps.local_int_consts;
4548 if (int_skip & (1u <<
i))
4550 args->loop_ctrl[
i][0] = 0;
4551 args->loop_ctrl[
i][1] = 0;
4552 args->loop_ctrl[
i][2] = 0;
4578 TRACE(
"Using pixel shader %p.\n", ps);
4586 checkGLcall(
"glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, priv->current_fprogram_id);");
4593 checkGLcall(
"glEnable(GL_FRAGMENT_PROGRAM_ARB);");
4604 for(
i = 0;
i < 8;
i++)
4613 UINT rt_height =
state->fb->render_targets[0]->height;
4633 checkGLcall(
"glDisable(GL_FRAGMENT_PROGRAM_ARB)");
4646 TRACE(
"Using vertex shader %p\n",
vs);
4653 ps_input_sig =
NULL;
4664 checkGLcall(
"glBindProgramARB(GL_VERTEX_PROGRAM_ARB, priv->current_vprogram_id);");
4682 FIXME(
"vertex color clamp needs to be changed, but extension not supported.\n");
4686 if (
vs->load_local_constsF)
4704 ERR(
"Compute pipeline not supported by the ARB shader backend.\n");
4716 checkGLcall(
"glDisable(GL_FRAGMENT_PROGRAM_ARB)");
4754 if(!shader_data)
return;
4763 checkGLcall(
"GL_EXTCALL(glDeleteProgramsARB(1, &shader_data->gl_shaders[i].prgId))");
4778 if(!shader_data)
return;
4787 checkGLcall(
"GL_EXTCALL(glDeleteProgramsARB(1, &shader_data->gl_shaders[i].prgId))");
4810 void *vertex_priv, *fragment_priv;
4813 if (!(priv = heap_alloc_zero(
sizeof(*priv))))
4818 ERR(
"Failed to initialize vertex pipe.\n");
4825 ERR(
"Failed to initialize fragment pipe.\n");
4843 device->vertex_priv = vertex_priv;
4844 device->fragment_priv = fragment_priv;
4845 device->shader_priv = priv;
4855 for (
i = 0;
i <
sig->sig.element_count; ++
i)
4883 priv =
context->device->shader_priv;
4901 if (gl_info->
limits.arb_vs_native_constants < 96)
4902 vs_consts = gl_info->
limits.arb_vs_float_constants;
4904 vs_consts =
min(gl_info->
limits.arb_vs_float_constants, gl_info->
limits.arb_vs_native_constants);
4909 TRACE(
"Hardware vertex shader version 3.0 enabled (NV_VERTEX_PROGRAM3)\n");
4911 else if (vs_consts >= 256)
4915 TRACE(
"Hardware vertex shader version 2.0 enabled (ARB_PROGRAM)\n");
4920 TRACE(
"Hardware vertex shader version 1.1 enabled (ARB_PROGRAM)\n");
4943 if (gl_info->
limits.arb_ps_native_constants < 24)
4944 ps_consts = gl_info->
limits.arb_ps_float_constants;
4946 ps_consts =
min(gl_info->
limits.arb_ps_float_constants, gl_info->
limits.arb_ps_native_constants);
4951 TRACE(
"Hardware pixel shader version 3.0 enabled (NV_FRAGMENT_PROGRAM2)\n");
4953 else if (ps_consts >= 32)
4957 TRACE(
"Hardware pixel shader version 2.0 enabled (ARB_PROGRAM)\n");
4962 TRACE(
"Hardware pixel shader version 1.4 enabled (ARB_PROGRAM)\n");
4989 char write_mask[20], regstr[50];
5273 ERR(
"Local constant not found\n");
5308 ERR(
"Local constant not found\n");
5309 loop_control->
count = 0;
5310 loop_control->
start = 0;
5311 loop_control->
step = 0;
5344 if (!(rec = heap_alloc_zero(
sizeof(*rec))))
5346 ERR(
"Out of memory\n");
5351 if (!(dst_param =
heap_alloc(
sizeof(*dst_param))))
5353 *dst_param = *
ins->dst;
5354 if (
ins->dst->reg.idx[0].rel_addr)
5356 if (!(rel_addr =
heap_alloc(
sizeof(*rel_addr))))
5358 *rel_addr = *
ins->dst->reg.idx[0].rel_addr;
5359 dst_param->
reg.idx[0].rel_addr = rel_addr;
5361 rec->
ins.dst = dst_param;
5363 if (!(src_param =
heap_calloc(
ins->src_count,
sizeof(*src_param))))
5365 for (
i = 0;
i <
ins->src_count; ++
i)
5367 src_param[
i] =
ins->src[
i];
5368 if (
ins->src[
i].reg.idx[0].rel_addr)
5370 if (!(rel_addr =
heap_alloc(
sizeof(*rel_addr))))
5372 *rel_addr = *
ins->src[
i].reg.idx[0].rel_addr;
5373 src_param[
i].
reg.idx[0].rel_addr = rel_addr;
5376 rec->
ins.src = src_param;
5381 ERR(
"Out of memory\n");
5389 for (
i = 0;
i <
ins->src_count; ++
i)
5406 if (rec_ins->
ins.dst)
5408 heap_free((
void *)rec_ins->
ins.dst->reg.idx[0].rel_addr);
5411 if (rec_ins->
ins.src)
5413 for (
i = 0;
i < rec_ins->
ins.src_count; ++
i)
5579 bool_const = !bool_const;
5580 if (!priv->
muted && !bool_const)
5616 ERR(
"Control frame does not match.\n");
5633 ERR(
"Control frame does not match.\n");
5689#define ARB_FFP_CONST_TFACTOR 0
5690#define ARB_FFP_CONST_COLOR_KEY_LOW ((ARB_FFP_CONST_TFACTOR) + 1)
5691#define ARB_FFP_CONST_COLOR_KEY_HIGH ((ARB_FFP_CONST_COLOR_KEY_LOW) + 1)
5692#define ARB_FFP_CONST_SPECULAR_ENABLE ((ARB_FFP_CONST_COLOR_KEY_HIGH) + 1)
5693#define ARB_FFP_CONST_CONSTANT(i) ((ARB_FFP_CONST_SPECULAR_ENABLE) + 1 + i)
5694#define ARB_FFP_CONST_BUMPMAT(i) ((ARB_FFP_CONST_CONSTANT(7)) + 1 + i)
5695#define ARB_FFP_CONST_LUMINANCE(i) ((ARB_FFP_CONST_BUMPMAT(7)) + 1 + i)
5714 checkGLcall(
"glDisable(GL_FRAGMENT_PROGRAM_ARB)");
5728 else if (!(priv = heap_alloc_zero(
sizeof(*priv))))
5744 checkGLcall(
"glDeleteProgramsARB(1, &entry_arb->shader)");
5819 priv =
device->shader_priv;
5826 checkGLcall(
"glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_TFACTOR, &color.r)");
5847 priv =
device->shader_priv;
5854 checkGLcall(
"glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_CONSTANT(stage), &color.r)");
5874 priv =
device->shader_priv;
5882 col[0] = 1.0f; col[1] = 1.0f;
5883 col[2] = 1.0f; col[3] = 0.0f;
5885 col[0] = 0.0f; col[1] = 0.0f;
5886 col[2] = 0.0f; col[3] = 0.0f;
5889 checkGLcall(
"glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_SPECULAR_ENABLE, col)");
5919 checkGLcall(
"glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_BUMPMAT(stage), &mat[0][0])");
5950 checkGLcall(
"glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_LUMINANCE(stage), param)");
5978 gl_info->
gl_ops.gl.p_glAlphaFunc(glParm,
ref);
6002 priv =
device->shader_priv;
6011 checkGLcall(
"glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY_LOW, &float_key[0].r)");
6013 checkGLcall(
"glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY_HIGH, &float_key[1].r)");
6024 ret =
"fragment.color.primary";
break;
6032 case 0:
ret =
"tex0";
break;
6033 case 1:
ret =
"tex1";
break;
6034 case 2:
ret =
"tex2";
break;
6035 case 3:
ret =
"tex3";
break;
6036 case 4:
ret =
"tex4";
break;
6037 case 5:
ret =
"tex5";
break;
6038 case 6:
ret =
"tex6";
break;
6039 case 7:
ret =
"tex7";
break;
6040 default:
ret =
"unknown texture";
6045 ret =
"tfactor";
break;
6048 ret =
"fragment.color.secondary";
break;
6051 ret =
"tempreg";
break;
6055 case 0:
ret =
"const0";
break;
6056 case 1:
ret =
"const1";
break;
6057 case 2:
ret =
"const2";
break;
6058 case 3:
ret =
"const3";
break;
6059 case 4:
ret =
"const4";
break;
6060 case 5:
ret =
"const5";
break;
6061 case 6:
ret =
"const6";
break;
6062 case 7:
ret =
"const7";
break;
6063 default:
ret =
"unknown constant";
6073 if(argnum == 0)
ret =
"arg0";
6074 if(argnum == 1)
ret =
"arg1";
6075 if(argnum == 2)
ret =
"arg2";
6079 if(argnum == 0)
ret =
"arg0";
6080 if(argnum == 1)
ret =
"arg1";
6081 if(argnum == 2)
ret =
"arg2";
6089 const char *dstmask, *dstreg, *arg0, *
arg1, *
arg2;
6090 unsigned int mul = 1;
6093 else if(
color) dstmask =
".xyz";
6094 else dstmask =
".w";
6097 else dstreg =
"ret";
6207 FIXME(
"Unhandled texture op %08x\n",
op);
6231 return "unexpected_resource_type";
6237 BYTE tex_read = 0, bump_used = 0, luminance_used = 0, constant_used = 0;
6239 unsigned int stage, lowest_disabled_stage;
6243 const char *textype, *instr;
6245 char colorcor_dst[8];
6251 ERR(
"Failed to initialize shader buffer.\n");
6275 tex_read |= 1u << stage;
6277 tempreg_used =
TRUE;
6279 tempreg_used =
TRUE;
6281 tfactor_used =
TRUE;
6283 constant_used |= 1u << stage;
6288 luminance_used |= 1u << stage;
6291 bump_used |= 1u << stage;
6295 tex_read |= 1u << stage;
6299 tfactor_used =
TRUE;
6314 tex_read |= 1u << stage;
6316 tempreg_used =
TRUE;
6318 tfactor_used =
TRUE;
6320 constant_used |= 1u << stage;
6322 lowest_disabled_stage = stage;
6330 custom_linear_fog =
TRUE;
6338 default:
FIXME(
"Unexpected fog setting %d\n",
settings->fog);
6350 if (constant_used & (1u << stage))
6353 if (!(tex_read & (1u << stage)))
6358 if (!(bump_used & (1u << stage)))
6362 if (!(luminance_used & (1u << stage)))
6380 if (lowest_disabled_stage < 7 && settings->emul_clipplanes)
6383 if (tempreg_used ||
settings->sRGB_write)
6389 if (!(tex_read & (1u << stage)))
6400 FIXME(
"Unexpected projection mode %d\n",
settings->op[stage].projected);
6419 shader_addline(&
buffer,
"MUL ret.xyz, ret, fragment.texcoord[%u].w, fragment.texcoord[%u];\n", stage, stage);
6422 shader_addline(&
buffer,
"MAD ret.xyz, ret, fragment.texcoord[%u].z, fragment.texcoord[%u];\n", stage, stage);
6429 instr, stage, stage, textype);
6433 stage - 1, stage - 1, stage - 1);
6440 instr, stage, stage, textype);
6443 instr, stage, stage, stage, textype);
6446 sprintf(colorcor_dst,
"tex%u", stage);
6512 if (
settings->sRGB_write || custom_linear_fog)
6517 if (custom_linear_fog)
6523 shader_addline(&
buffer,
"MAD result.color, fragment.color.secondary, specular_enable, ret;\n");
6565 else if (use_pshader)
6582 if (!(new_desc =
heap_alloc(
sizeof(*new_desc))))
6584 ERR(
"Out of memory\n");
6591 TRACE(
"Allocated fixed function replacement shader descriptor %p\n", new_desc);
6600 checkGLcall(
"glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, desc->shader)");
6618 else if (!
context->last_was_pshader)
6668 if (new_source !=
context->fog_source || fogstart == fogend)
6670 context->fog_source = new_source;
6876#define ARBFP_BLIT_PARAM_SIZE 0
6877#define ARBFP_BLIT_PARAM_COLOR_KEY_LOW 1
6878#define ARBFP_BLIT_PARAM_COLOR_KEY_HIGH 2
6892 return memcmp(ka, kb,
sizeof(*ka));
6906 checkGLcall(
"glDeleteProgramsARB(1, &entry_arb->shader)");
6935 const char *tex, *texinstr =
"TXP";
7023 static const float yv12_coef[]
7024 = {2.0f / 3.0f, 1.0f / 6.0f, (2.0f / 3.0f) + (1.0f / 6.0f), 1.0f / 3.0f};
7172 static const float nv12_coef[]
7173 = {2.0f / 3.0f, 1.0f / 3.0f, 1.0f, 1.0f};
7313 if (
type->use_color_key)
7314 FIXME(
"Implement P8 color keying.\n");
7319 ERR(
"Failed to initialize shader buffer.\n");
7381 static const DWORD black;
7382 FIXME(
"P8 surface loaded without a palette.\n");
7396 char luminance_component;
7398 if (
type->use_color_key)
7399 FIXME(
"Implement YUV color keying.\n");
7404 ERR(
"Failed to initialize shader buffer.\n");
7409 checkGLcall(
"GL_EXTCALL(glGenProgramsARB(1, &shader))");
7411 checkGLcall(
"glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader)");
7463 switch (
type->fixup)
7491 FIXME(
"Unsupported YUV fixup %#x\n",
type->fixup);
7502 shader_addline(&
buffer,
"MAD result.color.x, chroma.x, yuv_coef.x, luminance.%c;\n", luminance_component);
7503 shader_addline(&
buffer,
"MAD temp.x, -chroma.y, yuv_coef.y, luminance.%c;\n", luminance_component);
7505 shader_addline(&
buffer,
"MAD result.color.z, chroma.y, yuv_coef.w, luminance.%c;\n", luminance_component);
7525 ERR(
"Failed to initialize shader buffer.\n");
7539 if (
type->use_color_key)
7556 shader_addline(&
buffer,
"TEX result.color, fragment.texcoord[0], texture[0], %s;\n", tex_target);
7617 ERR(
"Unexpected GL texture type %#x.\n",
texture->target);
7635 FIXME(
"Implement support for sign or swizzle fixups.\n");
7653 FIXME(
"Unsupported complex fixup %#x, not setting a shader\n", fixup);
7665 ERR(
"Out of memory\n");
7667 checkGLcall(
"GL_EXTCALL(glDeleteProgramsARB(1, &shader))");
7669 checkGLcall(
"glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0)");
7681 checkGLcall(
"glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader)");
7684 if (
type.use_color_key)
7701 checkGLcall(
"glDisable(GL_FRAGMENT_PROGRAM_ARB)");
7727 if (!
context->d3d_info->shader_color_key)
7730 TRACE(
"Color keying not supported with converted textures.\n");
7738 TRACE(
"Unsupported blit_op=%d\n", blit_op);
7750 TRACE(
"Checking support for fixup:\n");
7757 TRACE(
"Destination fixups are not supported\n");
7772 WARN(
"Claiming fixup support because of ORM_BACKBUFFER.\n");
7776 TRACE(
"[FAILED]\n");
7791 FIXME(
"Unsupported YUV fixup %#x\n", src_fixup);
7792 TRACE(
"[FAILED]\n");
7812 &dst_texture->
resource, dst_location))
7828 unsigned int src_level = src_sub_resource_idx % src_texture->
level_count;
7860 TRACE(
"Destination surface %p is onscreen.\n", dst_surface);
7865 TRACE(
"Destination surface %p is offscreen.\n", dst_surface);
7891 || (dst_texture->
swapchain && (dst_texture->
swapchain->front_buffer == dst_texture)))
7892 context->gl_info->gl_ops.gl.p_glFlush();
7894 return dst_location;
7898 unsigned int rt_count,
const struct wined3d_fb_state *fb,
unsigned int rect_count,
const RECT *clear_rects,
7932 ERR(
"Failed to allocate blitter.\n");
std::map< E_MODULE, HMODULE > mod
struct mke2fs_defaults settings[]
char * strcat(char *DstString, const char *SrcString)
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static void pshader_hw_texreg2rgb(const struct wined3d_shader_instruction *ins)
static void shader_hw_nrm(const struct wined3d_shader_instruction *ins)
static void shader_arb_load_np2fixup_constants(const struct arb_ps_np2fixup_info *fixup, const struct wined3d_gl_info *gl_info, const struct wined3d_state *state)
static void gen_ffp_instr(struct wined3d_string_buffer *buffer, unsigned int stage, BOOL color, BOOL alpha, DWORD dst, DWORD op, DWORD dw_arg0, DWORD dw_arg1, DWORD dw_arg2)
static void shader_hw_breakc(const struct wined3d_shader_instruction *ins)
static BOOL vs_args_equal(const struct arb_vs_compile_args *stored, const struct arb_vs_compile_args *new, const DWORD use_map, BOOL skip_int)
static void shader_hw_dsy(const struct wined3d_shader_instruction *ins)
static void arbfp_blit_unset(const struct wined3d_gl_info *gl_info)
static BOOL get_bool_const(const struct wined3d_shader_instruction *ins, const struct wined3d_shader *shader, DWORD idx)
static void shader_arb_get_caps(const struct wined3d_gl_info *gl_info, struct shader_caps *caps)
static BOOL gen_yv12_read(struct wined3d_string_buffer *buffer, const struct arbfp_blit_type *type, char *luminance)
static void arbfp_free_blit_shader(struct wine_rb_entry *entry, void *ctx)
static void shader_generate_arb_declarations(const struct wined3d_shader *shader, const struct wined3d_shader_reg_maps *reg_maps, struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, DWORD *num_clipplanes, const struct shader_arb_ctx_priv *ctx)
static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
#define ARB_FFP_CONST_BUMPMAT(i)
static void shader_arb_precompile(void *shader_priv, struct wined3d_shader *shader)
static void shader_arb_select(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
static void shader_arb_get_src_param(const struct wined3d_shader_instruction *ins, const struct wined3d_shader_src_param *src, unsigned int tmpreg, char *outregstr)
static void shader_hw_sincos(const struct wined3d_shader_instruction *ins)
static void fragment_prog_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD sampler_idx, const char *dst_str, const char *coord_reg, WORD flags, const char *dsx, const char *dsy)
static void pop_control_frame(const struct wined3d_shader_instruction *ins)
static void shader_hw_texldd(const struct wined3d_shader_instruction *ins)
static void state_arbfp_fog(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_hw_call(const struct wined3d_shader_instruction *ins)
static DWORD arbfp_get_emul_mask(const struct wined3d_gl_info *gl_info)
const struct wined3d_shader_backend_ops arb_program_shader_backend
static void shader_hw_label(const struct wined3d_shader_instruction *ins)
static BOOL arbfp_blit_supported(enum wined3d_blit_op blit_op, const struct wined3d_context *context, const struct wined3d_resource *src_resource, DWORD src_location, const struct wined3d_resource *dst_resource, DWORD dst_location)
static void pshader_hw_texm3x3vspec(const struct wined3d_shader_instruction *ins)
static const struct StateEntryTemplate arbfp_fragmentstate_template[]
static void shader_arb_get_write_mask(const struct wined3d_shader_instruction *ins, const struct wined3d_shader_dst_param *dst, char *write_mask)
static void shader_hw_endif(const struct wined3d_shader_instruction *ins)
static void state_arb_specularenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_hw_endloop(const struct wined3d_shader_instruction *ins)
static GLuint shader_arb_generate_pshader(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, const struct arb_ps_compile_args *args, struct arb_ps_compiled_shader *compiled)
static BOOL shader_arb_compile(const struct wined3d_gl_info *gl_info, GLenum target, const char *src)
static void pshader_hw_texdepth(const struct wined3d_shader_instruction *ins)
static const char * shader_arb_get_modifier(const struct wined3d_shader_instruction *ins)
static void shader_arb_append_imm_vec4(struct wined3d_string_buffer *buffer, const float *values)
static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, const struct wined3d_gl_info *gl_info)
static void arbfp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, const RECT *draw_rect, DWORD flags, const struct wined3d_color *colour, float depth, DWORD stencil)
static void shader_hw_else(const struct wined3d_shader_instruction *ins)
static BOOL gen_nv12_read(struct wined3d_string_buffer *buffer, const struct arbfp_blit_type *type, char *luminance)
#define ARBFP_BLIT_PARAM_COLOR_KEY_LOW
static void arbfp_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
static void arbfp_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
static const char * arbfp_texture_target(enum wined3d_gl_resource_type type)
static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABLE_SIZE]
#define ARB_FFP_CONST_CONSTANT(i)
static void pshader_hw_cmp(const struct wined3d_shader_instruction *ins)
static void arbfp_add_linear_fog(struct wined3d_string_buffer *buffer, const char *fragcolor, const char *tmp)
static void shader_arb_ps_local_constants(const struct arb_ps_compiled_shader *gl_shader, const struct wined3d_context *context, const struct wined3d_state *state, UINT rt_height)
void wined3d_arbfp_blitter_create(struct wined3d_blitter **next, const struct wined3d_device *device)
static int compare_sig(const struct wined3d_shader_signature *sig1, const struct wined3d_shader_signature *sig2)
#define ARB_FFP_CONST_SPECULAR_ENABLE
static void arbfp_enable(const struct wined3d_gl_info *gl_info, BOOL enable)
static BOOL need_helper_const(const struct arb_vshader_private *shader_data, const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
static void tex_bumpenvlum_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static BOOL shader_arb_color_fixup_supported(struct color_fixup_desc fixup)
static void set_bumpmat_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_arb_get_register_name(const struct wined3d_shader_instruction *ins, const struct wined3d_shader_register *reg, char *register_name, BOOL *is_color)
static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins)
static void gen_color_correction(struct wined3d_string_buffer *buffer, const char *dst, const char *src, const char *one, const char *two, struct color_fixup_desc fixup, struct color_fixup_masks masks)
static void shader_arb_disable(void *shader_priv, struct wined3d_context *context)
static DWORD negate_modifiers(DWORD mod, char *extra_char)
static struct arb_vs_compiled_shader * find_arb_vshader(struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, DWORD use_map, const struct arb_vs_compile_args *args, const struct wined3d_shader_signature *ps_input_sig)
static GLuint gen_p8_shader(const struct wined3d_gl_info *gl_info, const struct arbfp_blit_type *type)
static void pshader_hw_texm3x2depth(const struct wined3d_shader_instruction *ins)
#define ARBFP_BLIT_PARAM_SIZE
static void shader_arb_update_float_vertex_constants(struct wined3d_device *device, UINT start, UINT count)
static void textransform(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void pshader_hw_bem(const struct wined3d_shader_instruction *ins)
static GLuint shader_arb_generate_vshader(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, const struct arb_vs_compile_args *args, struct arb_vs_compiled_shader *compiled, const struct wined3d_shader_signature *ps_input_sig)
static BOOL ffp_clip_emul(const struct wined3d_context *context)
static void shader_hw_break(const struct wined3d_shader_instruction *ins)
static BOOL shader_is_vshader_version(enum wined3d_shader_type type)
static void pshader_hw_texm3x3(const struct wined3d_shader_instruction *ins)
static void shader_hw_rep(const struct wined3d_shader_instruction *ins)
static void record_instruction(struct list *list, const struct wined3d_shader_instruction *ins)
static const char * shader_arb_get_fixup_swizzle(enum fixup_channel_source channel_source)
static void shader_hw_ifc(const struct wined3d_shader_instruction *ins)
static void shader_hw_scalar_op(const struct wined3d_shader_instruction *ins)
static BOOL gen_planar_yuv_read(struct wined3d_string_buffer *buffer, const struct arbfp_blit_type *type, char *luminance)
static BOOL shader_arb_has_ffp_proj_control(void *shader_priv)
static BOOL shader_is_pshader_version(enum wined3d_shader_type type)
static void shader_hw_lrp(const struct wined3d_shader_instruction *ins)
static BOOL need_rel_addr_const(const struct arb_vshader_private *shader_data, const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
static void state_texfactor_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_arb_add_instruction_modifiers(const struct wined3d_shader_instruction *ins)
#define ARB_FFP_CONST_COLOR_KEY_HIGH
static unsigned int reserved_vs_const(const struct arb_vshader_private *shader_data, const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
static unsigned int shader_arb_load_constants_f(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, GLuint target_type, unsigned int max_constants, const struct wined3d_vec4 *constants, char *dirty_consts)
static void free_recorded_instruction(struct list *list)
static void shader_hw_pow(const struct wined3d_shader_instruction *ins)
static BOOL shader_arb_allocate_context_data(struct wined3d_context *context)
static void pshader_hw_texm3x3spec(const struct wined3d_shader_instruction *ins)
static int arbfp_blit_type_compare(const void *key, const struct wine_rb_entry *entry)
const struct fragment_pipeline arbfp_fragment_pipeline
static void init_ps_input(const struct wined3d_shader *shader, const struct arb_ps_compile_args *args, struct shader_arb_ctx_priv *priv)
static void shader_arb_free(struct wined3d_device *device)
static struct color_fixup_masks calc_color_correction(struct color_fixup_desc fixup, DWORD dst_mask)
static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context, struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect, const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter)
static DWORD abs_modifier(DWORD mod, BOOL *need_abs)
static void clone_sig(struct wined3d_shader_signature *new, const struct wined3d_shader_signature *sig)
static void pshader_hw_tex(const struct wined3d_shader_instruction *ins)
static void pshader_hw_dp2add(const struct wined3d_shader_instruction *ins)
static void arbfp_add_sRGB_correction(struct wined3d_string_buffer *buffer, const char *fragcolor, const char *tmp1, const char *tmp2, const char *tmp3, const char *tmp4, BOOL condcode)
static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, struct wined3d_context *context, const struct wined3d_state *state, BOOL usePixelShader, BOOL useVertexShader, BOOL from_shader_select)
static BOOL use_nv_clip(const struct wined3d_gl_info *gl_info)
static struct arb_ps_compiled_shader * find_arb_pshader(struct wined3d_shader *shader, const struct arb_ps_compile_args *args)
static void alpha_test_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static const char * arb_get_helper_value(enum wined3d_shader_type shader, enum arb_helper_value value)
static void shader_arb_free_context_data(struct wined3d_context *context)
static void arbfp_free(struct wined3d_device *device)
static DWORD shader_arb_select_component(DWORD swizzle, DWORD component)
static const char * get_argreg(struct wined3d_string_buffer *buffer, DWORD argnum, unsigned int stage, DWORD arg)
static void * arbfp_alloc(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv)
static void shader_hw_ret(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texm3x2pad(const struct wined3d_shader_instruction *ins)
#define ARB_FFP_CONST_LUMINANCE(i)
static void shader_hw_mov(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texdp3tex(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texcoord(const struct wined3d_shader_instruction *ins)
static void state_tss_constant_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static enum wined3d_shader_rel_op invert_compare(enum wined3d_shader_rel_op op)
static void shader_hw_sgn(const struct wined3d_shader_instruction *ins)
static const struct wined3d_blitter_ops arbfp_blitter_ops
static void vshader_add_footer(struct shader_arb_ctx_priv *priv_ctx, const struct arb_vshader_private *shader_data, const struct arb_vs_compile_args *args, const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer)
static DWORD find_input_signature(struct shader_arb_priv *priv, const struct wined3d_shader_signature *sig)
static void shader_arb_load_constants(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
static void color_key_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static HRESULT shader_arb_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe, const struct fragment_pipeline *fragment_pipe)
static void shader_arb_destroy(struct wined3d_shader *shader)
static const char * get_compare(enum wined3d_shader_rel_op op)
static void arbfp_free_context_data(struct wined3d_context *context)
static void shader_arb_vs_local_constants(const struct arb_vs_compiled_shader *gl_shader, const struct wined3d_context *context, const struct wined3d_state *state)
static void shader_arb_request_a0(const struct wined3d_shader_instruction *ins, const char *src)
#define ARB_FFP_CONST_COLOR_KEY_LOW
static const char *const shift_tab[]
static void find_arb_ps_compile_args(const struct wined3d_state *state, const struct wined3d_context *context, const struct wined3d_shader *shader, struct arb_ps_compile_args *args)
static GLuint arbfp_gen_plain_shader(const struct wined3d_gl_info *gl_info, const struct arbfp_blit_type *type)
static void pshader_hw_texm3x2tex(const struct wined3d_shader_instruction *ins)
static HRESULT arbfp_blit_set(struct wined3d_arbfp_blitter *blitter, struct wined3d_context *context, const struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_color_key *color_key)
static void shader_hw_texldl(const struct wined3d_shader_instruction *ins)
static void shader_hw_loop(const struct wined3d_shader_instruction *ins)
static void init_output_registers(const struct wined3d_shader *shader, const struct wined3d_shader_signature *ps_input_sig, struct shader_arb_ctx_priv *priv_ctx, struct arb_vs_compiled_shader *compiled)
static void find_arb_vs_compile_args(const struct wined3d_state *state, const struct wined3d_context *context, const struct wined3d_shader *shader, struct arb_vs_compile_args *args)
static void release_signature(struct wine_rb_entry *entry, void *context)
static void pshader_hw_texm3x3pad(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texkill(const struct wined3d_shader_instruction *ins)
static void upload_palette(struct wined3d_arbfp_blitter *blitter, const struct wined3d_texture *texture, struct wined3d_context *context)
static GLuint gen_yuv_shader(const struct wined3d_gl_info *gl_info, const struct arbfp_blit_type *type)
static void shader_arb_update_float_pixel_constants(struct wined3d_device *device, UINT start, UINT count)
static const DWORD * find_loop_control_values(const struct wined3d_shader *shader, DWORD idx)
static void get_loop_control_const(const struct wined3d_shader_instruction *ins, const struct wined3d_shader *shader, UINT idx, struct wined3d_shader_loop_control *loop_control)
static int sig_tree_compare(const void *key, const struct wine_rb_entry *entry)
static void shader_arb_get_dst_param(const struct wined3d_shader_instruction *ins, const struct wined3d_shader_dst_param *wined3d_dst, char *str)
static void arbfp_free_ffpshader(struct wine_rb_entry *entry, void *context)
static void pshader_hw_texbem(const struct wined3d_shader_instruction *ins)
static void shader_hw_endrep(const struct wined3d_shader_instruction *ins)
static void shader_arb_get_swizzle(const struct wined3d_shader_src_param *param, BOOL fixup, char *swizzle_str)
static void pshader_hw_texreg2gb(const struct wined3d_shader_instruction *ins)
static void shader_arb_select_compute(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
static void shader_hw_nop(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texreg2ar(const struct wined3d_shader_instruction *ins)
static BOOL arbfp_alloc_context_data(struct wined3d_context *context)
static void shader_arb_init_context_state(struct wined3d_context *context)
#define ARB_FFP_CONST_TFACTOR
static const struct control_frame * find_last_loop(const struct shader_arb_ctx_priv *priv)
static void shader_arb_handle_instruction(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texm3x3tex(const struct wined3d_shader_instruction *ins)
#define ARBFP_BLIT_PARAM_COLOR_KEY_HIGH
static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texdp3(const struct wined3d_shader_instruction *ins)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static WCHAR *(* get_line)(FILE *)
static void list_remove(struct list_entry *entry)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
static const char * tex_type[]
void context_check_fbo_status(const struct wined3d_context *context, GLenum target)
void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer)
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, unsigned int unit)
void context_invalidate_state(struct wined3d_context *context, DWORD state)
void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device)
struct wined3d_context * context_get_current(void)
void context_release(struct wined3d_context *context)
void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location)
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage)
void find_vs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, WORD swizzle_map, struct vs_compile_args *args, const struct wined3d_context *context)
const float wined3d_srgb_const0[]
void find_ps_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, BOOL position_transformed, struct ps_compile_args *args, const struct wined3d_context *context)
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,...)
void pixelshader_update_resource_types(struct wined3d_shader *shader, WORD tex_types)
const char * debug_d3dshaderinstructionhandler(enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx)
const float wined3d_srgb_const1[]
unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_maps *reg_maps, unsigned int max)
HRESULT shader_generate_code(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, void *backend_ctx, const DWORD *start, const DWORD *end)
void state_fogstartend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
void state_fogcolor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
void state_fogdensity(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
GLenum wined3d_gl_compare_func(enum wined3d_cmp_func f)
void state_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *old_ctx)
void draw_textured_quad(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter)
void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect)
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture)
void wined3d_texture_load(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
const struct ffp_frag_desc * find_ffp_frag_shader(const struct wine_rb_tree *fragment_shaders, const struct ffp_frag_settings *settings)
const char * debug_shader_type(enum wined3d_shader_type type)
const char * debug_vec4(const struct wined3d_vec4 *v)
void wined3d_ftoa(float value, char *s)
int wined3d_ffp_frag_program_key_compare(const void *key, const struct wine_rb_entry *entry)
void wined3d_format_get_float_color_key(const struct wined3d_format *format, const struct wined3d_color_key *key, struct wined3d_color *float_colors)
void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *desc)
void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d_state *state, struct ffp_frag_settings *settings, BOOL ignore_textype)
void dump_color_fixup_desc(struct color_fixup_desc fixup)
#define WINE_DECLARE_DEBUG_CHANNEL(x)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static void list_move_tail(struct list_head *list, struct list_head *head)
#define GL_TEXTURE_MIN_FILTER
GLint GLint GLsizei GLsizei GLsizei depth
#define GL_TEXTURE_WRAP_S
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLclampf GLclampf GLclampf alpha
GLint GLint GLint GLint GLint GLint y
#define GL_TEXTURE_ENV_MODE
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
#define GL_TEXTURE_MAG_FILTER
GLAPI void GLAPIENTRY glActiveTexture(GLenum texture)
#define GL_UNSIGNED_INT_8_8_8_8_REV
GLdouble GLdouble GLdouble GLdouble q
#define GL_CLAMP_VERTEX_COLOR_ARB
#define GL_PROGRAM_ERROR_POSITION_ARB
GLenum GLenum GLenum GLenum GLenum scale
GLsizei const GLint * locations
#define GL_PROGRAM_FORMAT_ASCII_ARB
#define GL_PROGRAM_ERROR_STRING_ARB
#define GL_FRAGMENT_PROGRAM_ARB
#define GL_FIXED_ONLY_ARB
GLuint GLuint GLuint GLuint arg1
#define GL_COLOR_ATTACHMENT0
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
#define GL_TEXTURE_CUBE_MAP_ARB
#define GL_DRAW_FRAMEBUFFER
GLboolean GLenum GLenum GLvoid * values
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
#define GL_TEXTURE_RECTANGLE_ARB
GLenum GLenum GLenum input
#define GL_VERTEX_PROGRAM_ARB
GLubyte GLubyte GLubyte GLubyte w
#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB
GLint GLfloat GLint stencil
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 flag
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 const GLfloat const GLdouble const GLfloat GLint GLint GLint j
const struct wined3d_shader_backend_ops glsl_shader_backend
#define sprintf(buf, format,...)
static const WCHAR desc[]
static const char * dst_format
static const BYTE masks[8]
static float(__cdecl *square_half_float)(float x
static const char * target_type(DWORD dwType)
static unsigned __int64 next
static void * heap_calloc(SIZE_T count, SIZE_T size)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
static void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context)
#define WINE_RB_ENTRY_VALUE(element, type, field)
static struct wine_rb_entry * wine_rb_get(const struct wine_rb_tree *tree, const void *key)
static void wine_rb_init(struct wine_rb_tree *tree, wine_rb_compare_func_t compare)
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
unsigned char loop_ctrl[WINED3D_MAX_CONSTS_I][3]
struct ps_compile_args super
unsigned char numbumpenvmatconsts
struct arb_ps_np2fixup_info np2fixup_info
struct stb_const_desc bumpenvmatconst[MAX_TEXTURES]
UINT int_consts[WINED3D_MAX_CONSTS_I]
struct stb_const_desc luminanceconst[MAX_TEXTURES]
struct ps_np2fixup_info super
DWORD clipplane_emulation
struct arb_ps_compiled_shader * gl_shaders
DWORD input_signature_idx
union arb_vs_compile_args::@262 clip
unsigned char loop_ctrl[WINED3D_MAX_CONSTS_I][3]
struct vs_compile_args super
unsigned char clipplane_mask
union arb_vs_compile_args::@263 vertex
unsigned char clip_texcoord
struct arb_vs_compile_args::@262::@264 boolclip
UINT int_consts[WINED3D_MAX_CONSTS_I]
struct arb_vs_compiled_shader * gl_shaders
struct wine_rb_entry entry
enum wined3d_gl_resource_type res_type
struct ffp_frag_desc parent
union constant::@230 value[4]
enum control_frame::@260 type
struct wined3d_shader_loop_control loop_control
union control_frame::@261 no
DWORD MaxSimultaneousTextures
DWORD MaxTextureBlendStages
struct wine_rb_entry entry
struct wined3d_shader_signature sig
struct wined3d_shader_instruction ins
const char * ps_input[MAX_REG_INPUT]
const char * vs_output[MAX_REG_OUTPUT]
const char * color_output[2]
unsigned int vs_clipplanes
const struct arb_vs_compiled_shader * compiled_vprog
struct list control_frames
const struct arb_ps_compiled_shader * compiled_fprog
const struct arb_ps_compile_args * cur_ps_args
const struct arb_vs_compile_args * cur_vs_args
struct arb_ps_np2fixup_info * cur_np2fixup_info
enum shader_arb_ctx_priv::@265 target_version
const char * texcrd_output[8]
struct wine_rb_tree signature_tree
BOOL use_arbfp_fixed_func
const struct arb_ps_compiled_shader * compiled_fprog
const struct arb_vs_compiled_shader * compiled_vprog
GLuint current_vprogram_id
char vshader_const_dirty[WINED3D_MAX_VS_CONSTS_F]
unsigned int highest_dirty_vs_const
GLuint current_fprogram_id
BOOL last_vs_color_unclamp
const struct fragment_pipeline * fragment_pipe
BOOL last_ps_const_clamped
char pshader_const_dirty[WINED3D_MAX_PS_CONSTS_F]
struct wine_rb_tree fragment_shaders
const struct wined3d_context * last_context
unsigned int highest_dirty_ps_const
const struct wined3d_vertex_pipe_ops * vertex_pipe
struct wined3d_blitter blitter
struct wine_rb_tree shaders
struct wined3d_blitter * next
DWORD color_space_high_value
DWORD color_space_low_value
const struct wined3d_gl_info * gl_info
struct wined3d_d3d_limits limits
DWORD reserved_arb_constants
BOOL supported[WINED3D_GL_EXT_COUNT]
struct opengl_funcs gl_ops
struct wined3d_gl_limits limits
const struct wined3d_format * format
int offscreen_rendering_mode
BOOL strict_draw_ordering
struct wined3d_shader_register reg
const struct wined3d_shader_src_param * src
const struct wined3d_shader_dst_param * dst
enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx
const struct wined3d_shader_context * ctx
struct wined3d_shader_version shader_version
DWORD texcoord_mask[MAX_REG_TEXCRD]
unsigned int min_rel_offset
unsigned int max_rel_offset
union wined3d_shader_reg_maps::@273 u
struct wined3d_shader_register_index idx[2]
unsigned int register_idx
const char * semantic_name
unsigned int semantic_idx
enum wined3d_component_type component_type
enum wined3d_sysval_semantic sysval_semantic
struct wined3d_shader_signature_element * elements
enum wined3d_shader_src_modifier modifiers
struct wined3d_shader_register reg
struct wined3d_pixel_shader ps
struct wined3d_shader_reg_maps reg_maps
struct wined3d_texture * container
struct wined3d_swapchain * swapchain
struct wined3d_resource resource
#define new(TYPE, numElems)
#define CONTAINING_RECORD(address, type, field)
static HRESULT compile_args(compile_ctx_t *ctx, expression_t *args, unsigned *ret)
#define WINED3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR
#define WINED3DTEXOPCAPS_ADD
#define WINED3DTEXOPCAPS_MODULATECOLOR_ADDALPHA
#define WINED3DTA_SPECULAR
#define WINED3DTEXOPCAPS_BLENDDIFFUSEALPHA
#define WINED3DTA_COMPLEMENT
@ WINED3D_DECL_USAGE_PSIZE
@ WINED3D_DECL_USAGE_POSITION
@ WINED3D_DECL_USAGE_COLOR
@ WINED3D_DECL_USAGE_TEXCOORD
@ WINED3D_RS_TEXTUREFACTOR
@ WINED3D_RS_COLORKEYENABLE
@ WINED3D_RS_SRGBWRITEENABLE
@ WINED3D_RS_FOGTABLEMODE
@ WINED3D_RS_CLIPPLANEENABLE
@ WINED3D_RS_SPECULARENABLE
@ WINED3D_RS_FOGVERTEXMODE
@ WINED3D_RS_ALPHATESTENABLE
#define WINED3DTEXOPCAPS_BUMPENVMAPLUMINANCE
#define WINED3DTEXOPCAPS_BLENDTEXTUREALPHA
#define WINED3DTEXOPCAPS_MODULATE2X
#define WINED3D_RESOURCE_ACCESS_GPU
#define WINED3DTA_SELECTMASK
#define WINED3DTEXOPCAPS_DISABLE
#define WINED3DTEXOPCAPS_SELECTARG1
#define WINED3DTA_TFACTOR
#define WINED3DTEXOPCAPS_SUBTRACT
wined3d_texture_filter_type
@ WINED3D_TSS_BUMPENV_LOFFSET
@ WINED3D_TSS_BUMPENV_MAT11
@ WINED3D_TSS_BUMPENV_MAT10
@ WINED3D_TSS_BUMPENV_MAT01
@ WINED3D_TSS_BUMPENV_LSCALE
@ WINED3D_TSS_BUMPENV_MAT00
@ WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
#define WINED3DTEXOPCAPS_BUMPENVMAP
#define WINED3DTA_CURRENT
#define WINED3DTEXOPCAPS_ADDSIGNED2X
#define WINED3DTEXOPCAPS_MODULATE4X
@ 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 WINED3DTEXOPCAPS_ADDSMOOTH
#define WINED3DTA_ALPHAREPLICATE
#define WINED3DPMISCCAPS_TSSARGTEMP
#define WINED3DTEXOPCAPS_MULTIPLYADD
#define WINED3D_HIGHEST_TEXTURE_STATE
#define WINED3DTEXOPCAPS_BLENDFACTORALPHA
#define WINED3DTA_DIFFUSE
#define WINED3DTEXOPCAPS_ADDSIGNED
#define WINED3DTEXOPCAPS_DOTPRODUCT3
#define WINED3DTA_CONSTANT
#define WINED3DTEXOPCAPS_LERP
#define WINED3DTEXOPCAPS_BLENDTEXTUREALPHAPM
#define WINED3DTEXOPCAPS_SELECTARG2
#define WINED3DTEXOPCAPS_MODULATE
#define WINED3DTA_TEXTURE
#define WINED3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA
#define WINED3DTEXOPCAPS_BLENDCURRENTALPHA
#define WINED3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR
@ NV_FRAGMENT_PROGRAM_OPTION
@ WINED3D_GL_LEGACY_CONTEXT
@ NV_VERTEX_PROGRAM2_OPTION
@ EXT_GPU_PROGRAM_PARAMETERS
static void shader_get_position_fixup(const struct wined3d_context *context, const struct wined3d_state *state, float *position_fixup)
#define WINED3D_SHADER_CONST_PS_BUMP_ENV
#define WINED3DSP_WRITEMASK_ALL
static unsigned int wined3d_texture_get_level_height(const struct wined3d_texture *texture, unsigned int level)
#define WINED3DSP_WRITEMASK_0
@ WINED3D_SHADER_REL_OP_GT
@ WINED3D_SHADER_REL_OP_LE
@ WINED3D_SHADER_REL_OP_GE
@ WINED3D_SHADER_REL_OP_EQ
@ WINED3D_SHADER_REL_OP_LT
@ WINED3D_SHADER_REL_OP_NE
#define MAX_FRAGMENT_SAMPLERS
#define WINED3D_QUIRK_NV_CLIP_BROKEN
#define WINED3DSP_WRITEMASK_3
#define WINED3DSI_TEXLD_BIAS
#define WINED3D_PSARGS_PROJECTED
static unsigned int wined3d_texture_get_level_pow2_height(const struct wined3d_texture *texture, unsigned int level)
#define WINED3D_FRAGMENT_CAP_COLOR_KEY
wined3d_shader_src_modifier
static BOOL use_vs(const struct wined3d_state *state)
#define WINED3D_MAX_PS_CONSTS_F
#define WINED3D_SHADER_CONST_PS_F
static unsigned int surface_get_sub_resource_idx(const struct wined3d_surface *surface)
#define WINED3D_PSARGS_TEXTRANSFORM_SHIFT
@ WINED3DSPDM_MSAMPCENTROID
@ WINED3DSPDM_PARTIALPRECISION
#define WINED3D_MAX_VS_CONSTS_F
static enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)
#define WINED3D_QUIRK_BROKEN_ARB_FOG
static BOOL is_complex_fixup(struct color_fixup_desc fixup)
#define WINED3D_CONST_NUM_UNUSED
wined3d_shader_resource_type
@ WINED3D_SHADER_RESOURCE_TEXTURE_3D
@ WINED3D_SHADER_RESOURCE_TEXTURE_2D
@ WINED3D_SHADER_RESOURCE_TEXTURE_CUBE
@ WINED3D_SHADER_RESOURCE_TEXTURE_1D
static struct wined3d_texture_sub_resource * surface_get_sub_resource(struct wined3d_surface *surface)
#define WINED3D_FRAGMENT_CAP_SRGB_WRITE
static unsigned int wined3d_texture_get_level_pow2_width(const struct wined3d_texture *texture, unsigned int level)
#define WINED3D_SHADER_VERSION(major, minor)
#define WINED3D_SHADER_CAP_SRGB_WRITE
#define WINED3D_SHADER_CONST_PS_NP2_FIXUP
#define GL_EXT_EMUL_EXT_FOG_COORD
#define GL_EXT_EMUL_ARB_MULTITEXTURE
static void wined3d_color_from_d3dcolor(struct wined3d_color *wined3d_color, DWORD d3d_color)
static BOOL is_identity_fixup(struct color_fixup_desc fixup)
#define WINED3D_SHADER_CONST_VS_F
@ WINED3D_GL_RES_TYPE_TEX_3D
@ WINED3D_GL_RES_TYPE_TEX_CUBE
@ WINED3D_GL_RES_TYPE_TEX_2D
@ WINED3D_GL_RES_TYPE_TEX_RECT
@ WINED3D_GL_RES_TYPE_TEX_1D
#define WINED3D_LOCATION_TEXTURE_RGB
#define WINED3D_FRAGMENT_CAP_PROJ_CONTROL
#define WINED3DSP_NOSWIZZLE
#define WINED3DSI_TEXLD_PROJECT
static BOOL shader_constant_is_local(const struct wined3d_shader *shader, DWORD reg)
void(* SHADER_HANDLER)(const struct wined3d_shader_instruction *)
static DWORD wined3d_extract_bits(const DWORD *bitstream, unsigned int offset, unsigned int count)
#define WINED3D_MAX_CONSTS_B
#define WINED3D_LOCATION_DRAWABLE
@ WINED3D_SHADER_TYPE_HULL
@ WINED3D_SHADER_TYPE_PIXEL
@ WINED3D_SHADER_TYPE_GEOMETRY
@ WINED3D_SHADER_TYPE_DOMAIN
@ WINED3D_SHADER_TYPE_COMPUTE
@ WINED3D_SHADER_TYPE_VERTEX
static BOOL use_ps(const struct wined3d_state *state)
#define WINED3D_QUIRK_SET_TEXCOORD_W
#define STATE_TEXTURESTAGE(stage, num)
#define WINED3D_SHADER_CAP_VS_CLIPPING
#define WINED3D_MAX_CONSTS_I
#define WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT
@ WINED3D_FFP_PS_FOG_EXP2
@ WINED3D_FFP_PS_FOG_LINEAR
#define WINED3DFMT_FLAG_STENCIL
#define WINED3DFMT_FLAG_COMPRESSED
#define WINED3DFMT_FLAG_DEPTH
static BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
#define STATE_FRAMEBUFFER
static unsigned int wined3d_popcount(unsigned int x)
@ WINED3D_BLIT_OP_COLOR_BLIT_CKEY
@ WINED3D_BLIT_OP_RAW_BLIT
@ WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST
@ WINED3D_BLIT_OP_DEPTH_BLIT
@ WINED3D_BLIT_OP_COLOR_BLIT
#define WINED3DSP_WRITEMASK_2
#define WINED3DSP_WRITEMASK_1