ReactOS  0.4.14-dev-55-g2da92ac
glsl_shader.c File Reference
#include "config.h"
#include "wine/port.h"
#include <limits.h>
#include <stdio.h>
#include "wined3d_private.h"
Include dependency graph for glsl_shader.c:

Go to the source code of this file.

Classes

struct  glsl_dst_param
 
struct  glsl_src_param
 
struct  glsl_sample_function
 
struct  constant_entry
 
struct  constant_heap
 
struct  shader_glsl_priv
 
struct  glsl_vs_program
 
struct  glsl_hs_program
 
struct  glsl_ds_program
 
struct  glsl_gs_program
 
struct  glsl_ps_program
 
struct  glsl_cs_program
 
struct  glsl_shader_prog_link
 
struct  glsl_program_key
 
struct  shader_glsl_ctx_priv
 
struct  glsl_context_data
 
struct  glsl_ps_compiled_shader
 
struct  glsl_vs_compiled_shader
 
struct  glsl_hs_compiled_shader
 
struct  glsl_ds_compiled_shader
 
struct  glsl_gs_compiled_shader
 
struct  glsl_cs_compiled_shader
 
struct  glsl_shader_private
 
struct  glsl_ffp_vertex_shader
 
struct  glsl_ffp_fragment_shader
 
struct  glsl_ffp_destroy_ctx
 

Macros

#define WINED3D_GLSL_SAMPLE_PROJECTED   0x01
 
#define WINED3D_GLSL_SAMPLE_LOD   0x02
 
#define WINED3D_GLSL_SAMPLE_GRAD   0x04
 
#define WINED3D_GLSL_SAMPLE_LOAD   0x08
 
#define WINED3D_GLSL_SAMPLE_OFFSET   0x10
 
#define WINED3D_TO_STR(u)   case u: return #u
 

Enumerations

enum  heap_node_op { HEAP_NODE_TRAVERSE_LEFT, HEAP_NODE_TRAVERSE_RIGHT, HEAP_NODE_POP }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d_shader)
 
 WINE_DECLARE_DEBUG_CHANNEL (d3d)
 
 WINE_DECLARE_DEBUG_CHANNEL (winediag)
 
static void shader_glsl_generate_shader_epilogue (const struct wined3d_shader_context *ctx)
 
static const chardebug_gl_shader_type (GLenum type)
 
static const charshader_glsl_get_prefix (enum wined3d_shader_type type)
 
static unsigned int shader_glsl_get_version (const struct wined3d_gl_info *gl_info)
 
static void shader_glsl_add_version_declaration (struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info)
 
static void shader_glsl_append_imm_vec4 (struct wined3d_string_buffer *buffer, const float *values)
 
static void shader_glsl_append_imm_ivec (struct wined3d_string_buffer *buffer, const int *values, unsigned int size)
 
static const charget_info_log_line (const char **ptr)
 
void print_glsl_info_log (const struct wined3d_gl_info *gl_info, GLuint id, BOOL program)
 
static void shader_glsl_compile (const struct wined3d_gl_info *gl_info, GLuint shader, const char *src)
 
static void shader_glsl_dump_program_source (const struct wined3d_gl_info *gl_info, GLuint program)
 
void shader_glsl_validate_link (const struct wined3d_gl_info *gl_info, GLuint program)
 
static BOOL shader_glsl_use_layout_qualifier (const struct wined3d_gl_info *gl_info)
 
static BOOL shader_glsl_use_layout_binding_qualifier (const struct wined3d_gl_info *gl_info)
 
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_load_samplers_range (const struct wined3d_gl_info *gl_info, struct shader_glsl_priv *priv, GLuint program_id, const char *prefix, unsigned int base, unsigned int count, const DWORD *tex_unit_map)
 
static 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_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_load_samplers (const struct wined3d_context *context, struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader_reg_maps *reg_maps)
 
static void shader_glsl_load_icb (const struct wined3d_gl_info *gl_info, struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader_reg_maps *reg_maps)
 
static void shader_glsl_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)
 
static void shader_glsl_load_program_resources (const struct wined3d_context *context, struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader *shader)
 
static void append_transform_feedback_varying (const char **varyings, unsigned int *varying_count, char **strings, unsigned int *strings_length, struct wined3d_string_buffer *buffer)
 
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 void shader_glsl_generate_transform_feedback_varyings (const struct wined3d_stream_output_desc *so_desc, struct wined3d_string_buffer *buffer, const char **varyings, unsigned int *varying_count, char *strings, unsigned int *strings_length, GLenum buffer_mode)
 
static void shader_glsl_init_transform_feedback (const struct wined3d_context *context, struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader *shader)
 
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 apply_clamped_constant (const struct wined3d_gl_info *gl_info, GLint location, const struct wined3d_vec4 *data)
 
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 void shader_glsl_load_constants_f (const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, const struct wined3d_vec4 *constants, const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, unsigned int version)
 
static void shader_glsl_load_constants_i (const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, const struct wined3d_ivec4 *constants, const GLint locations[WINED3D_MAX_CONSTS_I], WORD constants_set)
 
static void shader_glsl_load_constantsB (const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, const GLint locations[WINED3D_MAX_CONSTS_B], const BOOL *constants, WORD constants_set)
 
static void reset_program_constant_version (struct wine_rb_entry *entry, void *context)
 
static void shader_glsl_load_np2fixup_constants (const struct glsl_ps_program *ps, const struct wined3d_gl_info *gl_info, const struct wined3d_state *state)
 
static void shader_glsl_ffp_vertex_texmatrix_uniform (const struct wined3d_context *context, const struct wined3d_state *state, unsigned int tex, struct glsl_shader_prog_link *prog)
 
