42#define WINED3D_GLSL_SAMPLE_PROJECTED 0x01
43#define WINED3D_GLSL_SAMPLE_LOD 0x02
44#define WINED3D_GLSL_SAMPLE_GRAD 0x04
45#define WINED3D_GLSL_SAMPLE_LOAD 0x08
46#define WINED3D_GLSL_SAMPLE_OFFSET 0x10
357#define WINED3D_TO_STR(u) case u: return #u
393 FIXME(
"Unhandled shader type %#x.\n",
type);
427 const int *int_values = (
const int *)
values;
470 ERR(
"Invalid vector size %u.\n",
size);
518 WARN(
"Info log received from GLSL shader #%u:\n",
id);
526 FIXME(
"Info log received from GLSL shader #%u:\n",
id);
563 GLint i, shader_count, source_size = -1;
570 ERR(
"Failed to allocate shader array memory.\n");
575 for (
i = 0;
i < shader_count; ++
i)
582 if (source_size < tmp)
588 ERR(
"Failed to allocate %d bytes for shader source.\n", tmp);
603 FIXME(
" GL_COMPILE_STATUS: %d.\n", tmp);
639 unsigned int base,
i;
642 if (!(bindings =
calloc(*
count,
sizeof(*bindings))))
665 unsigned int bind_idx, shader_sampler_count,
base,
i;
668 const unsigned int *tex_unit_map;
673 shader_sampler_count =
shader->reg_maps.sampler_map.count;
674 if (shader_sampler_count > *
count)
676 FIXME(
"Shader %p needs %u samplers, but only %u are supported.\n",
682 if (!(bindings =
calloc(*
count,
sizeof(*bindings))))
714 unsigned int binding_count, combined_sampler_count;
747 ERR(
"Failed to create resource bindings.\n");
753 ERR(
"Failed to create combined sampler bindings.\n");
782 info.options = compile_options;
792 FIXME(
"Shader log:\n");
802 free(combined_samplers);
807 ERR(
"Failed to compile shader, ret %d.\n",
ret);
811 if (!(shader_id =
GL_EXTCALL(glCreateShader(gl_shader_type))))
813 ERR(
"Failed to create shader.\n");
818 TRACE(
"Compiling shader object %u.\n", shader_id);
863 block_idx =
GL_EXTCALL(glGetUniformBlockIndex(program_id,
name->buffer));
873 unsigned int base,
unsigned int count,
const unsigned int *tex_unit_map)
876 unsigned int i, mapped_unit;
882 name_loc =
GL_EXTCALL(glGetUniformLocation(program_id, sampler_name->
buffer));
886 mapped_unit = tex_unit_map ? tex_unit_map[
base +
i] :
base +
i;
889 ERR(
"Trying to load sampler %s on unsupported unit %u.\n", sampler_name->
buffer, mapped_unit);
893 TRACE(
"Loading sampler %s on unit %u.\n", sampler_name->
buffer, mapped_unit);
894 GL_EXTCALL(glUniform1i(name_loc, mapped_unit));
908 if (sampler_idx >=
count)
911 return base + sampler_idx;
917 unsigned int sampler_idx)
923 ERR(
"Unmapped sampler %u.\n", sampler_idx);
933 const unsigned int *tex_unit_map;
958 icb_location =
GL_EXTCALL(glGetUniformLocation(program_id, icb_name->
buffer));
989 TRACE(
"Loading image %s on unit %u.\n",
name->buffer,
i);
1024 *strings_length +=
buffer->content_size + 1;
1029 unsigned int *varying_count,
char **
strings,
unsigned int *strings_length,
1047 const char **
varyings,
unsigned int *varying_count,
char *
strings,
unsigned int *strings_length,
1052 unsigned int i, register_idx, component_idx;
1056 highest_output_slot = 0;
1065 highest_output_slot =
max(highest_output_slot,
e->output_slot);
1066 if (
e->output_slot != buffer_idx)
1071 FIXME(
"Unhandled stream %u.\n",
e->stream_idx);
1077 if (!
e->semantic_name)
1107 have_varyings_to_record =
TRUE;
1110 if (buffer_idx < so_desc->buffer_stride_count
1111 && stride < so_desc->buffer_strides[buffer_idx] / 4)
1118 if (highest_output_slot <= buffer_idx)
1129 *varying_count =
count;
1131 *strings_length =
length;
1133 return have_varyings_to_record;
1160 if (!so_desc->
elements[
i].semantic_name)
1162 FIXME(
"ARB_transform_feedback3 is needed for stream output gaps.\n");
1184 FIXME(
"Only single element per buffer is allowed in separate mode.\n");
1195 FIXME(
"No varyings to record, disabling transform feedback.\n");
1203 ERR(
"Out of memory.\n");
1209 ERR(
"Out of memory.\n");
1230 unsigned int heap_idx = 1;
1233 if (
heap->entries[heap_idx].version <=
version)
return;
1235 idx =
heap->entries[heap_idx].idx;
1236 if (constant_locations[
idx] != -1)
1240 while (stack_idx >= 0)
1243 switch(
stack[stack_idx])
1247 unsigned int left_idx = heap_idx << 1;
1248 if (left_idx < heap->
size &&
heap->entries[left_idx].version >
version)
1250 heap_idx = left_idx;
1251 idx =
heap->entries[heap_idx].idx;
1252 if (constant_locations[
idx] != -1)
1268 unsigned int right_idx = (heap_idx << 1) + 1;
1269 if (right_idx < heap->
size &&
heap->entries[right_idx].version >
version)
1271 heap_idx = right_idx;
1272 idx =
heap->entries[heap_idx].idx;
1273 if (constant_locations[
idx] != -1)
1306 clamped_constant[0] =
data->x < -1.0f ? -1.0f :
data->x > 1.0f ? 1.0f :
data->x;
1307 clamped_constant[1] =
data->y < -1.0f ? -1.0f :
data->y > 1.0f ? 1.0f :
data->y;
1308 clamped_constant[2] =
data->z < -1.0f ? -1.0f :
data->z > 1.0f ? 1.0f :
data->z;
1309 clamped_constant[3] =
data->w < -1.0f ? -1.0f :
data->w > 1.0f ? 1.0f :
data->w;
1320 unsigned int heap_idx = 1;
1323 if (
heap->entries[heap_idx].version <=
version)
return;
1325 idx =
heap->entries[heap_idx].idx;
1329 while (stack_idx >= 0)
1332 switch(
stack[stack_idx])
1336 unsigned int left_idx = heap_idx << 1;
1337 if (left_idx < heap->
size &&
heap->entries[left_idx].version >
version)
1339 heap_idx = left_idx;
1340 idx =
heap->entries[heap_idx].idx;
1351 unsigned int right_idx = (heap_idx << 1) + 1;
1352 if (right_idx < heap->
size &&
heap->entries[right_idx].version >
version)
1354 heap_idx = right_idx;
1355 idx =
heap->entries[heap_idx].idx;
1381 if (constant_buffer)
1386 if (
shader->reg_maps.shader_version.major == 1
1393 if (!
shader->load_local_constsF)
1395 TRACE(
"No need to load local float constants for this shader.\n");
1415 if (constant_buffer)
1419 while (constants_set)
1432 unsigned int idx = lconst->
idx;
1450 if (constant_buffer)
1454 while (constants_set)
1466 unsigned int idx = lconst->
idx;
1485 float center_offset;
1508 ERR(
"Did not expect to enter this codepath without WINED3D_PIXEL_CENTER_INTEGER.\n");
1515 center_offset = 0.0f;
1517 if (
context->stream_info.position_transformed)
1520 float x =
state->viewports[0].x;
1521 float y =
state->viewports[0].y;
1522 float w =
state->viewports[0].width;
1523 float h =
state->viewports[0].height;
1524 float x_scale = 2.0f /
w;
1525 float x_offset = (center_offset - (2.0f *
x) -
w) /
w;
1526 float y_scale = flip ? 2.0f /
h : 2.0f / -
h;
1527 float y_offset = flip
1528 ? (center_offset - (2.0f *
y) -
h) /
h
1529 : (center_offset - (2.0f *
y) -
h) / -
h;
1530 bool zenable =
state->fb.depth_stencil ?
1531 (
state->depth_stencil_state ?
state->depth_stencil_state->desc.depth :
true) :
false;
1532 float z_scale = zenable ?
clip_control ? 1.0f : 2.0f : 0.0f;
1533 float z_offset = zenable ?
clip_control ? 0.0f : -1.0f : 0.0f;
1536 x_scale, 0.0f, 0.0f, 0.0f,
1537 0.0f, y_scale, 0.0f, 0.0f,
1538 0.0f, 0.0f, z_scale, 0.0f,
1539 x_offset, y_offset, z_offset, 1.0f,
1546 float y_scale = flip ? -1.0f : 1.0f;
1547 float x_offset = center_offset /
state->viewports[0].width;
1548 float y_offset = flip
1549 ? center_offset /
state->viewports[0].height
1550 : -center_offset /
state->viewports[0].height;
1551 float z_scale = clip_control ? 1.0f : 2.0f;
1552 float z_offset = clip_control ? 0.0f : -1.0f;
1555 1.0f, 0.0f, 0.0f, 0.0f,
1556 0.0f, y_scale, 0.0f, 0.0f,
1557 0.0f, 0.0f, z_scale, 0.0f,
1558 x_offset, y_offset, z_offset, 1.0f,
1570 if (
prog->vs.normal_matrix_location == -1)
1585 if (
prog->vs.texture_matrix_location[tex] == -1)
1588 GL_EXTCALL(glUniformMatrix4fv(
prog->vs.texture_matrix_location[tex],
1653 FIXME(
"Unrecognized light type %#x.\n",
type);
1700 GL_EXTCALL(glUniform1f(
prog->ps.fog_density_location, tmpvalue.f));
1727 unsigned int constant_version;
1735 constant_version =
prog->constant_version;
1736 update_mask =
context->constant_update_mask &
prog->constant_update_mask;
1752 if (
context->constant_update_mask & vs_update_mask)
1764 prog->vs.uniform_i_locations, vshader->
reg_maps.integer_constants);
1768 prog->vs.uniform_b_locations, vshader->
reg_maps.boolean_constants);
1775 for (
i = 0;
i < gl_info->
limits.user_clip_distances; ++
i)
1793 GL_EXTCALL(glUniform4fv(
prog->gs.pos_fixup_location, fixup_count, position_fixup));
1795 GL_EXTCALL(glUniform4fv(
prog->ds.pos_fixup_location, 1, position_fixup));
1797 GL_EXTCALL(glUniform4fv(
prog->vs.pos_fixup_location, 1, position_fixup));
1813 GL_EXTCALL(glUniformMatrix4fv(
prog->vs.modelview_matrix_location[0], 1,
1828 if (
prog->vs.modelview_matrix_location[
i] == -1)
1865 DWORD point_count = 0;
1866 DWORD spot_count = 0;
1867 DWORD directional_count = 0;
1868 DWORD parallel_point_count = 0;
1874 if (!
state->light_state.lights[
i])
1877 switch (
state->light_state.lights[
i]->OriginalParms.type)
1886 ++directional_count;
1889 ++parallel_point_count;
1892 FIXME(
"Unhandled light type %#x.\n",
state->light_state.lights[
i]->OriginalParms.type);
1900 for (
i = 0;
i < point_count; ++
i)
1903 for (;
i < point_count + spot_count; ++
i)
1906 for (;
i < point_count + spot_count + directional_count; ++
i)
1909 for (;
i < point_count + spot_count + directional_count + parallel_point_count; ++
i)
1921 if (
context->constant_update_mask & ps_update_mask)
1933 prog->ps.uniform_i_locations, pshader->
reg_maps.integer_constants);
1937 prog->ps.uniform_b_locations, pshader->
reg_maps.boolean_constants);
1947 if (
prog->ps.bumpenv_mat_location[
i] == -1)
1953 if (
prog->ps.bumpenv_lum_scale_location[
i] != -1)
1980 if (
prog->ps.tex_factor_location != -1)
1987 if (
prog->ps.tss_constant_location[
i] == -1)
2010 TRACE(
"Max constant version reached, resetting to 0.\n");
2023 unsigned int *positions =
heap->positions;
2024 unsigned int heap_idx, parent_idx;
2028 heap_idx =
heap->size++;
2033 heap_idx = positions[
idx];
2036 while (heap_idx > 1)
2038 parent_idx = heap_idx >> 1;
2040 if (new_version <= entries[parent_idx].
version)
break;
2042 entries[heap_idx] = entries[parent_idx];
2043 positions[entries[parent_idx].
idx] = heap_idx;
2044 heap_idx = parent_idx;
2047 entries[heap_idx].
version = new_version;
2048 entries[heap_idx].
idx =
idx;
2049 positions[
idx] = heap_idx;
2078 unsigned int ret = gl_info->
limits.glsl_varyings / 4;
2080 if(shader_major > 3)
return ret;
2165 return "noperspective ";
2167 FIXME(
"Unhandled interpolation mode %#x.\n",
mode);
2175 const uint32_t *packed_interpolation_mode,
unsigned int register_idx)
2221 const uint32_t *interpolation_mode)
2228 if (rasterizer_setup)
2233 const char *interpolation_qualifiers =
"";
2269 switch (primitive_type)
2278 return "line_strip";
2284 return "triangle_strip";
2287 return "lines_adjacency";
2290 return "triangles_adjacency";
2306 return input_reg_used & (1u <<
idx);
2317 return input_reg_used & (1u <<
input->register_idx);
2323 const struct wined3d_gl_info *gl_info,
const char *vector_type,
const char *scalar_type,
2335 unsigned int index =
e->register_idx;
2351 FIXME(
"Unhandled sysval semantic %#x.\n",
e->sysval_semantic);
2356 type =
e->component_type;
2380 unsigned int uniform_block_base, uniform_block_count;
2409 if (
shader->limits->constant_float > 0)
2411 unsigned max_constantsF;
2433 max_constantsF = gl_info->
limits.glsl_ps_float_constants;
2449 max_constantsF = gl_info->
limits.glsl_vs_float_constants - 3;
2451 max_constantsF -= gl_info->
limits.user_clip_distances;
2461 if (max_constantsF < shader->limits->constant_float)
2463 static unsigned int once;
2466 ERR_(winediag)(
"The hardware does not support enough uniform components to run this shader,"
2467 " it may not render correctly.\n");
2469 WARN(
"The hardware does not support enough uniform components to run this shader.\n");
2474 max_constantsF = gl_info->
limits.glsl_vs_float_constants;
2477 max_constantsF =
min(
shader->limits->constant_float, max_constantsF);
2496 &uniform_block_base, &uniform_block_count);
2513 const char *sampler_type_prefix, *sampler_type;
2514 BOOL shadow_sampler;
2520 ERR(
"Invalid resource index %u.\n",
entry->resource_idx);
2529 sampler_type_prefix =
"";
2533 sampler_type_prefix =
"i";
2537 sampler_type_prefix =
"u";
2541 sampler_type_prefix =
"";
2542 ERR(
"Unhandled resource data type %#x.\n", reg_maps->
resource_info[
i].data_type);
2551 switch (resource_type)
2554 sampler_type =
"samplerBuffer";
2559 sampler_type =
"sampler1DShadow";
2561 sampler_type =
"sampler1D";
2566 sampler_type =
"sampler2DShadow";
2568 sampler_type =
"sampler2D";
2573 FIXME(
"Unsupported 3D shadow sampler.\n");
2574 sampler_type =
"sampler3D";
2579 sampler_type =
"samplerCubeShadow";
2581 sampler_type =
"samplerCube";
2586 sampler_type =
"sampler1DArrayShadow";
2588 sampler_type =
"sampler1DArray";
2593 sampler_type =
"sampler2DArrayShadow";
2595 sampler_type =
"sampler2DArray";
2600 sampler_type =
"samplerCubeArrayShadow";
2602 sampler_type =
"samplerCubeArray";
2606 sampler_type =
"sampler2DMS";
2610 sampler_type =
"sampler2DMSArray";
2614 sampler_type =
"unsupported_sampler";
2615 FIXME(
"Unhandled resource type %#x.\n", resource_type);
2622 sampler_type_prefix, sampler_type,
prefix,
entry->bind_idx);
2628 const char *image_type_prefix, *image_type, *read_format;
2638 image_type_prefix =
"";
2639 read_format =
"r32f";
2643 image_type_prefix =
"i";
2644 read_format =
"r32i";
2648 image_type_prefix =
"u";
2649 read_format =
"r32ui";
2653 image_type_prefix =
"";
2662 image_type =
"imageBuffer";
2666 image_type =
"image1D";
2670 image_type =
"image2D";
2674 image_type =
"image3D";
2678 image_type =
"image1DArray";
2682 image_type =
"image2DArray";
2686 image_type =
"unsupported_image";
2695 read_format, image_type_prefix, image_type,
prefix,
i);
2698 image_type_prefix, image_type,
prefix,
i);
2714 if (
shader->limits->packed_output)
2759 if (!
shader->load_local_constsF)
2797 const char *in_reg,
const char *in_regswizzle,
char *out_str)
2799 switch (src_modifier)
2804 sprintf(out_str,
"%s%s", in_reg, in_regswizzle);
2807 sprintf(out_str,
"-%s%s", in_reg, in_regswizzle);
2810 sprintf(out_str,
"!%s%s", in_reg, in_regswizzle);
2813 sprintf(out_str,
"(%s%s - vec4(0.5)%s)", in_reg, in_regswizzle, in_regswizzle);
2816 sprintf(out_str,
"-(%s%s - vec4(0.5)%s)", in_reg, in_regswizzle, in_regswizzle);
2819 sprintf(out_str,
"(2.0 * (%s%s - 0.5))", in_reg, in_regswizzle);
2822 sprintf(out_str,
"-(2.0 * (%s%s - 0.5))", in_reg, in_regswizzle);
2825 sprintf(out_str,
"(1.0 - %s%s)", in_reg, in_regswizzle);
2828 sprintf(out_str,
"(2.0 * %s%s)", in_reg, in_regswizzle);
2831 sprintf(out_str,
"-(2.0 * %s%s)", in_reg, in_regswizzle);
2834 sprintf(out_str,
"abs(%s%s)", in_reg, in_regswizzle);
2837 sprintf(out_str,
"-abs(%s%s)", in_reg, in_regswizzle);
2840 FIXME(
"Unhandled modifier %u\n", src_modifier);
2841 sprintf(out_str,
"%s%s", in_reg, in_regswizzle);
2863 static const char *
const hwrastout_reg_names[] = {
"vs_out[10]",
"vs_out[11].x",
"vs_out[11].y"};
2873 if (
reg->idx[0].offset != ~0
u &&
reg->idx[0].rel_addr)
2875 &rel_param0,
reg->idx[0].rel_addr->reg.data_type);
2876 if (
reg->idx[1].offset != ~0
u &&
reg->idx[1].rel_addr)
2878 &rel_param1,
reg->idx[1].rel_addr->reg.data_type);
2880 *is_swizzled =
FALSE;
2892 if (
reg->idx[0].rel_addr)
2893 FIXME(
"VS3 input registers relative addressing.\n");
2894 if (is_swizzled && priv->
cur_vs_args->swizzle_map & (1u <<
reg->idx[0].offset))
2895 *is_swizzled =
TRUE;
2896 if (
reg->idx[0].rel_addr)
2912 if (
reg->idx[0].rel_addr)
2914 if (
reg->idx[1].rel_addr)
2921 reg->idx[1].offset);
2923 else if (
reg->idx[1].rel_addr)
2928 reg->idx[0].offset,
reg->idx[1].offset);
2935 unsigned int idx =
shader->u.ps.input_reg_map[
reg->idx[0].offset];
2938 if (
reg->idx[0].rel_addr)
2945 &&
shader->u.ps.declared_in_count > in_count)
2948 "((%s + %u) > %u ? (%s + %u) > %u ? gl_SecondaryColor : gl_Color : %s_in[%s + %u])",
2960 &&
shader->u.ps.declared_in_count > in_count)
2963 "((%s) > %u ? (%s) > %u ? gl_SecondaryColor : gl_Color : %s_in[%s])",
2975 if (
idx == in_count)
2977 else if (
idx == in_count + 1)
2985 if (!
reg->idx[0].offset)
2996 if (
reg->idx[0].rel_addr)
3000 "(%s + %u >= 0 && %s + %u < %u ? %s_c[%s + %u] : vec4(0.0))",
3004 else if (
reg->idx[0].offset)
3044 if (
reg->idx[0].offset >= gl_info->
limits.buffers)
3045 WARN(
"Write to render target %u, only %d supported.\n",
3046 reg->idx[0].offset, gl_info->
limits.buffers);
3062 if (!
reg->idx[0].offset)
3070 if (
reg->idx[0].rel_addr)
3078 if (!
reg->idx[0].offset)
3083 else if (
reg->idx[0].offset == 1)
3091 FIXME(
"Unhandled misctype register %u.\n",
reg->idx[0].offset);
3097 switch (
reg->immconst_type)
3133 reg->u.immconst_data[0],
reg->u.immconst_data[1],
3134 reg->u.immconst_data[2],
reg->u.immconst_data[3]);
3140 reg->u.immconst_data[0],
reg->u.immconst_data[1],
3141 reg->u.immconst_data[2],
reg->u.immconst_data[3]);
3150 FIXME(
"Unhandled immconst type %#x\n",
reg->immconst_type);
3156 if (
reg->idx[1].rel_addr)
3164 if (
reg->idx[0].rel_addr)
3179 if (
reg->idx[1].rel_addr)
3188 "int(gl_LocalInvocationIndex)", gl_info);
3194 "gl_InvocationID", gl_info);
3212 "phase_instance_id", gl_info);
3220 if (
reg->idx[0].rel_addr)
3222 if (
reg->idx[1].rel_addr)
3229 reg->idx[1].offset);
3231 else if (
reg->idx[1].rel_addr)
3235 reg->idx[1].offset);
3240 reg->idx[0].offset,
reg->idx[1].offset);
3264 FIXME(
"Unhandled register type %#x.\n",
reg->type);
3300 unsigned int size = 0;
3311 unsigned int component_idx)
3314 return (
swizzle >> (2 * component_idx)) & 0x3;
3322 const char *swizzle_chars = fixup ?
"zyxw" :
"xyzw";
3326 for (
i = 0;
i < 4; ++
i)
3338 *swizzle_str =
'\0';
3351 if (dst_data_type == src_data_type)
3359 switch (dst_data_type)
3382 switch (dst_data_type)
3398 FIXME(
"Unhandled cast from %#x to %#x.\n", src_data_type, dst_data_type);
3414 char swizzle_str[6];
3418 swizzle_str[0] =
'\0';
3423 switch (wined3d_src->
reg.type)
3553 if (!(modifiers =
dst->modifiers))
3567 FIXME(
"_centroid modifier not handled\n");
3588 FIXME(
"Unrecognized operator %#x.\n",
op);
3599 unsigned int *
coord_size,
unsigned int *deriv_size)
3621 const char *
base =
"texture", *
type_part =
"", *suffix =
"";
3626 :
ctx->reg_maps->resource_info[resource_idx].type;
3628 sample_function->
data_type =
ctx->reg_maps->resource_info[resource_idx].data_type;
3632 ERR(
"Unexpected resource type %#x.\n", resource_type);
3647 FIXME(
"Unhandled resource type %#x.\n", resource_type);
3654 FIXME(
"Unsupported grad function.\n");
3661 if (
flags & ~texel_fetch_flags)
3662 ERR(
"Unexpected flags %#x for texelFetch.\n",
flags & ~texel_fetch_flags);
3664 base =
"texelFetch";
3670 lod ?
"Lod" : grad ?
"Grad" :
"",
offset ?
"Offset" :
"", suffix);
3692 switch(channel_source)
3695 strcat(arguments,
"0.0");
3699 strcat(arguments,
"1.0");
3723 FIXME(
"Unhandled channel source %#x\n", channel_source);
3724 strcat(arguments,
"undefined");
3728 if (sign_fixup)
strcat(arguments,
" * 2.0 - 1.0");
3734 unsigned int mask_size, remaining;
3736 char arguments[256];
3756 arguments[0] =
'\0';
3757 remaining = mask_size;
3761 if (--remaining)
strcat(arguments,
", ");
3766 if (--remaining)
strcat(arguments,
", ");
3771 if (--remaining)
strcat(arguments,
", ");
3776 if (--remaining)
strcat(arguments,
", ");
3799 const char *coord_reg_fmt, ...)
3802 char dst_swizzle[6];
3814 fixup = priv->
cur_ps_args->color_fixup[sampler_bind_idx];
3823 if (sample_function->output_single_component)
3844 if (sample_function->offset_size)
3852 if (sample_function->output_single_component)
3870 if (use_viewport_index)
3873 shader_addline(
buffer,
"gl_Position.xy += pos_fixup[gl_ViewportIndex].zw * gl_Position.ww;\n");
3918 op =
"<unhandled operator>";
3934 unsigned int mask_size;
3958 op =
"<unhandled operator>";
3981 op =
"<unhandled operator>";
4002 op =
"<unhandled operator>";
4003 ERR(
"Unhandled opcode %s.\n",
4023 FIXME(
"64-bit integer multiplies not implemented.\n");
4093 if (ins->
ctx->reg_maps->shader_version.major == 1
4099 if (mask_size > 1) {
4138 DWORD dst_write_mask, src_write_mask;
4139 unsigned int dst_size;
4185 FIXME(
"Unhandled primitive stream %u.\n",
stream);
4196 DWORD dst_write_mask;
4197 unsigned int dst_size;
4289 ?
"unpackHalf2x16(%s).x);\n" :
"packHalf2x16(vec2(%s, 0.0)));\n";
4292 for (
i = 0;
i < 4; ++
i)
4296 &
dst, 0,
dst.reg.data_type)))
4327 if (ins->
dst[0].reg.idx[0].offset == ins->
src[
i].reg.idx[0].offset
4328 && ins->
dst[0].reg.type == ins->
src[
i].reg.type)
4333 for (
i = 0;
i < 4; ++
i)
4364 unsigned int mask_size;
4387 ins->
ctx->reg_maps->shader_version.minor);
4390 const char *
prefix, *suffix;
4391 unsigned int dst_size;
4392 DWORD dst_write_mask;
4422 prefix =
"inversesqrt(abs(";
4450 if (ins->
ctx->reg_maps->shader_version.major < 2)
4472 const char *vector_constructor,
const char *scalar_constructor)
4476 unsigned int mask_size;
4493 unsigned int mask_size;
4501 shader_addline(
buffer,
"mix(mix(ivec%u(max(%s, vec%u(-2147483648.0))), ivec%u(0x7fffffff), greaterThanEqual(%s, vec%u(2147483648.0))), ivec%u(0), isnan(%s)));\n",
4504 shader_addline(
buffer,
"mix(mix(int(max(%s, -2147483648.0)), 0x7fffffff, %s >= 2147483648.0), 0, isnan(%s)));\n",
4512 unsigned int mask_size;
4520 shader_addline(
buffer,
"mix(uvec%u(max(%s, vec%u(0.0))), uvec%u(0xffffffffu), greaterThanEqual(%s, vec%u(4294967296.0))));\n",
4521 mask_size, src_param.
param_str, mask_size, mask_size, src_param.
param_str, mask_size);
4538 unsigned int mask_size;
4545 if (mask_size > 1) {
4588 unsigned int i,
j,
k;
4598 if (ins->
dst[
i].reg.idx[0].offset == ins->
src[
j].reg.idx[0].offset
4599 && ins->
dst[
i].reg.type == ins->
src[
j].reg.type)
4606 for (
i = 0;
i < 4; ++
i)
4637 const char *condition_prefix, *condition_suffix;
4643 DWORD cmp_channel = 0;
4651 condition_prefix =
"";
4652 condition_suffix =
" >= 0.0";
4656 condition_prefix =
"";
4657 condition_suffix =
" > 0.5";
4661 condition_prefix =
"bool(";
4662 condition_suffix =
")";
4667 condition_prefix =
"<unhandled prefix>";
4668 condition_suffix =
"<unhandled suffix>";
4680 condition_prefix, src0_param.
param_str, condition_suffix,
4690 if ((ins->
src[0].reg.idx[0].offset ==
dst.reg.idx[0].offset
4691 && ins->
src[0].reg.type ==
dst.reg.type)
4692 || (ins->
src[1].reg.idx[0].offset ==
dst.reg.idx[0].offset
4693 && ins->
src[1].reg.type ==
dst.reg.type)
4694 || (ins->
src[2].reg.idx[0].offset ==
dst.reg.idx[0].offset
4695 && ins->
src[2].reg.type ==
dst.reg.type))
4696 temp_destination =
TRUE;
4699 for (
i = 0;
i < 4; ++
i)
4703 for (
j = 0;
j < 4; ++
j)
4711 dst.write_mask = ins->
dst[0].write_mask & write_mask;
4713 if (temp_destination)
4727 condition_prefix, src0_param.
param_str, condition_suffix,
4731 if (temp_destination)
4749 ins->
ctx->reg_maps->shader_version.minor);
4790 int nComponents = 0;
4795 memset(&tmp_ins, 0,
sizeof(tmp_ins));
4800 tmp_ins.
dst = &tmp_dst;
4802 tmp_ins.
src = tmp_src;
4830 tmp_dst = ins->
dst[0];
4831 tmp_src[0] = ins->
src[0];
4832 tmp_src[1] = ins->
src[1];
4833 for (
i = 0;
i < nComponents; ++
i)
4837 ++tmp_src[1].
reg.idx[0].offset;
4911 "vec4(1.0, max(%s, 0.0), %s == 0.0 ? 0.0 : "
4912 "pow(max(0.0, %s) * step(0.0, %s), clamp(%s, -128.0, 128.0)), 1.0)%s);\n",
4958 if (ins->
ctx->reg_maps->shader_version.major < 4)
4979 ERR(
"Write mask should be .x, .y or .xy\n");
5048 const unsigned int *control_values =
NULL;
5050 if (ins->
ctx->reg_maps->shader_version.major < 4)
5061 if (
constant->idx == ins->
src[1].reg.idx[0].offset)
5072 loop_control.
count = control_values[0];
5073 loop_control.
start = control_values[1];
5074 loop_control.
step = (
int)control_values[2];
5076 if (loop_control.
step > 0)
5079 state->current_loop_depth, loop_control.
start,
5081 state->current_loop_depth, loop_control.
step);
5083 else if (loop_control.
step < 0)
5086 state->current_loop_depth, loop_control.
start,
5088 state->current_loop_depth, loop_control.
step);
5093 state->current_loop_depth, loop_control.
start,
state->current_loop_depth,
5094 state->current_loop_depth, loop_control.
count,
5095 state->current_loop_depth);
5103 shader_addline(
buffer,
"for (tmpInt%u = 0, aL%u = %s.y; tmpInt%u < %s.x; tmpInt%u++, aL%u += %s.z)\n{\n",
5112 ++
state->current_loop_reg;
5119 ++
state->current_loop_depth;
5130 --
state->current_loop_depth;
5131 --
state->current_loop_reg;
5136 --
state->current_loop_depth;
5146 const unsigned int *control_values =
NULL;
5153 if (
constant->idx == ins->
src[0].reg.idx[0].offset)
5163 shader_addline(ins->
ctx->buffer,
"for (tmpInt%d = 0; tmpInt%d < %d; tmpInt%d++) {\n",
5164 state->current_loop_depth,
state->current_loop_depth,
5165 control_values[0],
state->current_loop_depth);
5170 shader_addline(ins->
ctx->buffer,
"for (tmpInt%d = 0; tmpInt%d < %s; tmpInt%d++) {\n",
5171 state->current_loop_depth,
state->current_loop_depth,
5175 ++
state->current_loop_depth;
5245 FIXME(
"Unhandled primitive stream %u.\n",
stream);
5308 ins->
ctx->state->in_subroutine =
TRUE;
5329 if (
version->major >= 4 && !ins->
ctx->state->in_subroutine)
5339 ins->
ctx->reg_maps->shader_version.minor);
5341 DWORD sample_flags = 0;
5342 unsigned int resource_idx;
5350 resource_idx = ins->
dst[0].reg.idx[0].offset;
5352 resource_idx = ins->
src[1].reg.idx[0].offset;
5356 : ins->
ctx->reg_maps->resource_info[resource_idx].type;
5370 FIXME(
"WINED3D_TTFF_PROJECTED with WINED3D_TTFF_COUNT1?\n");
5422 "T%u%s", resource_idx, coord_mask);
5432 shader_glsl_gen_sample_code(ins, resource_idx, &sample_function,
swizzle,
NULL,
NULL,
bias.param_str,
5453 FIXME(
"texldd used, but not supported by hardware. Falling back to regular tex.\n");
5458 sampler_idx = ins->
src[1].reg.idx[0].offset;
5480 sampler_idx = ins->
src[1].reg.idx[0].offset;
5493 WARN(
"Using %s in fragment shader.\n", sample_function.
name->buffer);
5501 unsigned int resource_idx,
unsigned int sampler_idx)
5506 for (
i = 0;
i < sampler_map->
count; ++
i)
5529 unsigned int resource_idx,
stride;
5534 resource_idx = ins->
dst[is_imm_instruction].reg.idx[0].offset;
5540 ERR(
"Invalid TGSM index %u.\n", resource_idx);
5546 stride = reg_maps->
tgsm[resource_idx].stride;
5552 ERR(
"Invalid UAV index %u.\n", resource_idx);
5558 ERR(
"Unexpected resource type %#x.\n", resource_type);
5574 op =
"imageAtomicAnd";
5579 op =
"atomicCompSwap";
5581 op =
"imageAtomicCompSwap";
5588 op =
"imageAtomicAdd";
5595 op =
"imageAtomicMax";
5607 op =
"imageAtomicMin";
5619 op =
"imageAtomicOr";
5626 op =
"imageAtomicMax";
5638 op =
"imageAtomicMin";
5650 op =
"imageAtomicXor";
5654 op =
"atomicExchange";
5656 op =
"imageAtomicExchange";
5678 if (is_imm_instruction)
5696 if (is_imm_instruction)
5709 op =
"atomicCounterIncrement";
5711 op =
"atomicCounterDecrement";
5724 DWORD coord_mask, write_mask;
5725 unsigned int uav_idx;
5726 char dst_swizzle[6];
5728 uav_idx = ins->
src[1].reg.idx[0].offset;
5731 ERR(
"Invalid UAV index %u.\n", uav_idx);
5737 ERR(
"Unexpected resource type %#x.\n", resource_type);
5755 unsigned int i,
swizzle, resource_idx, bind_idx,
stride, src_idx = 0;
5764 resource_idx =
src->reg.idx[0].offset;
5769 ERR(
"Invalid resource index %u.\n", resource_idx);
5774 function =
"texelFetch";
5781 ERR(
"Invalid UAV index %u.\n", resource_idx);
5785 bind_idx = resource_idx;
5786 function =
"imageLoad";
5793 ERR(
"Invalid TGSM index %u.\n", resource_idx);
5796 stride = reg_maps->
tgsm[resource_idx].stride;
5797 bind_idx = resource_idx;
5820 for (
i = 0;
i < 4; ++
i)
5845 unsigned int uav_idx;
5848 uav_idx = ins->
dst[0].reg.idx[0].offset;
5851 ERR(
"Invalid UAV index %u.\n", uav_idx);
5857 ERR(
"Unexpected resource type %#x.\n", resource_type);
5877 unsigned int i, resource_idx,
stride, src_idx = 0;
5882 resource_idx = ins->
dst[0].reg.idx[0].offset;
5888 ERR(
"Invalid TGSM index %u.\n", resource_idx);
5891 stride = reg_maps->
tgsm[resource_idx].stride;
5897 ERR(
"Invalid UAV index %u.\n", resource_idx);
5912 for (
i = 0;
i < 4; ++
i)
5933 unsigned int sync_flags = ins->
flags;
5944 sync_flags &= ~WINED3DSSF_GROUP_SHARED_MEMORY;
5950 sync_flags &= ~WINED3DSSF_GLOBAL_UAV;
5954 FIXME(
"Unhandled sync flags %#x.\n", sync_flags);
5961 unsigned int idx =
reg->idx[0].offset;
5967 ERR(
"Invalid resource index %u.\n",
idx);
5977 ERR(
"Invalid UAV index %u.\n",
idx);
5983 FIXME(
"Unhandled register type %#x.\n",
reg->type);
5992 unsigned int resource_idx;
5993 char dst_swizzle[6];
6001 resource_idx = ins->
src[0].reg.idx[0].offset;
6014 if (resource_info->
stride)
6040 unsigned int resource_idx, bind_idx,
i;
6043 BOOL supports_mipmaps;
6044 char dst_swizzle[6];
6047 dst_data_type = ins->
dst[0].reg.data_type;
6050 else if (ins->
flags)
6054 resource_idx = ins->
src[1].reg.idx[0].offset;
6058 resource_type = ins->
ctx->reg_maps->resource_info[resource_idx].type;
6064 resource_type = ins->
ctx->reg_maps->uav_resource_info[resource_idx].type;
6065 bind_idx = resource_idx;
6070 ERR(
"Unexpected resource type %#x.\n", resource_type);
6094 if (supports_mipmaps)
6101 if (supports_mipmaps)
6110 FIXME(
"textureQueryLevels is not supported, returning 1 level.\n");
6132 unsigned int resource_idx, bind_idx;
6133 char dst_swizzle[6];
6136 dst_data_type =
dst->reg.data_type;
6139 else if (ins->
flags)
6158 FIXME(
"OpenGL implementation does not support ARB_sample_shading.\n");
6164 resource_idx =
src->reg.idx[0].offset;
6168 ERR(
"Unexpected resource type %#x.\n", resource_type);
6180 FIXME(
"textureSamples() is not supported.\n");
6193 char dst_swizzle[6];
6208 unsigned int resource_idx, sampler_idx, sampler_bind_idx;
6216 resource_idx = ins->
src[1].reg.idx[0].offset;
6221 ERR(
"Invalid resource index %u.\n", resource_idx);
6233 shader_glsl_gen_sample_code(ins, sampler_bind_idx, &sample_function, ins->
src[1].swizzle,
6238 shader_glsl_gen_sample_code(ins, sampler_bind_idx, &sample_function, ins->
src[1].swizzle,
6247 const char *lod_param_str =
NULL, *dx_param_str =
NULL, *dy_param_str =
NULL;
6248 struct glsl_src_param coord_param, lod_param, dx_param, dy_param;
6249 unsigned int resource_idx, sampler_idx, sampler_bind_idx;
6260 resource_idx = ins->
src[1].reg.idx[0].offset;
6261 sampler_idx = ins->
src[2].reg.idx[0].offset;
6290 shader_glsl_gen_sample_code(ins, sampler_bind_idx, &sample_function, ins->
src[1].swizzle,
6300 unsigned int coord_size,
const char *coord_param,
const char *ref_param)
6306 char dst_swizzle[6];
6308 WARN(
"Emitting textureGrad() for sample_c_lz.\n");
6312 shader_addline(
buffer,
"vec4(textureGrad%s(%s_sampler%u, vec%u(%s, %s), vec%u(0.0), vec%u(0.0)",
6315 coord_size, coord_param, ref_param, deriv_size, deriv_size);
6328 unsigned int resource_idx, sampler_idx, sampler_bind_idx;
6333 const char *lod_param =
NULL;
6348 resource_idx = ins->
src[1].reg.idx[0].offset;
6349 sampler_idx = ins->
src[2].reg.idx[0].offset;
6375 unsigned int resource_param_idx, resource_idx, sampler_idx, sampler_bind_idx, component_idx;
6384 char dst_swizzle[6];
6389 FIXME(
"OpenGL implementation does not support textureGather.\n");
6397 resource_param_idx =
6399 resource_idx = ins->
src[resource_param_idx].reg.idx[0].offset;
6400 sampler_idx = ins->
src[resource_param_idx + 1].reg.idx[0].offset;
6409 ERR(
"Unexpected resource type %#x.\n", resource_info->
type);
6420 has_offset ?
"Offset" :
"",
prefix, sampler_bind_idx, coord_param.
param_str);
6431 else if (has_offset)
6449 if (!(ins->
ctx->reg_maps->shader_version.major == 1 && ins->
ctx->reg_maps->shader_version.minor == 4))
6455 ins->
dst[0].reg.idx[0].offset, dst_mask);
6460 unsigned int reg = ins->
src[0].reg.idx[0].offset;
6461 char dst_swizzle[6];
6491 unsigned int sampler_idx = ins->
dst[0].reg.idx[0].offset;
6510 NULL,
"dot(ffp_texcoord[%u].xyz, %s)", sampler_idx, src0_param.
param_str);
6515 NULL,
"vec2(dot(ffp_texcoord[%u].xyz, %s), 0.0)", sampler_idx, src0_param.
param_str);
6520 NULL,
"vec3(dot(ffp_texcoord[%u].xyz, %s), 0.0, 0.0)", sampler_idx, src0_param.
param_str);
6524 FIXME(
"Unexpected mask size %u\n", mask_size);
6535 unsigned int dstreg = ins->
dst[0].reg.idx[0].offset;
6538 unsigned int mask_size;
6544 if (mask_size > 1) {
6565 shader_addline(ins->
ctx->buffer,
"gl_FragDepth = clamp((%s.x / min(%s.y, 1.0)), 0.0, 1.0);\n",
6577 unsigned int dstreg = ins->
dst[0].reg.idx[0].offset;
6583 shader_addline(ins->
ctx->buffer,
"gl_FragDepth = (tmp0.y == 0.0) ? 1.0 : clamp(tmp0.x / tmp0.y, 0.0, 1.0);\n");
6591 unsigned int reg = ins->
dst[0].reg.idx[0].offset;
6606 unsigned int reg = ins->
dst[0].reg.idx[0].offset;
6619 unsigned int reg = ins->
dst[0].reg.idx[0].offset;
6639 unsigned int reg = ins->
dst[0].reg.idx[0].offset;
6661 unsigned int reg = ins->
dst[0].reg.idx[0].offset;
6684 unsigned int reg = ins->
dst[0].reg.idx[0].offset;
6715 unsigned int reg = ins->
dst[0].reg.idx[0].offset;
6725 shader_addline(
buffer,
"tmp1.xyz = normalize(vec3(ffp_texcoord[%u].w, ffp_texcoord[%u].w, ffp_texcoord[%u].w));\n",
6750 unsigned int sampler_idx;
6755 sampler_idx = ins->
dst[0].reg.idx[0].offset;
6770 char coord_div_mask[3];
6774 FIXME(
"WINED3D_TTFF_PROJECTED with WINED3D_TTFF_COUNT1?\n");
6788 shader_addline(ins->
ctx->buffer,
"T%u%s /= T%u%s;\n", sampler_idx, coord_mask, sampler_idx, coord_div_mask);
6794 "T%u%s + vec4(bumpenv_mat%u * %s, 0.0, 0.0)%s", sampler_idx, coord_mask, sampler_idx,
6805 shader_addline(ins->
ctx->buffer,
"%s%s *= (%s * bumpenv_lum_scale%u + bumpenv_lum_offset%u);\n",
6807 luminance_param.
param_str, sampler_idx, sampler_idx);
6814 unsigned int sampler_idx = ins->
dst[0].reg.idx[0].offset;
6830 DWORD sampler_idx = ins->
dst[0].reg.idx[0].offset;
6850 DWORD sampler_idx = ins->
dst[0].reg.idx[0].offset;
6869 DWORD sampler_idx = ins->
dst[0].reg.idx[0].offset;
6886 if (ins->
ctx->reg_maps->shader_version.major >= 4)
6899 if (ins->
ctx->reg_maps->shader_version.major >= 2)
6918 unsigned int mask_size;
6927 if (mask_size > 1) {
6963 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
6972 input->register_idx, reg_mask);
6978 input->register_idx, reg_mask);
6980 FIXME(
"ARB_sample_shading is not supported.\n");
6986 input->register_idx, reg_mask);
6988 FIXME(
"ARB_fragment_layer_viewport is not supported.\n");
6994 input->register_idx, reg_mask);
6996 FIXME(
"ARB_viewport_array is not supported.\n");
7000 if (
input->sysval_semantic)
7001 FIXME(
"Unhandled sysval semantic %#x.\n",
input->sysval_semantic);
7003 shader->u.ps.input_reg_map[
input->register_idx], reg_mask,
7005 shader->u.ps.input_reg_map[
input->register_idx], reg_mask);
7010 if (
args->pointsprite)
7015 shader->u.ps.input_reg_map[
input->register_idx], reg_mask,
7017 ?
"gl_TexCoord" :
"ffp_varying_texcoord",
semantic_idx, reg_mask);
7020 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
7026 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
7029 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
7032 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
7037 shader->u.ps.input_reg_map[
input->register_idx], reg_mask, reg_mask);
7055 ERR(
"Failed to insert program entry.\n");
7102 unsigned int in_idx;
7120 if (in_idx >= max_varyings)
7122 FIXME(
"More input varyings declared than supported, expect issues.\n");
7126 if (in_idx == in_count)
7128 else if (in_idx == in_count + 1)
7147 if (
set[in_idx] == ~0
u)
7157 for (
i = 0;
i < max_varyings; ++
i)
7169 reg_mask[
size++] =
'x';
7171 reg_mask[
size++] =
'y';
7173 reg_mask[
size++] =
'z';
7175 reg_mask[
size++] =
'w';
7176 reg_mask[
size] =
'\0';
7180 else if (
i == in_count + 1)
7198 BOOL rasterizer_setup)
7220 rasterizer_setup ?
"%s.reg%u%s = outputs[%u]%s;\n" :
"%s.reg[%u]%s = outputs[%u]%s;\n",
7228 unsigned int i, clip_or_cull_index;
7235 for (
i = 0;
i < 4; ++
i)
7242 name, clip_or_cull_index,
element->register_idx, reg_mask);
7243 ++clip_or_cull_index;
7255 const char *semantic_name;
7256 unsigned int semantic_idx;
7283 "ffp_point.size_min, ffp_point.size_max);\n", output->
register_idx, reg_mask[1]);
7312 output_signature, reg_maps_out);
7323 DWORD ps_major = ps ? ps->
reg_maps.shader_version.major : 0;
7325 const char *semantic_name;
7337 if (per_vertex_point_size)
7347 DWORD colors_written_mask[2] = {0};
7352 declare_out_varying(gl_info,
buffer, flatshading,
"vec4 ffp_varying_diffuse;\n");
7353 declare_out_varying(gl_info,
buffer, flatshading,
"vec4 ffp_varying_specular;\n");
7355 declare_out_varying(gl_info,
buffer,
FALSE,
"float ffp_varying_fogcoord;\n");
7360 for (
i = 0;
i <
vs->output_signature.element_count; ++
i)
7365 if (!(
vs->reg_maps.output_registers & (1u << output->
register_idx)))
7370 write_mask = output->
mask;
7394 legacy_syntax ?
"gl_TexCoord" :
"ffp_varying_texcoord",
7402 "ffp_point.size_min, ffp_point.size_max);\n", output->
register_idx, reg_mask[1]);
7407 legacy_syntax ?
"gl_FogFragCoord" :
"ffp_varying_fogcoord",
7412 for (
i = 0;
i < 2; ++
i)
7419 legacy_syntax ?
"gl_FrontColor" :
"ffp_varying_diffuse",
7420 reg_mask, reg_mask);
7423 legacy_syntax ?
"gl_FrontSecondaryColor" :
"ffp_varying_specular",
7424 reg_mask, reg_mask);
7429 if (ps && !(ps->
reg_maps.texcoord & (1u <<
i)))
7439 legacy_syntax ?
"gl_TexCoord" :
"ffp_varying_texcoord",
i, reg_mask, reg_mask);
7450 &ps->
reg_maps, 0, &
vs->output_signature, &
vs->reg_maps, per_vertex_point_size);
7466 unsigned int i, register_idx, component_idx;
7475 FIXME(
"Unhandled stream %u.\n",
e->stream_idx);
7478 if (!
e->semantic_name)
7485 if (
e->component_count == 1)
7501 shader->limits->packed_output);
7508 FIXME(
"Unhandled stream %u.\n",
e->stream_idx);
7511 if (!
e->semantic_name)
7525 register_idx, str_mask);
7542 if (rasterizer_setup)
7551 if (rasterizer_setup)
7556 &
shader->reg_maps,
"shader_out", rasterizer_setup);
7563 const char *reg_mask)
7584 FIXME(
"Unhandled sysval semantic %#x.\n",
constant->sysval_semantic);
7592 unsigned int i, register_count, user_constant_index, user_constant_count;
7594 register_count = user_constant_count = 0;
7598 register_count =
max(
constant->register_idx + 1, register_count);
7600 ++user_constant_count;
7603 if (user_constant_count)
7605 input_setup ?
"in" :
"out", user_constant_count);
7609 shader_addline(
buffer,
"void setup_patch_constant_%s()\n{\n", input_setup ?
"input" :
"output");
7610 for (
i = 0, user_constant_index = 0;
i <
signature->element_count; ++
i)
7642 shader_addline(
buffer,
"bvec3 srgb_compare = lessThan(%s[0].xyz, vec3(srgb_const1.x));\n", output);
7667 " * ffp_varying_fogcoord * ffp_varying_fogcoord);\n");
7671 ERR(
"Invalid fog mode %#x.\n",
mode);
7675 shader_addline(
buffer,
"%s[0].xyz = mix(ffp_fog.color.xyz, %s[0].xyz, clamp(fog, 0.0, 1.0));\n",
7684 static const char *
const comparison_operator[] =
7706 const char *colour,
const char *colour_key_low,
const char *colour_key_high)
7709 colour, colour_key_low, colour, colour_key_high);
7801 swizzle =
args->rt_alpha_swizzle & (1u <<
i) ?
".argb" :
"";
7817 if (
args->srgb_correction)
7847 unsigned int i, extra_constants_needed = 0;
7855 memset(&priv_ctx, 0,
sizeof(priv_ctx));
7910 declare_in_varying(
gl_info,
buffer,
args->flatshading,
"vec4 ffp_varying_diffuse;\n");
7912 declare_in_varying(
gl_info,
buffer,
args->flatshading,
"vec4 ffp_varying_specular;\n");
7939 extra_constants_needed++;
7942 extra_constants_needed++;
7945 if (
args->srgb_correction)
7971 if (
args->dual_source_blend)
7990 if (
args->dual_source_blend)
8008 if (
args->dual_source_blend)
8018 if (
shader->limits->constant_float + extra_constants_needed >= gl_info->
limits.glsl_ps_float_constants)
8019 FIXME(
"Insufficient uniforms to run this shader.\n");
8021 if (
shader->u.ps.force_early_depth_stencil)
8073 if (
args->pointsprite)
8075 else if (
args->texcoords_initialized & (1u <<
i))
8077 legacy_syntax ?
"gl_TexCoord" :
"ffp_varying_texcoord",
i);
8103 TRACE(
"Compiling shader object %u.\n", shader_id);
8129 legacy_syntax ?
"gl_FogFragCoord" :
"ffp_varying_fogcoord");
8132 legacy_syntax ?
"gl_FogFragCoord" :
"ffp_varying_fogcoord");
8133 else if (!reg_maps->
fog)
8137 legacy_syntax ?
"gl_FogFragCoord" :
"ffp_varying_fogcoord");
8140 legacy_syntax ?
"gl_FogFragCoord" :
"ffp_varying_fogcoord");
8145 if (
args->clip_enabled)
8150 for (
i = 0;
i < gl_info->
limits.user_clip_distances; ++
i)
8154 if (
args->point_size && !
shader->reg_maps.point_size)
8159 shader_addline(
buffer,
"gl_PointSize = clamp(ffp_point.size, ffp_point.size_min, ffp_point.size_max);\n");
8182 memset(&priv_ctx, 0,
sizeof(priv_ctx));
8200 for (
i = 0;
i <
shader->input_signature.element_count; ++
i)
8214 if (
args->clip_enabled)
8219 declare_out_varying(
gl_info,
buffer,
args->flatshading,
"vec4 ffp_varying_diffuse;\n");
8220 declare_out_varying(
gl_info,
buffer,
args->flatshading,
"vec4 ffp_varying_specular;\n");
8242 for (
i = 0;
i <
shader->input_signature.element_count; ++
i)
8259 TRACE(
"Compiling shader object %u.\n", shader_id);
8277 shader_addline(
buffer,
"shader_out[gl_InvocationID].reg[%u]%s = shader_in[gl_InvocationID].reg[%u]%s;\n",
8285 const char *phase_name,
unsigned phase_idx)
8291 phase_name, phase_idx, phase->
instance_count ?
"int phase_instance_id" :
"");
8330 memset(&priv_ctx, 0,
sizeof(priv_ctx));
8348 if (hs->
phases.control_point)
8351 shader->limits->packed_output);
8353 &
shader->reg_maps,
"shader_out[gl_InvocationID]",
FALSE);
8358 if ((phase = hs->
phases.control_point))
8372 for (
i = 0;
i < hs->
phases.fork_count; ++
i)
8379 for (
i = 0;
i < hs->
phases.join_count; ++
i)
8390 for (
i = 0;
i < hs->
phases.fork_count; ++
i)
8392 for (
i = 0;
i < hs->
phases.join_count; ++
i)
8398 TRACE(
"Compiling shader object %u.\n", shader_id);
8427 memset(&priv_ctx, 0,
sizeof(priv_ctx));
8440 switch (
shader->u.ds.tessellator_domain)
8452 switch (
args->tessellator_output_primitive)
8466 switch (
args->tessellator_partitioning)
8499 TRACE(
"Compiling shader object %u.\n", shader_id);
8516 unsigned int max_vertices;
8523 memset(&priv_ctx, 0,
sizeof(priv_ctx));
8533 primitive_type =
shader->u.gs.input_type ?
shader->u.gs.input_type :
args->primitive_type;
8535 if (
shader->u.gs.instance_count > 1)
8539 primitive_type =
shader->u.gs.output_type ?
shader->u.gs.output_type :
args->primitive_type;
8540 if (!(max_vertices =
shader->u.gs.vertices_out))
8542 switch (
args->primitive_type)
8588 for (
i = 0;
i < max_vertices; ++
i)
8590 for (
j = 0;
j <
shader->output_signature.element_count; ++
j)
8592 output = &
shader->output_signature.elements[
j];
8605 TRACE(
"Compiling shader object %u.\n", shader_id);
8618 switch (
shader->reg_maps.shader_version.type)
8633 FIXME(
"Unhandled shader type %#x.\n",
shader->reg_maps.shader_version.type);
8654 memset(&priv_ctx, 0,
sizeof(priv_ctx));
8667 if (reg_maps->
tgsm[
i].size)
8671 shader_addline(
buffer,
"layout(local_size_x = %u, local_size_y = %u, local_size_z = %u) in;\n",
8672 thread_group_size->
x, thread_group_size->
y, thread_group_size->
z);
8679 TRACE(
"Compiling shader object %u.\n", shader_id);
8694 if (!
shader->backend_data)
8696 if (!(
shader->backend_data =
calloc(1,
sizeof(*shader_data))))
8698 ERR(
"Failed to allocate backend data.\n");
8702 shader_data =
shader->backend_data;
8715 TRACE(
"No matching GL shader found for shader %p, compiling a new shader.\n",
shader);
8730 ERR(
"Out of memory\n");
8748 const DWORD use_map)
8771 uint32_t use_map = context_gl->
c.stream_info.use_map;
8776 if (!
shader->backend_data)
8778 if (!(
shader->backend_data =
calloc(1,
sizeof(*shader_data))))
8780 ERR(
"Failed to allocate backend data.\n");
8784 shader_data =
shader->backend_data;
8797 TRACE(
"No matching GL shader found for shader %p, compiling a new shader.\n",
shader);
8813 ERR(
"Out of memory\n");
8838 if (!
shader->backend_data)
8840 if (!(
shader->backend_data =
calloc(1,
sizeof(*shader_data))))
8842 ERR(
"Failed to allocate backend data.\n");
8846 shader_data =
shader->backend_data;
8855 TRACE(
"No matching GL shader found for shader %p, compiling a new shader.\n",
shader);
8859 if (!(new_array =
malloc(
sizeof(*new_array))))
8861 ERR(
"Failed to allocate GL shaders array.\n");
8883 if (!
shader->backend_data)
8885 if (!(
shader->backend_data =
calloc(1,
sizeof(*shader_data))))
8887 ERR(
"Failed to allocate backend data.\n");
8891 shader_data =
shader->backend_data;
8900 TRACE(
"No matching GL shader found for shader %p, compiling a new shader.\n",
shader);
8909 new_array =
malloc(
sizeof(*new_array));
8915 ERR(
"Failed to allocate GL shaders array.\n");
8938 if (!
shader->backend_data)
8940 if (!(
shader->backend_data =
calloc(1,
sizeof(*shader_data))))
8942 ERR(
"Failed to allocate backend data.\n");
8946 shader_data =
shader->backend_data;
8955 TRACE(
"No matching GL shader found for shader %p, compiling a new shader.\n",
shader);
8964 new_array =
malloc(
sizeof(*new_array));
8970 ERR(
"Failed to allocate GL shaders array.\n");
8992 return "ffp_attrib_diffuse";
8994 return "ffp_attrib_specular";
8996 ERR(
"Invalid material color source %#x.\n",
mcs);
9005 " * ffp_light[%u].diffuse.xyz * att;\n",
idx);
9012 " pow(t, ffp_material.shininess) * ffp_light[%u].specular * att;\n",
9013 legacy_lighting ?
" && ffp_material.shininess > 0.0" :
"",
idx);
9020 unsigned int i,
idx;
9052 if (legacy_lighting)
9063 " ffp_light[%u].l_att, ffp_light[%u].q_att));\n",
idx,
idx,
idx);
9064 if (!legacy_lighting)
9083 if (legacy_lighting)
9098 " / (ffp_light[%u].cos_htheta - ffp_light[%u].cos_hphi), ffp_light[%u].falloff);\n",
9100 if (legacy_lighting)
9102 " ffp_light[%u].l_att, ffp_light[%u].q_att));\n",
9106 " ffp_light[%u].l_att, ffp_light[%u].q_att));\n",
9128 for (
i = 0;
i <
settings->parallel_point_light_count; ++
i, ++
idx)
9138 shader_addline(
buffer,
"ffp_varying_diffuse.xyz = %s.xyz * ambient + %s.xyz * diffuse + %s.xyz;\n",
9151 static const struct attrib_info
9154 const char name[24];
9158 {
"vec4",
"ffp_attrib_position"},
9159 {
"vec4",
"ffp_attrib_blendweight"},
9162 {
"vec3",
"ffp_attrib_normal"},
9163 {
"float",
"ffp_attrib_psize"},
9164 {
"vec4",
"ffp_attrib_diffuse"},
9165 {
"vec4",
"ffp_attrib_specular"},
9169 BOOL output_legacy_fogcoord = legacy_syntax;
9185 const char *
type =
i <
ARRAY_SIZE(attrib_info) ? attrib_info[
i].type :
"vec4";
9246 declare_out_varying(gl_info,
buffer,
settings->flatshading,
"vec4 ffp_varying_diffuse;\n");
9247 declare_out_varying(gl_info,
buffer,
settings->flatshading,
"vec4 ffp_varying_specular;\n");
9249 declare_out_varying(gl_info,
buffer,
FALSE,
"float ffp_varying_fogcoord;\n");
9263 if (attrib_info[
i].
name[0])
9265 i,
settings->swizzle_map & (1u <<
i) ?
".zyxw" :
"");
9269 unsigned int coord_idx =
settings->texgen[
i] & 0x0000ffff;
9281 shader_addline(
buffer,
"if (ffp_attrib_position.w != 0.0) gl_Position /= ffp_attrib_position.w;\n");
9290 shader_addline(
buffer,
"ec_pos += ffp_attrib_blendweight[%u] * (ffp_modelview_matrix[%u] * vec4(ffp_attrib_position.xyz, 1.0));\n",
i,
i);
9298 for (
i = 0;
i < gl_info->
limits.user_clip_distances; ++
i)
9321 shader_addline(
buffer,
"normal += ffp_attrib_blendweight[%u] * (mat3(ffp_modelview_matrix[%u]) * ffp_attrib_normal);\n",
i,
i);
9344 bool output_texcoord =
true;
9349 switch (
settings->texgen[
i] & 0xffff0000)
9357 output_texcoord =
false;
9369 shader_addline(texcoord,
"vec4(reflect(ffp_normalize(ec_pos.xyz), normal), 1.0)");
9375 shader_addline(texcoord,
"vec4(r.x / m + 0.5, r.y / m + 0.5, 0.0, 1.0)");
9382 if (output_texcoord)
9394 output_legacy_fogcoord =
FALSE;
9425 ERR(
"Unhandled fog mode %#x.\n",
settings->fog_mode);
9428 if (output_legacy_fogcoord)
9434 " + ffp_point.l_att * length(ec_pos.xyz)"
9435 " + ffp_point.q_att * dot(ec_pos.xyz, ec_pos.xyz));\n",
9436 settings->per_vertex_point_size ?
"ffp_attrib_psize" :
"ffp_point.size");
9437 shader_addline(
buffer,
"gl_PointSize = clamp(gl_PointSize, ffp_point.size_min, ffp_point.size_max);\n");
9449 unsigned int argnum,
unsigned int stage,
DWORD arg)
9454 return "<unused arg>";
9459 ret =
"ffp_varying_diffuse";
9469 case 0:
ret =
"tex0";
break;
9470 case 1:
ret =
"tex1";
break;
9471 case 2:
ret =
"tex2";
break;
9472 case 3:
ret =
"tex3";
break;
9473 case 4:
ret =
"tex4";
break;
9474 case 5:
ret =
"tex5";
break;
9475 case 6:
ret =
"tex6";
break;
9476 case 7:
ret =
"tex7";
break;
9478 ret =
"<invalid texture>";
9488 ret =
"ffp_varying_specular";
9498 case 0:
ret =
"tss_const0";
break;
9499 case 1:
ret =
"tss_const1";
break;
9500 case 2:
ret =
"tss_const2";
break;
9501 case 3:
ret =
"tss_const3";
break;
9502 case 4:
ret =
"tss_const4";
break;
9503 case 5:
ret =
"tss_const5";
break;
9504 case 6:
ret =
"tss_const6";
break;
9505 case 7:
ret =
"tss_const7";
break;
9507 ret =
"<invalid constant>";
9513 return "<unhandled arg>";
9521 else if (argnum == 1)
9523 else if (argnum == 2)
9532 else if (argnum == 1)
9534 else if (argnum == 2)
9544 const char *dstmask, *dstreg, *arg0, *
arg1, *
arg2;
9553 dstreg = tmp_dst ?
"temp_reg" :
"ret";
9578 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
9583 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
9588 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
9593 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
9598 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
9603 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask);
9608 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask,
arg1, dstmask);
9614 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
9620 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
9626 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
9632 dstreg, dstmask,
arg2, dstmask, arg0,
arg1, dstmask);
9638 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0);
9666 shader_addline(
buffer,
"%s%s = vec4(clamp(dot(%s.xyz - 0.5, %s.xyz - 0.5) * 4.0, 0.0, 1.0))%s;\n",
9667 dstreg, dstmask,
arg1,
arg2, dstmask);
9672 dstreg, dstmask,
arg1, dstmask,
arg2, dstmask, arg0, dstmask);
9678 dstreg, dstmask,
arg2, dstmask,
arg1, dstmask, arg0, dstmask);
9682 FIXME(
"Unhandled operation %#x.\n",
op);
9694 BYTE lum_map = 0, bump_map = 0, tex_map = 0, tss_const_map = 0;
9715 || (stage == 0 &&
settings->color_key_enabled))
9716 tex_map |= 1u << stage;
9718 tfactor_used =
TRUE;
9720 tempreg_used =
TRUE;
9722 tempreg_used =
TRUE;
9724 tss_const_map |= 1u << stage;
9729 lum_map |= 1u << stage;
9732 bump_map |= 1u << stage;
9736 tex_map |= 1u << stage;
9740 tfactor_used =
TRUE;
9755 tex_map |= 1u << stage;
9757 tfactor_used =
TRUE;
9759 tempreg_used =
TRUE;
9761 tss_const_map |= 1u << stage;
9781 if (tempreg_used ||
settings->sRGB_write)
9787 const char *sampler_type;
9789 if (tss_const_map & (1u << stage))
9792 if (!(tex_map & (1u << stage)))
9795 switch (
settings->op[stage].tex_type)
9798 sampler_type =
"1D";
9801 sampler_type =
"2D";
9804 sampler_type =
"3D";
9807 sampler_type =
"Cube";
9810 FIXME(
"Unhandled sampler type %#x.\n",
settings->op[stage].tex_type);
9811 sampler_type =
NULL;
9823 if (!(bump_map & (1u << stage)))
9827 if (!(lum_map & (1u << stage)))
9868 declare_in_varying(gl_info,
buffer,
settings->flatshading,
"vec4 ffp_varying_diffuse;\n");
9869 declare_in_varying(gl_info,
buffer,
settings->flatshading,
"vec4 ffp_varying_specular;\n");
9872 declare_in_varying(gl_info,
buffer,
FALSE,
"float ffp_varying_fogcoord;\n");
9885 if (tex_map & (1u << stage))
9889 else if (
settings->texcoords_initialized & (1u << stage))
9891 stage, legacy_syntax ?
"gl_TexCoord" :
"ffp_varying_texcoord", stage);
9903 const char *texture_function, *coord_mask;
9906 if (!(tex_map & (1u << stage)))
9920 FIXME(
"Unexpected projection mode %d\n",
settings->op[stage].projected);
9927 switch (
settings->op[stage].tex_type)
9930 texture_function =
"texture1D";
9934 texture_function =
"texture2D";
9938 texture_function =
"texture3D";
9942 texture_function =
"textureCube";
9946 FIXME(
"Unhandled texture type %#x.\n",
settings->op[stage].tex_type);
9947 texture_function =
"";
9948 coord_mask =
"xyzw";
9953 texture_function =
"texture";
9986 stage, texture_function, proj ?
"Proj" :
"", stage, coord_mask, proj ?
"w" :
"");
9989 shader_addline(
buffer,
"tex%u *= clamp(tex%u.z * bumpenv_lum_scale%u + bumpenv_lum_offset%u, 0.0, 1.0);\n",
9990 stage, stage - 1, stage - 1, stage - 1);
9995 stage, texture_function, proj ?
"Proj" :
"", stage, stage);
10000 stage, texture_function, proj ?
"Proj" :
"", stage, stage, coord_mask, proj ?
"w" :
"");
10100 ERR(
"Failed to insert ffp vertex shader.\n");
10114 if (!(glsl_desc =
malloc(
sizeof(*glsl_desc))))
10132 for (
i = 0;
i < vs_c_count; ++
i)
10135 vs->uniform_f_locations[
i] =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10142 vs->uniform_i_locations[
i] =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10148 vs->uniform_b_locations[
i] =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10151 vs->pos_fixup_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"pos_fixup"));
10152 vs->base_vertex_id_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"base_vertex_id"));
10157 vs->modelview_matrix_location[
i] =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10159 vs->projection_matrix_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_projection_matrix"));
10160 vs->normal_matrix_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_normal_matrix"));
10164 vs->texture_matrix_location[
i] =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10166 vs->material_ambient_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_material.ambient"));
10167 vs->material_diffuse_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_material.diffuse"));
10168 vs->material_specular_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_material.specular"));
10169 vs->material_emissive_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_material.emissive"));
10170 vs->material_shininess_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_material.shininess"));
10171 vs->light_ambient_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_light_ambient"));
10175 vs->light_location[
i].diffuse =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10177 vs->light_location[
i].specular =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10179 vs->light_location[
i].ambient =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10181 vs->light_location[
i].position =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10183 vs->light_location[
i].direction =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10185 vs->light_location[
i].range =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10187 vs->light_location[
i].falloff =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10189 vs->light_location[
i].c_att =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10191 vs->light_location[
i].l_att =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10193 vs->light_location[
i].q_att =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10195 vs->light_location[
i].cos_htheta =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10197 vs->light_location[
i].cos_hphi =
GL_EXTCALL(glGetUniformLocation(program_id,
name->buffer));
10199 vs->pointsize_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.size"));
10200 vs->pointsize_min_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.size_min"));
10201 vs->pointsize_max_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.size_max"));
10202 vs->pointsize_c_att_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.c_att"));
10203 vs->pointsize_l_att_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.l_att"));
10204 vs->pointsize_q_att_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"ffp_point.q_att"));
10205 vs->clip_planes_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"clip_planes"));
10213 ds->pos_fixup_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"pos_fixup"));
10219 gs->pos_fixup_location =
GL_EXTCALL(glGetUniformLocation(program_id,
"pos_fixup"));
10228 for (
i = 0;
i < ps_c_count; ++
i)
10283 GLuint shader_id, program_id;
10287 ERR(
"Out of memory.\n");
10291 if (!(
shader->backend_data =
calloc(1,
sizeof(*shader_data))))
10293 ERR(
"Failed to allocate backend data.\n");
10297 shader_data =
shader->backend_data;
10301 ERR(
"Failed to allocate GL shader array.\n");
10317 TRACE(
"Created new GLSL shader program %u.\n", program_id);
10319 entry->id = program_id;
10325 entry->cs.id = shader_id;
10326 entry->constant_version = 0;
10327 entry->shader_controlled_clip_distances = 0;
10330 TRACE(
"Attaching GLSL shader object %u to program %u.\n", shader_id, program_id);
10331 GL_EXTCALL(glAttachShader(program_id, shader_id));
10336 TRACE(
"Linking GLSL shader program %u.\n", program_id);
10345 entry->constant_update_mask = 0;
10357 if (!
shader->backend_data)
10359 WARN(
"Failed to find GLSL program for compute shader %p.\n",
shader);
10362 ERR(
"Failed to compile compute shader %p.\n",
shader);
10366 shader_data =
shader->backend_data;
10384 WARN(
"Compute shader is NULL.\n");
10393 ERR(
"Failed to find GLSL program for compute shader %p.\n",
shader);
10408 GLuint reorder_shader_id = 0;
10418 struct list *ps_list, *vs_list;
10437 vs_list = &vshader->linked_programs;
10446 vs_id = ffp_shader->
id;
10503 ps_list = &pshader->linked_programs;
10506 && !(vshader && vshader->
reg_maps.shader_version.major >= 4))
10513 ps_id = ffp_shader->
id;
10531 TRACE(
"Created new GLSL shader program %u.\n", program_id);
10535 entry->id = program_id;
10536 entry->vs.id = vs_id;
10537 entry->hs.id = hs_id;
10538 entry->ds.id = ds_id;
10539 entry->gs.id = gs_id;
10540 entry->ps.id = ps_id;
10542 entry->constant_version = 0;
10543 entry->shader_controlled_clip_distances = 0;
10553 TRACE(
"Attaching GLSL shader object %u to program %u.\n", vs_id, program_id);
10554 GL_EXTCALL(glAttachShader(program_id, vs_id));
10562 attribs_map = vshader->
reg_maps.input_registers;
10563 if (vshader->
reg_maps.shader_version.major < 4)
10569 TRACE(
"Attaching GLSL shader object %u to program %u.\n", reorder_shader_id, program_id);
10570 GL_EXTCALL(glAttachShader(program_id, reorder_shader_id));
10574 GL_EXTCALL(glDeleteShader(reorder_shader_id));
10594 while (attribs_map)
10599 if (vshader && vshader->
reg_maps.shader_version.major >= 4)
10614 if (
state->blend_state &&
state->blend_state->dual_source)
10626 TRACE(
"Attaching GLSL tessellation control shader object %u to program %u.\n", hs_id, program_id);
10627 GL_EXTCALL(glAttachShader(program_id, hs_id));
10635 TRACE(
"Attaching GLSL tessellation evaluation shader object %u to program %u.\n", ds_id, program_id);
10636 GL_EXTCALL(glAttachShader(program_id, ds_id));
10644 TRACE(
"Attaching GLSL geometry shader object %u to program %u.\n", gs_id, program_id);
10645 GL_EXTCALL(glAttachShader(program_id, gs_id));
10656 TRACE(
"Attaching GLSL shader object %u to program %u.\n", ps_id, program_id);
10657 GL_EXTCALL(glAttachShader(program_id, ps_id));
10664 TRACE(
"Linking GLSL shader program %u.\n", program_id);
10669 vshader ? vshader->
limits->constant_float : 0);
10673 pshader ? pshader->
limits->constant_float : 0);
10674 checkGLcall(
"find glsl program uniform locations");
10676 pre_rasterization_shader = gshader ? gshader : dshader ? dshader : vshader;
10677 if (pre_rasterization_shader && pre_rasterization_shader->
reg_maps.shader_version.major >= 4)
10680 entry->shader_controlled_clip_distances = 1;
10686 if (pshader && pshader->
reg_maps.shader_version.major >= 3
10689 TRACE(
"Shader %d needs vertex color clamping disabled.\n", program_id);
10709 entry->constant_update_mask = 0;
10713 if (vshader->
reg_maps.integer_constants)
10715 if (vshader->
reg_maps.boolean_constants)
10717 if (
entry->vs.pos_fixup_location != -1)
10719 if (
entry->vs.base_vertex_id_location != -1)
10731 if (
entry->vs.modelview_matrix_location[
i] != -1)
10740 if (
entry->vs.texture_matrix_location[
i] != -1)
10746 if (
entry->vs.material_ambient_location != -1 ||
entry->vs.material_diffuse_location != -1
10747 ||
entry->vs.material_specular_location != -1
10748 ||
entry->vs.material_emissive_location != -1
10749 ||
entry->vs.material_shininess_location != -1)
10752 if (
entry->vs.clip_planes_location != -1)
10754 if (
entry->vs.pointsize_min_location != -1)
10762 if (
entry->ds.pos_fixup_location != -1)
10770 if (
entry->gs.pos_fixup_location != -1)
10781 if (pshader->
reg_maps.integer_constants)
10783 if (pshader->
reg_maps.boolean_constants)
10798 if (
entry->ps.bumpenv_mat_location[
i] != -1)
10805 if (
entry->ps.fog_color_location != -1)
10807 if (
entry->ps.alpha_test_ref_location != -1)
10809 if (
entry->ps.color_key_location != -1)
10834 GLenum current_vertex_color_clamp;
10835 GLuint program_id, prev_id;
10846 program_id = glsl_program->
id;
10847 current_vertex_color_clamp = glsl_program->
vs.vertex_color_clamp;
10867 FIXME(
"Vertex color clamp needs to be changed, but extension not supported.\n");
10871 TRACE(
"Using GLSL program %u.\n", program_id);
10873 if (prev_id != program_id)
10898 if (
context->constant_update_mask)
10907 GLuint program_id, prev_id;
10913 TRACE(
"Using GLSL program %u.\n", program_id);
10915 if (prev_id != program_id)
10982 for (
i = 0;
i <
device->context_count; ++
i)
10985 ctx_data =
context->shader_backend_data;
10998 const struct list *linked_programs;
11011 TRACE(
"Deleting linked programs.\n");
11012 linked_programs = &
shader->linked_programs;
11018 switch (
shader->reg_maps.shader_version.type)
11026 TRACE(
"Deleting pixel shader %u.\n", gl_shaders[
i].
id);
11048 TRACE(
"Deleting vertex shader %u.\n", gl_shaders[
i].
id);
11070 TRACE(
"Deleting hull shader %u.\n", gl_shaders[
i].
id);
11092 TRACE(
"Deleting domain shader %u.\n", gl_shaders[
i].
id);
11114 TRACE(
"Deleting geometry shader %u.\n", gl_shaders[
i].
id);
11136 TRACE(
"Deleting compute shader %u.\n", gl_shaders[
i].
id);
11153 ERR(
"Unhandled shader type %#x.\n",
shader->reg_maps.shader_version.type);
11196 ERR(
"Failed to allocate memory\n");
11201 heap->entries[1].version = 0;
11219 void *vertex_priv, *fragment_priv;
11222 if (!(priv =
calloc(1,
sizeof(*priv))))
11235 ERR(
"Failed to initialize vertex pipe.\n");
11242 ERR(
"Failed to initialize fragment pipe.\n");
11250 ERR(
"Failed to initialize shader buffer.\n");
11256 ERR(
"Failed to allocate memory.\n");
11262 ERR(
"Failed to initialize vertex shader constant heap\n");
11268 ERR(
"Failed to initialize pixel shader constant heap\n");
11279 device->vertex_priv = vertex_priv;
11280 device->fragment_priv = fragment_priv;
11281 device->shader_priv = priv;
11318 if (!(ctx_data =
calloc(1,
sizeof(*ctx_data))))
11321 context->shader_backend_data = ctx_data;
11360 if (shader_model_4)
11376 TRACE(
"Shader model %u.\n", shader_model);
11378 memset(caps, 0,
sizeof(*caps));
11406 if (shader_model >= 4)
11689 ERR(
"Not implemented.\n");
11721 memset(caps, 0,
sizeof(*caps));
11752 priv = shader_priv;
11757 FIXME(
"GLSL vertex pipe without GLSL shader backend not implemented.\n");
11770 gl_info =
ctx->context_gl->gl_info;
11804 BOOL transformed =
context->stream_info.position_transformed;
11807 context->last_was_rhw = transformed;
11812 if (transformed != wasrhw
11813 ||
context->stream_info.swizzle_map !=
context->last_swizzle_map)
11904 if (
index >= gl_info->
limits.user_clip_distances)
11995 memset(caps, 0,
sizeof(*caps));
12040 priv = shader_priv;
12045 FIXME(
"GLSL fragment pipe without GLSL shader backend not implemented.\n");
12058 gl_info =
ctx->context_gl->gl_info;
12108 ||
context->stream_info.position_transformed)
12118 if (new_source !=
context->fog_source || fogstart == fogend)
12120 context->fog_source = new_source;
12377 gl_info = context_gl->
gl_info;
12402 free(glsl_blitter);
12407 const char *output,
const char *tex_type,
const char *
swizzle)
12420 if (
args->use_colour_key)
12427 const char *tex_type)
12430 char chroma, luminance;
12522 shader_addline(
buffer,
" luminance = texture%s(sampler, out_texcoord.xy).%c;\n", tex, luminance);
12586 "2.0 / 3.0 + 0.5 / size.y, 5.0 / 6.0 - 0.5 / size.y);\n");
12602 shader_addline(
buffer,
" texcoord.y = min(texcoord.y * 2.0 / 3.0, 2.0 / 3.0 - 0.5 / size.y);\n");
12670 shader_addline(
buffer,
" texcoord.y = min(texcoord.y * 2.0 / 3.0, 2.0 / 3.0 - 0.5 / size.y);\n");
12676 const char *output,
const char *tex_type,
const char *
swizzle)
12724 shader_addline(
buffer,
" %s.y = luminance + chroma.y * yuv_coef.y + chroma.x * yuv_coef.z;\n", output);
12726 if (
args->use_colour_key)
12734 const char *output,
const char *tex_type,
const char *
swizzle)
12740 if (
args->use_colour_key)
12749 static const struct
12752 const char texture_type[7];
12753 const char texcoord_swizzle[4];
12760 static const char vshader_main[] =
12764 " gl_Position = vec4(pos, 0.0, 1.0);\n"
12765 " out_texcoord = texcoord;\n"
12776 if (
args->texture_type == texture_data[
i].texture_target)
12778 tex_type = texture_data[
i].texture_type;
12779 swizzle = texture_data[
i].texcoord_swizzle;
12785 FIXME(
"Unsupported texture type %#x.\n",
args->texture_type);
12797 declare_out_varying(gl_info,
buffer,
FALSE,
"vec3 out_texcoord;\n");
12810 if (
args->use_colour_key)
12816 declare_in_varying(gl_info,
buffer,
FALSE,
"vec3 out_texcoord;\n");
12881 palette = texture_gl->
t.swapchain ? texture_gl->
t.swapchain->palette :
NULL;
12902 static const DWORD black;
12904 FIXME(
"P8 texture loaded without a palette.\n");
12923 args.fixup = texture_gl->
t.resource.format->color_fixup;
12924 args.use_colour_key = use_colour_key;
12931 ERR(
"Failed to allocate blitter program memory.\n");
12938 WARN(
"Failed to generate blitter program.\n");
12945 ERR(
"Failed to store blitter program.\n");
12962 bool src_ds, dst_ds;
12973 if (src_ds && dst_ds)
12975 else if (!src_ds && !dst_ds)
12982 TRACE(
"Unsupported blit_op %#x.\n", blit_op);
12992 TRACE(
"Multi-sample source textures not supported.\n");
12998 TRACE(
"Destination resource does not have GPU access.\n");
13009 TRACE(
"Source resource does not have GPU access.\n");
13016 TRACE(
"Destination fixups are not supported.\n");
13023 TRACE(
"Destination texture is not FBO attachable.\n");
13027 TRACE(
"Returning supported.\n");
13034 unsigned int dst_sub_resource_idx,
DWORD dst_location,
const RECT *dst_rect,
13048 unsigned int src_level;
13052 TRACE(
"blitter %p, op %#x, context %p, src_texture %p, src_sub_resource_idx %u, src_location %s, "
13053 "src_rect %s, dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_rect %s, "
13054 "colour_key %p, filter %s, resolve format %p.\n",
13063 ERR(
"No blitter to handle blit op %#x.\n",
op);
13064 return dst_location;
13067 TRACE(
"Forwarding to blitter %p.\n",
next);
13068 return next->ops->blitter_blit(
next,
op,
context, src_texture, src_sub_resource_idx, src_location,
13069 src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect, colour_key,
filter,
13081 TRACE(
"Source texture is not GPU accessible, creating a staging texture.\n");
13083 src_level = src_sub_resource_idx % src_texture->
level_count;
13086 desc.multisample_type = src_texture->
resource.multisample_type;
13087 desc.multisample_quality = src_texture->
resource.multisample_quality;
13089 desc.bind_flags = 0;
13099 ERR(
"Failed to create staging texture, hr %#lx.\n",
hr);
13100 return dst_location;
13105 src_texture, src_sub_resource_idx, &upload_box);
13107 src_texture = staging_texture;
13109 src_sub_resource_idx = 0;
13137 colour_key = &alpha_test_key;
13146 ERR(
"Failed to get blitter program.\n");
13147 return dst_location;
13161 src_level = src_sub_resource_idx % src_texture->
level_count;
13183 if (dst_texture->
swapchain && (dst_texture->
swapchain->front_buffer == dst_texture))
13184 gl_info->
gl_ops.gl.p_glFlush();
13186 if (staging_texture)
13189 return dst_location;
13193 unsigned int rt_count,
const struct wined3d_fb_state *fb,
unsigned int rect_count,
const RECT *clear_rects,
13199 next->ops->blitter_clear(
next,
device, rt_count, fb, rect_count,
13224 ERR(
"Failed to allocate blitter.\n");
13234 blitter->palette_texture = 0;
struct mke2fs_defaults settings[]
static struct myctx * mcs
static const char * wine_dbgstr_rect(const RECT *prc)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static int list_empty(struct list_entry *head)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
void wined3d_context_gl_enable_clip_distances(struct wined3d_context_gl *context_gl, uint32_t enable_mask)
void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl, const struct wined3d_device *device)
void wined3d_context_gl_draw_shaded_quad(struct wined3d_context_gl *context_gl, struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter)
void context_gl_apply_texture_draw_state(struct wined3d_context_gl *context_gl, struct wined3d_texture *texture, unsigned int sub_resource_idx, unsigned int location)
const unsigned int * wined3d_context_gl_get_tex_unit_mapping(const struct wined3d_context_gl *context_gl, const struct wined3d_shader_version *shader_version, unsigned int *base, unsigned int *count)
void wined3d_context_gl_active_texture(struct wined3d_context_gl *context_gl, const struct wined3d_gl_info *gl_info, unsigned int unit)
unsigned int component_count
#define PRINTF_ATTR(fmt, args)
void multiply_matrix(struct wined3d_matrix *dst, const struct wined3d_matrix *src1, const struct wined3d_matrix *src2)
static void wined3d_color_from_d3dcolor(struct wined3d_color *wined3d_colour, D3DCOLOR d3d_colour)
void * wined3d_buffer_load_sysmem(struct wined3d_buffer *buffer, 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)
BOOL shader_get_stream_output_register_info(const struct wined3d_shader *shader, const struct wined3d_stream_output_element *so_element, unsigned int *register_idx, unsigned int *component_idx)
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 find_vs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, struct vs_compile_args *args, const struct wined3d_context *context)
enum vkd3d_shader_visibility vkd3d_shader_visibility_from_wined3d(enum wined3d_shader_type shader_type)
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,...)
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)
enum wined3d_shader_resource_type pixelshader_get_resource_type(const struct wined3d_shader_reg_maps *reg_maps, unsigned int resource_idx, DWORD tex_types)
const struct wined3d_vec4 wined3d_srgb_const[]
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)
HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT layer_count, UINT level_count, uint32_t flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
void wined3d_texture_translate_drawable_coords(const struct wined3d_texture *texture, HWND window, RECT *rect)
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
void wined3d_texture_upload_from_texture(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box)
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, unsigned int location)
BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, uint32_t location)
void wined3d_texture_load(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
const struct ffp_frag_desc * find_ffp_frag_shader(const struct wine_rb_tree *fragment_shaders, const struct ffp_frag_settings *settings)
void get_fog_start_end(const struct wined3d_context *context, const struct wined3d_state *state, float *start, float *end)
void wined3d_ffp_get_fs_settings(const struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info, struct ffp_frag_settings *settings)
const char * wined3d_debug_location(uint32_t location)
const char * debug_d3dprimitivetype(enum wined3d_primitive_type primitive_type)
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)
const char * debug_d3dtexturefiltertype(enum wined3d_texture_filter_type filter_type)
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 wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct wined3d_stream_info *si, const struct wined3d_d3d_info *d3d_info, struct wined3d_ffp_vs_settings *settings)
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[]
static WCHAR * fixup_mask(const WCHAR *mask)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static const size_t stack_size
void state_nop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
void ffp_vertex_update_clip_plane_constants(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state)
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 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)
#define GL_TEXTURE_MIN_FILTER
GLint GLint GLsizei GLsizei GLsizei depth
#define GL_TEXTURE_WRAP_S
#define GL_TEXTURE_CUBE_MAP
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLclampf GLclampf GLclampf alpha
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
#define GL_TEXTURE_MAG_FILTER
#define GL_UNSIGNED_INT_8_8_8_8_REV
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
GLboolean GLboolean GLboolean b
#define GL_SHADER_SOURCE_LENGTH
GLboolean GLenum GLenum GLvoid * values
#define GL_COMPILE_STATUS
GLuint GLsizei GLsizei * length
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY
#define GL_TESS_EVALUATION_SHADER
#define GL_TEXTURE_2D_MULTISAMPLE
GLboolean GLboolean GLboolean GLboolean a
GLenum GLenum GLenum input
#define GL_SEPARATE_ATTRIBS
GLubyte GLubyte GLubyte GLubyte w
#define GL_INFO_LOG_LENGTH
GLint GLfloat GLint stencil
#define GL_ATTACHED_SHADERS
GLfloat GLfloat GLfloat GLfloat h
#define GL_PIXEL_UNPACK_BUFFER
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 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 shader_glsl_free(struct wined3d_device *device, struct wined3d_context *context)
static BOOL use_legacy_fragment_output(const struct wined3d_gl_info *gl_info)
static void glsl_fragment_pipe_vdecl(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void shader_glsl_free_ffp_fragment_shader(struct wine_rb_entry *entry, void *param)
static BOOL needs_interpolation_qualifiers_for_shader_outputs(const struct wined3d_gl_info *gl_info)
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 glsl_fragment_pipe_free(struct wined3d_device *device, struct wined3d_context *context)
const char * glsl_scalar_type
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 unsigned int glsl_fragment_pipe_get_emul_mask(const struct wined3d_adapter *adapter)
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 void shader_glsl_fixup_scalar_register_variable(struct wined3d_string_buffer *register_name, const char *glsl_variable, const struct wined3d_gl_info *gl_info)
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 glsl_vertex_pipe_vp_get_caps(const struct wined3d_adapter *adapter, struct wined3d_vertex_caps *caps)
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 glsl_blitter_generate_yuv_shader(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *output, const char *tex_type, const char *swizzle)
static void shader_glsl_texcoord(const struct wined3d_shader_instruction *ins)
static void glsl_fragment_pipe_alpha_test(struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
static unsigned int shader_glsl_get_version(const struct wined3d_gl_info *gl_info)
static void shader_generate_glsl_declarations(const struct wined3d_context_gl *context_gl, 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_sincos(const struct wined3d_shader_instruction *ins)
static void shader_glsl_update_graphics_program(struct shader_glsl_priv *priv, struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
static void shader_glsl_resinfo(const struct wined3d_shader_instruction *ins)
static DWORD glsl_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, DWORD src_location, const RECT *src_rect, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, DWORD dst_location, const RECT *dst_rect, const struct wined3d_color_key *colour_key, enum wined3d_texture_filter_type filter, const struct wined3d_format *resolve_format)
static void glsl_blitter_generate_p8_shader(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *output, const char *tex_type, const char *swizzle)
static void shader_glsl_load_program_resources(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader *shader)
static const char * shader_glsl_get_ffp_fragment_op_arg(struct wined3d_string_buffer *buffer, unsigned int argnum, unsigned int stage, DWORD arg)
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_blitter_upload_palette(struct wined3d_glsl_blitter *blitter, struct wined3d_context_gl *context_gl, const struct wined3d_texture_gl *texture_gl)
static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, struct wined3d_context_gl *context_gl, struct wined3d_buffer *constant_buffer, const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, unsigned int version)
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 const struct @336 component_type_info[]
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_sample_info(const struct wined3d_shader_instruction *ins)
static void glsl_free_blitter_program(struct wine_rb_entry *entry, void *ctx)
static void shader_glsl_udiv(const struct wined3d_shader_instruction *ins)
static void shader_glsl_invalidate_current_program(struct wined3d_context *context)
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, unsigned int dst_idx, enum wined3d_data_type data_type)
static void glsl_fragment_pipe_apply_draw_state(struct wined3d_context *context, const struct wined3d_state *state)
static const struct wined3d_state_entry_template glsl_fragment_pipe_state_template[]
static GLuint shader_glsl_generate_compute_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, const struct wined3d_shader *shader)
static int glsl_blitter_args_compare(const void *key, const struct wine_rb_entry *entry)
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_gl *context_gl)
static void shader_glsl_to_uint(const struct wined3d_shader_instruction *ins)
static void shader_glsl_unary_op(const struct wined3d_shader_instruction *ins)
#define WINED3D_GLSL_SAMPLE_PROJECTED
static void add_glsl_program_entry(struct shader_glsl_priv *priv, struct glsl_shader_prog_link *entry)
static void shader_glsl_ffp_vertex_normalmatrix_uniform(const struct wined3d_context_gl *context_gl, const struct wined3d_ffp_vs_constants *constants, struct glsl_shader_prog_link *prog)
static const char * shader_glsl_get_rel_op(enum wined3d_shader_rel_op op)
static void shader_glsl_texm3x3pad(const struct wined3d_shader_instruction *ins)
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 uint32_t *interpolation_mode)
static void shader_glsl_texreg2rgb(const struct wined3d_shader_instruction *ins)
static struct vkd3d_shader_combined_resource_sampler * create_combined_resource_sampler_bindings(const struct wined3d_context_gl *context_gl, const struct wined3d_shader *shader, unsigned int *count)
static void shader_glsl_texm3x2depth(const struct wined3d_shader_instruction *ins)
static unsigned int shader_glsl_full_ffp_varyings(const struct wined3d_gl_info *gl_info)
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 GLuint find_glsl_geometry_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, struct wined3d_shader *shader, const struct gs_compile_args *args)
static void glsl_vertex_pipe_nop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void glsl_fragment_pipe_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps)
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_update_legacy_states(struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
static void glsl_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
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 void shader_glsl_free_ffp_vertex_shader(struct wine_rb_entry *entry, void *param)
static BOOL glsl_fragment_pipe_alloc_context_data(struct wined3d_context *context)
static void shader_glsl_generate_color_output(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct wined3d_shader *shader, const struct ps_compile_args *args, struct wined3d_string_buffer_list *string_buffers)
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 void shader_glsl_ffp_vertex_texmatrix_uniform(const struct wined3d_context_gl *context_gl, const struct wined3d_ffp_vs_constants *constants, unsigned int tex, struct glsl_shader_prog_link *prog)
static void glsl_vertex_pipe_vp_disable(const struct wined3d_context *context)
static void apply_clamped_constant(const struct wined3d_gl_info *gl_info, GLint location, const struct wined3d_vec4 *data)
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 void shader_glsl_texm3x3tex(const struct wined3d_shader_instruction *ins)
static void gen_packed_yuv_read(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *tex_type)
static void shader_glsl_gen_sample_c_lz_emulation(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 const char *const shift_glsl_tab[]
static void shader_glsl_mul_extended(const struct wined3d_shader_instruction *ins)
static void shader_glsl_ret(const struct wined3d_shader_instruction *ins)
static void glsl_vertex_pipe_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void gen_nv12_read(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const char *tex_type)
struct wined3d_blitter * wined3d_glsl_blitter_create(struct wined3d_blitter **next, const struct wined3d_device *device)
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 HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe, const struct wined3d_fragment_pipe_ops *fragment_pipe)
static GLuint find_glsl_vertex_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, struct wined3d_shader *shader, const struct vs_compile_args *args)
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 GLuint find_glsl_domain_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, struct wined3d_shader *shader, const struct ds_compile_args *args)
static BOOL shader_glsl_use_layout_qualifier(const struct wined3d_gl_info *gl_info)
static GLuint shader_glsl_generate_vertex_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct vs_compile_args *args)
static void shader_glsl_compile(const struct wined3d_gl_info *gl_info, GLuint shader, const char *src)
enum wined3d_data_type data_type
static void shader_glsl_load_fog_uniform(const struct wined3d_context_gl *context_gl, const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
static void shader_glsl_setup_sm3_rasterizer_input(struct shader_glsl_priv *priv, const struct wined3d_gl_info *gl_info, const unsigned int *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 void shader_glsl_generate_shader_epilogue(const struct wined3d_shader_context *ctx)
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 unsigned int *tex_unit_map)
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 unsigned int glsl_vertex_pipe_vp_get_emul_mask(const struct wined3d_adapter *adapter)
static void shader_glsl_enable_extensions(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info)
static void glsl_fragment_pipe_fogparams(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
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_lrp(const struct wined3d_shader_instruction *ins)
static void shader_glsl_dp2add(const struct wined3d_shader_instruction *ins)
static const char * glsl_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
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 GLuint find_glsl_hull_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, struct wined3d_shader *shader)
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_generate_colour_key_test(struct wined3d_string_buffer *buffer, const char *colour, const char *colour_key_low, const char *colour_key_high)
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 get_projection_matrix(const struct wined3d_context *context, const struct wined3d_ffp_vs_constants *constants, const struct wined3d_state *state, struct wined3d_matrix *mat)
static void constant_free(struct constant_heap *heap)
static void shader_glsl_append_imm_vec(struct wined3d_string_buffer *buffer, const float *values, unsigned int size, const struct wined3d_gl_info *gl_info)
static GLuint find_glsl_compute_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, struct wined3d_shader *shader)
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 const struct wined3d_blitter_ops glsl_blitter_ops
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_glsl_texdp3(const struct wined3d_shader_instruction *ins)
static void shader_glsl_load_constants_i(const struct wined3d_shader *shader, struct wined3d_context_gl *context_gl, struct wined3d_buffer *constant_buffer, const GLint locations[WINED3D_MAX_CONSTS_I], uint32_t constants_set)
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 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)
static void glsl_vertex_pipe_vp_apply_draw_state(struct wined3d_context *context, const struct wined3d_state *state)
static void shader_glsl_get_sample_function(const struct wined3d_shader_context *ctx, DWORD resource_idx, DWORD sampler_idx, uint32_t flags, struct glsl_sample_function *sample_function)
#define WINED3D_GLSL_SAMPLE_OFFSET
static BOOL shader_glsl_allocate_context_data(struct wined3d_context *context)
static void shader_glsl_update_compute_program(struct shader_glsl_priv *priv, struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
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 GLuint shader_glsl_generate_geometry_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct gs_compile_args *args)
static BOOL shader_glsl_color_fixup_supported(struct color_fixup_desc fixup)
static void shader_glsl_cut(const struct wined3d_shader_instruction *ins)
static void shader_glsl_pointsize_uniform(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
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_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_setup_vs3_output(struct shader_glsl_priv *priv, const struct wined3d_gl_info *gl_info, const unsigned int *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_conditional_op(const struct wined3d_shader_instruction *ins)
static void shader_glsl_get_caps(const struct wined3d_adapter *adapter, struct shader_caps *caps)
static void shader_glsl_cross(const struct wined3d_shader_instruction *ins)
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_uav_counter(const struct wined3d_shader_instruction *ins)
static void shader_glsl_apply_compute_state(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
static void set_glsl_compute_shader_program(const struct wined3d_context_gl *context_gl, const struct wined3d_state *state, struct shader_glsl_priv *priv, struct glsl_context_data *ctx_data)
static unsigned int shader_glsl_swizzle_get_component(DWORD swizzle, unsigned int component_idx)
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, unsigned int size)
static void shader_glsl_ffp_vertex_material_uniform(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl, const struct wined3d_state *state, struct shader_glsl_priv *priv, struct glsl_context_data *ctx_data)
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_fixup_position(struct wined3d_string_buffer *buffer, BOOL use_viewport_index)
static void shader_glsl_bitwise_op(const struct wined3d_shader_instruction *ins)
static void shader_glsl_apply_draw_state(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
static void shader_glsl_add_instruction_modifiers(const struct wined3d_shader_instruction *ins)
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 glsl_fragment_pipe_disable(const struct wined3d_context *context)
static uint64_t shader_glsl_shader_compile(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc, enum wined3d_shader_type shader_type)
static const char * get_fragment_output(const struct wined3d_gl_info *gl_info)
static void shader_glsl_ffp_vertex_light_uniform(const struct wined3d_context_gl *context_gl, const struct wined3d_state *state, unsigned int light, enum wined3d_light_type type, const struct wined3d_light_constants *constants, struct glsl_shader_prog_link *prog)
static void shader_glsl_end(const struct wined3d_shader_instruction *ins)
static void shader_glsl_case(const struct wined3d_shader_instruction *ins)
static BOOL is_mipmapped(enum wined3d_shader_resource_type resource_type)
static BOOL glsl_is_color_reg_read(const struct wined3d_shader *shader, unsigned int idx)
const char * glsl_vector_type
static void shader_glsl_load_constants(struct shader_glsl_priv *priv, struct wined3d_context *context, const struct wined3d_state *state)
static struct vkd3d_shader_resource_binding * create_resource_bindings(const struct wined3d_gl_info *gl_info, enum wined3d_shader_type shader_type, unsigned int *count)
static void shader_glsl_texdp3tex(const struct wined3d_shader_instruction *ins)
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 void shader_glsl_ffp_vertex_lighting_footer(struct wined3d_string_buffer *buffer, const struct wined3d_ffp_vs_settings *settings, unsigned int idx, BOOL legacy_lighting)
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_call(const struct wined3d_shader_instruction *ins)
static void shader_glsl_declare_shader_inputs(const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, unsigned int element_count, const uint32_t *interpolation_mode, BOOL unroll)
static void shader_glsl_generate_stream_output_setup(struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader)
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 uint32_t *interpolation_mode)
static void shader_glsl_binop(const struct wined3d_shader_instruction *ins)
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_clip_plane_uniform(const struct wined3d_context_gl *context_gl, const struct wined3d_state *state, unsigned int index, struct glsl_shader_prog_link *prog)
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 enum wined3d_shader_interpolation_mode wined3d_extract_interpolation_mode(const uint32_t *packed_interpolation_mode, unsigned int register_idx)
static void shader_glsl_add_src_param_ext(const struct wined3d_shader_context *ctx, 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_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 glsl_fragment_pipe_alpha_test_func(struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
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 BOOL shader_glsl_generate_transform_feedback_varyings(struct wined3d_string_buffer *buffer, const char **varyings, unsigned int *varying_count, char *strings, unsigned int *strings_length, GLenum buffer_mode, struct wined3d_shader *shader)
static GLuint shader_glsl_generate_fragment_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct ps_compile_args *args)
static void shader_glsl_get_coord_size(enum wined3d_shader_resource_type resource_type, unsigned int *coord_size, unsigned int *deriv_size)
const struct wined3d_fragment_pipe_ops glsl_fragment_pipe
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 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 const struct @335 resource_type_info[]
static void shader_glsl_sync(const struct wined3d_shader_instruction *ins)
static void glsl_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, const RECT *draw_rect, uint32_t flags, const struct wined3d_color *color, float depth, unsigned int stencil)
static void shader_glsl_precompile(void *shader_priv, struct wined3d_shader *shader)
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_dump_program_source(const struct wined3d_gl_info *gl_info, GLuint program)
#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 void shader_glsl_load_constants_b(const struct wined3d_shader *shader, struct wined3d_context_gl *context_gl, struct wined3d_buffer *constant_buffer, const GLint locations[WINED3D_MAX_CONSTS_B], uint32_t constants_set)
static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TABLE_SIZE]
static struct glsl_blitter_program * glsl_blitter_get_program(struct wined3d_glsl_blitter *blitter, struct wined3d_context_gl *context_gl, const struct wined3d_texture_gl *texture_gl, BOOL use_colour_key)
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_ffp_fragment_op(struct wined3d_string_buffer *buffer, unsigned int stage, BOOL color, BOOL alpha, BOOL tmp_dst, unsigned int op, DWORD dw_arg0, DWORD dw_arg1, DWORD dw_arg2)
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 unsigned int shader_glsl_find_sampler(const struct wined3d_shader_sampler_map *sampler_map, unsigned int resource_idx, unsigned int sampler_idx)
static HRESULT shader_glsl_compile_compute_shader(struct shader_glsl_priv *priv, const struct wined3d_context_gl *context_gl, struct wined3d_shader *shader)
static void shader_glsl_generate_condition(const struct wined3d_shader_instruction *ins)
static BOOL shader_glsl_use_interface_blocks(const struct wined3d_gl_info *gl_info)
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, struct wined3d_string_buffer_list *string_buffers)
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 void shader_glsl_default(const struct wined3d_shader_instruction *ins)
static void shader_glsl_store_raw_structured(const struct wined3d_shader_instruction *ins)
static void shader_glsl_free_context_data(struct wined3d_context *context)
static void glsl_fragment_pipe_free_context_data(struct wined3d_context *context)
static void shader_glsl_interpolate(const struct wined3d_shader_instruction *ins)
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 GLuint shader_glsl_generate_domain_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct ds_compile_args *args)
static void shader_glsl_tex(const struct wined3d_shader_instruction *ins)
static void shader_glsl_nop(const struct wined3d_shader_instruction *ins)
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 GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *priv, const struct ffp_frag_settings *settings, const struct wined3d_context_gl *context_gl)
static void shader_glsl_init_transform_feedback(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, GLuint program_id, struct wined3d_shader *shader)
@ HEAP_NODE_TRAVERSE_RIGHT
@ HEAP_NODE_TRAVERSE_LEFT
static const char * shader_glsl_shader_input_name(const struct wined3d_gl_info *gl_info)
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 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 GLuint shader_glsl_generate_hull_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, const struct wined3d_shader *shader)
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_ffp_vertex_shader(struct shader_glsl_priv *priv, const struct wined3d_ffp_vs_settings *settings, const struct wined3d_gl_info *gl_info)
static void glsl_blitter_generate_plain_shader(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *output, const char *tex_type, const char *swizzle)
static void shader_glsl_breakc(const struct wined3d_shader_instruction *ins)
static BOOL glsl_blitter_supported(enum wined3d_blit_op blit_op, const struct wined3d_context *context, const struct wined3d_texture_gl *src_texture, DWORD src_location, const struct wined3d_texture_gl *dst_texture, DWORD dst_location)
static void gen_yv12_read(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const char *tex_type)
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 GLuint find_glsl_fragment_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, struct wined3d_shader *shader, const struct ps_compile_args *args)
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_vp_free(struct wined3d_device *device, struct wined3d_context *context)
static GLuint shader_glsl_generate_vkd3d_shader(const struct wined3d_context_gl *context_gl, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, GLenum gl_shader_type)
static void shader_glsl_get_register_name(const struct wined3d_shader_register *reg, enum wined3d_data_type data_type, struct wined3d_string_buffer *register_name, BOOL *is_swizzled, const struct wined3d_shader_context *ctx)
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_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 wined3d_state_entry_template glsl_vertex_pipe_vp_states[]
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_continue(const struct wined3d_shader_instruction *ins)
static GLuint glsl_blitter_generate_program(struct wined3d_glsl_blitter *blitter, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args)
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)
#define location(file, line)
#define memcpy(s1, s2, n)
D3D11_SHADER_VARIABLE_DESC desc
static const char * dst_format
static ULONG ** element_count
static unsigned __int64 next
#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)
#define WINE_RB_ENTRY_VALUE
#define wine_rb_for_each_entry
enum vkd3d_shader_register_type reg_type
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::@270 value[4]
unsigned int max_blend_stages
unsigned int PrimitiveMiscCaps
unsigned int max_textures
unsigned int TextureOpCaps
unsigned short use_colour_key
struct color_fixup_desc fixup
struct wine_rb_entry entry
struct glsl_shader_prog_link * glsl_program
GLenum vertex_color_clamp
BOOL rasterization_disabled
struct shader_glsl_priv * priv
const struct wined3d_context_gl * context_gl
struct ffp_frag_desc entry
struct list linked_programs
struct wined3d_ffp_vs_desc desc
struct list linked_programs
GLint tss_constant_location[WINED3D_MAX_FFP_TEXTURES]
GLint fog_density_location
GLint tex_factor_location
GLint alpha_test_ref_location
GLint uniform_b_locations[WINED3D_MAX_CONSTS_B]
GLint bumpenv_lum_scale_location[WINED3D_MAX_FFP_TEXTURES]
GLint uniform_i_locations[WINED3D_MAX_CONSTS_I]
GLint bumpenv_lum_offset_location[WINED3D_MAX_FFP_TEXTURES]
GLint uniform_f_locations[WINED3D_MAX_PS_CONSTS_F]
GLint bumpenv_mat_location[WINED3D_MAX_FFP_TEXTURES]
GLint specular_enable_location
enum wined3d_data_type data_type
struct wined3d_string_buffer * name
BOOL output_single_component
unsigned int num_gl_shaders
struct glsl_ds_compiled_shader * ds
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
union glsl_shader_private::@338 gl_shaders
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 texture_matrix_location[WINED3D_MAX_FFP_TEXTURES]
GLint pointsize_l_att_location
GLint base_vertex_id_location
struct glsl_vs_program::@337 light_location[WINED3D_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 normal_matrix_location
GLint light_ambient_location
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 pointsize_min_location
GLint pointsize_c_att_location
GLint material_ambient_location
GLint modelview_matrix_location[MAX_VERTEX_BLENDS]
struct interface_info * next
unsigned int varying_count
unsigned int ps_uniform_count
unsigned int vs_uniform_count
const struct ds_compile_args * cur_ds_args
const struct vs_compile_args * cur_vs_args
const struct wined3d_gl_info * gl_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
struct wine_rb_tree program_lookup
const struct wined3d_vertex_pipe_ops * vertex_pipe
struct wined3d_string_buffer shader_buffer
const struct wined3d_fragment_pipe_ops * fragment_pipe
struct vkd3d_shader_descriptor_binding binding
unsigned int resource_index
unsigned int sampler_index
unsigned int sampler_space
unsigned int resource_space
enum vkd3d_shader_visibility shader_visibility
struct vkd3d_shader_descriptor_binding binding
unsigned int register_space
enum vkd3d_shader_descriptor_type type
unsigned int register_index
enum vkd3d_shader_visibility shader_visibility
uint32_t interpolation_mode[WINED3D_PACKED_INTERPOLATION_SIZE]
unsigned int next_shader_input_count
struct wined3d_gl_info gl_info
struct wined3d_blitter * next
unsigned int color_space_low_value
unsigned int color_space_high_value
unsigned int tex_unit_map[WINED3D_MAX_COMBINED_SAMPLERS]
const struct wined3d_gl_info * gl_info
uint32_t wined3d_creation_flags
uint32_t emulated_flatshading
float filling_convention_offset
BOOL supported[WINED3D_GL_EXT_COUNT]
struct opengl_funcs gl_ops
struct wined3d_gl_limits limits
unsigned int glsl_version
unsigned int reserved_glsl_constants
struct wine_rb_tree programs
struct wined3d_blitter blitter
struct wined3d_string_buffer_list string_buffers
unsigned int output_vertex_count
struct wined3d_hull_shader::@357 phases
enum wined3d_resource_type type
const struct wined3d_format * format
bool check_float_constants
enum wined3d_shader_backend shader_backend
unsigned int strict_shader_math
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::@346 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_component_type component_type
enum wined3d_sysval_semantic sysval_semantic
unsigned int element_count
struct wined3d_shader_signature_element * elements
enum wined3d_shader_src_modifier modifiers
struct wined3d_shader_register reg
unsigned int texcoord_w[2]
enum wined3d_shader_type type
union wined3d_shader::@358 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]
unsigned int element_count
const struct wined3d_stream_output_element * elements
unsigned int rasterizer_stream_idx
unsigned int buffer_stride_count
struct wined3d_swapchain * swapchain
struct wined3d_resource resource
DWORD vertex_processing_caps
DWORD max_user_clip_planes
BOOL emulated_flatshading
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)
@ VKD3D_SHADER_COMPILE_OPTION_API_VERSION
VKD3D_SHADER_API const char * vkd3d_shader_get_version(unsigned int *major, unsigned int *minor)
VKD3D_SHADER_API void vkd3d_shader_free_shader_code(struct vkd3d_shader_code *code)
@ VKD3D_SHADER_SOURCE_D3D_BYTECODE
@ VKD3D_SHADER_LOG_WARNING
@ VKD3D_SHADER_STRUCTURE_TYPE_TRANSFORM_FEEDBACK_INFO
@ VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO
@ VKD3D_SHADER_STRUCTURE_TYPE_INTERFACE_INFO
@ VKD3D_SHADER_API_VERSION_1_6
@ VKD3D_SHADER_DESCRIPTOR_TYPE_CBV
@ VKD3D_SHADER_BINDING_FLAG_IMAGE
@ VKD3D_SHADER_BINDING_FLAG_BUFFER
VKD3D_SHADER_API int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out, char **messages)
@ VKD3D_SHADER_TARGET_GLSL
VKD3D_SHADER_API void vkd3d_shader_free_messages(char *messages)
#define GL_COMPUTE_SHADER
const struct wined3d_parent_ops wined3d_null_parent_ops
#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 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_COLORKEYENABLE
@ WINED3D_RS_SPECULARMATERIALSOURCE
@ WINED3D_RS_SRGBWRITEENABLE
@ WINED3D_RS_RANGEFOGENABLE
@ WINED3D_RS_POINTSIZE_MIN
@ 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_FOGVERTEXMODE
@ WINED3D_RS_ALPHATESTENABLE
@ WINED3D_PT_TRIANGLELIST_ADJ
@ WINED3D_PT_LINELIST_ADJ
@ WINED3D_PT_TRIANGLESTRIP
@ WINED3D_PT_TRIANGLELIST
static int wined3d_bit_scan(unsigned int *x)
#define WINED3DVTXPCAPS_TEXGEN
#define WINED3DTEXOPCAPS_BUMPENVMAPLUMINANCE
wined3d_material_color_source
#define WINED3DVTXPCAPS_MATERIALSOURCE7
#define WINED3DTEXOPCAPS_BLENDTEXTUREALPHA
#define WINED3DTEXOPCAPS_MODULATE2X
#define WINED3D_MAX_PS_CONSTS_F
#define WINED3D_MAX_STREAM_OUTPUT_BUFFERS
#define WINED3D_RESOURCE_ACCESS_GPU
#define WINED3DVTXPCAPS_VERTEXFOG
@ WINED3D_RTYPE_TEXTURE_2D
#define WINED3DTA_SELECTMASK
#define WINED3D_MAX_VIEWPORTS
#define WINED3D_MAX_VS_CONSTS_F
#define WINED3D_MAX_RENDER_TARGETS
#define WINED3DTEXOPCAPS_DISABLE
@ 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_texture_filter_type
@ WINED3D_TSS_TEXCOORD_INDEX
@ 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
static void wined3d_box_set(struct wined3d_box *box, unsigned int left, unsigned int top, unsigned int right, unsigned int bottom, unsigned int front, unsigned int back)
#define WINED3DTA_ALPHAREPLICATE
#define WINED3DTSS_TCI_SPHEREMAP
#define WINED3DVTXPCAPS_TEXGEN_SPHEREMAP
#define WINED3D_MAX_CONSTS_B
@ WINED3D_SHADER_TYPE_HULL
@ WINED3D_SHADER_TYPE_PIXEL
@ WINED3D_SHADER_TYPE_GEOMETRY
@ WINED3D_SHADER_TYPE_DOMAIN
@ WINED3D_SHADER_TYPE_COMPUTE
@ WINED3D_SHADER_TYPE_VERTEX
#define WINED3DPMISCCAPS_TSSARGTEMP
#define WINED3D_MAX_CONSTS_I
#define WINED3D_BIND_RENDER_TARGET
#define WINED3DTEXOPCAPS_MULTIPLYADD
#define WINED3D_LEGACY_FFP_LIGHTING
#define WINED3DTEXOPCAPS_BLENDFACTORALPHA
#define WINED3DTA_DIFFUSE
#define WINED3DTEXOPCAPS_ADDSIGNED
#define WINED3D_MAX_FFP_TEXTURES
#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_SHADER_TEXTURE_IMAGE_SAMPLES
@ ARB_FRAGMENT_COORD_CONVENTIONS
@ ARB_UNIFORM_BUFFER_OBJECT
@ ARB_SHADER_ATOMIC_COUNTERS
@ ARB_SHADING_LANGUAGE_420PACK
@ ARB_TESSELLATION_SHADER
@ ARB_TRANSFORM_FEEDBACK3
@ WINED3D_GL_LEGACY_CONTEXT
@ ARB_SHADER_STENCIL_EXPORT
@ ARB_SHADER_IMAGE_LOAD_STORE
@ ARB_SHADER_VIEWPORT_LAYER_ARRAY
@ ARB_TEXTURE_CUBE_MAP_ARRAY
static const struct wined3d_context_gl * wined3d_context_gl_const(const struct wined3d_context *context)
#define WINED3D_QUIRK_INFO_LOG_SPAM
#define WINED3D_QUIRK_GLSL_CLIP_VARYING
static const struct wined3d_adapter_gl * wined3d_adapter_gl_const(const struct wined3d_adapter *adapter)
#define WINED3D_SHADER_CONST_PS_BUMP_ENV
#define WINED3DSP_WRITEMASK_ALL
static void context_apply_state(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static unsigned int wined3d_texture_get_level_height(const struct wined3d_texture *texture, unsigned int level)
#define WINED3DSI_PRECISE_XYZW
static bool isStateDirty(const struct wined3d_context *context, unsigned int state_id)
#define STATE_CLIPPLANE(a)
#define WINED3DSP_WRITEMASK_0
@ WINED3D_PUSH_CONSTANTS_PS_FFP
@ WINED3D_PUSH_CONSTANTS_PS_B
@ WINED3D_PUSH_CONSTANTS_VS_B
@ WINED3D_PUSH_CONSTANTS_VS_FFP
@ WINED3D_PUSH_CONSTANTS_VS_I
@ WINED3D_PUSH_CONSTANTS_PS_F
@ WINED3D_PUSH_CONSTANTS_PS_I
@ WINED3D_PUSH_CONSTANTS_VS_F
@ 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
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_SHADER_CONST_BASE_VERTEX_ID
@ WINED3DSSF_THREAD_GROUP
@ WINED3DSSF_GROUP_SHARED_MEMORY
wined3d_shader_src_modifier
static DWORD wined3d_extract_bits(const uint32_t *bitstream, unsigned int offset, unsigned int count)
#define WINED3D_PACKED_INTERPOLATION_BIT_COUNT
static BOOL shader_sampler_is_shadow(const struct wined3d_shader *shader, const struct ps_compile_args *ps_args, unsigned int resource_idx, unsigned int sampler_idx)
#define MAKEDWORD_VERSION(maj, min)
static BOOL use_vs(const struct wined3d_state *state)
static void shader_get_position_fixup(const struct wined3d_context *context, const struct wined3d_state *state, unsigned int fixup_count, float *position_fixup)
#define WINED3D_SHADER_CONST_PS_F
static unsigned int wined3d_texture_get_level_width(const struct wined3d_texture *texture, unsigned int level)
#define WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION
#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND
#define WINED3D_PSARGS_TEXTRANSFORM_SHIFT
@ WINED3DSPDM_MSAMPCENTROID
@ WINED3DSPDM_PARTIALPRECISION
#define WINED3DSI_RESINFO_UINT
#define WINED3D_SHADER_CONST_VS_B
#define WINED3D_PSARGS_TEXTRANSFORM_MASK
@ WINED3D_SV_CULL_DISTANCE
@ WINED3D_SV_CLIP_DISTANCE
@ WINED3D_SV_VIEWPORT_ARRAY_INDEX
@ WINED3D_SV_TESS_FACTOR_QUADINT
@ WINED3D_SV_SAMPLE_INDEX
@ 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
static enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)
static BOOL wined3d_shader_instruction_has_texel_offset(const struct wined3d_shader_instruction *ins)
static bool wined3d_texture_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r)
#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
static int wined3d_uint32_compare(uint32_t x, uint32_t y)
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_TEXTURE_2DMSARRAY
@ WINED3D_SHADER_RESOURCE_TEXTURE_2DMS
@ WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY
@ WINED3D_SHADER_RESOURCE_TEXTURE_CUBE
@ WINED3D_SHADER_RESOURCE_TEXTURE_1D
#define WINED3D_FORMAT_ATTR_COMPRESSED
#define WINED3D_MAX_ACTIVE_LIGHTS
static void context_release(struct wined3d_context *context)
#define WINED3D_SAMPLER_DEFAULT
#define WINED3D_SHADER_CONST_FFP_COLOR_KEY
static uint32_t wined3d_mask_from_size(unsigned int size)
#define WINED3D_SHADER_CAP_FULL_FFP_VARYINGS
#define WINED3D_SHADER_VERSION(major, minor)
static const char * wined3d_get_line(const char **ptr, const char *end)
static const struct color_fixup_desc COLOR_FIXUP_IDENTITY
static BOOL is_rasterization_disabled(const struct wined3d_shader *geometry_shader)
#define GL_EXT_EMUL_ARB_MULTITEXTURE
@ WINED3D_TESSELLATOR_DOMAIN_TRIANGLE
@ WINED3D_TESSELLATOR_DOMAIN_QUAD
@ WINED3D_TESSELLATOR_DOMAIN_LINE
#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE
@ WINED3D_SHADER_BACKEND_GLSL_VKD3D
#define WINED3DSI_SAMPLE_INFO_UINT
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_1D
wined3d_shader_register_type
@ WINED3DSPR_LOCALTHREADID
@ WINED3DSPR_OUTCONTROLPOINT
@ WINED3DSPR_INCONTROLPOINT
@ WINED3DSPR_THREADGROUPID
@ WINED3DSPR_GROUPSHAREDMEM
@ WINED3DSPR_LOCALTHREADINDEX
@ WINED3DSPR_IMMCONSTBUFFER
#define WINED3D_SHADER_CONST_PS_ALPHA_TEST
#define WINED3DSP_NOSWIZZLE
#define WINED3DSI_TEXLD_PROJECT
#define WINED3D_SHADER_CONST_PS_B
@ WINED3D_IMMCONST_SCALAR
static BOOL shader_constant_is_local(const struct wined3d_shader *shader, DWORD reg)
void(* SHADER_HANDLER)(const struct wined3d_shader_instruction *)
#define WINED3D_SHADER_CONST_FFP_MODELVIEW
#define WINED3D_LOCATION_DRAWABLE
#define WINED3D_SHADER_CONST_FFP_PS
static BOOL use_ps(const struct wined3d_state *state)
#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 MAX_VERTEX_BLENDS
@ WINED3D_FFP_PS_FOG_EXP2
@ WINED3D_FFP_PS_FOG_LINEAR
static float int_to_float(uint32_t i)
#define WINED3D_SHADER_CONST_FFP_TEXMATRIX
static struct wined3d_context * context_acquire(struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
#define WINED3D_SHADER_CONST_VS_POINTSIZE
#define WINED3D_SHADER_CONST_POS_FIXUP
#define WINED3D_SHADER_CONST_VS_CLIP_PLANES
#define WINED3D_UNMAPPED_STAGE
@ WINED3D_PROJECTION_COUNT3
@ WINED3D_PROJECTION_NONE
@ WINED3D_PROJECTION_COUNT4
static unsigned int wined3d_popcount(unsigned int x)
@ WINED3D_BLIT_OP_COLOR_BLIT_CKEY
@ WINED3D_BLIT_OP_RAW_BLIT
@ WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST
@ WINED3D_BLIT_OP_DEPTH_BLIT
@ WINED3D_BLIT_OP_COLOR_BLIT
#define WINED3DSP_WRITEMASK_2
#define WINED3DSP_WRITEMASK_1
@ WINED3D_SHADER_CONDITIONAL_OP_NZ
#define WINED3D_SHADER_CONST_FFP_MATERIAL