47#define WINED3D_GLSL_SAMPLE_PROJECTED 0x01
48#define WINED3D_GLSL_SAMPLE_LOD 0x02
49#define WINED3D_GLSL_SAMPLE_GRAD 0x04
50#define WINED3D_GLSL_SAMPLE_LOAD 0x08
51#define WINED3D_GLSL_SAMPLE_OFFSET 0x10
351#define WINED3D_TO_STR(u) case u: return #u
387 FIXME(
"Unhandled shader type %#x.\n",
type);
428 ERR(
"Invalid vector size %u.\n",
size);
449 if (!*
p)
return NULL;
492 WARN(
"Info log received from GLSL shader #%u:\n",
id);
497 FIXME(
"Info log received from GLSL shader #%u:\n",
id);
527 GLint i, shader_count, source_size = -1;
534 ERR(
"Failed to allocate shader array memory.\n");
539 for (
i = 0;
i < shader_count; ++
i)
546 if (source_size < tmp)
550 if (!(
source = heap_alloc_zero(tmp)))
552 ERR(
"Failed to allocate %d bytes for shader source.\n", tmp);
563 FIXME(
" GL_COMPILE_STATUS: %d.\n", tmp);
627 block_idx =
GL_EXTCALL(glGetUniformBlockIndex(program_id,
name->buffer));
640 unsigned int i, mapped_unit;
646 name_loc =
GL_EXTCALL(glGetUniformLocation(program_id, sampler_name->
buffer));
650 mapped_unit = tex_unit_map ? tex_unit_map[
base +
i] :
base +
i;
653 ERR(
"Trying to load sampler %s on unsupported unit %u.\n", sampler_name->
buffer, mapped_unit);
657 TRACE(
"Loading sampler %s on unit %u.\n", sampler_name->
buffer, mapped_unit);
658 GL_EXTCALL(glUniform1i(name_loc, mapped_unit));
667 const DWORD *tex_unit_map;
671 if (sampler_idx >=
count)
674 return base + sampler_idx;
675 return tex_unit_map[
base + sampler_idx];
680 unsigned int sampler_idx)
686 ERR(
"Unmapped sampler %u.\n", sampler_idx);
695 const DWORD *tex_unit_map;
720 icb_location =
GL_EXTCALL(glGetUniformLocation(program_id, icb_name->
buffer));
751 TRACE(
"Loading image %s on unit %u.\n",
name->buffer,
i);
786 *strings_length +=
buffer->content_size + 1;
791 unsigned int *varying_count,
char **
strings,
unsigned int *strings_length,
810 char *
strings,
unsigned int *strings_length,
GLenum buffer_mode)
815 highest_output_slot = 0;
824 highest_output_slot =
max(highest_output_slot,
e->output_slot);
825 if (
e->output_slot != buffer_idx)
830 FIXME(
"Unhandled stream %u.\n",
e->stream_idx);
843 if (
e->component_idx ||
e->component_count != 4)
847 FIXME(
"Unsupported component range %u-%u.\n",
e->component_idx,
e->component_count);
854 e->register_idx,
e->component_idx,
e->component_idx +
e->component_count - 1);
864 if (buffer_idx < so_desc->buffer_stride_count
865 && stride < so_desc->buffer_strides[buffer_idx] / 4)
872 if (highest_output_slot <= buffer_idx)
883 *varying_count =
count;
914 FIXME(
"ARB_transform_feedback3 is needed for stream output gaps.\n");
917 ++element_count[so_desc->
elements[
i].output_slot];
929 if (element_count[
i] != 1)
934 if (element_count[
i])
936 FIXME(
"Only single element per buffer is allowed in separate mode.\n");
949 ERR(
"Out of memory.\n");
955 ERR(
"Out of memory.\n");
976 unsigned int heap_idx = 1;
979 if (
heap->entries[heap_idx].version <=
version)
return;
981 idx =
heap->entries[heap_idx].idx;
982 if (constant_locations[
idx] != -1)
986 while (stack_idx >= 0)
989 switch(
stack[stack_idx])
993 unsigned int left_idx = heap_idx << 1;
994 if (left_idx < heap->
size &&
heap->entries[left_idx].version >
version)
997 idx =
heap->entries[heap_idx].idx;
998 if (constant_locations[
idx] != -1)
1014 unsigned int right_idx = (heap_idx << 1) + 1;
1015 if (right_idx < heap->
size &&
heap->entries[right_idx].version >
version)
1017 heap_idx = right_idx;
1018 idx =
heap->entries[heap_idx].idx;
1019 if (constant_locations[
idx] != -1)
1052 clamped_constant[0] =
data->x < -1.0f ? -1.0f :
data->x > 1.0f ? 1.0f :
data->x;
1053 clamped_constant[1] =
data->y < -1.0f ? -1.0f :
data->y > 1.0f ? 1.0f :
data->y;
1054 clamped_constant[2] =
data->z < -1.0f ? -1.0f :
data->z > 1.0f ? 1.0f :
data->z;
1055 clamped_constant[3] =
data->w < -1.0f ? -1.0f :
data->w > 1.0f ? 1.0f :
data->w;
1066 unsigned int heap_idx = 1;
1069 if (
heap->entries[heap_idx].version <=
version)
return;
1071 idx =
heap->entries[heap_idx].idx;
1075 while (stack_idx >= 0)
1078 switch(
stack[stack_idx])
1082 unsigned int left_idx = heap_idx << 1;
1083 if (left_idx < heap->
size &&
heap->entries[left_idx].version >
version)
1085 heap_idx = left_idx;
1086 idx =
heap->entries[heap_idx].idx;
1097 unsigned int right_idx = (heap_idx << 1) + 1;
1098 if (right_idx < heap->
size &&
heap->entries[right_idx].version >
version)
1100 heap_idx = right_idx;
1101 idx =
heap->entries[heap_idx].idx;
1127 if (
shader->reg_maps.shader_version.major == 1
1133 if (!
shader->load_local_constsF)
1135 TRACE(
"No need to load local float constants for this shader.\n");
1154 for (
i = 0; constants_set; constants_set >>= 1, ++
i)
1156 if (!(constants_set & 1))
continue;
1167 unsigned int idx = lconst->
idx;
1184 for (
i = 0; constants_set; constants_set >>= 1, ++
i)
1186 if (!(constants_set & 1))
continue;
1196 unsigned int idx = lconst->
idx;
1222 for (
i = 0; fixup; fixup >>= 1, ++
i)
1229 ERR(
"Nonexistent texture is flagged for NP2 texcoord fixup.\n");
1248 if (
prog->vs.texture_matrix_location[tex] == -1)
1263 GL_EXTCALL(glUniform4fv(
prog->vs.material_specular_location, 1, &
state->material.specular.r));
1268 static const float black[] = {0.0f, 0.0f, 0.0f, 0.0f};
1270 GL_EXTCALL(glUniform4fv(
prog->vs.material_specular_location, 1, black));
1272 GL_EXTCALL(glUniform4fv(
prog->vs.material_ambient_location, 1, &
state->material.ambient.r));
1273 GL_EXTCALL(glUniform4fv(
prog->vs.material_diffuse_location, 1, &
state->material.diffuse.r));
1274 GL_EXTCALL(glUniform4fv(
prog->vs.material_emissive_location, 1, &
state->material.emissive.r));
1294 temp.x = (src1->
x * src2->
_11) + (src1->
y * src2->
_21) + (src1->
z * src2->
_31) + (src1->
w * src2->
_41);
1295 temp.y = (src1->
x * src2->
_12) + (src1->
y * src2->
_22) + (src1->
z * src2->
_32) + (src1->
w * src2->
_42);
1296 temp.z = (src1->
x * src2->
_13) + (src1->
y * src2->
_23) + (src1->
z * src2->
_33) + (src1->
w * src2->
_43);
1297 temp.w = (src1->
x * src2->
_14) + (src1->
y * src2->
_24) + (src1->
z * src2->
_34) + (src1->
w * src2->
_44);
1375 GL_EXTCALL(glUniform1f(
prog->vs.pointsize_c_att_location, att[0]));
1377 GL_EXTCALL(glUniform1f(
prog->vs.pointsize_l_att_location, att[1]));
1379 GL_EXTCALL(glUniform1f(
prog->vs.pointsize_q_att_location, att[2]));
1398 GL_EXTCALL(glUniform1f(
prog->ps.fog_density_location, tmpvalue.f));
1449 for (
i = 0;
i < 3; ++
i)
1450 for (
j = 0;
j < 3; ++
j)
1463 float position_fixup[4];
1476 update_mask =
context->constant_update_mask &
prog->constant_update_mask;
1484 prog->vs.uniform_i_locations, vshader->
reg_maps.integer_constants);
1488 vshader->
reg_maps.boolean_constants);
1492 for (
i = 0;
i < gl_info->
limits.user_clip_distances; ++
i)
1503 GL_EXTCALL(glUniform4fv(
prog->gs.pos_fixup_location, 1, position_fixup));
1505 GL_EXTCALL(glUniform4fv(
prog->ds.pos_fixup_location, 1, position_fixup));
1507 GL_EXTCALL(glUniform4fv(
prog->vs.pos_fixup_location, 1, position_fixup));
1530 if (
prog->vs.modelview_matrix_location[
i] == -1)
1565 unsigned int point_idx, spot_idx, directional_idx, parallel_point_idx;
1566 DWORD point_count = 0;
1567 DWORD spot_count = 0;
1568 DWORD directional_count = 0;
1569 DWORD parallel_point_count = 0;
1576 switch (
state->lights[
i]->OriginalParms.type)
1585 ++directional_count;
1588 ++parallel_point_count;
1591 FIXME(
"Unhandled light type %#x.\n",
state->lights[
i]->OriginalParms.type);
1596 spot_idx = point_idx + point_count;
1597 directional_idx = spot_idx + spot_count;
1598 parallel_point_idx = directional_idx + directional_count;
1618 idx = directional_idx++;
1621 idx = parallel_point_idx++;
1637 prog->ps.uniform_i_locations, pshader->
reg_maps.integer_constants);
1641 pshader->
reg_maps.boolean_constants);
1647 if (
prog->ps.bumpenv_mat_location[
i] == -1)
1653 if (
prog->ps.bumpenv_lum_scale_location[
i] != -1)
1671 context->render_offscreen ? 1.0f : -1.0f,
1676 GL_EXTCALL(glUniform4fv(
prog->ps.ycorrection_location, 1, &correction_params.
x));
1688 if (
prog->ps.tex_factor_location != -1)
1695 GL_EXTCALL(glUniform4f(
prog->ps.specular_enable_location, 1.0f, 1.0f, 1.0f, 0.0f));
1697 GL_EXTCALL(glUniform4f(
prog->ps.specular_enable_location, 0.0f, 0.0f, 0.0f, 0.0f));
1701 if (
prog->ps.tss_constant_location[
i] == -1)
1724 TRACE(
"Max constant version reached, resetting to 0.\n");
1737 unsigned int *positions =
heap->positions;
1738 unsigned int heap_idx, parent_idx;
1742 heap_idx =
heap->size++;
1747 heap_idx = positions[
idx];
1750 while (heap_idx > 1)
1752 parent_idx = heap_idx >> 1;
1754 if (new_version <= entries[parent_idx].
version)
break;
1756 entries[heap_idx] = entries[parent_idx];
1757 positions[entries[parent_idx].
idx] = heap_idx;
1758 heap_idx = parent_idx;
1761 entries[heap_idx].
version = new_version;
1762 entries[heap_idx].
idx =
idx;
1763 positions[
idx] = heap_idx;
1792 unsigned int ret = gl_info->
limits.glsl_varyings / 4;
1794 if(shader_major > 3)
return ret;
1879 return "noperspective";
1881 FIXME(
"Unhandled interpolation mode %#x.\n",
mode);
1889 const DWORD *packed_interpolation_mode,
unsigned int register_idx)
1897 const DWORD *interpolation_mode,
BOOL unroll)
1907 for (
i = 0;
i < element_count; ++
i)
1921 declare_in_varying(gl_info,
buffer,
FALSE,
"vec4 ps_link[%u];\n", element_count);
1927 const DWORD *interpolation_mode)
1934 if (rasterizer_setup)
1937 for (
i = 0;
i < element_count; ++
i)
1939 const char *interpolation_qualifiers =
"";
1956 declare_out_varying(gl_info,
buffer,
FALSE,
"vec4 ps_link[%u];\n", element_count);
1962 switch (primitive_type)
1971 return "line_strip";
1977 return "triangle_strip";
1980 return "lines_adjacency";
1983 return "triangles_adjacency";
1999 return input_reg_used & (1u <<
idx);
2010 return input_reg_used & (1u <<
input->register_idx);
2016 const struct ps_compile_args *ps_args,
unsigned int resource_idx,
unsigned int sampler_idx)
2021 return shader->reg_maps.sampler_comparison_mode & (1u << sampler_idx);
2027 const struct wined3d_gl_info *gl_info,
const char *vector_type,
const char *scalar_type,
2039 unsigned int index =
e->register_idx;
2054 FIXME(
"Unhandled sysval semantic %#x.\n",
e->sysval_semantic);
2059 switch (
e->component_type)
2069 FIXME(
"Unhandled type %#x.\n",
e->component_type);
2088 unsigned int uniform_block_base, uniform_block_count;
2103 if (
shader->limits->constant_float > 0)
2105 unsigned max_constantsF;
2127 max_constantsF = gl_info->
limits.glsl_ps_float_constants;
2143 max_constantsF = gl_info->
limits.glsl_vs_float_constants - 3;
2145 max_constantsF -= gl_info->
limits.user_clip_distances;
2155 if (max_constantsF < shader->limits->constant_float)
2157 static unsigned int once;
2160 ERR_(winediag)(
"The hardware does not support enough uniform components to run this shader,"
2161 " it may not render correctly.\n");
2163 WARN(
"The hardware does not support enough uniform components to run this shader.\n");
2168 max_constantsF = gl_info->
limits.glsl_vs_float_constants;
2171 max_constantsF =
min(
shader->limits->constant_float, max_constantsF);
2190 &uniform_block_base, &uniform_block_count);
2207 const char *sampler_type_prefix, *sampler_type;
2208 BOOL shadow_sampler, tex_rect;
2214 ERR(
"Invalid resource index %u.\n",
entry->resource_idx);
2223 sampler_type_prefix =
"";
2227 sampler_type_prefix =
"i";
2231 sampler_type_prefix =
"u";
2235 sampler_type_prefix =
"";
2236 ERR(
"Unhandled resource data type %#x.\n", reg_maps->
resource_info[
i].data_type);
2244 sampler_type =
"samplerBuffer";
2249 sampler_type =
"sampler1DShadow";
2251 sampler_type =
"sampler1D";
2261 sampler_type =
"sampler2DRectShadow";
2263 sampler_type =
"sampler2DShadow";
2268 sampler_type =
"sampler2DRect";
2270 sampler_type =
"sampler2D";
2276 FIXME(
"Unsupported 3D shadow sampler.\n");
2277 sampler_type =
"sampler3D";
2282 sampler_type =
"samplerCubeShadow";
2284 sampler_type =
"samplerCube";
2289 sampler_type =
"sampler1DArrayShadow";
2291 sampler_type =
"sampler1DArray";
2296 sampler_type =
"sampler2DArrayShadow";
2298 sampler_type =
"sampler2DArray";
2303 sampler_type =
"samplerCubeArrayShadow";
2305 sampler_type =
"samplerCubeArray";
2309 sampler_type =
"sampler2DMS";
2313 sampler_type =
"sampler2DMSArray";
2317 sampler_type =
"unsupported_sampler";
2325 sampler_type_prefix, sampler_type,
prefix,
entry->bind_idx);
2331 const char *image_type_prefix, *image_type, *read_format;
2341 image_type_prefix =
"";
2342 read_format =
"r32f";
2346 image_type_prefix =
"i";
2347 read_format =
"r32i";
2351 image_type_prefix =
"u";
2352 read_format =
"r32ui";
2356 image_type_prefix =
"";
2365 image_type =
"imageBuffer";
2369 image_type =
"image2D";
2373 image_type =
"image3D";
2377 image_type =
"image2DArray";
2381 image_type =
"unsupported_image";
2390 read_format, image_type_prefix, image_type,
prefix,
i);
2393 image_type_prefix, image_type,
prefix,
i);
2407 if (
shader->limits->packed_output)
2447 if (!
shader->load_local_constsF)
2484 const char *in_reg,
const char *in_regswizzle,
char *out_str)
2486 switch (src_modifier)
2491 sprintf(out_str,
"%s%s", in_reg, in_regswizzle);
2494 sprintf(out_str,
"-%s%s", in_reg, in_regswizzle);
2497 sprintf(out_str,
"!%s%s", in_reg, in_regswizzle);
2500 sprintf(out_str,
"(%s%s - vec4(0.5)%s)", in_reg, in_regswizzle, in_regswizzle);
2503 sprintf(out_str,
"-(%s%s - vec4(0.5)%s)", in_reg, in_regswizzle, in_regswizzle);
2506 sprintf(out_str,
"(2.0 * (%s%s - 0.5))", in_reg, in_regswizzle);
2509 sprintf(out_str,
"-(2.0 * (%s%s - 0.5))", in_reg, in_regswizzle);
2512 sprintf(out_str,
"(1.0 - %s%s)", in_reg, in_regswizzle);
2515 sprintf(out_str,
"(2.0 * %s%s)", in_reg, in_regswizzle);
2518 sprintf(out_str,
"-(2.0 * %s%s)", in_reg, in_regswizzle);
2521 sprintf(out_str,
"abs(%s%s)", in_reg, in_regswizzle);
2524 sprintf(out_str,
"-abs(%s%s)", in_reg, in_regswizzle);
2527 FIXME(
"Unhandled modifier %u\n", src_modifier);
2528 sprintf(out_str,
"%s%s", in_reg, in_regswizzle);
2538 sprintf(register_name,
"%s", glsl_variable);
2540 sprintf(register_name,
"ivec2(%s, 0)", glsl_variable);
2550 static const char *
const hwrastout_reg_names[] = {
"vs_out[10]",
"vs_out[11].x",
"vs_out[11].y"};
2558 char imm_str[4][17];
2560 if (
reg->idx[0].offset != ~0
U &&
reg->idx[0].rel_addr)
2562 if (
reg->idx[1].offset != ~0
U &&
reg->idx[1].rel_addr)
2569 sprintf(register_name,
"R%u",
reg->idx[0].offset);
2578 if (
reg->idx[0].rel_addr)
2579 FIXME(
"VS3 input registers relative addressing.\n");
2582 if (
reg->idx[0].rel_addr)
2584 sprintf(register_name,
"%s_in[%s + %u]",
2598 if (
reg->idx[0].rel_addr)
2600 if (
reg->idx[1].rel_addr)
2601 sprintf(register_name,
"shader_in[%s + %u].reg[%s + %u]",
2605 sprintf(register_name,
"shader_in[%s + %u].reg[%u]",
2607 reg->idx[1].offset);
2609 else if (
reg->idx[1].rel_addr)
2610 sprintf(register_name,
"shader_in[%u].reg[%s + %u]",
reg->idx[0].offset,
2613 sprintf(register_name,
"shader_in[%u].reg[%u]",
2614 reg->idx[0].offset,
reg->idx[1].offset);
2624 if (
reg->idx[0].rel_addr)
2631 &&
shader->u.ps.declared_in_count > in_count)
2634 "((%s + %u) > %u ? (%s + %u) > %u ? gl_SecondaryColor : gl_Color : %s_in[%s + %u])",
2646 &&
shader->u.ps.declared_in_count > in_count)
2648 sprintf(register_name,
"((%s) > %u ? (%s) > %u ? gl_SecondaryColor : gl_Color : %s_in[%s])",
2660 if (
idx == in_count)
sprintf(register_name,
"gl_Color");
2661 else if (
idx == in_count + 1)
sprintf(register_name,
"gl_SecondaryColor");
2667 if (!
reg->idx[0].offset)
2668 strcpy(register_name,
"ffp_varying_diffuse");
2670 strcpy(register_name,
"ffp_varying_specular");
2678 if (
reg->idx[0].rel_addr)
2681 sprintf(register_name,
"(%s + %u >= 0 && %s + %u < %u ? %s_c[%s + %u] : vec4(0.0))",
2685 else if (
reg->idx[0].offset)
2710 sprintf(register_name,
"T%u",
reg->idx[0].offset);
2712 sprintf(register_name,
"A%u",
reg->idx[0].offset);
2716 sprintf(register_name,
"aL%u", ins->
ctx->state->current_loop_reg - 1);
2725 if (
reg->idx[0].offset >= gl_info->
limits.buffers)
2726 WARN(
"Write to render target %u, only %d supported.\n",
2727 reg->idx[0].offset, gl_info->
limits.buffers);
2730 reg->idx[0].offset);
2734 sprintf(register_name,
"%s", hwrastout_reg_names[
reg->idx[0].offset]);
2740 sprintf(register_name,
"gl_FragDepth");
2744 if (!
reg->idx[0].offset)
2752 if (
reg->idx[0].rel_addr)
2753 sprintf(register_name,
"%s_out[%s + %u]",
2760 if (!
reg->idx[0].offset)
2763 sprintf(register_name,
"vpos");
2765 else if (
reg->idx[0].offset == 1)
2769 sprintf(register_name,
"(gl_FrontFacing ? 1.0 : -1.0)");
2773 FIXME(
"Unhandled misctype register %u.\n",
reg->idx[0].offset);
2774 sprintf(register_name,
"unrecognized_register");
2779 switch (
reg->immconst_type)
2786 sprintf(register_name,
"uintBitsToFloat(%#xu)",
reg->u.immconst_data[0]);
2791 sprintf(register_name,
"%#x",
reg->u.immconst_data[0]);
2796 sprintf(register_name,
"%#xu",
reg->u.immconst_data[0]);
2799 sprintf(register_name,
"<unhandled data type %#x>", data_type);
2810 sprintf(register_name,
"uintBitsToFloat(uvec4(%#xu, %#xu, %#xu, %#xu))",
2811 reg->u.immconst_data[0],
reg->u.immconst_data[1],
2812 reg->u.immconst_data[2],
reg->u.immconst_data[3]);
2820 sprintf(register_name,
"vec4(%s, %s, %s, %s)",
2821 imm_str[0], imm_str[1], imm_str[2], imm_str[3]);
2825 sprintf(register_name,
"ivec4(%#x, %#x, %#x, %#x)",
2826 reg->u.immconst_data[0],
reg->u.immconst_data[1],
2827 reg->u.immconst_data[2],
reg->u.immconst_data[3]);
2832 sprintf(register_name,
"uvec4(%#xu, %#xu, %#xu, %#xu)",
2833 reg->u.immconst_data[0],
reg->u.immconst_data[1],
2834 reg->u.immconst_data[2],
reg->u.immconst_data[3]);
2837 sprintf(register_name,
"<unhandled data type %#x>", data_type);
2843 FIXME(
"Unhandled immconst type %#x\n",
reg->immconst_type);
2844 sprintf(register_name,
"<unhandled_immconst_type %#x>",
reg->immconst_type);
2849 if (
reg->idx[1].rel_addr)
2850 sprintf(register_name,
"%s_cb%u[%s + %u]",
2857 if (
reg->idx[0].rel_addr)
2865 sprintf(register_name,
"gl_PrimitiveIDIn");
2867 sprintf(register_name,
"gl_PrimitiveID");
2871 if (
reg->idx[1].rel_addr)
2874 sprintf(register_name,
"X%u[%u]",
reg->idx[0].offset,
reg->idx[1].offset);
2879 "int(gl_LocalInvocationIndex)", gl_info);
2885 "gl_InvocationID", gl_info);
2889 sprintf(register_name,
"ivec3(gl_GlobalInvocationID)");
2893 sprintf(register_name,
"ivec3(gl_WorkGroupID)");
2897 sprintf(register_name,
"ivec3(gl_LocalInvocationID)");
2903 "phase_instance_id", gl_info);
2907 sprintf(register_name,
"gl_TessCoord");
2911 if (
reg->idx[0].rel_addr)
2913 if (
reg->idx[1].rel_addr)
2914 sprintf(register_name,
"shader_out[%s + %u].reg[%s + %u]",
2918 sprintf(register_name,
"shader_out[%s + %u].reg[%u]",
2920 reg->idx[1].offset);
2922 else if (
reg->idx[1].rel_addr)
2924 sprintf(register_name,
"shader_out[%u].reg[%s + %u]",
2926 reg->idx[1].offset);
2930 sprintf(register_name,
"shader_out[%u].reg[%u]",
2931 reg->idx[0].offset,
reg->idx[1].offset);
2937 sprintf(register_name,
"hs_out[%u]",
reg->idx[0].offset);
2939 sprintf(register_name,
"vpc[%u]",
reg->idx[0].offset);
2943 FIXME(
"Unhandled register type %#x.\n",
reg->type);
2944 sprintf(register_name,
"unrecognized_register");
2979 unsigned int size = 0;
2990 unsigned int component_idx)
2993 return (
swizzle >> (2 * component_idx)) & 0x3;
3001 const char *swizzle_chars = fixup ?
"zyxw" :
"xyzw";
3005 for (
i = 0;
i < 4; ++
i)
3017 *swizzle_str =
'\0';
3025 if (dst_data_type == src_data_type)
3033 switch (dst_data_type)
3060 FIXME(
"Unhandled cast from %#x to %#x.\n", src_data_type, dst_data_type);
3075 char swizzle_str[6];
3079 swizzle_str[0] =
'\0';
3084 switch (wined3d_src->
reg.type)
3087 param_data_type = data_type;
3129 glsl_dst->
reg_name, &is_color, ins);
3160 FIXME(
"Unhandled data type %#x.\n", data_type);
3184 modifiers = ins->
dst[0].modifiers;
3185 if (!modifiers)
return;
3198 FIXME(
"_centroid modifier not handled\n");
3218 FIXME(
"Unrecognized operator %#x.\n",
op);
3229 unsigned int *
coord_size,
unsigned int *deriv_size)
3250 && priv->
cur_ps_args->np2_fixup & (1u << resource_idx)
3255 const char *
base =
"texture", *
type_part =
"", *suffix =
"";
3258 sample_function->
data_type =
ctx->reg_maps->resource_info[resource_idx].data_type;
3263 ERR(
"Unexpected resource type %#x.\n", resource_type);
3273 switch (resource_type)
3285 grad = legacy_syntax =
TRUE;
3303 FIXME(
"Unhandled resource type %#x.\n", resource_type);
3310 FIXME(
"Unsupported grad function.\n");
3317 if (
flags & ~texel_fetch_flags)
3318 ERR(
"Unexpected flags %#x for texelFetch.\n",
flags & ~texel_fetch_flags);
3320 base =
"texelFetch";
3326 lod ?
"Lod" : grad ?
"Grad" :
"",
offset ?
"Offset" :
"", suffix);
3333 sample_function->
deriv_mask = (1u << deriv_size) - 1;
3348 switch(channel_source)
3351 strcat(arguments,
"0.0");
3355 strcat(arguments,
"1.0");
3379 FIXME(
"Unhandled channel source %#x\n", channel_source);
3380 strcat(arguments,
"undefined");
3384 if (sign_fixup)
strcat(arguments,
" * 2.0 - 1.0");
3390 unsigned int mask_size, remaining;
3391 DWORD fixup_mask = 0;
3392 char arguments[256];
3399 if (!(
mask &= fixup_mask))
3412 arguments[0] =
'\0';
3413 remaining = mask_size;
3417 if (--remaining)
strcat(arguments,
", ");
3422 if (--remaining)
strcat(arguments,
", ");
3427 if (--remaining)
strcat(arguments,
", ");
3432 if (--remaining)
strcat(arguments,
", ");
3453 const char *coord_reg_fmt, ...)
3457 char dst_swizzle[6];
3470 fixup = priv->
cur_ps_args->color_fixup[sampler_bind_idx];
3472 if (priv->
cur_ps_args->np2_fixup & (1u << sampler_bind_idx))
3482 if (sample_function->output_single_component)
3508 idx >> 1, (
idx % 2) ?
"z" :
"x");
3512 idx >> 1, (
idx % 2) ?
"zw" :
"xy");
3515 shader_addline(ins->ctx->buffer,
" * vec3(ps_samplerNP2Fixup[%u].%s, 1.0)",
3516 idx >> 1, (
idx % 2) ?
"zw" :
"xy");
3519 shader_addline(ins->ctx->buffer,
" * vec4(ps_samplerNP2Fixup[%u].%s, 1.0, 1.0)",
3520 idx >> 1, (
idx % 2) ?
"zw" :
"xy");
3524 if (sample_function->emulate_lod)
3527 switch (sample_function->emulate_lod)
3530 if (!
dx)
dx =
"vec2(0.0, 0.0)";
3531 if (!
dy)
dy =
"vec2(0.0, 0.0)";
3535 if (!
dx)
dx =
"vec3(0.0, 0.0, 0.0)";
3536 if (!
dy)
dy =
"vec3(0.0, 0.0, 0.0)";
3548 if (sample_function->offset_size)
3556 if (sample_function->output_single_component)
3614 op =
"<unhandled operator>";
3630 unsigned int mask_size;
3654 op =
"<unhandled operator>";
3677 op =
"<unhandled operator>";
3698 op =
"<unhandled operator>";
3699 ERR(
"Unhandled opcode %s.\n",
3719 FIXME(
"64-bit integer multiplies not implemented.\n");
3788 if (ins->
ctx->reg_maps->shader_version.major == 1
3794 if (mask_size > 1) {
3833 DWORD dst_write_mask, src_write_mask;
3834 unsigned int dst_size;
3880 FIXME(
"Unhandled primitive stream %u.\n",
stream);
3891 DWORD dst_write_mask;
3892 unsigned int dst_size;
3984 ?
"unpackHalf2x16(%s).x);\n" :
"packHalf2x16(vec2(%s, 0.0)));\n";
3987 for (
i = 0;
i < 4; ++
i)
3991 &
dst,
dst.reg.data_type)))
4022 if (ins->
dst[0].reg.idx[0].offset == ins->
src[
i].reg.idx[0].offset
4023 && ins->
dst[0].reg.type == ins->
src[
i].reg.type)
4028 for (
i = 0;
i < 4; ++
i)
4059 unsigned int mask_size;
4086 ins->
ctx->reg_maps->shader_version.minor);
4089 const char *
prefix, *suffix;
4090 unsigned int dst_size;
4091 DWORD dst_write_mask;
4121 prefix =
"inversesqrt(abs(";
4149 if (ins->
ctx->reg_maps->shader_version.major < 2)
4171 const char *vector_constructor,
const char *scalar_constructor)
4175 unsigned int mask_size;
4209 unsigned int mask_size;
4216 if (mask_size > 1) {
4259 unsigned int i,
j,
k;
4269 if (ins->
dst[
i].reg.idx[0].offset == ins->
src[
j].reg.idx[0].offset
4270 && ins->
dst[
i].reg.type == ins->
src[
j].reg.type)
4277 for (
i = 0;
i < 4; ++
i)
4308 const char *condition_prefix, *condition_suffix;
4314 DWORD cmp_channel = 0;
4322 condition_prefix =
"";
4323 condition_suffix =
" >= 0.0";
4327 condition_prefix =
"";
4328 condition_suffix =
" > 0.5";
4332 condition_prefix =
"bool(";
4333 condition_suffix =
")";
4338 condition_prefix =
"<unhandled prefix>";
4339 condition_suffix =
"<unhandled suffix>";
4351 condition_prefix, src0_param.
param_str, condition_suffix,
4361 if ((ins->
src[0].reg.idx[0].offset ==
dst.reg.idx[0].offset
4362 && ins->
src[0].reg.type ==
dst.reg.type)
4363 || (ins->
src[1].reg.idx[0].offset ==
dst.reg.idx[0].offset
4364 && ins->
src[1].reg.type ==
dst.reg.type)
4365 || (ins->
src[2].reg.idx[0].offset ==
dst.reg.idx[0].offset
4366 && ins->
src[2].reg.type ==
dst.reg.type))
4367 temp_destination =
TRUE;
4370 for (
i = 0;
i < 4; ++
i)
4374 for (
j = 0;
j < 4; ++
j)
4382 dst.write_mask = ins->
dst[0].write_mask & write_mask;
4384 if (temp_destination)
4398 condition_prefix, src0_param.
param_str, condition_suffix,
4402 if (temp_destination)
4420 ins->
ctx->reg_maps->shader_version.minor);
4461 int nComponents = 0;
4466 memset(&tmp_ins, 0,
sizeof(tmp_ins));
4471 tmp_ins.
dst = &tmp_dst;
4473 tmp_ins.
src = tmp_src;
4501 tmp_dst = ins->
dst[0];
4502 tmp_src[0] = ins->
src[0];
4503 tmp_src[1] = ins->
src[1];
4504 for (
i = 0;
i < nComponents; ++
i)
4508 ++tmp_src[1].
reg.idx[0].offset;
4582 "vec4(1.0, max(%s, 0.0), %s == 0.0 ? 0.0 : "
4583 "pow(max(0.0, %s) * step(0.0, %s), clamp(%s, -128.0, 128.0)), 1.0)%s);\n",
4629 if (ins->
ctx->reg_maps->shader_version.major < 4)
4650 ERR(
"Write mask should be .x, .y or .xy\n");
4720 if (ins->
ctx->reg_maps->shader_version.major < 4)
4733 if (
constant->idx == ins->
src[1].reg.idx[0].offset)
4744 loop_control.
count = control_values[0];
4745 loop_control.
start = control_values[1];
4746 loop_control.
step = (
int)control_values[2];
4748 if (loop_control.
step > 0)
4751 state->current_loop_depth, loop_control.
start,
4753 state->current_loop_depth, loop_control.
step);
4755 else if (loop_control.
step < 0)
4758 state->current_loop_depth, loop_control.
start,
4760 state->current_loop_depth, loop_control.
step);
4765 state->current_loop_depth, loop_control.
start,
state->current_loop_depth,
4766 state->current_loop_depth, loop_control.
count,
4767 state->current_loop_depth);
4772 shader_addline(
buffer,
"for (tmpInt%u = 0, aL%u = %s.y; tmpInt%u < %s.x; tmpInt%u++, aL%u += %s.z)\n{\n",
4773 state->current_loop_depth,
state->current_loop_reg,
4778 ++
state->current_loop_reg;
4785 ++
state->current_loop_depth;
4796 --
state->current_loop_depth;
4797 --
state->current_loop_reg;
4802 --
state->current_loop_depth;
4819 if (
constant->idx == ins->
src[0].reg.idx[0].offset)
4829 shader_addline(ins->
ctx->buffer,
"for (tmpInt%d = 0; tmpInt%d < %d; tmpInt%d++) {\n",
4830 state->current_loop_depth,
state->current_loop_depth,
4831 control_values[0],
state->current_loop_depth);
4836 shader_addline(ins->
ctx->buffer,
"for (tmpInt%d = 0; tmpInt%d < %s; tmpInt%d++) {\n",
4837 state->current_loop_depth,
state->current_loop_depth,
4841 ++
state->current_loop_depth;
4909 FIXME(
"Unhandled primitive stream %u.\n",
stream);
4958 ins->
ctx->state->in_subroutine =
TRUE;
4979 if (
version->major >= 4 && !ins->
ctx->state->in_subroutine)
4989 ins->
ctx->reg_maps->shader_version.minor);
4991 DWORD sample_flags = 0;
4999 resource_idx = ins->
dst[0].reg.idx[0].offset;
5001 resource_idx = ins->
src[1].reg.idx[0].offset;
5016 FIXME(
"WINED3D_TTFF_PROJECTED with WINED3D_TTFF_COUNT1?\n");
5068 "T%u%s", resource_idx, coord_mask);
5078 shader_glsl_gen_sample_code(ins, resource_idx, &sample_function,
swizzle,
NULL,
NULL,
bias.param_str,
5098 FIXME(
"texldd used, but not supported by hardware. Falling back to regular tex.\n");
5103 sampler_idx = ins->
src[1].reg.idx[0].offset;
5124 sampler_idx = ins->
src[1].reg.idx[0].offset;
5137 WARN(
"Using %s in fragment shader.\n", sample_function.
name->buffer);
5145 unsigned int resource_idx,
unsigned int sampler_idx)
5150 for (
i = 0;
i < sampler_map->
count; ++
i)
5173 unsigned int resource_idx,
stride;
5178 resource_idx = ins->
dst[is_imm_instruction].reg.idx[0].offset;
5184 ERR(
"Invalid TGSM index %u.\n", resource_idx);
5190 stride = reg_maps->
tgsm[resource_idx].stride;
5196 ERR(
"Invalid UAV index %u.\n", resource_idx);
5202 ERR(
"Unexpected resource type %#x.\n", resource_type);
5218 op =
"imageAtomicAnd";
5223 op =
"atomicCompSwap";
5225 op =
"imageAtomicCompSwap";
5232 op =
"imageAtomicAdd";
5239 op =
"imageAtomicMax";
5251 op =
"imageAtomicMin";
5263 op =
"imageAtomicOr";
5270 op =
"imageAtomicMax";
5282 op =
"imageAtomicMin";
5294 op =
"imageAtomicXor";
5298 op =
"atomicExchange";
5300 op =
"imageAtomicExchange";
5322 if (is_imm_instruction)
5340 if (is_imm_instruction)
5353 op =
"atomicCounterIncrement";
5355 op =
"atomicCounterDecrement";
5368 DWORD coord_mask, write_mask;
5369 unsigned int uav_idx;
5370 char dst_swizzle[6];
5372 uav_idx = ins->
src[1].reg.idx[0].offset;
5375 ERR(
"Invalid UAV index %u.\n", uav_idx);
5381 ERR(
"Unexpected resource type %#x.\n", resource_type);
5399 unsigned int i,
swizzle, resource_idx, bind_idx,
stride, src_idx = 0;
5408 resource_idx =
src->reg.idx[0].offset;
5413 ERR(
"Invalid resource index %u.\n", resource_idx);
5418 function =
"texelFetch";
5425 ERR(
"Invalid UAV index %u.\n", resource_idx);
5429 bind_idx = resource_idx;
5430 function =
"imageLoad";
5437 ERR(
"Invalid TGSM index %u.\n", resource_idx);
5440 stride = reg_maps->
tgsm[resource_idx].stride;
5441 bind_idx = resource_idx;
5464 for (
i = 0;
i < 4; ++
i)
5489 unsigned int uav_idx;
5492 uav_idx = ins->
dst[0].reg.idx[0].offset;
5495 ERR(
"Invalid UAV index %u.\n", uav_idx);
5501 ERR(
"Unexpected resource type %#x.\n", resource_type);
5521 unsigned int i, resource_idx,
stride, src_idx = 0;
5526 resource_idx = ins->
dst[0].reg.idx[0].offset;
5532 ERR(
"Invalid TGSM index %u.\n", resource_idx);
5535 stride = reg_maps->
tgsm[resource_idx].stride;
5541 ERR(
"Invalid UAV index %u.\n", resource_idx);
5556 for (
i = 0;
i < 4; ++
i)
5577 unsigned int sync_flags = ins->
flags;
5588 sync_flags &= ~WINED3DSSF_GROUP_SHARED_MEMORY;
5592 FIXME(
"Unhandled sync flags %#x.\n", sync_flags);
5599 unsigned int idx =
reg->idx[0].offset;
5605 ERR(
"Invalid resource index %u.\n",
idx);
5615 ERR(
"Invalid UAV index %u.\n",
idx);
5621 FIXME(
"Unhandled register type %#x.\n",
reg->type);
5630 unsigned int resource_idx;
5631 char dst_swizzle[6];
5639 resource_idx = ins->
src[0].reg.idx[0].offset;
5652 if (resource_info->
stride)
5677 unsigned int resource_idx, bind_idx,
i;
5680 BOOL supports_mipmaps;
5681 char dst_swizzle[6];
5684 dst_data_type = ins->
dst[0].reg.data_type;
5687 else if (ins->
flags)
5691 resource_idx = ins->
src[1].reg.idx[0].offset;
5695 resource_type = ins->
ctx->reg_maps->resource_info[resource_idx].type;
5701 resource_type = ins->
ctx->reg_maps->uav_resource_info[resource_idx].type;
5702 bind_idx = resource_idx;
5707 ERR(
"Unexpected resource type %#x.\n", resource_type);
5731 if (supports_mipmaps)
5738 if (supports_mipmaps)
5747 FIXME(
"textureQueryLevels is not supported, returning 1 level.\n");
5763 unsigned int resource_idx, sampler_idx, sampler_bind_idx;
5771 resource_idx = ins->
src[1].reg.idx[0].offset;
5776 ERR(
"Invalid resource index %u.\n", resource_idx);
5788 shader_glsl_gen_sample_code(ins, sampler_bind_idx, &sample_function, ins->
src[1].swizzle,
5793 shader_glsl_gen_sample_code(ins, sampler_bind_idx, &sample_function, ins->
src[1].swizzle,
5802 const char *lod_param_str =
NULL, *dx_param_str =
NULL, *dy_param_str =
NULL;
5803 struct glsl_src_param coord_param, lod_param, dx_param, dy_param;
5804 unsigned int resource_idx, sampler_idx, sampler_bind_idx;
5815 resource_idx = ins->
src[1].reg.idx[0].offset;
5816 sampler_idx = ins->
src[2].reg.idx[0].offset;
5845 shader_glsl_gen_sample_code(ins, sampler_bind_idx, &sample_function, ins->
src[1].swizzle,
5856 unsigned int coord_size,
const char *coord_param,
const char *ref_param)
5862 char dst_swizzle[6];
5864 WARN(
"Emitting textureGrad() for sample_c_lz.\n");
5868 shader_addline(
buffer,
"vec4(textureGrad%s(%s_sampler%u, vec%u(%s, %s), vec%u(0.0), vec%u(0.0)",
5871 coord_size, coord_param, ref_param, deriv_size, deriv_size);
5883 unsigned int resource_idx, sampler_idx, sampler_bind_idx;
5887 const char *lod_param =
NULL;
5902 resource_idx = ins->
src[1].reg.idx[0].offset;
5903 sampler_idx = ins->
src[2].reg.idx[0].offset;
5928 unsigned int resource_param_idx, resource_idx, sampler_idx, sampler_bind_idx, component_idx;
5936 char dst_swizzle[6];
5941 FIXME(
"OpenGL implementation does not support textureGather.\n");
5949 resource_param_idx =
5951 resource_idx = ins->
src[resource_param_idx].reg.idx[0].offset;
5952 sampler_idx = ins->
src[resource_param_idx + 1].reg.idx[0].offset;
5961 ERR(
"Unexpected resource type %#x.\n", resource_info->
type);
5972 has_offset ?
"Offset" :
"",
prefix, sampler_bind_idx, coord_param.
param_str);
5983 else if (has_offset)
6001 if (!(ins->
ctx->reg_maps->shader_version.major == 1 && ins->
ctx->reg_maps->shader_version.minor == 4))
6007 ins->
dst[0].reg.idx[0].offset, dst_mask);
6013 char dst_swizzle[6];
6043 DWORD sampler_idx = ins->
dst[0].reg.idx[0].offset;
6062 NULL,
"dot(ffp_texcoord[%u].xyz, %s)", sampler_idx, src0_param.
param_str);
6067 NULL,
"vec2(dot(ffp_texcoord[%u].xyz, %s), 0.0)", sampler_idx, src0_param.
param_str);
6072 NULL,
"vec3(dot(ffp_texcoord[%u].xyz, %s), 0.0, 0.0)", sampler_idx, src0_param.
param_str);
6076 FIXME(
"Unexpected mask size %u\n", mask_size);
6087 DWORD dstreg = ins->
dst[0].reg.idx[0].offset;
6090 unsigned int mask_size;
6096 if (mask_size > 1) {
6117 shader_addline(ins->
ctx->buffer,
"gl_FragDepth = clamp((%s.x / min(%s.y, 1.0)), 0.0, 1.0);\n",
6129 DWORD dstreg = ins->
dst[0].reg.idx[0].offset;
6135 shader_addline(ins->
ctx->buffer,
"gl_FragDepth = (tmp0.y == 0.0) ? 1.0 : clamp(tmp0.x / tmp0.y, 0.0, 1.0);\n");
6277 shader_addline(
buffer,
"tmp1.xyz = normalize(vec3(ffp_texcoord[%u].w, ffp_texcoord[%u].w, ffp_texcoord[%u].w));\n",
6307 sampler_idx = ins->
dst[0].reg.idx[0].offset;
6322 char coord_div_mask[3];
6326 FIXME(
"WINED3D_TTFF_PROJECTED with WINED3D_TTFF_COUNT1?\n");
6340 shader_addline(ins->
ctx->buffer,
"T%u%s /= T%u%s;\n", sampler_idx, coord_mask, sampler_idx, coord_div_mask);
6346 "T%u%s + vec4(bumpenv_mat%u * %s, 0.0, 0.0)%s", sampler_idx, coord_mask, sampler_idx,
6357 shader_addline(ins->
ctx->buffer,
"%s%s *= (%s * bumpenv_lum_scale%u + bumpenv_lum_offset%u);\n",
6359 luminance_param.
param_str, sampler_idx, sampler_idx);
6366 DWORD sampler_idx = ins->
dst[0].reg.idx[0].offset;
6381 DWORD sampler_idx = ins->
dst[0].reg.idx[0].offset;
6397 DWORD sampler_idx = ins->
dst[0].reg.idx[0].offset;
6413 DWORD sampler_idx = ins->
dst[0].reg.idx[0].offset;
6430 if (ins->
ctx->reg_maps->shader_version.major >= 4)
6442 if (ins->
ctx->reg_maps->shader_version.major >= 2)
6461 unsigned int mask_size;
6470 if (mask_size > 1) {
6506 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
6515 input->register_idx, reg_mask);
6521 input->register_idx, reg_mask);
6523 FIXME(
"ARB_fragment_layer_viewport is not supported.\n");
6527 if (
input->sysval_semantic)
6528 FIXME(
"Unhandled sysval semantic %#x.\n",
input->sysval_semantic);
6530 shader->u.ps.input_reg_map[
input->register_idx], reg_mask,
6532 shader->u.ps.input_reg_map[
input->register_idx], reg_mask);
6537 if (
args->pointsprite)
6542 shader->u.ps.input_reg_map[
input->register_idx], reg_mask,
6544 ?
"gl_TexCoord" :
"ffp_varying_texcoord",
semantic_idx, reg_mask);
6547 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
6553 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
6556 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
6559 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
6564 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
6582 ERR(
"Failed to insert program entry.\n");
6646 if (in_idx >= max_varyings)
6648 FIXME(
"More input varyings declared than supported, expect issues.\n");
6652 if (in_idx == in_count)
6654 else if (in_idx == in_count + 1)
6673 if (
set[in_idx] == ~0
u)
6683 for (
i = 0;
i < max_varyings; ++
i)
6695 reg_mask[
size++] =
'x';
6697 reg_mask[
size++] =
'y';
6699 reg_mask[
size++] =
'z';
6701 reg_mask[
size++] =
'w';
6702 reg_mask[
size] =
'\0';
6706 else if (
i == in_count + 1)
6724 BOOL rasterizer_setup)
6746 rasterizer_setup ?
"%s.reg%u%s = outputs[%u]%s;\n" :
"%s.reg[%u]%s = outputs[%u]%s;\n",
6754 unsigned int i, clip_or_cull_index;
6761 for (
i = 0;
i < 4; ++
i)
6768 name, clip_or_cull_index,
element->register_idx, reg_mask);
6769 ++clip_or_cull_index;
6781 const char *semantic_name;
6782 unsigned int semantic_idx;
6809 "ffp_point.size_min, ffp_point.size_max);\n", output->
register_idx, reg_mask[1]);
6833 output_signature, reg_maps_out);
6844 DWORD ps_major = ps ? ps->
reg_maps.shader_version.major : 0;
6846 const char *semantic_name;
6856 if (per_vertex_point_size)
6866 DWORD colors_written_mask[2] = {0};
6871 declare_out_varying(gl_info,
buffer, flatshading,
"vec4 ffp_varying_diffuse;\n");
6872 declare_out_varying(gl_info,
buffer, flatshading,
"vec4 ffp_varying_specular;\n");
6874 declare_out_varying(gl_info,
buffer,
FALSE,
"float ffp_varying_fogcoord;\n");
6879 for (
i = 0;
i <
vs->output_signature.element_count; ++
i)
6884 if (!(
vs->reg_maps.output_registers & (1u << output->
register_idx)))
6889 write_mask = output->
mask;
6913 legacy_syntax ?
"gl_TexCoord" :
"ffp_varying_texcoord",
6921 "ffp_point.size_min, ffp_point.size_max);\n", output->
register_idx, reg_mask[1]);
6926 legacy_syntax ?
"gl_FogFragCoord" :
"ffp_varying_fogcoord",
6931 for (
i = 0;
i < 2; ++
i)
6938 legacy_syntax ?
"gl_FrontColor" :
"ffp_varying_diffuse",
6939 reg_mask, reg_mask);
6942 legacy_syntax ?
"gl_FrontSecondaryColor" :
"ffp_varying_specular",
6943 reg_mask, reg_mask);
6948 if (ps && !(ps->
reg_maps.texcoord & (1u <<
i)))
6954 && !texcoords_written_mask[
i])
6959 legacy_syntax ?
"gl_TexCoord" :
"ffp_varying_texcoord",
i, reg_mask, reg_mask);
6970 &ps->
reg_maps, 0, &
vs->output_signature, &
vs->reg_maps, per_vertex_point_size);
6995 FIXME(
"Unhandled stream %u.\n",
e->stream_idx);
7001 if (
e->component_idx ||
e->component_count != 4)
7003 if (
e->component_count == 1)
7008 e->register_idx,
e->component_idx,
e->component_idx +
e->component_count - 1);
7018 shader->limits->packed_output);
7025 FIXME(
"Unhandled stream %u.\n",
e->stream_idx);
7031 if (
e->component_idx ||
e->component_count != 4)
7036 write_mask = ((1u <<
e->component_count) - 1) <<
e->component_idx;
7039 e->register_idx,
e->component_idx,
e->component_idx +
e->component_count - 1,
7040 e->register_idx, str_mask);
7045 e->register_idx,
e->register_idx);
7058 if (rasterizer_setup)
7067 if (rasterizer_setup)
7072 &
shader->reg_maps,
"shader_out", rasterizer_setup);
7079 const char *reg_mask)
7100 FIXME(
"Unhandled sysval semantic %#x.\n",
constant->sysval_semantic);
7108 unsigned int i, register_count, user_constant_index, user_constant_count;
7110 register_count = user_constant_count = 0;
7114 register_count =
max(
constant->register_idx + 1, register_count);
7116 ++user_constant_count;
7119 if (user_constant_count)
7121 input_setup ?
"in" :
"out", user_constant_count);
7125 shader_addline(
buffer,
"void setup_patch_constant_%s()\n{\n", input_setup ?
"input" :
"output");
7126 for (
i = 0, user_constant_index = 0;
i <
signature->element_count; ++
i)
7158 shader_addline(
buffer,
"bvec3 srgb_compare = lessThan(%s.xyz, vec3(srgb_const1.x));\n", output);
7183 " * ffp_varying_fogcoord * ffp_varying_fogcoord);\n");
7187 ERR(
"Invalid fog mode %#x.\n",
mode);
7202 static const char *
const comparison_operator[] =
7269 if (
args->srgb_correction)
7290 unsigned int i, extra_constants_needed = 0;
7295 memset(&priv_ctx, 0,
sizeof(priv_ctx));
7336 if (
args->np2_fixup)
7339 unsigned int cur = 0;
7346 for (
i = 0;
i <
shader->limits->sampler; ++
i)
7353 FIXME(
"Non-2D texture is flagged for NP2 texcoord fixup.\n");
7386 declare_in_varying(gl_info,
buffer,
args->flatshading,
"vec4 ffp_varying_diffuse;\n");
7388 declare_in_varying(gl_info,
buffer,
args->flatshading,
"vec4 ffp_varying_specular;\n");
7391 declare_in_varying(gl_info,
buffer,
FALSE,
"float ffp_varying_fogcoord;\n");
7416 extra_constants_needed++;
7419 extra_constants_needed++;
7422 if (
args->srgb_correction)
7435 ++extra_constants_needed;
7444 args->render_offscreen ?
"" :
"origin_upper_left, ");
7445 else if (!
args->render_offscreen)
7457 if (
args->dual_source_blend)
7459 for (
i = 0;
i < gl_info->
limits.dual_buffers * 2;
i++)
7468 for (
i = 0;
i < gl_info->
limits.buffers;
i++)
7477 if (
shader->limits->constant_float + extra_constants_needed >= gl_info->
limits.glsl_ps_float_constants)
7478 FIXME(
"Insufficient uniforms to run this shader.\n");
7480 if (
shader->u.ps.force_early_depth_stencil)
7507 "vpos = floor(vec4(0, ycorrection[0], 0, 0) + gl_FragCoord * vec4(1, ycorrection[1], 1, 1));\n");
7510 "vpos = vec4(0, ycorrection[0], 0, 0) + gl_FragCoord * vec4(1, ycorrection[1], 1, 1);\n");
7530 if (
args->pointsprite)
7532 else if (
args->texcoords_initialized & (1u <<
i))
7534 legacy_syntax ?
"gl_TexCoord" :
"ffp_varying_texcoord",
i);
7561 TRACE(
"Compiling shader object %u.\n", shader_id);
7587 legacy_syntax ?
"gl_FogFragCoord" :
"ffp_varying_fogcoord");
7588 else if (!reg_maps->
fog)
7590 legacy_syntax ?
"gl_FogFragCoord" :
"ffp_varying_fogcoord");
7594 if (
args->clip_enabled)
7599 for (
i = 0;
i < gl_info->
limits.user_clip_distances; ++
i)
7603 if (
args->point_size && !
args->per_vertex_point_size)
7604 shader_addline(
buffer,
"gl_PointSize = clamp(ffp_point.size, ffp_point.size_min, ffp_point.size_max);\n");
7623 memset(&priv_ctx, 0,
sizeof(priv_ctx));
7638 for (
i = 0;
i <
shader->input_signature.element_count; ++
i)
7641 if (
args->point_size && !
args->per_vertex_point_size)
7652 if (
args->clip_enabled)
7657 declare_out_varying(gl_info,
buffer,
args->flatshading,
"vec4 ffp_varying_diffuse;\n");
7658 declare_out_varying(gl_info,
buffer,
args->flatshading,
"vec4 ffp_varying_specular;\n");
7660 declare_out_varying(gl_info,
buffer,
FALSE,
"float ffp_varying_fogcoord;\n");
7680 for (
i = 0;
i <
shader->input_signature.element_count; ++
i)
7697 TRACE(
"Compiling shader object %u.\n", shader_id);
7715 shader_addline(
buffer,
"shader_out[gl_InvocationID].reg[%u]%s = shader_in[gl_InvocationID].reg[%u]%s;\n",
7723 const char *phase_name,
unsigned phase_idx)
7729 phase_name, phase_idx, phase->
instance_count ?
"int phase_instance_id" :
"");
7765 memset(&priv_ctx, 0,
sizeof(priv_ctx));
7782 if (hs->
phases.control_point)
7785 shader->limits->packed_output);
7787 &
shader->reg_maps,
"shader_out[gl_InvocationID]",
FALSE);
7792 if ((phase = hs->
phases.control_point))
7806 for (
i = 0;
i < hs->
phases.fork_count; ++
i)
7813 for (
i = 0;
i < hs->
phases.join_count; ++
i)
7824 for (
i = 0;
i < hs->
phases.fork_count; ++
i)
7826 for (
i = 0;
i < hs->
phases.join_count; ++
i)
7832 TRACE(
"Compiling shader object %u.\n", shader_id);
7858 memset(&priv_ctx, 0,
sizeof(priv_ctx));
7870 switch (
shader->u.ds.tessellator_domain)
7882 switch (
args->tessellator_output_primitive)
7885 if (
args->render_offscreen)
7891 if (
args->render_offscreen)
7902 switch (
args->tessellator_partitioning)
7935 TRACE(
"Compiling shader object %u.\n", shader_id);
7952 memset(&priv_ctx, 0,
sizeof(priv_ctx));
7962 if (
shader->u.gs.instance_count > 1)
7979 gl_info,
TRUE,
args->interpolation_mode);
7987 TRACE(
"Compiling shader object %u.\n", shader_id);
8000 switch (
shader->reg_maps.shader_version.type)
8015 FIXME(
"Unhandled shader type %#x.\n",
shader->reg_maps.shader_version.type);
8032 memset(&priv_ctx, 0,
sizeof(priv_ctx));
8044 if (reg_maps->
tgsm[
i].size)
8048 shader_addline(
buffer,
"layout(local_size_x = %u, local_size_y = %u, local_size_z = %u) in;\n",
8049 thread_group_size->
x, thread_group_size->
y, thread_group_size->
z);
8056 TRACE(
"Compiling shader object %u.\n", shader_id);
8074 if (!
shader->backend_data)
8076 if (!(
shader->backend_data = heap_alloc_zero(
sizeof(*shader_data))))
8078 ERR(
"Failed to allocate backend data.\n");
8082 shader_data =
shader->backend_data;
8093 if (
args->np2_fixup)
8094 *np2fixup_info = &gl_shaders[
i].
np2fixup;
8095 return gl_shaders[
i].
id;
8099 TRACE(
"No matching GL shader found for shader %p, compiling a new shader.\n",
shader);
8114 ERR(
"Out of memory\n");
8119 gl_shaders = new_array;
8125 memset(np2fixup, 0,
sizeof(*np2fixup));
8126 *np2fixup_info =
args->np2_fixup ? np2fixup :
NULL;
8138 const DWORD use_map)
8152 return stored->
fog_src ==
new->fog_src;
8165 if (!
shader->backend_data)
8167 if (!(
shader->backend_data = heap_alloc_zero(
sizeof(*shader_data))))
8169 ERR(
"Failed to allocate backend data.\n");
8173 shader_data =
shader->backend_data;
8186 TRACE(
"No matching GL shader found for shader %p, compiling a new shader.\n",
shader);
8202 ERR(
"Out of memory\n");
8227 if (!
shader->backend_data)
8229 if (!(
shader->backend_data = heap_alloc_zero(
sizeof(*shader_data))))
8231 ERR(
"Failed to allocate backend data.\n");
8235 shader_data =
shader->backend_data;
8244 TRACE(
"No matching GL shader found for shader %p, compiling a new shader.\n",
shader);
8248 if (!(new_array =
heap_alloc(
sizeof(*new_array))))
8250 ERR(
"Failed to allocate GL shaders array.\n");
8272 if (!
shader->backend_data)
8274 if (!(
shader->backend_data = heap_alloc_zero(
sizeof(*shader_data))))
8276 ERR(
"Failed to allocate backend data.\n");
8280 shader_data =
shader->backend_data;
8289 TRACE(
"No matching GL shader found for shader %p, compiling a new shader.\n",
shader);
8304 ERR(
"Failed to allocate GL shaders array.\n");
8327 if (!
shader->backend_data)
8329 if (!(
shader->backend_data = heap_alloc_zero(
sizeof(*shader_data))))
8331 ERR(
"Failed to allocate backend data.\n");
8335 shader_data =
shader->backend_data;
8344 TRACE(
"No matching GL shader found for shader %p, compiling a new shader.\n",
shader);
8359 ERR(
"Failed to allocate GL shaders array.\n");
8381 return "ffp_attrib_diffuse";
8383 return "ffp_attrib_specular";
8385 ERR(
"Invalid material color source %#x.\n",
mcs);
8394 " * ffp_light[%u].diffuse.xyz * att;\n",
idx);
8400 " pow(t, ffp_material.shininess) * ffp_light[%u].specular * att;\n",
idx);
8407 unsigned int i,
idx;
8434 if (legacy_lighting)
8445 " ffp_light[%u].l_att, ffp_light[%u].q_att));\n",
idx,
idx,
idx);
8446 if (!legacy_lighting)
8465 if (legacy_lighting)
8480 " / (ffp_light[%u].cos_htheta - ffp_light[%u].cos_hphi), ffp_light[%u].falloff);\n",
8482 if (legacy_lighting)
8484 " ffp_light[%u].l_att, ffp_light[%u].q_att));\n",
8488 " ffp_light[%u].l_att, ffp_light[%u].q_att));\n",
8510 for (
i = 0;
i <
settings->parallel_point_light_count; ++
i, ++
idx)
8520 shader_addline(
buffer,
"ffp_varying_diffuse.xyz = %s.xyz * ambient + %s.xyz * diffuse + %s.xyz;\n",
8530 static const struct attrib_info
8533 const char name[24];
8537 {
"vec4",
"ffp_attrib_position"},
8538 {
"vec4",
"ffp_attrib_blendweight"},
8539 {
"vec4",
"ffp_attrib_blendindices"},
8540 {
"vec3",
"ffp_attrib_normal"},
8541 {
"float",
"ffp_attrib_psize"},
8542 {
"vec4",
"ffp_attrib_diffuse"},
8543 {
"vec4",
"ffp_attrib_specular"},
8547 BOOL output_legacy_fogcoord = legacy_syntax;
8562 const char *
type =
i <
ARRAY_SIZE(attrib_info) ? attrib_info[
i].type :
"vec4";
8623 declare_out_varying(gl_info,
buffer,
settings->flatshading,
"vec4 ffp_varying_diffuse;\n");
8624 declare_out_varying(gl_info,
buffer,
settings->flatshading,
"vec4 ffp_varying_specular;\n");
8626 declare_out_varying(gl_info,
buffer,
FALSE,
"float ffp_varying_fogcoord;\n");
8635 if (attrib_info[
i].
name[0])
8637 i,
settings->swizzle_map & (1u <<
i) ?
".zyxw" :
"");
8641 unsigned int coord_idx =
settings->texgen[
i] & 0x0000ffff;
8653 shader_addline(
buffer,
"if (ffp_attrib_position.w != 0.0) gl_Position /= ffp_attrib_position.w;\n");
8666 shader_addline(
buffer,
"ec_pos += ffp_attrib_blendweight[%u] * (ffp_modelview_matrix[%s] * ffp_attrib_position);\n",
i,
var);
8680 for (
i = 0;
i < gl_info->
limits.user_clip_distances; ++
i)
8694 shader_addline(
buffer,
"normal += ffp_attrib_blendweight[%u] * (ffp_normal_matrix[%s] * ffp_attrib_normal);\n",
i,
var);
8720 BOOL output_legacy_texcoord = legacy_syntax;
8722 switch (
settings->texgen[
i] & 0xffff0000)
8726 shader_addline(
buffer,
"ffp_varying_texcoord[%u] = ffp_texture_matrix[%u] * ffp_attrib_texcoord%u;\n",
8731 output_legacy_texcoord =
FALSE;
8735 shader_addline(
buffer,
"ffp_varying_texcoord[%u] = ffp_texture_matrix[%u] * vec4(normal, 1.0);\n",
i,
i);
8744 " * vec4(reflect(normalize(ec_pos.xyz), normal), 1.0);\n",
i,
i);
8751 " * vec4(r.x / m + 0.5, r.y / m + 0.5, 0.0, 1.0);\n",
i,
i);
8758 if (output_legacy_texcoord)
8765 output_legacy_fogcoord =
FALSE;
8796 ERR(
"Unhandled fog mode %#x.\n",
settings->fog_mode);
8799 if (output_legacy_fogcoord)
8805 " + ffp_point.l_att * length(ec_pos.xyz)"
8806 " + ffp_point.q_att * dot(ec_pos.xyz, ec_pos.xyz));\n",
8807 settings->per_vertex_point_size ?
"ffp_attrib_psize" :
"ffp_point.size");
8808 shader_addline(
buffer,
"gl_PointSize = clamp(gl_PointSize, ffp_point.size_min, ffp_point.size_max);\n");
8825 return "<unused arg>";
8830 ret =
"ffp_varying_diffuse";
8840 case 0:
ret =
"tex0";
break;
8841 case 1:
ret =
"tex1";
break;
8842 case 2:
ret =
"tex2";
break;
8843 case 3:
ret =
"tex3";
break;
8844 case 4:
ret =
"tex4";
break;
8845 case 5:
ret =
"tex5";
break;
8846 case 6:
ret =
"tex6";
break;
8847 case 7:
ret =
"tex7";
break;
8849 ret =
"<invalid texture>";
8859 ret =
"ffp_varying_specular";
8869 case 0:
ret =
"tss_const0";
break;
8870 case 1:
ret =
"tss_const1";
break;
8871 case 2:
ret =
"tss_const2";
break;
8872 case 3:
ret =
"tss_const3";
break;
8873 case 4:
ret =
"tss_const4";
break;
8874 case 5:
ret =
"tss_const5";
break;
8875 case 6:
ret =
"tss_const6";
break;
8876 case 7:
ret =
"tss_const7";
break;
8878 ret =
"<invalid constant>";
8884 return "<unhandled arg>";
8892 else if (argnum == 1)
8894 else if (argnum == 2)
8903 else if (argnum == 1)
8905 else if (argnum == 2)
8915 const char *dstmask, *dstreg, *arg0, *
arg1, *
arg2;
8925 dstreg =
"temp_reg";
8952 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
8957 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
8962 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
8967 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
8972 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
8977 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
8982 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask,
arg1, dstmask);
8988 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
8994 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
9000 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
9006 dstreg, dstmask,
arg2, dstmask, arg0,
arg1, dstmask);
9012 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
9040 shader_addline(
buffer,
"%s%s = vec4(clamp(dot(%s.xyz - 0.5, %s.xyz - 0.5) * 4.0, 0.0, 1.0))%s;\n",
9041 dstreg, dstmask,
arg1,
arg2, dstmask);
9046 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask, arg0, dstmask);
9052 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0, dstmask);
9056 FIXME(
"Unhandled operation %#x.\n",
op);
9069 BYTE lum_map = 0, bump_map = 0, tex_map = 0, tss_const_map = 0;
9073 UINT lowest_disabled_stage;
9091 || (stage == 0 &&
settings->color_key_enabled))
9092 tex_map |= 1u << stage;
9094 tfactor_used =
TRUE;
9096 tempreg_used =
TRUE;
9098 tempreg_used =
TRUE;
9100 tss_const_map |= 1u << stage;
9105 lum_map |= 1u << stage;
9108 bump_map |= 1u << stage;
9112 tex_map |= 1u << stage;
9116 tfactor_used =
TRUE;
9131 tex_map |= 1u << stage;
9133 tfactor_used =
TRUE;
9135 tempreg_used =
TRUE;
9137 tss_const_map |= 1u << stage;
9139 lowest_disabled_stage = stage;
9159 if (tempreg_used ||
settings->sRGB_write)
9165 const char *sampler_type;
9167 if (tss_const_map & (1u << stage))
9170 if (!(tex_map & (1u << stage)))
9173 switch (
settings->op[stage].tex_type)
9176 sampler_type =
"1D";
9179 sampler_type =
"2D";
9182 sampler_type =
"3D";
9185 sampler_type =
"Cube";
9188 sampler_type =
"2DRect";
9191 FIXME(
"Unhandled sampler type %#x.\n",
settings->op[stage].tex_type);
9192 sampler_type =
NULL;
9204 if (!(bump_map & (1u << stage)))
9208 if (!(lum_map & (1u << stage)))
9249 declare_in_varying(gl_info,
buffer,
settings->flatshading,
"vec4 ffp_varying_diffuse;\n");
9250 declare_in_varying(gl_info,
buffer,
settings->flatshading,
"vec4 ffp_varying_specular;\n");
9253 declare_in_varying(gl_info,
buffer,
FALSE,
"float ffp_varying_fogcoord;\n");
9266 if (tex_map & (1u << stage))
9270 else if (
settings->texcoords_initialized & (1u << stage))
9272 stage, legacy_syntax ?
"gl_TexCoord" :
"ffp_varying_texcoord", stage);
9281 if (lowest_disabled_stage < 7 && settings->emul_clipplanes)
9287 const char *texture_function, *coord_mask;
9290 if (!(tex_map & (1u << stage)))
9304 FIXME(
"Unexpected projection mode %d\n",
settings->op[stage].projected);
9311 switch (
settings->op[stage].tex_type)
9316 texture_function =
"texture1DProj";
9321 texture_function =
"texture1D";
9328 texture_function =
"texture2DProj";
9333 texture_function =
"texture2D";
9340 texture_function =
"texture3DProj";
9341 coord_mask =
"xyzw";
9345 texture_function =
"texture3D";
9350 texture_function =
"textureCube";
9356 texture_function =
"texture2DRectProj";
9361 texture_function =
"texture2DRect";
9366 FIXME(
"Unhandled texture type %#x.\n",
settings->op[stage].tex_type);
9367 texture_function =
"";
9368 coord_mask =
"xyzw";
9372 texture_function = proj ?
"textureProj" :
"texture";
9405 stage, texture_function, stage, coord_mask);
9408 shader_addline(
buffer,
"tex%u *= clamp(tex%u.z * bumpenv_lum_scale%u + bumpenv_lum_offset%u, 0.0, 1.0);\n",
9409 stage, stage - 1, stage - 1, stage - 1);
9414 stage, texture_function, stage, stage);
9419 stage, texture_function, stage, stage, coord_mask);
9429 shader_addline(
buffer,
"if (all(greaterThanEqual(tex0, color_key[0])) && all(lessThan(tex0, color_key[1])))\n");
9519 ERR(
"Failed to insert ffp vertex shader.\n");
9533 if (!(glsl_desc =
heap_alloc(
sizeof(*glsl_desc))))
9551 for (
i = 0;
i < vs_c_count; ++
i)
9554 vs->uniform_f_locations[
i] =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9561 vs->uniform_i_locations[
i] =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9567 vs->uniform_b_locations[
i] =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9570 vs->pos_fixup_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"pos_fixup"));
9575 vs->modelview_matrix_location[
i] =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9580 vs->normal_matrix_location[
i] =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9582 vs->projection_matrix_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_projection_matrix"));
9586 vs->texture_matrix_location[
i] =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9588 vs->material_ambient_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_material.ambient"));
9589 vs->material_diffuse_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_material.diffuse"));
9590 vs->material_specular_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_material.specular"));
9591 vs->material_emissive_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_material.emissive"));
9592 vs->material_shininess_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_material.shininess"));
9593 vs->light_ambient_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_light_ambient"));
9597 vs->light_location[
i].diffuse =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9599 vs->light_location[
i].specular =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9601 vs->light_location[
i].ambient =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9603 vs->light_location[
i].position =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9605 vs->light_location[
i].direction =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9607 vs->light_location[
i].range =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9609 vs->light_location[
i].falloff =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9611 vs->light_location[
i].c_att =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9613 vs->light_location[
i].l_att =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9615 vs->light_location[
i].q_att =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9617 vs->light_location[
i].cos_htheta =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9619 vs->light_location[
i].cos_hphi =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
9621 vs->pointsize_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.size"));
9622 vs->pointsize_min_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.size_min"));
9623 vs->pointsize_max_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.size_max"));
9624 vs->pointsize_c_att_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.c_att"));
9625 vs->pointsize_l_att_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.l_att"));
9626 vs->pointsize_q_att_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.q_att"));
9627 vs->clip_planes_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"clip_planes"));
9635 ds->pos_fixup_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"pos_fixup"));
9641 gs->pos_fixup_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"pos_fixup"));
9650 for (
i = 0;
i < ps_c_count; ++
i)
9707 GLuint shader_id, program_id;
9711 ERR(
"Out of memory.\n");
9715 if (!(
shader->backend_data = heap_alloc_zero(
sizeof(*shader_data))))
9717 ERR(
"Failed to allocate backend data.\n");
9721 shader_data =
shader->backend_data;
9726 ERR(
"Failed to allocate GL shader array.\n");
9742 TRACE(
"Created new GLSL shader program %u.\n", program_id);
9744 entry->id = program_id;
9750 entry->cs.id = shader_id;
9751 entry->constant_version = 0;
9752 entry->shader_controlled_clip_distances = 0;
9756 TRACE(
"Attaching GLSL shader object %u to program %u.\n", shader_id, program_id);
9757 GL_EXTCALL(glAttachShader(program_id, shader_id));
9762 TRACE(
"Linking GLSL shader program %u.\n", program_id);
9771 entry->constant_update_mask = 0;
9783 if (!
shader->backend_data)
9785 WARN(
"Failed to find GLSL program for compute shader %p.\n",
shader);
9788 ERR(
"Failed to compile compute shader %p.\n",
shader);
9792 shader_data =
shader->backend_data;
9810 WARN(
"Compute shader is NULL.\n");
9819 ERR(
"Failed to find GLSL program for compute shader %p.\n",
shader);
9835 GLuint reorder_shader_id = 0;
9864 vs_list = &vshader->linked_programs;
9873 vs_id = ffp_shader->
id;
9930 ps_list = &pshader->linked_programs;
9933 && !(vshader && vshader->
reg_maps.shader_version.major >= 4))
9940 ps_id = ffp_shader->
id;
9958 TRACE(
"Created new GLSL shader program %u.\n", program_id);
9962 entry->id = program_id;
9963 entry->vs.id = vs_id;
9964 entry->hs.id = hs_id;
9965 entry->ds.id = ds_id;
9966 entry->gs.id = gs_id;
9967 entry->ps.id = ps_id;
9969 entry->constant_version = 0;
9970 entry->shader_controlled_clip_distances = 0;
9971 entry->ps.np2_fixup_info = np2fixup_info;
9981 TRACE(
"Attaching GLSL shader object %u to program %u.\n", vs_id, program_id);
9982 GL_EXTCALL(glAttachShader(program_id, vs_id));
9990 attribs_map = vshader->
reg_maps.input_registers;
9991 if (vshader->
reg_maps.shader_version.major < 4)
9997 TRACE(
"Attaching GLSL shader object %u to program %u.\n", reorder_shader_id, program_id);
9998 GL_EXTCALL(glAttachShader(program_id, reorder_shader_id));
10002 GL_EXTCALL(glDeleteShader(reorder_shader_id));
10022 for (
i = 0; attribs_map; attribs_map >>= 1, ++
i)
10024 if (!(attribs_map & 1))
10029 if (vshader && vshader->
reg_maps.shader_version.major >= 4)
10046 for (
i = 0;
i < gl_info->
limits.dual_buffers * 2;
i++)
10049 GL_EXTCALL(glBindFragDataLocationIndexed(program_id,
i / 2,
i % 2,
var));
10055 for (
i = 0;
i < gl_info->
limits.buffers;
i++)
10067 TRACE(
"Attaching GLSL tessellation control shader object %u to program %u.\n", hs_id, program_id);
10068 GL_EXTCALL(glAttachShader(program_id, hs_id));
10076 TRACE(
"Attaching GLSL tessellation evaluation shader object %u to program %u.\n", ds_id, program_id);
10077 GL_EXTCALL(glAttachShader(program_id, ds_id));
10085 TRACE(
"Attaching GLSL geometry shader object %u to program %u.\n", gs_id, program_id);
10086 GL_EXTCALL(glAttachShader(program_id, gs_id));
10097 TRACE(
"Attaching GLSL shader object %u to program %u.\n", ps_id, program_id);
10098 GL_EXTCALL(glAttachShader(program_id, ps_id));
10105 TRACE(
"Linking GLSL shader program %u.\n", program_id);
10110 vshader ? vshader->
limits->constant_float : 0);
10114 pshader ? pshader->
limits->constant_float : 0);
10115 checkGLcall(
"find glsl program uniform locations");
10117 pre_rasterization_shader = gshader ? gshader : dshader ? dshader : vshader;
10118 if (pre_rasterization_shader && pre_rasterization_shader->
reg_maps.shader_version.major >= 4)
10121 entry->shader_controlled_clip_distances = 1;
10122 entry->clip_distance_mask = (1u << clip_distance_count) - 1;
10127 if (pshader && pshader->
reg_maps.shader_version.major >= 3
10130 TRACE(
"Shader %d needs vertex color clamping disabled.\n", program_id);
10150 entry->constant_update_mask = 0;
10154 if (vshader->
reg_maps.integer_constants)
10156 if (vshader->
reg_maps.boolean_constants)
10158 if (
entry->vs.pos_fixup_location != -1)
10170 if (
entry->vs.modelview_matrix_location[
i] != -1)
10179 if (
entry->vs.texture_matrix_location[
i] != -1)
10185 if (
entry->vs.material_ambient_location != -1 ||
entry->vs.material_diffuse_location != -1
10186 ||
entry->vs.material_specular_location != -1
10187 ||
entry->vs.material_emissive_location != -1
10188 ||
entry->vs.material_shininess_location != -1)
10190 if (
entry->vs.light_ambient_location != -1)
10193 if (
entry->vs.clip_planes_location != -1)
10195 if (
entry->vs.pointsize_min_location != -1)
10203 if (
entry->ds.pos_fixup_location != -1)
10211 if (
entry->gs.pos_fixup_location != -1)
10222 if (pshader->
reg_maps.integer_constants)
10224 if (pshader->
reg_maps.boolean_constants)
10226 if (
entry->ps.ycorrection_location != -1)
10241 if (
entry->ps.bumpenv_mat_location[
i] != -1)
10248 if (
entry->ps.fog_color_location != -1)
10250 if (
entry->ps.alpha_test_ref_location != -1)
10252 if (
entry->ps.np2_fixup_location != -1)
10254 if (
entry->ps.color_key_location != -1)
10280 GLenum current_vertex_color_clamp;
10281 GLuint program_id, prev_id;
10292 program_id = glsl_program->
id;
10293 current_vertex_color_clamp = glsl_program->
vs.vertex_color_clamp;
10313 FIXME(
"Vertex color clamp needs to be changed, but extension not supported.\n");
10317 TRACE(
"Using GLSL program %u.\n", program_id);
10319 if (prev_id != program_id)
10338 GLuint program_id, prev_id;
10344 TRACE(
"Using GLSL program %u.\n", program_id);
10346 if (prev_id != program_id)
10402 for (
i = 0;
i <
device->context_count; ++
i)
10405 ctx_data =
context->shader_backend_data;
10418 const struct list *linked_programs;
10431 TRACE(
"Deleting linked programs.\n");
10432 linked_programs = &
shader->linked_programs;
10433 if (linked_programs->
next)
10438 switch (
shader->reg_maps.shader_version.type)
10446 TRACE(
"Deleting pixel shader %u.\n", gl_shaders[
i].
id);
10468 TRACE(
"Deleting vertex shader %u.\n", gl_shaders[
i].
id);
10490 TRACE(
"Deleting hull shader %u.\n", gl_shaders[
i].
id);
10512 TRACE(
"Deleting domain shader %u.\n", gl_shaders[
i].
id);
10534 TRACE(
"Deleting geometry shader %u.\n", gl_shaders[
i].
id);
10556 TRACE(
"Deleting compute shader %u.\n", gl_shaders[
i].
id);
10573 ERR(
"Unhandled shader type %#x.\n",
shader->reg_maps.shader_version.type);
10590 if (
k->vs_id >
prog->vs.id)
return 1;
10591 else if (
k->vs_id <
prog->vs.id)
return -1;
10593 if (
k->gs_id >
prog->gs.id)
return 1;
10594 else if (
k->gs_id <
prog->gs.id)
return -1;
10596 if (
k->ps_id >
prog->ps.id)
return 1;
10597 else if (
k->ps_id <
prog->ps.id)
return -1;
10599 if (
k->hs_id >
prog->hs.id)
return 1;
10600 else if (
k->hs_id <
prog->hs.id)
return -1;
10602 if (
k->ds_id >
prog->ds.id)
return 1;
10603 else if (
k->ds_id <
prog->ds.id)
return -1;
10605 if (
k->cs_id >
prog->cs.id)
return 1;
10606 else if (
k->cs_id <
prog->cs.id)
return -1;
10620 ERR(
"Failed to allocate memory\n");
10625 heap->entries[1].version = 0;
10645 void *vertex_priv, *fragment_priv;
10648 if (!(priv = heap_alloc_zero(
sizeof(*priv))))
10655 ERR(
"Failed to initialize vertex pipe.\n");
10662 ERR(
"Failed to initialize fragment pipe.\n");
10670 ERR(
"Failed to initialize shader buffer.\n");
10676 ERR(
"Failed to allocate memory.\n");
10682 ERR(
"Failed to initialize vertex shader constant heap\n");
10688 ERR(
"Failed to initialize pixel shader constant heap\n");
10701 device->vertex_priv = vertex_priv;
10702 device->fragment_priv = fragment_priv;
10703 device->shader_priv = priv;
10740 if (!(ctx_data = heap_alloc_zero(
sizeof(*ctx_data))))
10743 context->shader_backend_data = ctx_data;
10783 if (shader_model_4)
10798 TRACE(
"Shader model %u.\n", shader_model);
10826 if (shader_model >= 4)
11166 priv = shader_priv;
11171 FIXME(
"GLSL vertex pipe without GLSL shader backend not implemented.\n");
11188 ctx->gl_info->gl_ops.ext.p_glDeleteShader(
shader->id);
11199 ctx.gl_info = &
device->adapter->gl_info;
11218 BOOL transformed =
context->stream_info.position_transformed;
11222 context->last_was_rhw = transformed;
11227 if (transformed != wasrhw
11228 ||
context->stream_info.swizzle_map !=
context->last_swizzle_map)
11235 if (
context->last_was_vshader)
11237 if (legacy_clip_planes)
11238 for (
i = 0;
i < gl_info->
limits.user_clip_distances; ++
i)
11260 if (!
context->last_was_vshader)
11263 if (legacy_clip_planes)
11264 for (
i = 0;
i < gl_info->
limits.user_clip_distances; ++
i)
11350 for (
k = 0;
k < gl_info->
limits.user_clip_distances; ++
k)
11442 static unsigned int once;
11445 FIXME(
"Non-point sprite points not supported in core profile.\n");
11460 if (
index >= gl_info->
limits.user_clip_distances)
11669 priv = shader_priv;
11674 FIXME(
"GLSL fragment pipe without GLSL shader backend not implemented.\n");
11691 ctx->gl_info->gl_ops.ext.p_glDeleteShader(
shader->id);
11702 ctx.gl_info = &
device->adapter->gl_info;
11747 if (new_source !=
context->fog_source || fogstart == fogend)
11749 context->fog_source = new_source;
struct mke2fs_defaults settings[]
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)
static struct myctx * mcs
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static void * heap_realloc(void *mem, size_t len)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(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)
unsigned int component_count
#define PRINTF_ATTR(fmt, args)
void context_enable_clip_distances(struct wined3d_context *context, unsigned int enable_mask)
const DWORD * context_get_tex_unit_mapping(const struct wined3d_context *context, const struct wined3d_shader_version *shader_version, unsigned int *base, unsigned int *count)
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
void context_release(struct wined3d_context *context)
void string_buffer_list_cleanup(struct wined3d_string_buffer_list *list)
void string_buffer_clear(struct wined3d_string_buffer *buffer)
BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage)
void find_ds_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, struct ds_compile_args *args, const struct wined3d_context *context)
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[]
struct wined3d_string_buffer * string_buffer_get(struct wined3d_string_buffer_list *list)
void find_gs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, struct gs_compile_args *args, const struct wined3d_context *context)
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)
void string_buffer_sprintf(struct wined3d_string_buffer *buffer, const char *format,...)
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)
int shader_vaddline(struct wined3d_string_buffer *buffer, const char *format, va_list args)
BOOL string_buffer_resize(struct wined3d_string_buffer *buffer, int rc)
const char * debug_d3dshaderinstructionhandler(enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx)
void string_buffer_release(struct wined3d_string_buffer_list *list, struct wined3d_string_buffer *buffer)
void string_buffer_list_init(struct wined3d_string_buffer_list *list)
const float wined3d_srgb_const1[]
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_pointsprite(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_clipping(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
void state_pointsprite_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
void clipplane(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 get_modelview_matrix(const struct wined3d_context *context, const struct wined3d_state *state, unsigned int index, struct wined3d_matrix *mat)
const struct ffp_frag_desc * find_ffp_frag_shader(const struct wine_rb_tree *fragment_shaders, const struct ffp_frag_settings *settings)
void get_fog_start_end(const struct wined3d_context *context, const struct wined3d_state *state, float *start, float *end)
BOOL invert_matrix(struct wined3d_matrix *out, const struct wined3d_matrix *m)
const char * debug_d3dprimitivetype(enum wined3d_primitive_type primitive_type)
void transpose_matrix(struct wined3d_matrix *out, const struct wined3d_matrix *m)
void wined3d_ftoa(float value, char *s)
int wined3d_ffp_frag_program_key_compare(const void *key, const struct wine_rb_entry *entry)
void get_pointsize_minmax(const struct wined3d_context *context, const struct wined3d_state *state, float *out_min, float *out_max)
void get_pointsize(const struct wined3d_context *context, const struct wined3d_state *state, float *out_pointsize, float *out_att)
unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info)
BOOL invert_matrix_3d(struct wined3d_matrix *out, const struct wined3d_matrix *in)
void wined3d_format_get_float_color_key(const struct wined3d_format *format, const struct wined3d_color_key *key, struct wined3d_color *float_colors)
void wined3d_gl_limits_get_uniform_block_range(const struct wined3d_gl_limits *gl_limits, enum wined3d_shader_type shader_type, unsigned int *base, unsigned int *count)
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 get_texture_matrix(const struct wined3d_context *context, const struct wined3d_state *state, unsigned int tex, struct wined3d_matrix *mat)
void wined3d_ffp_get_vs_settings(const struct wined3d_context *context, const struct wined3d_state *state, struct wined3d_ffp_vs_settings *settings)
void get_projection_matrix(const struct wined3d_context *context, const struct wined3d_state *state, struct wined3d_matrix *mat)
int wined3d_ffp_vertex_program_key_compare(const void *key, const struct wine_rb_entry *entry)
const char * wine_dbg_sprintf(const char *format,...)
#define WINE_DECLARE_DEBUG_CHANNEL(x)
static const WCHAR version[]
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLclampf GLclampf GLclampf alpha
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * varyings
#define GL_CLAMP_VERTEX_COLOR_ARB
#define GL_FRAGMENT_SHADER
#define GL_GEOMETRY_SHADER
GLenum GLenum GLenum GLenum GLenum scale
GLsizei const GLint * locations
GLsizei const GLchar *const * strings
#define GL_PROGRAM_POINT_SIZE
#define GL_INTERLEAVED_ATTRIBS
#define GL_FIXED_ONLY_ARB
#define GL_TESS_CONTROL_SHADER
GLuint GLuint GLuint GLuint arg1
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
#define GL_SHADER_SOURCE_LENGTH
GLboolean GLenum GLenum GLvoid * values
#define GL_COMPILE_STATUS
GLuint GLsizei GLsizei * length
#define GL_TESS_EVALUATION_SHADER
GLenum GLenum GLenum input
#define GL_SEPARATE_ATTRIBS
#define GL_INFO_LOG_LENGTH
#define GL_ATTACHED_SHADERS
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
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
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 GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
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 light
static void shader_glsl_gen_modifier(enum wined3d_shader_src_modifier src_modifier, const char *in_reg, const char *in_regswizzle, char *out_str)
static void shader_glsl_expp(const struct wined3d_shader_instruction *ins)
static void glsl_fragment_pipe_vdecl(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void append_transform_feedback_skip_components(const char **varyings, unsigned int *varying_count, char **strings, unsigned int *strings_length, struct wined3d_string_buffer *buffer, unsigned int component_count)
static const char * shader_glsl_interpolation_qualifiers(enum wined3d_shader_interpolation_mode mode)
static void shader_glsl_generate_conditional_op(const struct wined3d_shader_instruction *ins, const char *op)
static void shader_glsl_generate_stream_output_setup(struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct wined3d_stream_output_desc *so_desc)
static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, const struct wined3d_vec4 *constants, const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, unsigned int version)
static void shader_glsl_rep(const struct wined3d_shader_instruction *ins)
#define WINED3D_GLSL_SAMPLE_LOAD
static void shader_glsl_break(const struct wined3d_shader_instruction *ins)
#define WINED3D_GLSL_SAMPLE_LOD
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
static void shader_glsl_ffp_vertex_material_uniform(const struct wined3d_context *context, const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
static void shader_glsl_else(const struct wined3d_shader_instruction *ins)
static void glsl_vertex_pipe_vs(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static BOOL constant_heap_init(struct constant_heap *heap, unsigned int constant_count)
static void shader_glsl_atomic(const struct wined3d_shader_instruction *ins)
static DWORD shader_glsl_append_dst(struct wined3d_string_buffer *buffer, const struct wined3d_shader_instruction *ins)
static void shader_glsl_texm3x3(const struct wined3d_shader_instruction *ins)
static void glsl_vertex_pipe_clip_plane(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
const struct wined3d_shader_backend_ops glsl_shader_backend
static void shader_glsl_color_correction_ext(struct wined3d_string_buffer *buffer, const char *reg_name, DWORD mask, struct color_fixup_desc fixup)
static void shader_glsl_ld_uav(const struct wined3d_shader_instruction *ins)
static void glsl_fragment_pipe_vs(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_generate_alpha_test(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, enum wined3d_cmp_func alpha_func)
static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins)
static void shader_glsl_texcoord(const struct wined3d_shader_instruction *ins)
static void set_glsl_shader_program(const struct wined3d_context *context, const struct wined3d_state *state, struct shader_glsl_priv *priv, struct glsl_context_data *ctx_data)
static void shader_glsl_get_caps(const struct wined3d_gl_info *gl_info, struct shader_caps *caps)
static unsigned int shader_glsl_get_version(const struct wined3d_gl_info *gl_info)
static void shader_glsl_sincos(const struct wined3d_shader_instruction *ins)
static BOOL shader_glsl_has_ffp_proj_control(void *shader_priv)
static void shader_glsl_resinfo(const struct wined3d_shader_instruction *ins)
static void shader_glsl_ffp_fragment_op(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_glsl_texldd(const struct wined3d_shader_instruction *ins)
static void glsl_vertex_pipe_shader(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void glsl_fragment_pipe_color_key(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_emit(const struct wined3d_shader_instruction *ins)
static void glsl_fragment_pipe_tex_transform(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void walk_constant_heap_clamped(const struct wined3d_gl_info *gl_info, const struct wined3d_vec4 *constants, const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version)
static BOOL is_multisampled(enum wined3d_shader_resource_type resource_type)
static void shader_glsl_pow(const struct wined3d_shader_instruction *ins)
static void shader_glsl_udiv(const struct wined3d_shader_instruction *ins)
static void shader_glsl_invalidate_current_program(struct wined3d_context *context)
static void shader_glsl_pointsize_uniform(const struct wined3d_context *context, const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
static void shader_glsl_to_uint(const struct wined3d_shader_instruction *ins)
static void shader_glsl_unary_op(const struct wined3d_shader_instruction *ins)
static GLuint find_glsl_geometry_shader(const struct wined3d_context *context, struct shader_glsl_priv *priv, struct wined3d_shader *shader, const struct gs_compile_args *args)
#define WINED3D_GLSL_SAMPLE_PROJECTED
static void add_glsl_program_entry(struct shader_glsl_priv *priv, struct glsl_shader_prog_link *entry)
static const char * shader_glsl_get_rel_op(enum wined3d_shader_rel_op op)
static void glsl_vertex_pipe_pointscale(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_texm3x3pad(const struct wined3d_shader_instruction *ins)
static void shader_glsl_texreg2rgb(const struct wined3d_shader_instruction *ins)
static void shader_glsl_texm3x2depth(const struct wined3d_shader_instruction *ins)
static void shader_glsl_generate_fog_code(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, enum wined3d_ffp_ps_fog_mode mode)
static void shader_glsl_declare_typed_vertex_attribute(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const char *vector_type, const char *scalar_type, unsigned int index)
static void glsl_vertex_pipe_nop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_declare_shader_inputs(const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, unsigned int element_count, const DWORD *interpolation_mode, BOOL unroll)
static void shader_glsl_ld(const struct wined3d_shader_instruction *ins)
static void shader_glsl_to_float(const struct wined3d_shader_instruction *ins)
static void glsl_vertex_pipe_pixel_shader(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_generate_shader_phase_invocation(struct wined3d_string_buffer *buffer, const struct wined3d_shader_phase *phase, const char *phase_name, unsigned int phase_idx)
static void shader_glsl_texkill(const struct wined3d_shader_instruction *ins)
static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe, const struct fragment_pipeline *fragment_pipe)
static BOOL glsl_fragment_pipe_alloc_context_data(struct wined3d_context *context)
static HRESULT shader_glsl_generate_shader_phase(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, struct shader_glsl_ctx_priv *priv_ctx, const struct wined3d_shader_phase *phase, const char *phase_name, unsigned phase_idx)
static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[]
static void apply_clamped_constant(const struct wined3d_gl_info *gl_info, GLint location, const struct wined3d_vec4 *data)
static GLuint shader_glsl_generate_vshader(const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct vs_compile_args *args)
static void shader_glsl_scalar_op(const struct wined3d_shader_instruction *ins)
void shader_glsl_validate_link(const struct wined3d_gl_info *gl_info, GLuint program)
static void shader_glsl_swapc(const struct wined3d_shader_instruction *ins)
static const char * shader_glsl_ffp_mcs(enum wined3d_material_color_source mcs, const char *material)
static DWORD glsl_vertex_pipe_vp_get_emul_mask(const struct wined3d_gl_info *gl_info)
static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *priv, const struct ffp_frag_settings *settings, const struct wined3d_context *context)
static void shader_glsl_texm3x3tex(const struct wined3d_shader_instruction *ins)
static void glsl_vertex_pipe_vp_enable(const struct wined3d_gl_info *gl_info, BOOL enable)
static void glsl_vertex_pipe_vp_free(struct wined3d_device *device)
static void glsl_fragment_pipe_free(struct wined3d_device *device)
static const char *const shift_glsl_tab[]
static void shader_glsl_mul_extended(const struct wined3d_shader_instruction *ins)
static void shader_glsl_declare_shader_outputs(const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, unsigned int element_count, BOOL rasterizer_setup, const DWORD *interpolation_mode)
static void shader_glsl_ret(const struct wined3d_shader_instruction *ins)
static GLuint find_glsl_domain_shader(const struct wined3d_context *context, struct shader_glsl_priv *priv, struct wined3d_shader *shader, const struct ds_compile_args *args)
static void glsl_vertex_pipe_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static BOOL shader_glsl_use_explicit_attrib_location(const struct wined3d_gl_info *gl_info)
static void shader_glsl_generate_patch_constant_name(struct wined3d_string_buffer *buffer, const struct wined3d_shader_signature_element *constant, unsigned int *user_constant_idx, const char *reg_mask)
static const char * shader_glsl_get_ffp_fragment_op_arg(struct wined3d_string_buffer *buffer, DWORD argnum, unsigned int stage, DWORD arg)
static void shader_glsl_sample(const struct wined3d_shader_instruction *ins)
static BOOL shader_glsl_has_core_grad(const struct wined3d_gl_info *gl_info)
static BOOL shader_glsl_use_layout_qualifier(const struct wined3d_gl_info *gl_info)
static void shader_glsl_compile(const struct wined3d_gl_info *gl_info, GLuint shader, const char *src)
static void shader_glsl_free(struct wined3d_device *device)
static void glsl_vertex_pipe_projection(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_clip_plane_uniform(const struct wined3d_context *context, const struct wined3d_state *state, unsigned int index, struct glsl_shader_prog_link *prog)
static const struct StateEntryTemplate glsl_fragment_pipe_state_template[]
static void shader_glsl_generate_shader_epilogue(const struct wined3d_shader_context *ctx)
static void shader_glsl_if(const struct wined3d_shader_instruction *ins)
static void shader_glsl_init_gs_uniform_locations(const struct wined3d_gl_info *gl_info, struct shader_glsl_priv *priv, GLuint program_id, struct glsl_gs_program *gs)
static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context, struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, const struct wined3d_shader *shader, const struct ps_compile_args *args, struct ps_np2fixup_info *np2fixup_info)
static void shader_glsl_enable_extensions(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info)
static BOOL glsl_is_shadow_sampler(const struct wined3d_shader *shader, const struct ps_compile_args *ps_args, unsigned int resource_idx, unsigned int sampler_idx)
static void glsl_fragment_pipe_fogparams(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_init_transform_feedback(const struct wined3d_context *context, struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader *shader)
static void shader_glsl_ffp_vertex_lighting(struct wined3d_string_buffer *buffer, const struct wined3d_ffp_vs_settings *settings, BOOL legacy_lighting)
static const char * shader_glsl_get_prefix(enum wined3d_shader_type type)
static void shader_glsl_setup_vs3_output(struct shader_glsl_priv *priv, const struct wined3d_gl_info *gl_info, const DWORD *map, const struct wined3d_shader_signature *input_signature, const struct wined3d_shader_reg_maps *reg_maps_in, const struct wined3d_shader_signature *output_signature, const struct wined3d_shader_reg_maps *reg_maps_out)
static void shader_glsl_lrp(const struct wined3d_shader_instruction *ins)
static void shader_glsl_dp2add(const struct wined3d_shader_instruction *ins)
static void shader_glsl_fixup_position(struct wined3d_string_buffer *buffer)
static const char * glsl_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
static void glsl_fragment_pipe_invalidate_constants(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_relop(const struct wined3d_shader_instruction *ins)
static int glsl_program_key_compare(const void *key, const struct wine_rb_entry *entry)
static void shader_glsl_generate_srgb_write_correction(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info)
static void shader_glsl_generate_patch_constant_setup(struct wined3d_string_buffer *buffer, const struct wined3d_shader_signature *signature, BOOL input_setup)
static void shader_glsl_append_sampler_binding_qualifier(struct wined3d_string_buffer *buffer, const struct wined3d_context *context, const struct wined3d_shader_version *shader_version, unsigned int sampler_idx)
static void shader_glsl_invalidate_contexts_program(struct wined3d_device *device, const struct glsl_shader_prog_link *program)
static void shader_glsl_mov(const struct wined3d_shader_instruction *ins)
static void shader_glsl_callnz(const struct wined3d_shader_instruction *ins)
static void shader_glsl_cnd(const struct wined3d_shader_instruction *ins)
static void shader_glsl_load_constantsB(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, const GLint locations[WINED3D_MAX_CONSTS_B], const BOOL *constants, WORD constants_set)
static void shader_glsl_load_samplers_range(const struct wined3d_gl_info *gl_info, struct shader_glsl_priv *priv, GLuint program_id, const char *prefix, unsigned int base, unsigned int count, const DWORD *tex_unit_map)
static void shader_glsl_dot(const struct wined3d_shader_instruction *ins)
static void shader_glsl_init_ps_uniform_locations(const struct wined3d_gl_info *gl_info, struct shader_glsl_priv *priv, GLuint program_id, struct glsl_ps_program *ps, unsigned int ps_c_count)
static unsigned int vec4_varyings(DWORD shader_major, const struct wined3d_gl_info *gl_info)
static void shader_glsl_declare_generic_vertex_attribute(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct wined3d_shader_signature_element *e)
static void shader_glsl_conditional_move(const struct wined3d_shader_instruction *ins)
static void shader_glsl_append_fixup_arg(char *arguments, const char *reg_name, BOOL sign_fixup, enum fixup_channel_source channel_source)
static void shader_glsl_switch(const struct wined3d_shader_instruction *ins)
static GLuint find_glsl_compute_shader(const struct wined3d_context *context, struct shader_glsl_priv *priv, struct wined3d_shader *shader)
static void shader_glsl_loop(const struct wined3d_shader_instruction *ins)
static void glsl_fragment_pipe_shader(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_generate_glsl_declarations(const struct wined3d_context *context, struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader, const struct wined3d_shader_reg_maps *reg_maps, const struct shader_glsl_ctx_priv *ctx_priv)
static void shader_glsl_texdp3(const struct wined3d_shader_instruction *ins)
static void shader_glsl_load_images(const struct wined3d_gl_info *gl_info, struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader_reg_maps *reg_maps)
#define WINED3D_GLSL_SAMPLE_GRAD
static void shader_glsl_add_version_declaration(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info)
static void glsl_vertex_pipe_viewport(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void glsl_vertex_pipe_texmatrix(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_map2gl(const struct wined3d_shader_instruction *ins)
static void shader_glsl_generate_clip_or_cull_distances(struct wined3d_string_buffer *buffer, const struct wined3d_shader_signature_element *element, DWORD clip_or_cull_distance_mask)
#define WINED3D_GLSL_SAMPLE_OFFSET
static BOOL shader_glsl_allocate_context_data(struct wined3d_context *context)
static void update_heap_entry(struct constant_heap *heap, unsigned int idx, DWORD new_version)
static void shader_glsl_init_context_state(struct wined3d_context *context)
static void shader_glsl_texreg2ar(const struct wined3d_shader_instruction *ins)
static const char * get_attribute_keyword(const struct wined3d_gl_info *gl_info)
static void shader_glsl_add_src_param(const struct wined3d_shader_instruction *ins, const struct wined3d_shader_src_param *wined3d_src, DWORD mask, struct glsl_src_param *glsl_src)
static BOOL shader_glsl_use_layout_binding_qualifier(const struct wined3d_gl_info *gl_info)
static BOOL shader_glsl_color_fixup_supported(struct color_fixup_desc fixup)
static void shader_glsl_generate_sm4_output_setup(struct shader_glsl_priv *priv, const struct wined3d_shader *shader, unsigned int input_count, const struct wined3d_gl_info *gl_info, BOOL rasterizer_setup, const DWORD *interpolation_mode)
static void shader_glsl_cut(const struct wined3d_shader_instruction *ins)
static DWORD shader_glsl_add_dst_param(const struct wined3d_shader_instruction *ins, const struct wined3d_shader_dst_param *wined3d_dst, struct glsl_dst_param *glsl_dst)
static void shader_glsl_append_imm_vec4(struct wined3d_string_buffer *buffer, const float *values)
static void shader_glsl_disable(void *shader_priv, struct wined3d_context *context)
static void shader_glsl_texreg2gb(const struct wined3d_shader_instruction *ins)
unsigned int resinfo_size
static unsigned int shader_glsl_get_shader_model(const struct wined3d_gl_info *gl_info)
static void shader_glsl_sample_c(const struct wined3d_shader_instruction *ins)
static void shader_glsl_gather4(const struct wined3d_shader_instruction *ins)
static void shader_glsl_conditional_op(const struct wined3d_shader_instruction *ins)
static void shader_glsl_cross(const struct wined3d_shader_instruction *ins)
static void glsl_vertex_pipe_texmatrix_np2(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_generate_default_control_point_phase(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps)
static void shader_glsl_generate_ds_epilogue(const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader, const struct ds_compile_args *args)
static void glsl_vertex_pipe_hs(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_select_compute(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
static void shader_glsl_uav_counter(const struct wined3d_shader_instruction *ins)
static GLuint shader_glsl_generate_domain_shader(const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct ds_compile_args *args)
static void multiply_vector_matrix(struct wined3d_vec4 *dest, const struct wined3d_vec4 *src1, const struct wined3d_matrix *src2)
static unsigned int shader_glsl_swizzle_get_component(DWORD swizzle, unsigned int component_idx)
static void glsl_fragment_pipe_fog(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_color_correction(const struct wined3d_shader_instruction *ins, struct color_fixup_desc fixup)
static void reset_program_constant_version(struct wine_rb_entry *entry, void *context)
static void shader_glsl_load_fog_uniform(const struct wined3d_context *context, const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
static void glsl_vertex_pipe_material(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_load_color_key_constant(const struct glsl_ps_program *ps, const struct wined3d_gl_info *gl_info, const struct wined3d_state *state)
static void shader_glsl_bitwise_op(const struct wined3d_shader_instruction *ins)
static void shader_glsl_add_instruction_modifiers(const struct wined3d_shader_instruction *ins)
static const char * get_info_log_line(const char **ptr)
static BOOL vs_args_equal(const struct vs_compile_args *stored, const struct vs_compile_args *new, const DWORD use_map)
static void shader_glsl_nrm(const struct wined3d_shader_instruction *ins)
static void shader_glsl_cast(const struct wined3d_shader_instruction *ins, const char *vector_constructor, const char *scalar_constructor)
static void shader_glsl_handle_instruction(const struct wined3d_shader_instruction *ins)
static unsigned int shader_glsl_get_write_mask_size(DWORD write_mask)
static void shader_glsl_setup_sm3_rasterizer_input(struct shader_glsl_priv *priv, const struct wined3d_gl_info *gl_info, const DWORD *map, const struct wined3d_shader_signature *input_signature, const struct wined3d_shader_reg_maps *reg_maps_in, unsigned int input_count, const struct wined3d_shader_signature *output_signature, const struct wined3d_shader_reg_maps *reg_maps_out, BOOL per_vertex_point_size)
static DWORD glsl_fragment_pipe_get_emul_mask(const struct wined3d_gl_info *gl_info)
static void shader_glsl_end(const struct wined3d_shader_instruction *ins)
static void shader_glsl_ffp_vertex_lightambient_uniform(const struct wined3d_context *context, const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
static void glsl_vertex_pipe_vp_get_caps(const struct wined3d_gl_info *gl_info, struct wined3d_vertex_caps *caps)
static void shader_glsl_case(const struct wined3d_shader_instruction *ins)
static BOOL is_mipmapped(enum wined3d_shader_resource_type resource_type)
static void shader_glsl_fixup_scalar_register_variable(char *register_name, const char *glsl_variable, const struct wined3d_gl_info *gl_info)
static BOOL glsl_is_color_reg_read(const struct wined3d_shader *shader, unsigned int idx)
static void shader_glsl_generate_transform_feedback_varyings(const struct wined3d_stream_output_desc *so_desc, struct wined3d_string_buffer *buffer, const char **varyings, unsigned int *varying_count, char *strings, unsigned int *strings_length, GLenum buffer_mode)
static void shader_glsl_texdp3tex(const struct wined3d_shader_instruction *ins)
static GLuint find_glsl_vshader(const struct wined3d_context *context, struct shader_glsl_priv *priv, struct wined3d_shader *shader, const struct vs_compile_args *args)
static void shader_glsl_update_float_vertex_constants(struct wined3d_device *device, UINT start, UINT count)
static void shader_glsl_ld_raw_structured(const struct wined3d_shader_instruction *ins)
static struct glsl_shader_prog_link * get_glsl_program_entry(const struct shader_glsl_priv *priv, const struct glsl_program_key *key)
static void shader_glsl_load_constants_i(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, const struct wined3d_ivec4 *constants, const GLint locations[WINED3D_MAX_CONSTS_I], WORD constants_set)
static void shader_glsl_call(const struct wined3d_shader_instruction *ins)
static void shader_glsl_free_ffp_vertex_shader(struct wine_rb_entry *entry, void *context)
static void set_glsl_compute_shader_program(const struct wined3d_context *context, const struct wined3d_state *state, struct shader_glsl_priv *priv, struct glsl_context_data *ctx_data)
static void shader_glsl_binop(const struct wined3d_shader_instruction *ins)
const struct fragment_pipeline glsl_fragment_pipe
static void shader_glsl_load_program_resources(const struct wined3d_context *context, struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader *shader)
static void shader_glsl_init_uniform_block_bindings(const struct wined3d_gl_info *gl_info, struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader_reg_maps *reg_maps)
static void shader_glsl_label(const struct wined3d_shader_instruction *ins)
static void shader_glsl_setup_sm4_shader_output(struct shader_glsl_priv *priv, unsigned int input_count, const struct wined3d_shader_signature *output_signature, const struct wined3d_shader_reg_maps *reg_maps_out, const char *output_variable_name, BOOL rasterizer_setup)
static GLuint find_glsl_pshader(const struct wined3d_context *context, struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, struct wined3d_shader *shader, const struct ps_compile_args *args, const struct ps_np2fixup_info **np2fixup_info)
static void shader_glsl_write_mask_to_str(DWORD write_mask, char *str)
static void shader_glsl_generate_vs_epilogue(const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader, const struct vs_compile_args *args)
static const struct wined3d_shader_resource_info * shader_glsl_get_resource_info(const struct wined3d_shader_instruction *ins, const struct wined3d_shader_register *reg)
static void shader_glsl_input_pack(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_signature *input_signature, const struct wined3d_shader_reg_maps *reg_maps, const struct ps_compile_args *args, const struct wined3d_gl_info *gl_info, BOOL unroll)
static void shader_glsl_texbem(const struct wined3d_shader_instruction *ins)
static void shader_glsl_load_icb(const struct wined3d_gl_info *gl_info, struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader_reg_maps *reg_maps)
static void shader_glsl_get_coord_size(enum wined3d_shader_resource_type resource_type, unsigned int *coord_size, unsigned int *deriv_size)
static GLuint find_glsl_hull_shader(const struct wined3d_context *context, struct shader_glsl_priv *priv, struct wined3d_shader *shader)
static void shader_glsl_get_register_name(const struct wined3d_shader_register *reg, enum wined3d_data_type data_type, char *register_name, BOOL *is_color, const struct wined3d_shader_instruction *ins)
static void * glsl_fragment_pipe_alloc(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv)
static void shader_glsl_init_ds_uniform_locations(const struct wined3d_gl_info *gl_info, struct shader_glsl_priv *priv, GLuint program_id, struct glsl_ds_program *ds)
static const char * shader_glsl_shader_output_name(const struct wined3d_gl_info *gl_info)
static void shader_glsl_compare(const struct wined3d_shader_instruction *ins)
static void glsl_fragment_pipe_core_alpha_test_ref(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_bem(const struct wined3d_shader_instruction *ins)
static void glsl_fragment_pipe_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_get_sample_function(const struct wined3d_shader_context *ctx, DWORD resource_idx, DWORD sampler_idx, DWORD flags, struct glsl_sample_function *sample_function)
static void shader_glsl_sync(const struct wined3d_shader_instruction *ins)
static void shader_glsl_precompile(void *shader_priv, struct wined3d_shader *shader)
static enum wined3d_shader_interpolation_mode wined3d_extract_interpolation_mode(const DWORD *packed_interpolation_mode, unsigned int register_idx)
static void glsl_fragment_pipe_alpha_test_func(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void delete_glsl_program_entry(struct shader_glsl_priv *priv, const struct wined3d_gl_info *gl_info, struct glsl_shader_prog_link *entry)
static void shader_glsl_ffp_vertex_lighting_footer(struct wined3d_string_buffer *buffer, const struct wined3d_ffp_vs_settings *settings, unsigned int idx)
static void shader_glsl_dump_program_source(const struct wined3d_gl_info *gl_info, GLuint program)
static void glsl_vertex_pointsprite_core(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
#define WINED3D_TO_STR(u)
static void shader_glsl_texm3x3spec(const struct wined3d_shader_instruction *ins)
static void shader_glsl_init_vs_uniform_locations(const struct wined3d_gl_info *gl_info, struct shader_glsl_priv *priv, GLuint program_id, struct glsl_vs_program *vs, unsigned int vs_c_count)
static void shader_glsl_mad(const struct wined3d_shader_instruction *ins)
static const char * debug_gl_shader_type(GLenum type)
static struct glsl_ffp_fragment_shader * shader_glsl_find_ffp_fragment_shader(struct shader_glsl_priv *priv, const struct ffp_frag_settings *args, const struct wined3d_context *context)
static void glsl_vertex_pipe_world(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_load_np2fixup_constants(const struct glsl_ps_program *ps, const struct wined3d_gl_info *gl_info, const struct wined3d_state *state)
static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TABLE_SIZE]
static void glsl_vertex_pipe_pointsize(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_swizzle_to_str(DWORD swizzle, BOOL fixup, DWORD mask, char *str)
static void shader_glsl_load_samplers(const struct wined3d_context *context, struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader_reg_maps *reg_maps)
static void shader_glsl_ffp_vertex_light_uniform(const struct wined3d_context *context, const struct wined3d_state *state, unsigned int light, const struct wined3d_light_info *light_info, struct glsl_shader_prog_link *prog)
static unsigned int shader_glsl_find_sampler(const struct wined3d_shader_sampler_map *sampler_map, unsigned int resource_idx, unsigned int sampler_idx)
static BOOL shader_glsl_use_interface_blocks(const struct wined3d_gl_info *gl_info)
static void shader_glsl_sgn(const struct wined3d_shader_instruction *ins)
static unsigned int shader_glsl_map_tex_unit(const struct wined3d_context *context, const struct wined3d_shader_version *shader_version, unsigned int sampler_idx)
static GLuint shader_glsl_generate_hull_shader(const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader)
static void shader_glsl_default(const struct wined3d_shader_instruction *ins)
static void shader_glsl_ffp_vertex_texmatrix_uniform(const struct wined3d_context *context, const struct wined3d_state *state, unsigned int tex, struct glsl_shader_prog_link *prog)
static void shader_glsl_gen_sample_c_lz(const struct wined3d_shader_instruction *ins, unsigned int sampler_bind_idx, const struct glsl_sample_function *sample_function, unsigned int coord_size, const char *coord_param, const char *ref_param)
static void shader_glsl_store_raw_structured(const struct wined3d_shader_instruction *ins)
static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
static void shader_glsl_free_context_data(struct wined3d_context *context)
static void glsl_fragment_pipe_free_context_data(struct wined3d_context *context)
static struct glsl_ffp_vertex_shader * shader_glsl_find_ffp_vertex_shader(struct shader_glsl_priv *priv, const struct wined3d_gl_info *gl_info, const struct wined3d_ffp_vs_settings *settings)
static void glsl_fragment_pipe_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
static void shader_glsl_tex(const struct wined3d_shader_instruction *ins)
static void shader_glsl_nop(const struct wined3d_shader_instruction *ins)
static DWORD shader_glsl_append_dst_ext(struct wined3d_string_buffer *buffer, const struct wined3d_shader_instruction *ins, const struct wined3d_shader_dst_param *dst, enum wined3d_data_type data_type)
const struct wined3d_vertex_pipe_ops glsl_vertex_pipe
static void shader_glsl_release_sample_function(const struct wined3d_shader_context *ctx, struct glsl_sample_function *sample_function)
static void shader_glsl_sprintf_cast(struct wined3d_string_buffer *dst_param, const char *src_param, enum wined3d_data_type dst_data_type, enum wined3d_data_type src_data_type)
static void glsl_vertex_pipe_light(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
@ HEAP_NODE_TRAVERSE_RIGHT
@ HEAP_NODE_TRAVERSE_LEFT
static HRESULT shader_glsl_compile_compute_shader(struct shader_glsl_priv *priv, const struct wined3d_context *context, struct wined3d_shader *shader)
static void glsl_fragment_pipe_alpha_test(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static const char * shader_glsl_shader_input_name(const struct wined3d_gl_info *gl_info)
static void glsl_fragment_pipe_enable(const struct wined3d_gl_info *gl_info, BOOL enable)
static DWORD shader_glsl_get_write_mask(const struct wined3d_shader_dst_param *param, char *write_mask)
static void shader_glsl_dst(const struct wined3d_shader_instruction *ins)
static void shader_glsl_texm3x2tex(const struct wined3d_shader_instruction *ins)
static void shader_glsl_update_float_pixel_constants(struct wined3d_device *device, UINT start, UINT count)
static void glsl_vertex_pipe_vertexblend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void get_normal_matrix(struct wined3d_context *context, struct wined3d_matrix *mat, float *normal)
static void shader_glsl_ifc(const struct wined3d_shader_instruction *ins)
static void shader_glsl_lit(const struct wined3d_shader_instruction *ins)
static void shader_glsl_store_uav(const struct wined3d_shader_instruction *ins)
static void constant_heap_free(struct constant_heap *heap)
static void shader_glsl_texdepth(const struct wined3d_shader_instruction *ins)
static void shader_glsl_get_swizzle(const struct wined3d_shader_src_param *param, BOOL fixup, DWORD mask, char *swizzle_str)
static GLuint shader_glsl_generate_geometry_shader(const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct gs_compile_args *args)
static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *priv, const struct wined3d_ffp_vs_settings *settings, const struct wined3d_gl_info *gl_info)
static void shader_glsl_breakc(const struct wined3d_shader_instruction *ins)
static void walk_constant_heap(const struct wined3d_gl_info *gl_info, const struct wined3d_vec4 *constants, const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version)
static void shader_glsl_bufinfo(const struct wined3d_shader_instruction *ins)
static void * glsl_vertex_pipe_vp_alloc(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv)
static void shader_glsl_texm3x2pad(const struct wined3d_shader_instruction *ins)
static void shader_glsl_destroy(struct wined3d_shader *shader)
static void glsl_vertex_pipe_view(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_generate_ps_epilogue(const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader, const struct ps_compile_args *args)
static void glsl_fragment_pipe_core_alpha_test(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void glsl_vertex_pipe_geometry_shader(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_select(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
static GLuint shader_glsl_generate_compute_shader(const struct wined3d_context *context, struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, const struct wined3d_shader *shader)
static void shader_glsl_float16(const struct wined3d_shader_instruction *ins)
static void shader_glsl_to_int(const struct wined3d_shader_instruction *ins)
void print_glsl_info_log(const struct wined3d_gl_info *gl_info, GLuint id, BOOL program)
static void shader_glsl_texm3x3vspec(const struct wined3d_shader_instruction *ins)
static const struct @289 resource_type_info[]
static void shader_glsl_free_ffp_fragment_shader(struct wine_rb_entry *entry, void *context)
static void shader_glsl_mnxn(const struct wined3d_shader_instruction *ins)
static void shader_glsl_append_imm_ivec(struct wined3d_string_buffer *buffer, const int *values, unsigned int size)
static void shader_glsl_add_src_param_ext(const struct wined3d_shader_instruction *ins, const struct wined3d_shader_src_param *wined3d_src, DWORD mask, struct glsl_src_param *glsl_src, enum wined3d_data_type data_type)
static void shader_glsl_continue(const struct wined3d_shader_instruction *ins)
static GLuint shader_glsl_generate_vs3_rasterizer_input_setup(struct shader_glsl_priv *priv, const struct wined3d_shader *vs, const struct wined3d_shader *ps, BOOL per_vertex_point_size, BOOL flatshading, const struct wined3d_gl_info *gl_info)
static void append_transform_feedback_varying(const char **varyings, unsigned int *varying_count, char **strings, unsigned int *strings_length, struct wined3d_string_buffer *buffer)
static void glsl_vertex_pipe_vdecl(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
_Check_return_ float __cdecl cosf(_In_ float x)
#define location(file, line)
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
static const WCHAR desc[]
static float(__cdecl *square_half_float)(float x
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)
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
static void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context)
static void wine_rb_for_each_entry(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_remove(struct wine_rb_tree *tree, struct wine_rb_entry *entry)
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 short y_sign_fixup
unsigned short x_sign_fixup
unsigned short z_sign_fixup
unsigned short w_sign_fixup
struct constant_entry * entries
union constant::@251 value[4]
DWORD MaxSimultaneousTextures
DWORD MaxTextureBlendStages
struct glsl_shader_prog_link * glsl_program
GLenum vertex_color_clamp
BOOL rasterization_disabled
struct shader_glsl_priv * priv
const struct wined3d_gl_info * gl_info
struct ffp_frag_desc entry
struct list linked_programs
struct wined3d_ffp_vs_desc desc
struct list linked_programs
struct ps_compile_args args
struct ps_np2fixup_info np2fixup
GLint bumpenv_lum_scale_location[MAX_TEXTURES]
GLint fog_density_location
GLint tex_factor_location
GLint alpha_test_ref_location
GLint uniform_b_locations[WINED3D_MAX_CONSTS_B]
GLint tss_constant_location[MAX_TEXTURES]
GLint uniform_i_locations[WINED3D_MAX_CONSTS_I]
GLint ycorrection_location
GLint uniform_f_locations[WINED3D_MAX_PS_CONSTS_F]
GLint specular_enable_location
GLint bumpenv_mat_location[MAX_TEXTURES]
GLint bumpenv_lum_offset_location[MAX_TEXTURES]
const struct ps_np2fixup_info * np2_fixup_info
enum wined3d_data_type data_type
struct wined3d_string_buffer * name
enum wined3d_shader_resource_type emulate_lod
BOOL output_single_component
unsigned int num_gl_shaders
struct glsl_ds_compiled_shader * ds
union glsl_shader_private::@291 gl_shaders
struct glsl_hs_compiled_shader * hs
struct glsl_ps_compiled_shader * ps
struct glsl_gs_compiled_shader * gs
unsigned int shader_array_size
struct glsl_cs_compiled_shader * cs
struct glsl_vs_compiled_shader * vs
struct glsl_hs_program hs
struct glsl_vs_program vs
struct wine_rb_entry program_lookup_entry
struct glsl_gs_program gs
DWORD constant_update_mask
struct glsl_ds_program ds
unsigned int constant_version
DWORD shader_controlled_clip_distances
struct glsl_ps_program ps
struct glsl_cs_program cs
GLint pointsize_max_location
GLint pointsize_l_att_location
struct glsl_vs_program::@290 light_location[MAX_ACTIVE_LIGHTS]
GLint uniform_f_locations[WINED3D_MAX_VS_CONSTS_F]
GLint clip_planes_location
GLint projection_matrix_location
GLenum vertex_color_clamp
GLint texture_matrix_location[MAX_TEXTURES]
GLint light_ambient_location
GLint normal_matrix_location[MAX_VERTEX_INDEX_BLENDS]
GLint material_shininess_location
GLint pointsize_q_att_location
GLint uniform_b_locations[WINED3D_MAX_CONSTS_B]
GLint material_diffuse_location
GLint material_emissive_location
GLint uniform_i_locations[WINED3D_MAX_CONSTS_I]
GLint material_specular_location
GLint modelview_matrix_location[MAX_VERTEX_INDEX_BLENDS]
GLint pointsize_min_location
GLint pointsize_c_att_location
GLint material_ambient_location
unsigned char idx[MAX_FRAGMENT_SAMPLERS]
const struct ds_compile_args * cur_ds_args
const struct vs_compile_args * cur_vs_args
struct ps_np2fixup_info * cur_np2fixup_info
const struct ps_compile_args * cur_ps_args
struct wined3d_string_buffer_list * string_buffers
struct constant_heap pconst_heap
struct wined3d_string_buffer_list string_buffers
struct wine_rb_tree ffp_vertex_shaders
UINT next_constant_version
struct constant_heap vconst_heap
struct wine_rb_tree ffp_fragment_shaders
const struct fragment_pipeline * fragment_pipe
struct wine_rb_tree program_lookup
const struct wined3d_vertex_pipe_ops * vertex_pipe
struct wined3d_string_buffer shader_buffer
unsigned int next_shader_input_count
BYTE per_vertex_point_size
const struct wined3d_gl_info * gl_info
BOOL emulated_flatshading
BOOL supported[WINED3D_GL_EXT_COUNT]
struct opengl_funcs gl_ops
DWORD reserved_glsl_constants
struct wined3d_gl_limits limits
unsigned int output_vertex_count
struct wined3d_hull_shader::@303 phases
struct wined3d_vec4 position
struct wined3d_light OriginalParms
struct wined3d_vec4 direction
BOOL check_float_constants
struct wined3d_shader_register reg
unsigned int component_count
unsigned int register_size
unsigned int register_idx
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_texel_offset texel_offset
unsigned int instance_count
unsigned int temporary_count
UINT cb_sizes[WINED3D_MAX_CBS]
struct wined3d_shader_version shader_version
DWORD input_rel_addressing
union wined3d_shader_reg_maps::@294 u
struct wined3d_shader_tgsm * tgsm
const struct wined3d_shader_immediate_constant_buffer * icb
unsigned int temporary_count
struct wined3d_shader_sampler_map sampler_map
struct list indexable_temps
BYTE output_registers_mask[MAX_REG_OUTPUT]
struct wined3d_shader_resource_info resource_info[MAX_SHADER_RESOURCE_VIEWS]
struct wined3d_shader_resource_info uav_resource_info[MAX_UNORDERED_ACCESS_VIEWS]
enum wined3d_shader_resource_type type
enum wined3d_data_type data_type
unsigned int resource_idx
struct wined3d_shader_sampler_map_entry * entries
unsigned int register_idx
const char * semantic_name
unsigned int semantic_idx
enum wined3d_sysval_semantic sysval_semantic
struct wined3d_shader_signature_element * elements
enum wined3d_shader_src_modifier modifiers
struct wined3d_shader_register reg
enum wined3d_shader_type type
union wined3d_shader::@304 u
struct wined3d_shader_signature input_signature
struct wined3d_pixel_shader ps
const struct wined3d_shader_limits * limits
struct wined3d_shader_reg_maps reg_maps
struct list linked_programs
unsigned int buffer_strides[WINED3D_MAX_STREAM_OUTPUT_BUFFERS]
struct wined3d_stream_output_element * elements
unsigned int element_count
unsigned int rasterizer_stream_idx
DWORD vertex_processing_caps
DWORD max_user_clip_planes
BOOL emulated_flatshading
BOOL ffp_generic_attributes
DWORD max_vertex_blend_matrix_index
DWORD max_vertex_blend_matrices
Character const *const prefix
#define new(TYPE, numElems)
#define CONTAINING_RECORD(address, type, field)
#define GL_COMPUTE_SHADER
type_t * reg_type(type_t *type, const char *name, struct namespace *namespace, int t)
#define WINED3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR
#define WINED3DPRASTERCAPS_FOGRANGE
#define WINED3DVTXPCAPS_LOCALVIEWER
#define WINED3DTEXOPCAPS_ADD
#define WINED3DTEXOPCAPS_MODULATECOLOR_ADDALPHA
#define WINED3DTA_SPECULAR
static unsigned int wined3d_log2i(unsigned int x)
#define WINED3DTEXOPCAPS_BLENDDIFFUSEALPHA
#define WINED3D_TS_WORLD_MATRIX(index)
#define WINED3DTA_COMPLEMENT
@ WINED3D_DECL_USAGE_PSIZE
@ WINED3D_DECL_USAGE_POSITION
@ WINED3D_DECL_USAGE_COLOR
@ WINED3D_DECL_USAGE_TEXCOORD
#define WINED3D_NO_RASTERIZER_STREAM
#define WINED3DPMISCCAPS_PERSTAGECONSTANT
#define WINED3DVTXPCAPS_POSITIONALLIGHTS
@ WINED3D_RS_TEXTUREFACTOR
@ WINED3D_RS_COLORKEYENABLE
@ WINED3D_RS_SPECULARMATERIALSOURCE
@ WINED3D_RS_POINTSCALE_A
@ WINED3D_RS_SRGBWRITEENABLE
@ WINED3D_RS_RANGEFOGENABLE
@ WINED3D_RS_POINTSIZE_MIN
@ WINED3D_RS_POINTSCALE_C
@ WINED3D_RS_FOGTABLEMODE
@ WINED3D_RS_POINTSIZE_MAX
@ WINED3D_RS_CLIPPLANEENABLE
@ WINED3D_RS_AMBIENTMATERIALSOURCE
@ WINED3D_RS_POINTSPRITEENABLE
@ WINED3D_RS_DIFFUSEMATERIALSOURCE
@ WINED3D_RS_NORMALIZENORMALS
@ WINED3D_RS_EMISSIVEMATERIALSOURCE
@ WINED3D_RS_SPECULARENABLE
@ WINED3D_RS_POINTSCALEENABLE
@ WINED3D_RS_FOGVERTEXMODE
@ WINED3D_RS_POINTSCALE_B
@ WINED3D_RS_INDEXEDVERTEXBLENDENABLE
@ WINED3D_RS_ALPHATESTENABLE
@ WINED3D_PT_TRIANGLELIST_ADJ
@ WINED3D_PT_LINELIST_ADJ
@ WINED3D_PT_TRIANGLESTRIP
@ WINED3D_PT_TRIANGLELIST
#define WINED3DVTXPCAPS_TEXGEN
#define WINED3DTEXOPCAPS_BUMPENVMAPLUMINANCE
wined3d_material_color_source
#define WINED3DVTXPCAPS_MATERIALSOURCE7
#define WINED3DTEXOPCAPS_BLENDTEXTUREALPHA
#define WINED3DTEXOPCAPS_MODULATE2X
#define WINED3D_MAX_STREAM_OUTPUT_BUFFERS
#define WINED3DVTXPCAPS_VERTEXFOG
#define WINED3DTA_SELECTMASK
#define WINED3DTEXOPCAPS_DISABLE
@ WINED3D_SV_CULL_DISTANCE
@ WINED3D_SV_CLIP_DISTANCE
@ WINED3D_SV_TESS_FACTOR_QUADINT
@ WINED3D_SV_IS_FRONT_FACE
@ WINED3D_SV_TESS_FACTOR_QUADEDGE
@ WINED3D_SV_TESS_FACTOR_LINEDET
@ WINED3D_SV_RENDER_TARGET_ARRAY_INDEX
@ WINED3D_SV_TESS_FACTOR_TRIINT
@ WINED3D_SV_TESS_FACTOR_TRIEDGE
@ WINED3D_SV_TESS_FACTOR_LINEDEN
@ WINED3D_LIGHT_PARALLELPOINT
@ WINED3D_LIGHT_DIRECTIONAL
#define WINED3DTEXOPCAPS_SELECTARG1
#define WINED3D_VIEW_BUFFER_RAW
#define WINED3DTA_TFACTOR
#define WINED3DTSS_TCI_PASSTHRU
#define WINED3DTEXOPCAPS_SUBTRACT
@ WINED3D_TSS_BUMPENV_LOFFSET
@ WINED3D_TSS_TEXCOORD_INDEX
@ WINED3D_TSS_BUMPENV_LSCALE
@ WINED3D_TSS_BUMPENV_MAT00
@ WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
#define WINED3DFVFCAPS_PSIZE
#define WINED3DTEXOPCAPS_BUMPENVMAP
#define WINED3DTA_CURRENT
#define WINED3DTEXOPCAPS_ADDSIGNED2X
#define WINED3DTEXOPCAPS_MODULATE4X
#define WINED3DTSS_TCI_CAMERASPACENORMAL
@ 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 WINED3D_STREAM_OUTPUT_GAP
#define WINED3DTSS_TCI_SPHEREMAP
#define WINED3DVTXPCAPS_TEXGEN_SPHEREMAP
#define WINED3DPMISCCAPS_TSSARGTEMP
#define WINED3DTEXOPCAPS_MULTIPLYADD
#define WINED3D_LEGACY_FFP_LIGHTING
#define WINED3DTEXOPCAPS_BLENDFACTORALPHA
#define WINED3DTA_DIFFUSE
#define WINED3DTEXOPCAPS_ADDSIGNED
#define WINED3D_PIXEL_CENTER_INTEGER
#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 WINED3DTSS_TCI_CAMERASPACEPOSITION
#define WINED3DVTXPCAPS_DIRECTIONALLIGHTS
#define WINED3DTEXOPCAPS_BLENDCURRENTALPHA
#define WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR
#define WINED3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR
@ ARB_EXPLICIT_ATTRIB_LOCATION
@ ARB_SHADING_LANGUAGE_PACKING
@ ARB_TEXTURE_QUERY_LEVELS
@ ARB_SHADER_BIT_ENCODING
@ ARB_FRAGMENT_LAYER_VIEWPORT
@ ARB_SHADER_STORAGE_BUFFER_OBJECT
@ ARB_FRAGMENT_COORD_CONVENTIONS
@ ARB_UNIFORM_BUFFER_OBJECT
@ WINED3D_GL_NORMALIZED_TEXRECT
@ ARB_SHADER_ATOMIC_COUNTERS
@ ARB_SHADING_LANGUAGE_420PACK
@ ARB_TESSELLATION_SHADER
@ ARB_TRANSFORM_FEEDBACK3
@ ARB_TEXTURE_NON_POWER_OF_TWO
@ WINED3D_GL_LEGACY_CONTEXT
@ ARB_SHADER_IMAGE_LOAD_STORE
@ ARB_TEXTURE_CUBE_MAP_ARRAY
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
static BOOL needs_interpolation_qualifiers_for_shader_outputs(const struct wined3d_gl_info *gl_info)
#define WINED3DSP_WRITEMASK_ALL
static void context_apply_state(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
#define STATE_CLIPPLANE(a)
#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
wined3d_shader_interpolation_mode
@ WINED3DSIM_LINEAR_NOPERSPECTIVE
@ WINED3DSIH_GATHER4_PO_C
@ WINED3DSIH_IMM_ATOMIC_XOR
@ WINED3DSIH_IMM_ATOMIC_IADD
@ WINED3DSIH_STORE_STRUCTURED
@ WINED3DSIH_IMM_ATOMIC_UMAX
@ WINED3DSIH_ATOMIC_CMP_STORE
@ WINED3DSIH_LD_STRUCTURED
@ WINED3DSIH_IMM_ATOMIC_AND
@ WINED3DSIH_IMM_ATOMIC_UMIN
@ WINED3DSIH_IMM_ATOMIC_CMP_EXCH
@ WINED3DSIH_IMM_ATOMIC_IMAX
@ WINED3DSIH_IMM_ATOMIC_ALLOC
@ WINED3DSIH_IMM_ATOMIC_IMIN
@ WINED3DSIH_IMM_ATOMIC_EXCH
@ WINED3DSIH_FIRSTBIT_SHI
@ WINED3DSIH_IMM_ATOMIC_OR
#define WINED3DSP_WRITEMASK_3
@ WINED3D_TESSELLATOR_OUTPUT_POINT
@ WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CW
@ WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW
@ WINED3D_TESSELLATOR_OUTPUT_LINE
#define WINED3DSI_TEXLD_BIAS
#define WINED3D_PSARGS_PROJECTED
@ WINED3D_FFP_ATTRIBS_COUNT
#define WINED3D_FRAGMENT_CAP_COLOR_KEY
@ WINED3DSSF_THREAD_GROUP
@ WINED3DSSF_GROUP_SHARED_MEMORY
wined3d_shader_src_modifier
#define WINED3D_PACKED_INTERPOLATION_BIT_COUNT
#define STATE_TRANSFORM(a)
#define MAKEDWORD_VERSION(maj, min)
static BOOL use_vs(const struct wined3d_state *state)
#define WINED3D_MAX_PS_CONSTS_F
#define WINED3D_SHADER_CONST_PS_F
#define STATE_POINT_ENABLE
#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND
#define WINED3D_PSARGS_TEXTRANSFORM_SHIFT
@ WINED3DSPDM_MSAMPCENTROID
@ WINED3DSPDM_PARTIALPRECISION
#define WINED3DSI_RESINFO_UINT
#define WINED3D_MAX_VS_CONSTS_F
#define WINED3D_TEXTURE_POW2_MAT_IDENT
#define WINED3D_SHADER_CONST_VS_B
#define WINED3D_PSARGS_TEXTRANSFORM_MASK
static enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)
static BOOL wined3d_dualblend_enabled(const struct wined3d_state *state, const struct wined3d_gl_info *gl_info)
#define MAX_VERTEX_INDEX_BLENDS
static BOOL wined3d_shader_instruction_has_texel_offset(const struct wined3d_shader_instruction *ins)
#define STATE_ACTIVELIGHT(a)
#define MAX_UNORDERED_ACCESS_VIEWS
#define WINED3D_SHADER_CONST_VS_I
static BOOL is_complex_fixup(struct color_fixup_desc fixup)
#define WINED3D_SHADER_CONST_PS_I
wined3d_shader_resource_type
@ WINED3D_SHADER_RESOURCE_BUFFER
@ WINED3D_SHADER_RESOURCE_TEXTURE_3D
@ WINED3D_SHADER_RESOURCE_TEXTURE_2D
@ WINED3D_SHADER_RESOURCE_TEXTURE_1DARRAY
@ WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY
@ WINED3D_SHADER_RESOURCE_NONE
@ WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY
@ WINED3D_SHADER_RESOURCE_TEXTURE_2DMS
@ WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY
@ WINED3D_SHADER_RESOURCE_TEXTURE_CUBE
@ WINED3D_SHADER_RESOURCE_TEXTURE_1D
#define WINED3D_SAMPLER_DEFAULT
#define WINED3D_SHADER_CONST_FFP_COLOR_KEY
#define WINED3D_FRAGMENT_CAP_SRGB_WRITE
#define WINED3D_SHADER_VERSION(major, minor)
#define WINED3D_SHADER_CAP_SRGB_WRITE
static const struct color_fixup_desc COLOR_FIXUP_IDENTITY
#define WINED3D_SHADER_CONST_PS_NP2_FIXUP
static BOOL is_rasterization_disabled(const struct wined3d_shader *geometry_shader)
#define MAX_ACTIVE_LIGHTS
#define GL_EXT_EMUL_ARB_MULTITEXTURE
@ WINED3D_TESSELLATOR_DOMAIN_TRIANGLE
@ WINED3D_TESSELLATOR_DOMAIN_QUAD
@ WINED3D_TESSELLATOR_DOMAIN_LINE
#define STATE_SAMPLER(num)
static void wined3d_color_from_d3dcolor(struct wined3d_color *wined3d_color, DWORD d3d_color)
#define WINED3D_QUIRK_INFO_LOG_SPAM
static BOOL is_identity_fixup(struct color_fixup_desc fixup)
#define WINED3D_SHADER_CONST_VS_F
static BOOL shader_is_scalar(const struct wined3d_shader_register *reg)
@ 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
wined3d_shader_register_type
@ WINED3DSPR_LOCALTHREADID
@ WINED3DSPR_OUTCONTROLPOINT
@ WINED3DSPR_INCONTROLPOINT
@ WINED3DSPR_THREADGROUPID
@ WINED3DSPR_GROUPSHAREDMEM
@ WINED3DSPR_LOCALTHREADINDEX
@ WINED3DSPR_IMMCONSTBUFFER
#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND_INDEX(i)
#define WINED3D_SHADER_CONST_PS_ALPHA_TEST
#define WINED3D_FRAGMENT_CAP_PROJ_CONTROL
#define WINED3DSP_NOSWIZZLE
#define WINED3DSI_TEXLD_PROJECT
#define WINED3D_SHADER_CONST_PS_B
@ WINED3D_IMMCONST_SCALAR
#define WINED3D_SHADER_CONST_PS_Y_CORR
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_SHADER_CONST_FFP_MODELVIEW
#define WINED3D_SHADER_CONST_FFP_PS
@ 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_GLSL_CLIP_VARYING
#define WINED3D_SHADER_CONST_FFP_LIGHTS
#define WINED3D_SHADER_CONST_FFP_PROJ
@ WINED3D_FFP_VS_FOG_FOGCOORD
@ WINED3D_FFP_VS_FOG_DEPTH
@ WINED3D_FFP_VS_FOG_RANGE
@ WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD
@ WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN
@ WINED3D_TESSELLATOR_PARTITIONING_INTEGER
@ WINED3D_TESSELLATOR_PARTITIONING_POW2
#define STATE_TEXTURESTAGE(stage, num)
#define WINED3D_SHADER_CONST_PS_FOG
#define WINED3D_SHADER_CAP_VS_CLIPPING
#define WINED3D_MAX_CONSTS_I
#define MAX_VERTEX_BLENDS
@ WINED3D_FFP_PS_FOG_EXP2
@ WINED3D_FFP_PS_FOG_LINEAR
#define WINED3D_SHADER_CONST_FFP_TEXMATRIX
#define WINED3D_SHADER_CONST_VS_POINTSIZE
#define WINED3D_SHADER_CONST_POS_FIXUP
static BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
#define WINED3D_SHADER_CONST_VS_CLIP_PLANES
#define WINED3D_UNMAPPED_STAGE
static unsigned int wined3d_popcount(unsigned int x)
#define WINED3DSP_WRITEMASK_2
#define WINED3DSP_WRITEMASK_1
@ WINED3D_SHADER_CONDITIONAL_OP_NZ
#define WINED3D_SHADER_CONST_FFP_MATERIAL