static void shader_glsl_ffp_vertex_material_uniform (const struct wined3d_context *context, const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
 
static void shader_glsl_ffp_vertex_lightambient_uniform (const struct wined3d_context *context, const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
 
static void multiply_vector_matrix (struct wined3d_vec4 *dest, const struct wined3d_vec4 *src1, const struct wined3d_matrix *src2)
 
static void shader_glsl_ffp_vertex_light_uniform (const struct wined3d_context *context, const struct wined3d_state *state, unsigned int light, const struct wined3d_light_info *light_info, struct glsl_shader_prog_link *prog)
 
static void shader_glsl_pointsize_uniform (const struct wined3d_context *context, const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
 
static void shader_glsl_load_fog_uniform (const struct wined3d_context *context, const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
 
static void shader_glsl_clip_plane_uniform (const struct wined3d_context *context, const struct wined3d_state *state, unsigned int index, struct glsl_shader_prog_link *prog)
 
static void shader_glsl_load_color_key_constant (const struct glsl_ps_program *ps, const struct wined3d_gl_info *gl_info, const struct wined3d_state *state)
 
static void get_normal_matrix (struct wined3d_context *context, struct wined3d_matrix *mat, float *normal)
 
static void shader_glsl_load_constants (void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
 
static void update_heap_entry (struct constant_heap *heap, unsigned int idx, DWORD new_version)
 
static void shader_glsl_update_float_vertex_constants (struct wined3d_device *device, UINT start, UINT count)
 
static void shader_glsl_update_float_pixel_constants (struct wined3d_device *device, UINT start, UINT count)
 
static unsigned int vec4_varyings (DWORD shader_major, const struct wined3d_gl_info *gl_info)
 
static BOOL needs_legacy_glsl_syntax (const struct wined3d_gl_info *gl_info)
 
static BOOL shader_glsl_use_explicit_attrib_location (const struct wined3d_gl_info *gl_info)
 
static BOOL shader_glsl_use_interface_blocks (const struct wined3d_gl_info *gl_info)
 
static const charget_attribute_keyword (const struct wined3d_gl_info *gl_info)
 
static void PRINTF_ATTR (4, 5)
 
static const charshader_glsl_shader_input_name (const struct wined3d_gl_info *gl_info)
 
static const charshader_glsl_shader_output_name (const struct wined3d_gl_info *gl_info)
 
static const charshader_glsl_interpolation_qualifiers (enum wined3d_shader_interpolation_mode mode)
 
static enum wined3d_shader_interpolation_mode wined3d_extract_interpolation_mode (const DWORD *packed_interpolation_mode, unsigned int register_idx)
 
static void shader_glsl_declare_shader_inputs (const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, unsigned int element_count, const DWORD *interpolation_mode, BOOL unroll)
 
static void shader_glsl_declare_shader_outputs (const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, unsigned int element_count, BOOL rasterizer_setup, const DWORD *interpolation_mode)
 
static const charglsl_primitive_type_from_d3d (enum wined3d_primitive_type primitive_type)
 
static BOOL glsl_is_color_reg_read (const struct wined3d_shader *shader, unsigned int idx)
 
static BOOL glsl_is_shadow_sampler (const struct wined3d_shader *shader, const struct ps_compile_args *ps_args, unsigned int resource_idx, unsigned int sampler_idx)
 
static void shader_glsl_declare_typed_vertex_attribute (struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const char *vector_type, const char *scalar_type, unsigned int index)
 
static void 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_generate_glsl_declarations (const struct wined3d_context *context, struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader, const struct wined3d_shader_reg_maps *reg_maps, const struct shader_glsl_ctx_priv *ctx_priv)
 
static void shader_glsl_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 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_fixup_scalar_register_variable (char *register_name, const char *glsl_variable, const struct wined3d_gl_info *gl_info)
 
static void shader_glsl_get_register_name (const struct wined3d_shader_register *reg, enum wined3d_data_type data_type, char *register_name, BOOL *is_color, const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_write_mask_to_str (DWORD write_mask, char *str)
 
static DWORD shader_glsl_get_write_mask (const struct wined3d_shader_dst_param *param, char *write_mask)
 
static unsigned int shader_glsl_get_write_mask_size (DWORD write_mask)
 
static unsigned int shader_glsl_swizzle_get_component (DWORD swizzle, unsigned int component_idx)
 
static void shader_glsl_swizzle_to_str (DWORD swizzle, BOOL fixup, DWORD mask, char *str)
 
static void shader_glsl_get_swizzle (const struct wined3d_shader_src_param *param, BOOL fixup, DWORD mask, char *swizzle_str)
 
static void shader_glsl_sprintf_cast (struct wined3d_string_buffer *dst_param, const char *src_param, enum wined3d_data_type dst_data_type, enum wined3d_data_type src_data_type)
 
static void shader_glsl_add_src_param_ext (const struct wined3d_shader_instruction *ins, const struct wined3d_shader_src_param *wined3d_src, DWORD mask, struct glsl_src_param *glsl_src, enum wined3d_data_type data_type)
 
static 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 DWORD shader_glsl_append_dst_ext (struct wined3d_string_buffer *buffer, const struct wined3d_shader_instruction *ins, const struct wined3d_shader_dst_param *dst, enum wined3d_data_type data_type)
 
static DWORD shader_glsl_append_dst (struct wined3d_string_buffer *buffer, const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_add_instruction_modifiers (const struct wined3d_shader_instruction *ins)
 
static const charshader_glsl_get_rel_op (enum wined3d_shader_rel_op op)
 
static BOOL shader_glsl_has_core_grad (const struct wined3d_gl_info *gl_info)
 
static void shader_glsl_get_coord_size (enum wined3d_shader_resource_type resource_type, unsigned int *coord_size, unsigned int *deriv_size)
 
static void shader_glsl_get_sample_function (const struct wined3d_shader_context *ctx, DWORD resource_idx, DWORD sampler_idx, DWORD flags, struct glsl_sample_function *sample_function)
 
static void shader_glsl_release_sample_function (const struct wined3d_shader_context *ctx, struct glsl_sample_function *sample_function)
 
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_color_correction_ext (struct wined3d_string_buffer *buffer, const char *reg_name, DWORD mask, struct color_fixup_desc fixup)
 
static void shader_glsl_color_correction (const struct wined3d_shader_instruction *ins, struct color_fixup_desc fixup)
 
static void PRINTF_ATTR (9, 10)
 
static void shader_glsl_fixup_position (struct wined3d_string_buffer *buffer)
 
static void shader_glsl_binop (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_relop (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_unary_op (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_mul_extended (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_udiv (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_mov (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_dot (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_cross (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_cut (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_pow (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_map2gl (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_float16 (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_bitwise_op (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_nop (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_nrm (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_scalar_op (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_expp (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_to_int (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_to_uint (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_to_float (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_compare (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_swapc (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_conditional_move (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_cnd (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_mad (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_mnxn (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_lrp (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_lit (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_dst (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_sincos (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_sgn (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_loop (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_end (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_rep (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_switch (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_case (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_default (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_generate_conditional_op (const struct wined3d_shader_instruction *ins, const char *op)
 
static void shader_glsl_if (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_ifc (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_else (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_emit (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_break (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_breakc (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_conditional_op (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_continue (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_label (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_call (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_callnz (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_ret (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_tex (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texldd (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texldl (const struct wined3d_shader_instruction *ins)
 
static unsigned int shader_glsl_find_sampler (const struct wined3d_shader_sampler_map *sampler_map, unsigned int resource_idx, unsigned int sampler_idx)
 
static void shader_glsl_atomic (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_uav_counter (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_ld_uav (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_ld_raw_structured (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_store_uav (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_store_raw_structured (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_sync (const struct wined3d_shader_instruction *ins)
 
static const struct wined3d_shader_resource_infoshader_glsl_get_resource_info (const struct wined3d_shader_instruction *ins, const struct wined3d_shader_register *reg)
 
static void shader_glsl_bufinfo (const struct wined3d_shader_instruction *ins)
 
static BOOL is_multisampled (enum wined3d_shader_resource_type resource_type)
 
static BOOL is_mipmapped (enum wined3d_shader_resource_type resource_type)
 
static void shader_glsl_resinfo (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_ld (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_sample (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_gen_sample_c_lz (const struct wined3d_shader_instruction *ins, unsigned int sampler_bind_idx, const struct glsl_sample_function *sample_function, unsigned int coord_size, const char *coord_param, const char *ref_param)
 
static void shader_glsl_sample_c (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_gather4 (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texcoord (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texdp3tex (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texdp3 (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texdepth (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texm3x2depth (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texm3x2pad (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texm3x3pad (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texm3x2tex (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texm3x3tex (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texm3x3 (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texm3x3spec (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texm3x3vspec (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texbem (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_bem (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texreg2ar (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texreg2gb (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texreg2rgb (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_texkill (const struct wined3d_shader_instruction *ins)
 
static void shader_glsl_dp2add (const struct wined3d_shader_instruction *ins)
 
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 add_glsl_program_entry (struct shader_glsl_priv *priv, struct glsl_shader_prog_link *entry)
 
static struct glsl_shader_prog_linkget_glsl_program_entry (const struct shader_glsl_priv *priv, const struct glsl_program_key *key)
 
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_setup_vs3_output (struct shader_glsl_priv *priv, const struct wined3d_gl_info *gl_info, const DWORD *map, const struct wined3d_shader_signature *input_signature, const struct wined3d_shader_reg_maps *reg_maps_in, const struct wined3d_shader_signature *output_signature, const struct wined3d_shader_reg_maps *reg_maps_out)
 
static void shader_glsl_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 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 shader_glsl_setup_sm3_rasterizer_input (struct shader_glsl_priv *priv, const struct wined3d_gl_info *gl_info, const DWORD *map, const struct wined3d_shader_signature *input_signature, const struct wined3d_shader_reg_maps *reg_maps_in, unsigned int input_count, const struct wined3d_shader_signature *output_signature, const struct wined3d_shader_reg_maps *reg_maps_out, BOOL per_vertex_point_size)
 
static 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 shader_glsl_generate_stream_output_setup (struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct wined3d_stream_output_desc *so_desc)
 
static void shader_glsl_generate_sm4_output_setup (struct shader_glsl_priv *priv, const struct wined3d_shader *shader, unsigned int input_count, const struct wined3d_gl_info *gl_info, BOOL rasterizer_setup, const DWORD *interpolation_mode)
 
static void shader_glsl_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 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_srgb_write_correction (struct wined3d_string_buffer *buffer, 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_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_enable_extensions (struct wined3d_string_buffer *buffer, 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)
 
static GLuint shader_glsl_generate_pshader (const struct wined3d_context *context, struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, const struct wined3d_shader *shader, const struct ps_compile_args *args, struct ps_np2fixup_info *np2fixup_info)
 
static void shader_glsl_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 GLuint shader_glsl_generate_vshader (const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct vs_compile_args *args)
 
static void shader_glsl_generate_default_control_point_phase (const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps)
 
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_generate_shader_phase_invocation (struct wined3d_string_buffer *buffer, const struct wined3d_shader_phase *phase, const char *phase_name, unsigned int phase_idx)
 
static GLuint shader_glsl_generate_hull_shader (const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader)
 
static void shader_glsl_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 GLuint shader_glsl_generate_domain_shader (const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct ds_compile_args *args)
 
static GLuint shader_glsl_generate_geometry_shader (const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct gs_compile_args *args)
 
static GLuint shader_glsl_generate_compute_shader (const struct wined3d_context *context, struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, const struct wined3d_shader *shader)
 
static GLuint find_glsl_pshader (const struct wined3d_context *context, struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, struct wined3d_shader *shader, const struct ps_compile_args *args, const struct ps_np2fixup_info **np2fixup_info)
 
static BOOL vs_args_equal (const struct vs_compile_args *stored, const struct vs_compile_args *new, const DWORD use_map)
 
static GLuint find_glsl_vshader (const struct wined3d_context *context, struct shader_glsl_priv *priv, struct wined3d_shader *shader, const struct vs_compile_args *args)
 
static GLuint find_glsl_hull_shader (const struct wined3d_context *context, struct shader_glsl_priv *priv, struct wined3d_shader *shader)
 
static GLuint find_glsl_domain_shader (const struct wined3d_context *context, struct shader_glsl_priv *priv, struct wined3d_shader *shader, const struct ds_compile_args *args)
 
static GLuint find_glsl_geometry_shader (const struct wined3d_context *context, struct shader_glsl_priv *priv, struct wined3d_shader *shader, const struct gs_compile_args *args)
 
static const charshader_glsl_ffp_mcs (enum wined3d_material_color_source mcs, const char *material)
 
static void shader_glsl_ffp_vertex_lighting_footer (struct wined3d_string_buffer *buffer, const struct wined3d_ffp_vs_settings *settings, unsigned int idx)
 
static void shader_glsl_ffp_vertex_lighting (struct wined3d_string_buffer *buffer, const struct wined3d_ffp_vs_settings *settings, BOOL legacy_lighting)
 
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 const charshader_glsl_get_ffp_fragment_op_arg (struct wined3d_string_buffer *buffer, DWORD argnum, unsigned int stage, DWORD arg)
 
static void shader_glsl_ffp_fragment_op (struct wined3d_string_buffer *buffer, unsigned int stage, BOOL color, BOOL alpha, DWORD dst, DWORD op, DWORD dw_arg0, DWORD dw_arg1, DWORD dw_arg2)
 
static GLuint shader_glsl_generate_ffp_fragment_shader (struct shader_glsl_priv *priv, const struct ffp_frag_settings *settings, const struct wined3d_context *context)
 
static struct glsl_ffp_vertex_shadershader_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 struct glsl_ffp_fragment_shadershader_glsl_find_ffp_fragment_shader (struct shader_glsl_priv *priv, const struct ffp_frag_settings *args, const struct wined3d_context *context)
 
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_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 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 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 HRESULT shader_glsl_compile_compute_shader (struct shader_glsl_priv *priv, const struct wined3d_context *context, struct wined3d_shader *shader)
 
static GLuint find_glsl_compute_shader (const struct wined3d_context *context, struct shader_glsl_priv *priv, struct wined3d_shader *shader)
 
static void set_glsl_compute_shader_program (const struct wined3d_context *context, const struct wined3d_state *state, struct shader_glsl_priv *priv, struct glsl_context_data *ctx_data)
 
static void set_glsl_shader_program (const struct wined3d_context *context, const struct wined3d_state *state, struct shader_glsl_priv *priv, struct glsl_context_data *ctx_data)
 
static void shader_glsl_precompile (void *shader_priv, struct wined3d_shader *shader)
 
static void shader_glsl_select (void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
 
static void shader_glsl_select_compute (void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
 
static void shader_glsl_invalidate_current_program (struct wined3d_context *context)
 
static void shader_glsl_disable (void *shader_priv, struct wined3d_context *context)
 
static void shader_glsl_invalidate_contexts_program (struct wined3d_device *device, const struct glsl_shader_prog_link *program)
 
static void shader_glsl_destroy (struct wined3d_shader *shader)
 
static int glsl_program_key_compare (const void *key, const struct wine_rb_entry *entry)
 
static BOOL constant_heap_init (struct constant_heap *heap, unsigned int constant_count)
 
static void constant_heap_free (struct constant_heap *heap)
 
static HRESULT shader_glsl_alloc (struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe, const struct fragment_pipeline *fragment_pipe)
 
static void shader_glsl_free (struct wined3d_device *device)
 
static BOOL shader_glsl_allocate_context_data (struct wined3d_context *context)
 
static void shader_glsl_free_context_data (struct wined3d_context *context)
 
static void shader_glsl_init_context_state (struct wined3d_context *context)
 
static unsigned int shader_glsl_get_shader_model (const struct wined3d_gl_info *gl_info)
 
static void shader_glsl_get_caps (const struct wined3d_gl_info *gl_info, struct shader_caps *caps)
 
static BOOL shader_glsl_color_fixup_supported (struct color_fixup_desc fixup)
 
static void shader_glsl_handle_instruction (const struct wined3d_shader_instruction *ins)
 
static BOOL shader_glsl_has_ffp_proj_control (void *shader_priv)
 
static void glsl_vertex_pipe_vp_enable (const struct wined3d_gl_info *gl_info, BOOL enable)
 
static void glsl_vertex_pipe_vp_get_caps (const struct wined3d_gl_info *gl_info, struct wined3d_vertex_caps *caps)
 
static DWORD glsl_vertex_pipe_vp_get_emul_mask (const struct wined3d_gl_info *gl_info)
 
static voidglsl_vertex_pipe_vp_alloc (const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv)
 
static void shader_glsl_free_ffp_vertex_shader (struct wine_rb_entry *entry, void *context)
 
static void glsl_vertex_pipe_vp_free (struct wined3d_device *device)
 
static void glsl_vertex_pipe_nop (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_shader (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_vdecl (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_vs (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_hs (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 glsl_vertex_pipe_pixel_shader (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_world (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_vertexblend (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_view (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_projection (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_viewport (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_texmatrix (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_texmatrix_np2 (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_material (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_light (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_pointsize (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_pointscale (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pointsprite_core (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_shademode (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_vertex_pipe_clip_plane (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_enable (const struct wined3d_gl_info *gl_info, BOOL enable)
 
static void glsl_fragment_pipe_get_caps (const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
 
static DWORD glsl_fragment_pipe_get_emul_mask (const struct wined3d_gl_info *gl_info)
 
static voidglsl_fragment_pipe_alloc (const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv)
 
static void shader_glsl_free_ffp_fragment_shader (struct wine_rb_entry *entry, void *context)
 
static void glsl_fragment_pipe_free (struct wined3d_device *device)
 
static void glsl_fragment_pipe_shader (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_fogparams (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_fog (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_vdecl (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_vs (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_tex_transform (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_invalidate_constants (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_alpha_test_func (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_core_alpha_test (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_alpha_test (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_core_alpha_test_ref (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_color_key (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void glsl_fragment_pipe_shademode (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static BOOL glsl_fragment_pipe_alloc_context_data (struct wined3d_context *context)
 
static void glsl_fragment_pipe_free_context_data (struct wined3d_context *context)
 

Variables

struct {
   unsigned int   coord_size
 
   unsigned int   resinfo_size
 
   const char *   type_part
 
resource_type_info []
 
static const char *const shift_glsl_tab []
 
static const SHADER_HANDLER shader_glsl_instruction_handler_table [WINED3DSIH_TABLE_SIZE]
 
const struct wined3d_shader_backend_ops glsl_shader_backend
 
static const struct StateEntryTemplate glsl_vertex_pipe_vp_states []
 
const struct wined3d_vertex_pipe_ops glsl_vertex_pipe
 
static const struct StateEntryTemplate glsl_fragment_pipe_state_template []
 
const struct fragment_pipeline glsl_fragment_pipe
 

Macro Definition Documentation

◆ WINED3D_GLSL_SAMPLE_GRAD

#define WINED3D_GLSL_SAMPLE_GRAD   0x04

Definition at line 49 of file glsl_shader.c.

◆ WINED3D_GLSL_SAMPLE_LOAD

#define WINED3D_GLSL_SAMPLE_LOAD   0x08

Definition at line 50 of file glsl_shader.c.

◆ WINED3D_GLSL_SAMPLE_LOD

#define WINED3D_GLSL_SAMPLE_LOD   0x02

Definition at line 48 of file glsl_shader.c.

◆ WINED3D_GLSL_SAMPLE_OFFSET

#define WINED3D_GLSL_SAMPLE_OFFSET   0x10

Definition at line 51 of file glsl_shader.c.

◆ WINED3D_GLSL_SAMPLE_PROJECTED

#define WINED3D_GLSL_SAMPLE_PROJECTED   0x01

Definition at line 47 of file glsl_shader.c.

◆ WINED3D_TO_STR

#define WINED3D_TO_STR (   u)    case u: return #u

Enumeration Type Documentation

◆ heap_node_op

Enumerator
HEAP_NODE_TRAVERSE_LEFT 
HEAP_NODE_TRAVERSE_RIGHT 
HEAP_NODE_POP 

Definition at line 97 of file glsl_shader.c.

Function Documentation

◆ add_glsl_program_entry()

static void add_glsl_program_entry ( struct shader_glsl_priv priv,
struct glsl_shader_prog_link entry 
)
static

Definition at line 6569 of file glsl_shader.c.

6570 {
6571  struct glsl_program_key key;
6572 
6573  key.vs_id = entry->vs.id;
6574  key.hs_id = entry->hs.id;
6575  key.ds_id = entry->ds.id;
6576  key.gs_id = entry->gs.id;
6577  key.ps_id = entry->ps.id;
6578  key.cs_id = entry->cs.id;
6579 
6580  if (wine_rb_put(&priv->program_lookup, &key, &entry->program_lookup_entry) == -1)
6581  {
6582  ERR("Failed to insert program entry.\n");
6583  }
6584 }
struct wine_rb_tree program_lookup
Definition: glsl_shader.c:123
uint32_t entry
Definition: isohybrid.c:63
#define ERR(fmt,...)
Definition: debug.h:109
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
Definition: rbtree.h:215
Definition: path.c:42

Referenced by set_glsl_shader_program(), and shader_glsl_compile_compute_shader().

◆ append_transform_feedback_skip_components()

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

Definition at line 790 of file glsl_shader.c.

793 {
794  unsigned int j;
795 
796  for (j = 0; j < component_count / 4; ++j)
797  {
798  string_buffer_sprintf(buffer, "gl_SkipComponents4");
799  append_transform_feedback_varying(varyings, varying_count, strings, strings_length, buffer);
800  }
801  if (component_count % 4)
802  {
803  string_buffer_sprintf(buffer, "gl_SkipComponents%u", component_count % 4);
804  append_transform_feedback_varying(varyings, varying_count, strings, strings_length, buffer);
805  }
806 }
GLsizei const GLchar *const * varyings
Definition: glext.h:6214
GLuint buffer
Definition: glext.h:5915
unsigned int component_count
static void append_transform_feedback_varying(const char **varyings, unsigned int *varying_count, char **strings, unsigned int *strings_length, struct wined3d_string_buffer *buffer)
Definition: glsl_shader.c:771
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
Definition: glfuncs.h:250
GLsizei const GLchar *const * strings
Definition: glext.h:7622
void string_buffer_sprintf(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:526

Referenced by shader_glsl_generate_transform_feedback_varyings().

◆ append_transform_feedback_varying()

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

Definition at line 771 of file glsl_shader.c.

773 {
774  if (varyings && *strings)
775  {
776  char *ptr = *strings;
777 
778  varyings[*varying_count] = ptr;
779 
780  memcpy(ptr, buffer->buffer, buffer->content_size + 1);
781  ptr += buffer->content_size + 1;
782 
783  *strings = ptr;
784  }
785 
786  *strings_length += buffer->content_size + 1;
787  ++(*varying_count);
788 }
GLsizei const GLchar *const * varyings
Definition: glext.h:6214
GLuint buffer
Definition: glext.h:5915
static PVOID ptr
Definition: dispmode.c:27
GLsizei const GLchar *const * strings
Definition: glext.h:7622
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by append_transform_feedback_skip_components(), and shader_glsl_generate_transform_feedback_varyings().

◆ apply_clamped_constant()

static void apply_clamped_constant ( const struct wined3d_gl_info gl_info,
GLint  location,
const struct wined3d_vec4 data 
)
inlinestatic

Definition at line 1045 of file glsl_shader.c.

1047 {
1048  GLfloat clamped_constant[4];
1049 
1050  if (location == -1) return;
1051 
1052  clamped_constant[0] = data->x < -1.0f ? -1.0f : data->x > 1.0f ? 1.0f : data->x;
1053  clamped_constant[1] = data->y < -1.0f ? -1.0f : data->y > 1.0f ? 1.0f : data->y;
1054  clamped_constant[2] = data->z < -1.0f ? -1.0f : data->z > 1.0f ? 1.0f : data->z;
1055  clamped_constant[3] = data->w < -1.0f ? -1.0f : data->w > 1.0f ? 1.0f : data->w;
1056 
1057  GL_EXTCALL(glUniform4fv(location, 1, clamped_constant));
1058 }
#define GL_EXTCALL(f)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
float GLfloat
Definition: gl.h:161

Referenced by walk_constant_heap_clamped().

◆ constant_heap_free()

static void constant_heap_free ( struct constant_heap heap)
static

Definition at line 10634 of file glsl_shader.c.

10635 {
10636  heap_free(heap->entries);
10637 }
struct constant_entry * entries
Definition: glsl_shader.c:112
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by shader_glsl_alloc(), and shader_glsl_free().

◆ constant_heap_init()

static BOOL constant_heap_init ( struct constant_heap heap,
unsigned int  constant_count 
)
static

Definition at line 10611 of file glsl_shader.c.

10612 {
10613  SIZE_T size = (constant_count + 1) * sizeof(*heap->entries)
10614  + constant_count * sizeof(*heap->contained)
10615  + constant_count * sizeof(*heap->positions);
10616  void *mem;
10617 
10618  if (!(mem = heap_alloc(size)))
10619  {
10620  ERR("Failed to allocate memory\n");
10621  return FALSE;
10622  }
10623 
10624  heap->entries = mem;
10625  heap->entries[1].version = 0;
10626  heap->contained = (BOOL *)(heap->entries + constant_count + 1);
10627  memset(heap->contained, 0, constant_count * sizeof(*heap->contained));
10628  heap->positions = (unsigned int *)(heap->contained + constant_count);
10629  heap->size = 1;
10630 
10631  return TRUE;
10632 }
struct constant_entry * entries
Definition: glsl_shader.c:112
#define TRUE
Definition: types.h:120
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int size
Definition: glsl_shader.c:115
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizeiptr size
Definition: glext.h:5919
#define ERR(fmt,...)
Definition: debug.h:109
ULONG_PTR SIZE_T
Definition: typedefs.h:78
Definition: mem.c:156
#define memset(x, y, z)
Definition: compat.h:39
BOOL * contained
Definition: glsl_shader.c:113
unsigned int * positions
Definition: glsl_shader.c:114

Referenced by shader_glsl_alloc().

◆ debug_gl_shader_type()

static const char* debug_gl_shader_type ( GLenum  type)
static

Definition at line 347 of file glsl_shader.c.

348 {
349  switch (type)
350  {
351 #define WINED3D_TO_STR(u) case u: return #u
358 #undef WINED3D_TO_STR
359  default:
360  return wine_dbg_sprintf("UNKNOWN(%#x)", type);
361  }
362 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define GL_VERTEX_SHADER
Definition: glext.h:420
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:271
#define WINED3D_TO_STR(u)
#define GL_TESS_EVALUATION_SHADER
Definition: glext.h:2125
#define GL_COMPUTE_SHADER
Definition: wgl.h:689
#define GL_GEOMETRY_SHADER
Definition: glext.h:820
#define GL_TESS_CONTROL_SHADER
Definition: glext.h:2126
#define GL_FRAGMENT_SHADER
Definition: glext.h:419

Referenced by shader_glsl_dump_program_source().

◆ delete_glsl_program_entry()

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

Definition at line 6596 of file glsl_shader.c.

6598 {
6599  wine_rb_remove(&priv->program_lookup, &entry->program_lookup_entry);
6600 
6601  GL_EXTCALL(glDeleteProgram(entry->id));
6602  if (entry->vs.id)
6603  list_remove(&entry->vs.shader_entry);
6604  if (entry->hs.id)
6605  list_remove(&entry->hs.shader_entry);
6606  if (entry->ds.id)
6607  list_remove(&entry->ds.shader_entry);
6608  if (entry->gs.id)
6609  list_remove(&entry->gs.shader_entry);
6610  if (entry->ps.id)
6611  list_remove(&entry->ps.shader_entry);
6612  if (entry->cs.id)
6613  list_remove(&entry->cs.shader_entry);
6614  heap_free(entry);
6615 }
struct wine_rb_tree program_lookup
Definition: glsl_shader.c:123
#define GL_EXTCALL(f)
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
uint32_t entry
Definition: isohybrid.c:63
static void wine_rb_remove(struct wine_rb_tree *tree, struct wine_rb_entry *entry)
Definition: rbtree.h:283
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by shader_glsl_destroy(), shader_glsl_free_ffp_fragment_shader(), and shader_glsl_free_ffp_vertex_shader().

◆ find_glsl_compute_shader()

static GLuint find_glsl_compute_shader ( const struct wined3d_context context,
struct shader_glsl_priv priv,
struct wined3d_shader shader 
)
static

Definition at line 9778 of file glsl_shader.c.

9780 {
9781  struct glsl_shader_private *shader_data;
9782 
9783  if (!shader->backend_data)
9784  {
9785  WARN("Failed to find GLSL program for compute shader %p.\n", shader);
9787  {
9788  ERR("Failed to compile compute shader %p.\n", shader);
9789  return 0;
9790  }
9791  }
9792  shader_data = shader->backend_data;
9793  return shader_data->gl_shaders.cs[0].id;
9794 }
Definition: http.c:6587
#define WARN(fmt,...)
Definition: debug.h:111
static HRESULT shader_glsl_compile_compute_shader(struct shader_glsl_priv *priv, const struct wined3d_context *context, struct wined3d_shader *shader)
Definition: glsl_shader.c:9698
struct glsl_cs_compiled_shader * cs
Definition: glsl_shader.c:320
union glsl_shader_private::@261 gl_shaders
GLuint shader
Definition: glext.h:6030
#define ERR(fmt,...)
Definition: debug.h:109

Referenced by set_glsl_compute_shader_program().

◆ find_glsl_domain_shader()

static GLuint find_glsl_domain_shader ( const struct wined3d_context context,
struct shader_glsl_priv priv,
struct wined3d_shader shader,
const struct ds_compile_args args 
)
static

Definition at line 8264 of file glsl_shader.c.

8266 {
8267  struct glsl_ds_compiled_shader *gl_shaders, *new_array;
8268  struct glsl_shader_private *shader_data;
8269  unsigned int i, new_size;
8270  GLuint ret;
8271 
8272  if (!shader->backend_data)
8273  {
8274  if (!(shader->backend_data = heap_alloc_zero(sizeof(*shader_data))))
8275  {
8276  ERR("Failed to allocate backend data.\n");
8277  return 0;
8278  }
8279  }
8280  shader_data = shader->backend_data;
8281  gl_shaders = shader_data->gl_shaders.ds;
8282 
8283  for (i = 0; i < shader_data->num_gl_shaders; ++i)
8284  {
8285  if (!memcmp(&gl_shaders[i].args, args, sizeof(*args)))
8286  return gl_shaders[i].id;
8287  }
8288 
8289  TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
8290 
8291  if (shader_data->num_gl_shaders)
8292  {
8293  new_size = shader_data->shader_array_size + 1;
8294  new_array = heap_realloc(shader_data->gl_shaders.ds, new_size * sizeof(*new_array));
8295  }
8296  else
8297  {
8298  new_array = heap_alloc(sizeof(*new_array));
8299  new_size = 1;
8300  }
8301 
8302  if (!new_array)
8303  {
8304  ERR("Failed to allocate GL shaders array.\n");
8305  return 0;
8306  }
8307  shader_data->gl_shaders.ds = new_array;
8308  shader_data->shader_array_size = new_size;
8309  gl_shaders = new_array;
8310 
8313  gl_shaders[shader_data->num_gl_shaders].args = *args;
8314  gl_shaders[shader_data->num_gl_shaders++].id = ret;
8315 
8316  return ret;
8317 }
unsigned int num_gl_shaders
Definition: glsl_shader.c:322
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
Definition: http.c:6587
Definition: match.c:390
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
Definition: glfuncs.h:248
union glsl_shader_private::@261 gl_shaders
void string_buffer_clear(struct wined3d_string_buffer *buffer)
Definition: shader.c:422
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
int ret
struct glsl_ds_compiled_shader * ds
Definition: glsl_shader.c:317
#define ERR(fmt,...)
Definition: debug.h:109
struct wined3d_string_buffer shader_buffer
Definition: glsl_shader.c:121
unsigned int GLuint
Definition: gl.h:159
static GLuint shader_glsl_generate_domain_shader(const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct ds_compile_args *args)
Definition: glsl_shader.c:7848
#define args
Definition: format.c:66
unsigned int shader_array_size
Definition: glsl_shader.c:322

Referenced by set_glsl_shader_program().

◆ find_glsl_geometry_shader()

static GLuint find_glsl_geometry_shader ( const struct wined3d_context context,
struct shader_glsl_priv priv,
struct wined3d_shader shader,
const struct gs_compile_args args 
)
static

Definition at line 8319 of file glsl_shader.c.

8321 {
8322  struct glsl_gs_compiled_shader *gl_shaders, *new_array;
8323  struct glsl_shader_private *shader_data;
8324  unsigned int i, new_size;
8325  GLuint ret;
8326 
8327  if (!shader->backend_data)
8328  {
8329  if (!(shader->backend_data = heap_alloc_zero(sizeof(*shader_data))))
8330  {
8331  ERR("Failed to allocate backend data.\n");
8332  return 0;
8333  }
8334  }
8335  shader_data = shader->backend_data;
8336  gl_shaders = shader_data->gl_shaders.gs;
8337 
8338  for (i = 0; i < shader_data->num_gl_shaders; ++i)
8339  {
8340  if (!memcmp(&gl_shaders[i].args, args, sizeof(*args)))
8341  return gl_shaders[i].id;
8342  }
8343 
8344  TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
8345 
8346  if (shader_data->num_gl_shaders)
8347  {
8348  new_size = shader_data->shader_array_size + 1;
8349  new_array = heap_realloc(shader_data->gl_shaders.gs, new_size * sizeof(*new_array));
8350  }
8351  else
8352  {
8353  new_array = heap_alloc(sizeof(*new_array));
8354  new_size = 1;
8355  }
8356 
8357  if (!new_array)
8358  {
8359  ERR("Failed to allocate GL shaders array.\n");
8360  return 0;
8361  }
8362  shader_data->gl_shaders.gs = new_array;
8363  shader_data->shader_array_size = new_size;
8364  gl_shaders = new_array;
8365 
8368  gl_shaders[shader_data->num_gl_shaders].args = *args;
8369  gl_shaders[shader_data->num_gl_shaders++].id = ret;
8370 
8371  return ret;
8372 }
unsigned int num_gl_shaders
Definition: glsl_shader.c:322
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
Definition: http.c:6587
struct glsl_gs_compiled_shader * gs
Definition: glsl_shader.c:318
Definition: match.c:390
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
Definition: glfuncs.h:248
union glsl_shader_private::@261 gl_shaders
void string_buffer_clear(struct wined3d_string_buffer *buffer)
Definition: shader.c:422
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
int ret
#define ERR(fmt,...)
Definition: debug.h:109
struct wined3d_string_buffer shader_buffer
Definition: glsl_shader.c:121
unsigned int GLuint
Definition: gl.h:159
#define args
Definition: format.c:66
unsigned int shader_array_size
Definition: glsl_shader.c:322
static GLuint shader_glsl_generate_geometry_shader(const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct gs_compile_args *args)
Definition: glsl_shader.c:7942

Referenced by set_glsl_shader_program().

◆ find_glsl_hull_shader()

static GLuint find_glsl_hull_shader ( const struct wined3d_context context,
struct shader_glsl_priv priv,
struct wined3d_shader shader 
)
static

Definition at line 8219 of file glsl_shader.c.

8221 {
8222  struct glsl_hs_compiled_shader *gl_shaders, *new_array;
8223  struct glsl_shader_private *shader_data;
8224  unsigned int new_size;
8225  GLuint ret;
8226 
8227  if (!shader->backend_data)
8228  {
8229  if (!(shader->backend_data = heap_alloc_zero(sizeof(*shader_data))))
8230  {
8231  ERR("Failed to allocate backend data.\n");
8232  return 0;
8233  }
8234  }
8235  shader_data = shader->backend_data;
8236  gl_shaders = shader_data->gl_shaders.hs;
8237 
8238  if (shader_data->num_gl_shaders > 0)
8239  {
8240  assert(shader_data->num_gl_shaders == 1);
8241  return gl_shaders[0].id;
8242  }
8243 
8244  TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
8245 
8246  assert(!shader_data->gl_shaders.hs);
8247  new_size = 1;
8248  if (!(new_array = heap_alloc(sizeof(*new_array))))
8249  {
8250  ERR("Failed to allocate GL shaders array.\n");
8251  return 0;
8252  }
8253  shader_data->gl_shaders.hs = new_array;
8254  shader_data->shader_array_size = new_size;
8255  gl_shaders = new_array;
8256 
8259  gl_shaders[shader_data->num_gl_shaders++].id = ret;
8260 
8261  return ret;
8262 }
unsigned int num_gl_shaders
Definition: glsl_shader.c:322
Definition: http.c:6587
#define assert(x)
Definition: debug.h:53
static GLuint shader_glsl_generate_hull_shader(const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader)
Definition: glsl_shader.c:7752
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
struct glsl_hs_compiled_shader * hs
Definition: glsl_shader.c:316
union glsl_shader_private::@261 gl_shaders
void string_buffer_clear(struct wined3d_string_buffer *buffer)
Definition: shader.c:422
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
int ret
#define ERR(fmt,...)
Definition: debug.h:109
struct wined3d_string_buffer shader_buffer
Definition: glsl_shader.c:121
unsigned int GLuint
Definition: gl.h:159
unsigned int shader_array_size
Definition: glsl_shader.c:322

Referenced by set_glsl_shader_program().

◆ find_glsl_pshader()

static GLuint find_glsl_pshader ( const struct wined3d_context context,
struct wined3d_string_buffer buffer,
struct wined3d_string_buffer_list string_buffers,
struct wined3d_shader shader,
const struct ps_compile_args args,
const struct ps_np2fixup_info **  np2fixup_info 
)
static

Definition at line 8062 of file glsl_shader.c.

8066 {
8067  struct glsl_ps_compiled_shader *gl_shaders, *new_array;
8068  struct glsl_shader_private *shader_data;
8069  struct ps_np2fixup_info *np2fixup;
8070  UINT i;
8071  DWORD new_size;
8072  GLuint ret;
8073 
8074  if (!shader->backend_data)
8075  {
8076  if (!(shader->backend_data = heap_alloc_zero(sizeof(*shader_data))))
8077  {
8078  ERR("Failed to allocate backend data.\n");
8079  return 0;
8080  }
8081  }
8082  shader_data = shader->backend_data;
8083  gl_shaders = shader_data->gl_shaders.ps;
8084 
8085  /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
8086  * so a linear search is more performant than a hashmap or a binary search
8087  * (cache coherency etc)
8088  */
8089  for (i = 0; i < shader_data->num_gl_shaders; ++i)
8090  {
8091  if (!memcmp(&gl_shaders[i].args, args, sizeof(*args)))
8092  {
8093  if (args->np2_fixup)
8094  *np2fixup_info = &gl_shaders[i].np2fixup;
8095  return gl_shaders[i].id;
8096  }
8097  }
8098 
8099  TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
8100  if (shader_data->shader_array_size == shader_data->num_gl_shaders)
8101  {
8102  if (shader_data->num_gl_shaders)
8103  {
8104  new_size = shader_data->shader_array_size + max(1, shader_data->shader_array_size / 2);
8105  new_array = heap_realloc(shader_data->gl_shaders.ps, new_size * sizeof(*gl_shaders));
8106  }
8107  else
8108  {
8109  new_array = heap_alloc(sizeof(*gl_shaders));
8110  new_size = 1;
8111  }
8112 
8113  if(!new_array) {
8114  ERR("Out of memory\n");
8115  return 0;
8116  }
8117  shader_data->gl_shaders.ps = new_array;
8118  shader_data->shader_array_size = new_size;
8119  gl_shaders = new_array;
8120  }
8121 
8122  gl_shaders[shader_data->num_gl_shaders].args = *args;
8123 
8124  np2fixup = &gl_shaders[shader_data->num_gl_shaders].np2fixup;
8125  memset(np2fixup, 0, sizeof(*np2fixup));
8126  *np2fixup_info = args->np2_fixup ? np2fixup : NULL;
8127 
8129 
8131  ret = shader_glsl_generate_pshader(context, buffer, string_buffers, shader, args, np2fixup);
8132  gl_shaders[shader_data->num_gl_shaders++].id = ret;
8133 
8134  return ret;
8135 }
unsigned int num_gl_shaders
Definition: glsl_shader.c:322
#define max(a, b)
Definition: svc.c:63
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
Definition: http.c:6587
struct glsl_ps_compiled_shader * ps
Definition: glsl_shader.c:319
GLuint buffer
Definition: glext.h:5915
Definition: match.c:390
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
struct ps_np2fixup_info np2fixup
Definition: glsl_shader.c:279
static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context, struct wined3d_string_buffer *buffer, struct wined3d_string_buffer_list *string_buffers, const struct wined3d_shader *shader, const struct ps_compile_args *args, struct ps_np2fixup_info *np2fixup_info)
Definition: glsl_shader.c:7280
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
Definition: glfuncs.h:248
void pixelshader_update_resource_types(struct wined3d_shader *shader, WORD tex_types)
Definition: shader.c:4073
smooth NULL
Definition: ftsmooth.c:416
union glsl_shader_private::@261 gl_shaders
void string_buffer_clear(struct wined3d_string_buffer *buffer)
Definition: shader.c:422
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int GLuint
Definition: gl.h:159
struct ps_compile_args args
Definition: glsl_shader.c:278
unsigned int UINT
Definition: ndis.h:50
#define memset(x, y, z)
Definition: compat.h:39
#define args
Definition: format.c:66
unsigned int shader_array_size
Definition: glsl_shader.c:322

Referenced by set_glsl_shader_program().

◆ find_glsl_vshader()

static GLuint find_glsl_vshader ( const struct wined3d_context context,
struct shader_glsl_priv priv,
struct wined3d_shader shader,
const struct vs_compile_args args 
)
static

Definition at line 8155 of file glsl_shader.c.

8157 {
8158  UINT i;
8159  DWORD new_size;
8160  DWORD use_map = context->stream_info.use_map;
8161  struct glsl_vs_compiled_shader *gl_shaders, *new_array;
8162  struct glsl_shader_private *shader_data;
8163  GLuint ret;
8164 
8165  if (!shader->backend_data)
8166  {
8167  if (!(shader->backend_data = heap_alloc_zero(sizeof(*shader_data))))
8168  {
8169  ERR("Failed to allocate backend data.\n");
8170  return 0;
8171  }
8172  }
8173  shader_data = shader->backend_data;
8174  gl_shaders = shader_data->gl_shaders.vs;
8175 
8176  /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
8177  * so a linear search is more performant than a hashmap or a binary search
8178  * (cache coherency etc)
8179  */
8180  for (i = 0; i < shader_data->num_gl_shaders; ++i)
8181  {
8182  if (vs_args_equal(&gl_shaders[i].args, args, use_map))
8183  return gl_shaders[i].id;
8184  }
8185 
8186  TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
8187 
8188  if (shader_data->shader_array_size == shader_data->num_gl_shaders)
8189  {
8190  if (shader_data->num_gl_shaders)
8191  {
8192  new_size = shader_data->shader_array_size + max(1, shader_data->shader_array_size / 2);
8193  new_array = heap_realloc(shader_data->gl_shaders.vs, new_size * sizeof(*gl_shaders));
8194  }
8195  else
8196  {
8197  new_array = heap_alloc(sizeof(*gl_shaders));
8198  new_size = 1;
8199  }
8200 
8201  if(!new_array) {
8202  ERR("Out of memory\n");
8203  return 0;
8204  }
8205  shader_data->gl_shaders.vs = new_array;
8206  shader_data->shader_array_size = new_size;
8207  gl_shaders = new_array;
8208  }
8209 
8210  gl_shaders[shader_data->num_gl_shaders].args = *args;
8211 
8214  gl_shaders[shader_data->num_gl_shaders++].id = ret;
8215 
8216  return ret;
8217 }
static BOOL vs_args_equal(const struct vs_compile_args *stored, const struct vs_compile_args *new, const DWORD use_map)
Definition: glsl_shader.c:8137
unsigned int num_gl_shaders
Definition: glsl_shader.c:322
#define max(a, b)
Definition: svc.c:63
Definition: http.c:6587
Definition: match.c:390
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
struct glsl_vs_compiled_shader * vs
Definition: glsl_shader.c:315
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
Definition: glfuncs.h:248
union glsl_shader_private::@261 gl_shaders
void string_buffer_clear(struct wined3d_string_buffer *buffer)
Definition: shader.c:422
static GLuint shader_glsl_generate_vshader(const struct wined3d_context *context, struct shader_glsl_priv *priv, const struct wined3d_shader *shader, const struct vs_compile_args *args)
Definition: glsl_shader.c:7611
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define ERR(fmt,...)
Definition: debug.h:109
struct wined3d_string_buffer shader_buffer
Definition: glsl_shader.c:121
unsigned int GLuint
Definition: gl.h:159
unsigned int UINT
Definition: ndis.h:50
#define args
Definition: format.c:66
unsigned int shader_array_size
Definition: glsl_shader.c:322

Referenced by set_glsl_shader_program().

◆ get_attribute_keyword()

static const char* get_attribute_keyword ( const struct wined3d_gl_info gl_info)
static

Definition at line 1817 of file glsl_shader.c.

1818 {
1819  return needs_legacy_glsl_syntax(gl_info) ? "attribute" : "in";
1820 }
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1801

Referenced by shader_glsl_declare_generic_vertex_attribute(), shader_glsl_declare_typed_vertex_attribute(), and shader_glsl_generate_ffp_vertex_shader().

◆ get_glsl_program_entry()

static struct glsl_shader_prog_link* get_glsl_program_entry ( const struct shader_glsl_priv priv,
const struct glsl_program_key key 
)
static

Definition at line 6586 of file glsl_shader.c.

6588 {
6589  struct wine_rb_entry *entry;
6590 
6591  entry = wine_rb_get(&priv->program_lookup, key);
6592  return entry ? WINE_RB_ENTRY_VALUE(entry, struct glsl_shader_prog_link, program_lookup_entry) : NULL;
6593 }
struct wine_rb_tree program_lookup
Definition: glsl_shader.c:123
smooth NULL
Definition: ftsmooth.c:416
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
uint32_t entry
Definition: isohybrid.c:63
Definition: rbtree.h:35
static struct wine_rb_entry * wine_rb_get(const struct wine_rb_tree *tree, const void *key)
Definition: rbtree.h:203
Definition: path.c:42

Referenced by set_glsl_compute_shader_program(), and set_glsl_shader_program().

◆ get_info_log_line()

static const char* get_info_log_line ( const char **  ptr)
static

Definition at line 442 of file glsl_shader.c.

443 {
444  const char *p, *q;
445 
446  p = *ptr;
447  if (!(q = strstr(p, "\n")))
448  {
449  if (!*p) return NULL;
450  *ptr += strlen(p);
451  return p;
452  }
453  *ptr = q + 1;
454 
455  return p;
456 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by print_glsl_info_log(), shader_glsl_compile(), and shader_glsl_dump_program_source().

◆ get_normal_matrix()

static void get_normal_matrix ( struct wined3d_context context,
struct wined3d_matrix mat,
float *  normal 
)
static

Definition at line 1438 of file glsl_shader.c.

1439 {
1440  int i, j;
1441 
1442  if (context->d3d_info->wined3d_creation_flags & WINED3D_LEGACY_FFP_LIGHTING)
1444  else
1445  invert_matrix(mat, mat);
1446  /* Tests show that singular modelview matrices are used unchanged as normal
1447  * matrices on D3D3 and older. There seems to be no clearly consistent
1448  * behavior on newer D3D versions so always follow older ddraw behavior. */
1449  for (i = 0; i < 3; ++i)
1450  for (j = 0; j < 3; ++j)
1451  normal[i * 3 + j] = (&mat->_11)[j * 4 + i];
1452 }
Definition: http.c:6587
BOOL invert_matrix_3d(struct wined3d_matrix *out, const struct wined3d_matrix *in)
Definition: utils.c:5424
static const MAT2 mat
Definition: font.c:66
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
Definition: glfuncs.h:248
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
Definition: glfuncs.h:250
BOOL invert_matrix(struct wined3d_matrix *out, const struct wined3d_matrix *m)
Definition: utils.c:5494
#define WINED3D_LEGACY_FFP_LIGHTING
Definition: wined3d.h:1323

Referenced by shader_glsl_load_constants().

◆ glsl_fragment_pipe_alloc()

static void* glsl_fragment_pipe_alloc ( const struct wined3d_shader_backend_ops shader_backend,
void shader_priv 
)
static

Definition at line 11663 of file glsl_shader.c.

11664 {
11665  struct shader_glsl_priv *priv;
11666 
11667  if (shader_backend == &glsl_shader_backend)
11668  {
11669  priv = shader_priv;
11671  return priv;
11672  }
11673 
11674  FIXME("GLSL fragment pipe without GLSL shader backend not implemented.\n");
11675 
11676  return NULL;
11677 }
struct wine_rb_tree ffp_fragment_shaders
Definition: glsl_shader.c:132
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static void wine_rb_init(struct wine_rb_tree *tree, wine_rb_compare_func_t compare)
Definition: rbtree.h:179
int wined3d_ffp_frag_program_key_compare(const void *key, const struct wine_rb_entry *entry)
Definition: utils.c:6223
const struct wined3d_shader_backend_ops glsl_shader_backend

◆ glsl_fragment_pipe_alloc_context_data()

static BOOL glsl_fragment_pipe_alloc_context_data ( struct wined3d_context context)
static

Definition at line 11960 of file glsl_shader.c.

11961 {
11962  return TRUE;
11963 }
#define TRUE
Definition: types.h:120

◆ glsl_fragment_pipe_alpha_test()

static void glsl_fragment_pipe_alpha_test ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11805 of file glsl_shader.c.

11807 {
11808  const struct wined3d_gl_info *gl_info = context->gl_info;
11809 
11810  if (state->render_states[WINED3D_RS_ALPHATESTENABLE])
11811  {
11812  gl_info->gl_ops.gl.p_glEnable(GL_ALPHA_TEST);
11813  checkGLcall("glEnable(GL_ALPHA_TEST)");
11814  }
11815  else
11816  {
11817  gl_info->gl_ops.gl.p_glDisable(GL_ALPHA_TEST);
11818  checkGLcall("glDisable(GL_ALPHA_TEST)");
11819  }
11820 }
struct opengl_funcs gl_ops
Definition: http.c:6587
static int state
Definition: maze.c:121
#define checkGLcall(A)
#define GL_ALPHA_TEST
Definition: gl.h:366

◆ glsl_fragment_pipe_alpha_test_func()

static void glsl_fragment_pipe_alpha_test_func ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11785 of file glsl_shader.c.

11787 {
11788  const struct wined3d_gl_info *gl_info = context->gl_info;
11790  float ref = state->render_states[WINED3D_RS_ALPHAREF] / 255.0f;
11791 
11792  if (func)
11793  {
11794  gl_info->gl_ops.gl.p_glAlphaFunc(func, ref);
11795  checkGLcall("glAlphaFunc");
11796  }
11797 }
GLenum func
Definition: glext.h:6028
struct opengl_funcs gl_ops
Definition: http.c:6587
Definition: send.c:47
GLenum wined3d_gl_compare_func(enum wined3d_cmp_func f)
Definition: state.c:345
static int state
Definition: maze.c:121
#define checkGLcall(A)
int GLint
Definition: gl.h:156

◆ glsl_fragment_pipe_color_key()

static void glsl_fragment_pipe_color_key ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11828 of file glsl_shader.c.

11830 {
11831  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_COLOR_KEY;
11832 }
Definition: http.c:6587
#define WINED3D_SHADER_CONST_FFP_COLOR_KEY

◆ glsl_fragment_pipe_core_alpha_test()

static void glsl_fragment_pipe_core_alpha_test ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11799 of file glsl_shader.c.

11801 {
11802  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
11803 }
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
Definition: glfuncs.h:240
Definition: http.c:6587

◆ glsl_fragment_pipe_core_alpha_test_ref()

static void glsl_fragment_pipe_core_alpha_test_ref ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11822 of file glsl_shader.c.

11824 {
11825  context->constant_update_mask |= WINED3D_SHADER_CONST_PS_ALPHA_TEST;
11826 }
Definition: http.c:6587
#define WINED3D_SHADER_CONST_PS_ALPHA_TEST

◆ glsl_fragment_pipe_enable()

static void glsl_fragment_pipe_enable ( const struct wined3d_gl_info gl_info,
BOOL  enable 
)
static

Definition at line 11615 of file glsl_shader.c.

11616 {
11617  /* Nothing to do. */
11618 }

◆ glsl_fragment_pipe_fog()

static void glsl_fragment_pipe_fog ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11720 of file glsl_shader.c.

11722 {
11723  BOOL use_vshader = use_vs(state);
11724  enum fogsource new_source;
11725  DWORD fogstart = state->render_states[WINED3D_RS_FOGSTART];
11726  DWORD fogend = state->render_states[WINED3D_RS_FOGEND];
11727 
11728  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
11729 
11730  if (!state->render_states[WINED3D_RS_FOGENABLE])
11731  return;
11732 
11733  if (state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3D_FOG_NONE)
11734  {
11735  if (use_vshader)
11736  new_source = FOGSOURCE_VS;
11737  else if (state->render_states[WINED3D_RS_FOGVERTEXMODE] == WINED3D_FOG_NONE || context->stream_info.position_transformed)
11738  new_source = FOGSOURCE_COORD;
11739  else
11740  new_source = FOGSOURCE_FFP;
11741  }
11742  else
11743  {
11744  new_source = FOGSOURCE_FFP;
11745  }
11746 
11747  if (new_source != context->fog_source || fogstart == fogend)
11748  {
11749  context->fog_source = new_source;
11750  context->constant_update_mask |= WINED3D_SHADER_CONST_PS_FOG;
11751  }
11752 }
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
Definition: glfuncs.h:240
Definition: http.c:6587
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WINED3D_SHADER_CONST_PS_FOG
unsigned long DWORD
Definition: ntddk_ex.h:95
static int state
Definition: maze.c:121
fogsource
static BOOL use_vs(const struct wined3d_state *state)

Referenced by glsl_fragment_pipe_vdecl().

◆ glsl_fragment_pipe_fogparams()

static void glsl_fragment_pipe_fogparams ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11714 of file glsl_shader.c.

11716 {
11717  context->constant_update_mask |= WINED3D_SHADER_CONST_PS_FOG;
11718 }
Definition: http.c:6587
#define WINED3D_SHADER_CONST_PS_FOG

◆ glsl_fragment_pipe_free()

static void glsl_fragment_pipe_free ( struct wined3d_device device)
static

Definition at line 11696 of file glsl_shader.c.

11697 {
11698  struct shader_glsl_priv *priv = device->fragment_priv;
11699  struct glsl_ffp_destroy_ctx ctx;
11700 
11701  ctx.priv = priv;
11702  ctx.gl_info = &device->adapter->gl_info;
11703  wine_rb_destroy(&priv->ffp_fragment_shaders, shader_glsl_free_ffp_fragment_shader, &ctx);
11704 }
static void shader_glsl_free_ffp_fragment_shader(struct wine_rb_entry *entry, void *context)
struct shader_glsl_priv * priv
Definition: glsl_shader.c:341
Definition: devices.h:37
static void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context)
Definition: rbtree.h:198

◆ glsl_fragment_pipe_free_context_data()

static void glsl_fragment_pipe_free_context_data ( struct wined3d_context context)
static

Definition at line 11965 of file glsl_shader.c.

11966 {
11967 }

◆ glsl_fragment_pipe_get_caps()

static void glsl_fragment_pipe_get_caps ( const struct wined3d_gl_info gl_info,
struct fragment_caps caps 
)
static

Definition at line 11620 of file glsl_shader.c.

11621 {
11654 }
DWORD MaxTextureBlendStages
#define MAX_TEXTURES
#define WINED3D_FRAGMENT_CAP_PROJ_CONTROL
#define WINED3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA
Definition: wined3d.h:1165
#define WINED3DTEXOPCAPS_DISABLE
Definition: wined3d.h:1145
#define WINED3DTEXOPCAPS_BLENDCURRENTALPHA
Definition: wined3d.h:1160
#define WINED3DTEXOPCAPS_ADDSIGNED
Definition: wined3d.h:1152
#define WINED3DTEXOPCAPS_MODULATE
Definition: wined3d.h:1148
#define WINED3D_FRAGMENT_CAP_SRGB_WRITE
#define WINED3DTEXOPCAPS_ADDSIGNED2X
Definition: wined3d.h:1153
#define WINED3DTEXOPCAPS_BLENDDIFFUSEALPHA
Definition: wined3d.h:1156
#define WINED3DTEXOPCAPS_ADDSMOOTH
Definition: wined3d.h:1155
#define WINED3DTEXOPCAPS_SELECTARG2
Definition: wined3d.h:1147
#define WINED3DTEXOPCAPS_LERP
Definition: wined3d.h:1170
#define WINED3DTEXOPCAPS_BLENDFACTORALPHA
Definition: wined3d.h:1158
#define WINED3DPMISCCAPS_PERSTAGECONSTANT
Definition: wined3d.h:1105
#define WINED3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR
Definition: wined3d.h:1164
#define WINED3DPMISCCAPS_TSSARGTEMP
Definition: wined3d.h:1101
#define WINED3DTEXOPCAPS_DOTPRODUCT3
Definition: wined3d.h:1168
#define WINED3DTEXOPCAPS_BLENDTEXTUREALPHAPM
Definition: wined3d.h:1159
#define WINED3DTEXOPCAPS_MODULATE4X
Definition: wined3d.h:1150
#define WINED3DTEXOPCAPS_SELECTARG1
Definition: wined3d.h:1146
#define WINED3DTEXOPCAPS_BUMPENVMAPLUMINANCE
Definition: wined3d.h:1167
#define WINED3DTEXOPCAPS_MULTIPLYADD
Definition: wined3d.h:1169
DWORD MaxSimultaneousTextures
const struct wined3d_gl_info * gl_info
Definition: glsl_shader.c:342
#define WINED3DTEXOPCAPS_MODULATE2X
Definition: wined3d.h:1149
#define min(a, b)
Definition: monoChain.cc:55
#define WINED3DTEXOPCAPS_SUBTRACT
Definition: wined3d.h:1154
#define WINED3DTEXOPCAPS_MODULATECOLOR_ADDALPHA
Definition: wined3d.h:1163
#define WINED3DTEXOPCAPS_BLENDTEXTUREALPHA
Definition: wined3d.h:1157
#define WINED3DTEXOPCAPS_BUMPENVMAP
Definition: wined3d.h:1166
#define WINED3D_FRAGMENT_CAP_COLOR_KEY
#define WINED3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR
Definition: wined3d.h:1162
#define WINED3DTEXOPCAPS_ADD
Definition: wined3d.h:1151

◆ glsl_fragment_pipe_get_emul_mask()

static DWORD glsl_fragment_pipe_get_emul_mask ( const struct wined3d_gl_info gl_info)
static

Definition at line 11656 of file glsl_shader.c.

11657 {
11658  if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
11660  return 0;
11661 }
const struct wined3d_gl_info * gl_info
Definition: glsl_shader.c:342
#define GL_EXT_EMUL_ARB_MULTITEXTURE

◆ glsl_fragment_pipe_invalidate_constants()

static void glsl_fragment_pipe_invalidate_constants ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11779 of file glsl_shader.c.

11781 {
11782  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_PS;
11783 }
Definition: http.c:6587
#define WINED3D_SHADER_CONST_FFP_PS

◆ glsl_fragment_pipe_shademode()

static void glsl_fragment_pipe_shademode ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11834 of file glsl_shader.c.

11836 {
11837  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
11838 }
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
Definition: glfuncs.h:240
Definition: http.c:6587

◆ glsl_fragment_pipe_shader()

static void glsl_fragment_pipe_shader ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11706 of file glsl_shader.c.

11708 {
11709  context->last_was_pshader = use_ps(state);
11710 
11711  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
11712 }
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
Definition: glfuncs.h:240
Definition: http.c:6587
static int state
Definition: maze.c:121
static BOOL use_ps(const struct wined3d_state *state)

◆ glsl_fragment_pipe_tex_transform()

static void glsl_fragment_pipe_tex_transform ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11773 of file glsl_shader.c.

11775 {
11776  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
11777 }
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
Definition: glfuncs.h:240
Definition: http.c:6587

◆ glsl_fragment_pipe_vdecl()

static void glsl_fragment_pipe_vdecl ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11754 of file glsl_shader.c.

11756 {
11757  /* Because of settings->texcoords_initialized and args->texcoords_initialized. */
11758  if (context->gl_info->limits.glsl_varyings < wined3d_max_compat_varyings(context->gl_info))
11759  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
11760 
11762  glsl_fragment_pipe_fog(context, state, state_id);
11763 }
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
Definition: glfuncs.h:240
Definition: http.c:6587
static BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
static void glsl_fragment_pipe_fog(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static int state
Definition: maze.c:121
#define STATE_RENDER(a)
unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info)
Definition: utils.c:5737

◆ glsl_fragment_pipe_vs()

static void glsl_fragment_pipe_vs ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11765 of file glsl_shader.c.

11767 {
11768  /* Because of settings->texcoords_initialized and args->texcoords_initialized. */
11769  if (context->gl_info->limits.glsl_varyings < wined3d_max_compat_varyings(context->gl_info))
11770  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
11771 }
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
Definition: glfuncs.h:240
Definition: http.c:6587
unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info)
Definition: utils.c:5737

◆ glsl_is_color_reg_read()

static BOOL glsl_is_color_reg_read ( const struct wined3d_shader shader,
unsigned int  idx 
)
static

Definition at line 1991 of file glsl_shader.c.

1992 {
1993  const struct wined3d_shader_signature *input_signature = &shader->input_signature;
1994  const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
1995  DWORD input_reg_used = shader->u.ps.input_reg_used;
1996  unsigned int i;
1997 
1998  if (reg_maps->shader_version.major < 3)
1999  return input_reg_used & (1u << idx);
2000 
2001  for (i = 0; i < input_signature->element_count; ++i)
2002  {
2003  const struct wined3d_shader_signature_element *input = &input_signature->elements[i];
2004 
2005  if (!(reg_maps->input_registers & (1u << input->register_idx)))
2006  continue;
2007 
2009  && input->semantic_idx == idx)
2010  return input_reg_used & (1u << input->register_idx);
2011  }
2012  return FALSE;
2013 }
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
Definition: glfuncs.h:240
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
Definition: glfuncs.h:248
unsigned int idx
Definition: utils.c:41
union wined3d_shader_reg_maps::@264 u
GLuint shader
Definition: glext.h:6030
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage)
Definition: shader.c:377
GLenum GLenum GLenum input
Definition: glext.h:9031
struct wined3d_shader_version shader_version
struct wined3d_shader_signature_element * elements
Definition: wined3d.h:2046

Referenced by shader_glsl_generate_pshader().

◆ glsl_is_shadow_sampler()

static BOOL glsl_is_shadow_sampler ( const struct wined3d_shader shader,
const struct ps_compile_args ps_args,
unsigned int  resource_idx,
unsigned int  sampler_idx 
)
static

Definition at line 2015 of file glsl_shader.c.

2017 {
2018  const struct wined3d_shader_version *version = &shader->reg_maps.shader_version;
2019 
2020  if (version->major >= 4)
2021  return shader->reg_maps.sampler_comparison_mode & (1u << sampler_idx);
2022  else
2023  return version->type == WINED3D_SHADER_TYPE_PIXEL && (ps_args->shadow & (1u << resource_idx));
2024 }
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
Definition: glfuncs.h:240
static const WCHAR version[]
Definition: asmname.c:64
GLuint shader
Definition: glext.h:6030

Referenced by shader_generate_glsl_declarations(), and shader_glsl_get_sample_function().

◆ glsl_primitive_type_from_d3d()

static const char* glsl_primitive_type_from_d3d ( enum wined3d_primitive_type  primitive_type)
static

Definition at line 1960 of file glsl_shader.c.

1961 {
1962  switch (primitive_type)
1963  {
1964  case WINED3D_PT_POINTLIST:
1965  return "points";
1966 
1967  case WINED3D_PT_LINELIST:
1968  return "lines";
1969 
1970  case WINED3D_PT_LINESTRIP:
1971  return "line_strip";
1972 
1974  return "triangles";
1975 
1977  return "triangle_strip";
1978 
1980  return "lines_adjacency";
1981 
1983  return "triangles_adjacency";
1984 
1985  default:
1986  FIXME("Unhandled primitive type %s.\n", debug_d3dprimitivetype(primitive_type));
1987  return "";
1988  }
1989 }
#define FIXME(fmt,...)
Definition: debug.h:110
const char * debug_d3dprimitivetype(enum wined3d_primitive_type primitive_type)
Definition: utils.c:4339

Referenced by shader_glsl_generate_geometry_shader().

◆ glsl_program_key_compare()

static int glsl_program_key_compare ( const void key,
const struct wine_rb_entry entry 
)
static

Definition at line 10584 of file glsl_shader.c.

10585 {
10586  const struct glsl_program_key *k = key;
10589 
10590  if (k->vs_id > prog->vs.id) return 1;
10591  else if (k->vs_id < prog->vs.id) return -1;
10592 
10593  if (k->gs_id > prog->gs.id) return 1;
10594  else if (k->gs_id < prog->gs.id) return -1;
10595 
10596  if (k->ps_id > prog->ps.id) return 1;
10597  else if (k->ps_id < prog->ps.id) return -1;
10598 
10599  if (k->hs_id > prog->hs.id) return 1;
10600  else if (k->hs_id < prog->hs.id) return -1;
10601 
10602  if (k->ds_id > prog->ds.id) return 1;
10603  else if (k->ds_id < prog->ds.id) return -1;
10604 
10605  if (k->cs_id > prog->cs.id) return 1;
10606  else if (k->cs_id < prog->cs.id) return -1;
10607 
10608  return 0;
10609 }
char * prog
Definition: isohybrid.c:47
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
HKEY key
Definition: reg.c:42
uint32_t entry
Definition: isohybrid.c:63
int k
Definition: mpi.c:3369

Referenced by shader_glsl_alloc().

◆ glsl_vertex_pipe_clip_plane()

static void glsl_vertex_pipe_clip_plane ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11454 of file glsl_shader.c.

11456 {
11457  const struct wined3d_gl_info *gl_info = context->gl_info;
11458  UINT index = state_id - STATE_CLIPPLANE(0);
11459 
11460  if (index >= gl_info->limits.user_clip_distances)
11461  return;
11462 
11463  context->constant_update_mask |= WINED3D_SHADER_CONST_VS_CLIP_PLANES;
11464 }
Definition: http.c:6587
#define STATE_CLIPPLANE(a)
#define WINED3D_SHADER_CONST_VS_CLIP_PLANES
GLuint index
Definition: glext.h:6031
unsigned int UINT
Definition: ndis.h:50
struct wined3d_gl_limits limits

◆ glsl_vertex_pipe_geometry_shader()

static void glsl_vertex_pipe_geometry_shader ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11296 of file glsl_shader.c.

11298 {
11299  struct glsl_context_data *ctx_data = context->shader_backend_data;
11301 
11304  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
11306 
11307  if (state->shader[WINED3D_SHADER_TYPE_DOMAIN])
11308  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_DOMAIN;
11309  else if (state->shader[WINED3D_SHADER_TYPE_VERTEX]
11310  && state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.shader_version.major >= 4)
11311  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
11312 }
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
Definition: glfuncs.h:240
Definition: http.c:6587
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL is_rasterization_disabled(const struct wined3d_shader *geometry_shader)
BOOL rasterization_disabled
Definition: glsl_shader.c:273
static int state
Definition: maze.c:121

◆ glsl_vertex_pipe_hs()

static void glsl_vertex_pipe_hs ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11284 of file glsl_shader.c.

11286 {
11287  /* In Direct3D tessellator options (e.g. output primitive type, primitive
11288  * winding) are defined in Hull Shaders, while in GLSL those are
11289  * specified in Tessellation Evaluation Shaders. */
11290  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_DOMAIN;
11291 
11292  if (state->shader[WINED3D_SHADER_TYPE_VERTEX])
11293  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
11294 }
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
Definition: glfuncs.h:240
Definition: http.c:6587
static int state
Definition: maze.c:121

◆ glsl_vertex_pipe_light()

static void glsl_vertex_pipe_light ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11420 of file glsl_shader.c.

11422 {
11423  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_LIGHTS;
11424 }
Definition: http.c:6587
#define WINED3D_SHADER_CONST_FFP_LIGHTS

◆ glsl_vertex_pipe_material()

static void glsl_vertex_pipe_material ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11414 of file glsl_shader.c.

11416 {
11417  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MATERIAL;
11418 }
Definition: http.c:6587
#define WINED3D_SHADER_CONST_FFP_MATERIAL

◆ glsl_vertex_pipe_nop()

static void glsl_vertex_pipe_nop ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11203 of file glsl_shader.c.

11204  {}

◆ glsl_vertex_pipe_pixel_shader()

static void glsl_vertex_pipe_pixel_shader ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11314 of file glsl_shader.c.

11316 {
11317  if (state->shader[WINED3D_SHADER_TYPE_GEOMETRY])
11318  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_GEOMETRY;
11319  else if (state->shader[WINED3D_SHADER_TYPE_DOMAIN])
11320  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_DOMAIN;
11321  else if (state->shader[WINED3D_SHADER_TYPE_VERTEX]
11322  && state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.shader_version.major >= 4)
11323  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
11324 }
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
Definition: glfuncs.h:240
Definition: http.c:6587
static int state
Definition: maze.c:121

◆ glsl_vertex_pipe_pointscale()

static void glsl_vertex_pipe_pointscale ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11432 of file glsl_shader.c.

11434 {
11435  if (!use_vs(state))
11436  context->constant_update_mask |= WINED3D_SHADER_CONST_VS_POINTSIZE;
11437 }
Definition: http.c:6587
static int state
Definition: maze.c:121
#define WINED3D_SHADER_CONST_VS_POINTSIZE
static BOOL use_vs(const struct wined3d_state *state)

◆ glsl_vertex_pipe_pointsize()

static void glsl_vertex_pipe_pointsize ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11426 of file glsl_shader.c.

11428 {
11429  context->constant_update_mask |= WINED3D_SHADER_CONST_VS_POINTSIZE;
11430 }
Definition: http.c:6587
#define WINED3D_SHADER_CONST_VS_POINTSIZE

◆ glsl_vertex_pipe_projection()

static void glsl_vertex_pipe_projection ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11362 of file glsl_shader.c.

11364 {
11365  /* Table fog behavior depends on the projection matrix. */
11366  if (state->render_states[WINED3D_RS_FOGENABLE]
11367  && state->render_states[WINED3D_RS_FOGTABLEMODE] != WINED3D_FOG_NONE)
11368  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
11369  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_PROJ;
11370 }
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
Definition: glfuncs.h:240
Definition: http.c:6587
#define WINED3D_SHADER_CONST_FFP_PROJ
static int state
Definition: maze.c:121

Referenced by glsl_vertex_pipe_viewport().

◆ glsl_vertex_pipe_shademode()

static void glsl_vertex_pipe_shademode ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11448 of file glsl_shader.c.

11450 {
11451  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
11452 }
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
Definition: glfuncs.h:240
Definition: http.c:6587

◆ glsl_vertex_pipe_shader()

static void glsl_vertex_pipe_shader ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11206 of file glsl_shader.c.

11208 {
11209  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
11210 }
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
Definition: glfuncs.h:240
Definition: http.c:6587

◆ glsl_vertex_pipe_texmatrix()

static void glsl_vertex_pipe_texmatrix ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11383 of file glsl_shader.c.

11385 {
11386  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_TEXMATRIX;
11387 }
Definition: http.c:6587
#define WINED3D_SHADER_CONST_FFP_TEXMATRIX

◆ glsl_vertex_pipe_texmatrix_np2()

static void glsl_vertex_pipe_texmatrix_np2 ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11389 of file glsl_shader.c.

11391 {
11392  DWORD sampler = state_id - STATE_SAMPLER(0);
11393  const struct wined3d_texture *texture = state->textures[sampler];
11394  BOOL np2;
11395 
11396  if (!texture)
11397  return;
11398 
11399  if (sampler >= MAX_TEXTURES)
11400  return;
11401 
11402  if ((np2 = !(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT))
11403  || context->lastWasPow2Texture & (1u << sampler))
11404  {
11405  if (np2)
11406  context->lastWasPow2Texture |= 1u << sampler;
11407  else
11408  context->lastWasPow2Texture &= ~(1u << sampler);
11409 
11410  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_TEXMATRIX;
11411  }
11412 }
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
Definition: glfuncs.h:240
#define MAX_TEXTURES
Definition: http.c:6587
#define WINED3D_TEXTURE_POW2_MAT_IDENT
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
static int state
Definition: maze.c:121
#define STATE_SAMPLER(num)
#define WINED3D_SHADER_CONST_FFP_TEXMATRIX
GLuint sampler
Definition: glext.h:7283

◆ glsl_vertex_pipe_vdecl()

static void glsl_vertex_pipe_vdecl ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11212 of file glsl_shader.c.

11214 {
11215  const struct wined3d_gl_info *gl_info = context->gl_info;
11216  BOOL normal = !!(context->stream_info.use_map & (1u << WINED3D_FFP_NORMAL));
11217  const BOOL legacy_clip_planes = needs_legacy_glsl_syntax(gl_info);
11218  BOOL transformed = context->stream_info.position_transformed;
11219  BOOL wasrhw = context->last_was_rhw;
11220  unsigned int i;
11221 
11222  context->last_was_rhw = transformed;
11223 
11224  /* If the vertex declaration contains a transformed position attribute,
11225  * the draw uses the fixed function vertex pipeline regardless of any
11226  * vertex shader set by the application. */
11227  if (transformed != wasrhw
11228  || context->stream_info.swizzle_map != context->last_swizzle_map)
11229  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
11230 
11231  context->last_swizzle_map = context->stream_info.swizzle_map;
11232 
11233  if (!use_vs(state))
11234  {
11235  if (context->last_was_vshader)
11236  {
11237  if (legacy_clip_planes)
11238  for (i = 0; i < gl_info->limits.user_clip_distances; ++i)
11240  else
11241  context->constant_update_mask |= WINED3D_SHADER_CONST_VS_CLIP_PLANES;
11242  }
11243 
11244  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_TEXMATRIX;
11245 
11246  /* Because of settings->texcoords, we have to regenerate the vertex
11247  * shader on a vdecl change if there aren't enough varyings to just
11248  * always output all the texture coordinates. */
11249  if (gl_info->limits.glsl_varyings < wined3d_max_compat_varyings(gl_info)
11250  || normal != context->last_was_normal)
11251  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
11252 
11253  if (use_ps(state)
11254  && state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.shader_version.major == 1
11255  && state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.shader_version.minor <= 3)
11256  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
11257  }
11258  else
11259  {
11260  if (!context->last_was_vshader)
11261  {
11262  /* Vertex shader clipping ignores the view matrix. Update all clip planes. */
11263  if (legacy_clip_planes)
11264  for (i = 0; i < gl_info->limits.user_clip_distances; ++i)
11266  else
11267  context->constant_update_mask |= WINED3D_SHADER_CONST_VS_CLIP_PLANES;
11268  }
11269  }
11270 
11271  context->last_was_vshader = use_vs(state);
11272  context->last_was_normal = normal;
11273 }
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
Definition: glfuncs.h:240
Definition: http.c:6587
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1801
#define STATE_CLIPPLANE(a)
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
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WINED3D_SHADER_CONST_VS_CLIP_PLANES
void clipplane(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:3833
static int state
Definition: maze.c:121
static BOOL use_ps(const struct wined3d_state *state)
unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info)
Definition: utils.c:5737
#define WINED3D_SHADER_CONST_FFP_TEXMATRIX
static BOOL use_vs(const struct wined3d_state *state)
struct wined3d_gl_limits limits

◆ glsl_vertex_pipe_vertexblend()

static void glsl_vertex_pipe_vertexblend ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11332 of file glsl_shader.c.

11334 {
11335  int i = state_id - STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(0));
11336  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_VERTEXBLEND_INDEX(i);
11337 }
#define WINED3D_TS_WORLD_MATRIX(index)
Definition: wined3d.h:664
Definition: http.c:6587
#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND_INDEX(i)
#define STATE_TRANSFORM(a)
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
Definition: glfuncs.h:248

◆ glsl_vertex_pipe_view()

static void glsl_vertex_pipe_view ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11339 of file glsl_shader.c.

11340 {
11341  const struct wined3d_gl_info *gl_info = context->gl_info;
11342  unsigned int k;
11343 
11344  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW
11347 
11348  if (needs_legacy_glsl_syntax(gl_info))
11349  {
11350  for (k = 0; k < gl_info->limits.user_clip_distances; ++k)
11351  {
11354  }
11355  }
11356  else
11357  {
11358  context->constant_update_mask |= WINED3D_SHADER_CONST_VS_CLIP_PLANES;
11359  }
11360 }
Definition: http.c:6587
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1801
#define WINED3D_SHADER_CONST_FFP_LIGHTS
#define STATE_CLIPPLANE(a)
static BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
#define WINED3D_SHADER_CONST_VS_CLIP_PLANES
void clipplane(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:3833
static int state
Definition: maze.c:121
#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND
#define WINED3D_SHADER_CONST_FFP_MODELVIEW
struct wined3d_gl_limits limits
int k
Definition: mpi.c:3369

◆ glsl_vertex_pipe_viewport()

static void glsl_vertex_pipe_viewport ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11372 of file glsl_shader.c.

11374 {
11378  && state->render_states[WINED3D_RS_POINTSCALEENABLE])
11379  context->constant_update_mask |= WINED3D_SHADER_CONST_VS_POINTSIZE;
11380  context->constant_update_mask |= WINED3D_SHADER_CONST_POS_FIXUP;
11381 }
Definition: http.c:6587
static BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
#define STATE_TRANSFORM(a)
static int state
Definition: maze.c:121
static void glsl_vertex_pipe_projection(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
#define STATE_RENDER(a)
#define WINED3D_SHADER_CONST_VS_POINTSIZE
#define WINED3D_SHADER_CONST_POS_FIXUP

◆ glsl_vertex_pipe_vp_alloc()

static void* glsl_vertex_pipe_vp_alloc ( const struct wined3d_shader_backend_ops shader_backend,
void shader_priv 
)
static

Definition at line 11160 of file glsl_shader.c.

11161 {
11162  struct shader_glsl_priv *priv;
11163 
11164  if (shader_backend == &glsl_shader_backend)
11165  {
11166  priv = shader_priv;
11168  return priv;
11169  }
11170 
11171  FIXME("GLSL vertex pipe without GLSL shader backend not implemented.\n");
11172 
11173  return NULL;
11174 }
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static void wine_rb_init(struct wine_rb_tree *tree, wine_rb_compare_func_t compare)
Definition: rbtree.h:179
int wined3d_ffp_vertex_program_key_compare(const void *key, const struct wine_rb_entry *entry)
Definition: utils.c:6380
struct wine_rb_tree ffp_vertex_shaders
Definition: glsl_shader.c:131
const struct wined3d_shader_backend_ops glsl_shader_backend

◆ glsl_vertex_pipe_vp_enable()

static void glsl_vertex_pipe_vp_enable ( const struct wined3d_gl_info gl_info,
BOOL  enable 
)
static

Definition at line 11131 of file glsl_shader.c.

11131 {}

◆ glsl_vertex_pipe_vp_free()

static void glsl_vertex_pipe_vp_free ( struct wined3d_device device)
static

Definition at line 11193 of file glsl_shader.c.

11194 {
11195  struct shader_glsl_priv *priv = device->vertex_priv;
11196  struct glsl_ffp_destroy_ctx ctx;
11197 
11198  ctx.priv = priv;
11199  ctx.gl_info = &device->adapter->gl_info;
11200  wine_rb_destroy(&priv->ffp_vertex_shaders, shader_glsl_free_ffp_vertex_shader, &ctx);
11201 }
struct shader_glsl_priv * priv
Definition: glsl_shader.c:341
Definition: devices.h:37
static void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context)
Definition: rbtree.h:198
static void shader_glsl_free_ffp_vertex_shader(struct wine_rb_entry *entry, void *context)

◆ glsl_vertex_pipe_vp_get_caps()

static void glsl_vertex_pipe_vp_get_caps ( const struct wined3d_gl_info gl_info,
struct wined3d_vertex_caps caps 
)
static

Definition at line 11133 of file glsl_shader.c.

11134 {
11135  caps->xyzrhw = TRUE;
11137  caps->ffp_generic_attributes = TRUE;
11148  caps->fvf_caps = WINED3DFVFCAPS_PSIZE | 8; /* 8 texture coordinates. */
11149  caps->max_user_clip_planes = gl_info->limits.user_clip_distances;
11151 }
#define TRUE
Definition: types.h:120
#define WINED3DVTXPCAPS_POSITIONALLIGHTS
Definition: wined3d.h:1281
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1801
#define MAX_ACTIVE_LIGHTS
#define WINED3DFVFCAPS_PSIZE
Definition: wined3d.h:1057
#define MAX_VERTEX_INDEX_BLENDS
#define WINED3DVTXPCAPS_TEXGEN
Definition: wined3d.h:1277
#define WINED3DVTXPCAPS_DIRECTIONALLIGHTS
Definition: wined3d.h:1280
#define WINED3DPRASTERCAPS_FOGRANGE
Definition: wined3d.h:1206
const struct wined3d_gl_info * gl_info
Definition: glsl_shader.c:342
#define WINED3DVTXPCAPS_LOCALVIEWER
Definition: wined3d.h:1282
#define WINED3DVTXPCAPS_VERTEXFOG
Definition: wined3d.h:1279
#define WINED3DVTXPCAPS_MATERIALSOURCE7
Definition: wined3d.h:1278
#define WINED3DVTXPCAPS_TEXGEN_SPHEREMAP
Definition: wined3d.h:1284
#define MAX_VERTEX_BLENDS

◆ glsl_vertex_pipe_vp_get_emul_mask()

static DWORD glsl_vertex_pipe_vp_get_emul_mask ( const struct wined3d_gl_info gl_info)
static

Definition at line 11153 of file glsl_shader.c.

11154 {
11155  if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
11157  return 0;
11158 }
const struct wined3d_gl_info * gl_info
Definition: glsl_shader.c:342
#define GL_EXT_EMUL_ARB_MULTITEXTURE

◆ glsl_vertex_pipe_vs()

static void glsl_vertex_pipe_vs ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11275 of file glsl_shader.c.

11277 {
11278  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
11279  /* Different vertex shaders potentially require a different vertex attributes setup. */
11282 }
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
Definition: glfuncs.h:240
#define STATE_VDECL
Definition: http.c:6587
static BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
static void context_apply_state(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static int state
Definition: maze.c:121

◆ glsl_vertex_pipe_world()

static void glsl_vertex_pipe_world ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11326 of file glsl_shader.c.

11328 {
11329  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW;
11330 }
Definition: http.c:6587
#define WINED3D_SHADER_CONST_FFP_MODELVIEW

◆ glsl_vertex_pointsprite_core()

static void glsl_vertex_pointsprite_core ( struct wined3d_context context,
const struct wined3d_state state,
DWORD  state_id 
)
static

Definition at line 11439 of file glsl_shader.c.

11441 {
11442  static unsigned int once;
11443 
11444  if (state->gl_primitive_type == GL_POINTS && !state->render_states[WINED3D_RS_POINTSPRITEENABLE] && !once++)
11445  FIXME("Non-point sprite points not supported in core profile.\n");
11446 }
#define GL_POINTS
Definition: gl.h:190
#define FIXME(fmt,...)
Definition: debug.h:110
static int state
Definition: maze.c:121

◆ is_mipmapped()

static BOOL is_mipmapped ( enum wined3d_shader_resource_type  resource_type)
static

Definition at line 5665 of file glsl_shader.c.

5666 {
5667  return resource_type != WINED3D_SHADER_RESOURCE_BUFFER && !is_multisampled(resource_type);
5668 }
static BOOL is_multisampled(enum wined3d_shader_resource_type resource_type)
Definition: glsl_shader.c:5659

Referenced by shader_glsl_ld(), and shader_glsl_resinfo().

◆ is_multisampled()

static BOOL is_multisampled ( enum wined3d_shader_resource_type  resource_type)
static

◆ multiply_vector_matrix()

static void multiply_vector_matrix ( struct wined3d_vec4 dest,
const struct wined3d_vec4 src1,
const struct wined3d_matrix src2 
)
static

Definition at line 1289 of file glsl_shader.c.

1291 {
1292  struct wined3d_vec4 temp;
1293 
1294  temp.x = (src1->x * src2->_11) + (src1->y * src2->_21) + (src1->z * src2->_31) + (src1->w * src2->_41);
1295  temp.y = (src1->x * src2->_12) + (src1->y * src2->_22) + (src1->z * src2->_32) + (src1->w * src2->_42);
1296  temp.z = (src1->x * src2->_13) + (src1->y * src2->_23) + (src1->z * src2->_33) + (src1->w * src2->_43);
1297  temp.w = (src1->x * src2->_14) + (src1->y * src2->_24) + (src1->z * src2->_34) + (src1->w * src2->_44);
1298 
1299  *dest = temp;
1300 }
static calc_node_t temp
Definition: rpn_ieee.c:38
static char * dest
Definition: rtl.c:135

Referenced by shader_glsl_clip_plane_uniform(), and shader_glsl_ffp_vertex_light_uniform().

◆ needs_legacy_glsl_syntax()

◆ print_glsl_info_log()

void print_glsl_info_log ( const struct wined3d_gl_info gl_info,
GLuint  id,
BOOL  program 
)

Definition at line 459 of file glsl_shader.c.

460 {
461  int length = 0;
462  char *log;
463 
464  if (!WARN_ON(d3d_shader) && !FIXME_ON(d3d_shader))
465  return;
466 
467  if (program)
468  GL_EXTCALL(glGetProgramiv(id, GL_INFO_LOG_LENGTH, &length));
469  else
470  GL_EXTCALL(glGetShaderiv(id, GL_INFO_LOG_LENGTH, &length));
471 
472  /* A size of 1 is just a null-terminated string, so the log should be bigger than
473  * that if there are errors. */
474  if (length > 1)
475  {
476  const char *ptr, *line;
477 
478  log = heap_alloc(length);
479  /* The info log is supposed to be zero-terminated, but at least some
480  * versions of fglrx don't terminate the string properly. The reported
481  * length does include the terminator, so explicitly set it to zero
482  * here. */
483  log[length - 1] = 0;
484  if (program)
485  GL_EXTCALL(glGetProgramInfoLog(id, length, NULL, log));
486  else
487  GL_EXTCALL(glGetShaderInfoLog(id, length, NULL, log));
488 
489  ptr = log;
490  if (gl_info->quirks & WINED3D_QUIRK_INFO_LOG_SPAM)
491  {
492  WARN("Info log received from GLSL shader #%u:\n", id);
493  while ((line = get_info_log_line(&ptr))) WARN(" %.*s", (int)(ptr - line), line);
494  }
495  else
496  {
497  FIXME("Info log received from GLSL shader #%u:\n", id);
498  while ((line = get_info_log_line(&ptr))) FIXME(" %.*s", (int)(ptr - line), line);
499  }
500  heap_free(log);
501  }
502 }
#define GL_INFO_LOG_LENGTH
Definition: glext.h:450
#define FIXME_ON(ch)
Definition: debug.h:406
#define WARN(fmt,...)
Definition: debug.h:111
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define WARN_ON(c)
Definition: module.h:255
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
#define GL_EXTCALL(f)
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
char line[200]
Definition: main.c:97
static const char * get_info_log_line(const char **ptr)
Definition: glsl_shader.c:442
GLuint program
Definition: glext.h:6723
#define WINED3D_QUIRK_INFO_LOG_SPAM
#define log(outFile, fmt,...)
Definition: util.h:15
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by draw_test_quad(), shader_glsl_compile(), and shader_glsl_validate_link().

◆ PRINTF_ATTR() [1/2]

static void PRINTF_ATTR ( ,
 
)
static

Definition at line 1822 of file glsl_shader.c.

1824 {
1825  va_list args;
1826  int ret;
1827 
1828  shader_addline(buffer, "%s%s ", flat ? "flat " : "",
1829  needs_legacy_glsl_syntax(gl_info) ? "varying" : "in");
1830  for (;;)
1831  {
1832  va_start(args, format);
1834  va_end(args);
1835  if (!ret)
1836  return;
1838  return;
1839  }
1840 }
int shader_vaddline(struct wined3d_string_buffer *buffer, const char *format, va_list args)
Definition: shader.c:464
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:478
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1801
GLuint buffer
Definition: glext.h:5915
Definition: match.c:390
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
BOOL string_buffer_resize(struct wined3d_string_buffer *buffer, int rc)
Definition: shader.c:446
int ret
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define args
Definition: format.c:66

◆ PRINTF_ATTR() [2/2]

static void PRINTF_ATTR ( ,
10   
)
static

Definition at line 3450 of file glsl_shader.c.

3454 {
3455  static const struct wined3d_shader_texel_offset dummy_offset = {0, 0, 0};
3456  const struct wined3d_shader_version *version = &ins->ctx->reg_maps->shader_version;
3457  char dst_swizzle[6];
3458  struct color_fixup_desc fixup;
3459  BOOL np2_fixup = FALSE;
3460  va_list args;
3461  int ret;
3462 
3463  shader_glsl_swizzle_to_str(swizzle, FALSE, ins->dst[0].write_mask, dst_swizzle);
3464 
3465  /* If ARB_texture_swizzle is supported we don't need to do anything here.
3466  * We actually rely on it for vertex shaders and SM4+. */
3467  if (version->type == WINED3D_SHADER_TYPE_PIXEL && version->major < 4)
3468  {
3469  const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
3470  fixup = priv->cur_ps_args->color_fixup[sampler_bind_idx];
3471 
3472  if (priv->cur_ps_args->np2_fixup & (1u << sampler_bind_idx))
3473  np2_fixup = TRUE;
3474  }
3475  else
3476  {
3477  fixup = COLOR_FIXUP_IDENTITY;
3478  }
3479 
3480  shader_glsl_append_dst_ext(ins->ctx->buffer, ins, &ins->dst[0], sample_function->data_type);
3481 
3482  if (sample_function->output_single_component)
3483  shader_addline(ins->ctx->buffer, "vec4(");
3484 
3485  shader_addline(ins->ctx->buffer, "%s(%s_sampler%u, ",
3486  sample_function->name->buffer, shader_glsl_get_prefix(version->type), sampler_bind_idx);
3487 
3488  for (;;)
3489  {
3490  va_start(args, coord_reg_fmt);
3491  ret = shader_vaddline(ins->ctx->buffer, coord_reg_fmt, args);
3492  va_end(args);
3493  if (!ret)
3494  break;
3495  if (!string_buffer_resize(ins->ctx->buffer, ret))
3496  break;
3497  }
3498 
3499  if (np2_fixup)
3500  {
3501  const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
3502  const unsigned char idx = priv->cur_np2fixup_info->idx[sampler_bind_idx];
3503 
3504  switch (shader_glsl_get_write_mask_size(sample_function->coord_mask))
3505  {
3506  case 1:
3507  shader_addline(ins->ctx->buffer, " * ps_samplerNP2Fixup[%u].%s",
3508  idx >> 1, (idx % 2) ? "z" : "x");
3509  break;
3510  case 2:
3511  shader_addline(ins->ctx->buffer, " * ps_samplerNP2Fixup[%u].%s",
3512  idx >> 1, (idx % 2) ? "zw" : "xy");
3513  break;
3514  case 3:
3515  shader_addline(ins->ctx->buffer, " * vec3(ps_samplerNP2Fixup[%u].%s, 1.0)",
3516  idx >> 1, (