ReactOS  0.4.13-dev-464-g6b95727
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
 
struct  glsl_blitter_args
 
struct  glsl_blitter_program
 
struct  wined3d_glsl_blitter
 

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 BOOL 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, 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 charget_fragment_output (const struct wined3d_gl_info *gl_info)
 
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, BOOL use_viewport_index)
 
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_sample_info (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, BOOL tmp_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)
 
static int glsl_blitter_args_compare (const void *key, const struct wine_rb_entry *entry)
 
static void glsl_free_blitter_program (struct wine_rb_entry *entry, void *ctx)
 
static void glsl_blitter_destroy (struct wined3d_blitter *blitter, struct wined3d_context *context)
 
static void glsl_blitter_generate_p8_shader (struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *output, const char *tex_type, const char *swizzle)
 
static void gen_packed_yuv_read (struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *tex_type)
 
static void gen_yv12_read (struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const char *tex_type)
 
static void gen_nv12_read (struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const char *tex_type)
 
static void glsl_blitter_generate_yuv_shader (struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *output, const char *tex_type, const char *swizzle)
 
static void glsl_blitter_generate_plain_shader (struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *output, const char *tex_type, const char *swizzle)
 
static GLuint glsl_blitter_generate_program (struct wined3d_glsl_blitter *blitter, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args)
 
static void glsl_blitter_upload_palette (struct wined3d_glsl_blitter *blitter, struct wined3d_context *context, const struct wined3d_texture *texture)
 
static struct glsl_blitter_programglsl_blitter_get_program (struct wined3d_glsl_blitter *blitter, struct wined3d_context *context, const struct wined3d_texture *texture)
 
static BOOL glsl_blitter_supported (enum wined3d_blit_op blit_op, const struct wined3d_context *context, const struct wined3d_texture *src_texture, DWORD src_location, const struct wined3d_texture *dst_texture, DWORD dst_location)
 
static DWORD glsl_blitter_blit (struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, DWORD src_location, const RECT *src_rect, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, DWORD dst_location, const RECT *dst_rect, const struct wined3d_color_key *colour_key, enum wined3d_texture_filter_type filter)
 
static void glsl_blitter_clear (struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, const RECT *draw_rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil)
 
struct wined3d_blitterwined3d_glsl_blitter_create (struct wined3d_blitter **next, const struct wined3d_device *device)
 

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
 
static const struct wined3d_blitter_ops glsl_blitter_ops
 

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 96 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 6634 of file glsl_shader.c.

6635 {
6636  struct glsl_program_key key;
6637 
6638  key.vs_id = entry->vs.id;
6639  key.hs_id = entry->hs.id;
6640  key.ds_id = entry->ds.id;
6641  key.gs_id = entry->gs.id;
6642  key.ps_id = entry->ps.id;
6643  key.cs_id = entry->cs.id;
6644 
6645  if (wine_rb_put(&priv->program_lookup, &key, &entry->program_lookup_entry) == -1)
6646  {
6647  ERR("Failed to insert program entry.\n");
6648  }
6649 }
struct wine_rb_tree program_lookup
Definition: glsl_shader.c:122
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 789 of file glsl_shader.c.

792 {
793  unsigned int j;
794 
795  for (j = 0; j < component_count / 4; ++j)
796  {
797  string_buffer_sprintf(buffer, "gl_SkipComponents4");
798  append_transform_feedback_varying(varyings, varying_count, strings, strings_length, buffer);
799  }
800  if (component_count % 4)
801  {
802  string_buffer_sprintf(buffer, "gl_SkipComponents%u", component_count % 4);
803  append_transform_feedback_varying(varyings, varying_count, strings, strings_length, buffer);
804  }
805 }
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:770
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:535

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 770 of file glsl_shader.c.

772 {
773  if (varyings && *strings)
774  {
775  char *ptr = *strings;
776 
777  varyings[*varying_count] = ptr;
778 
779  memcpy(ptr, buffer->buffer, buffer->content_size + 1);
780  ptr += buffer->content_size + 1;
781 
782  *strings = ptr;
783  }
784 
785  *strings_length += buffer->content_size + 1;
786  ++(*varying_count);
787 }
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 1055 of file glsl_shader.c.

1057 {
1058  GLfloat clamped_constant[4];
1059 
1060  if (location == -1) return;
1061 
1062  clamped_constant[0] = data->x < -1.0f ? -1.0f : data->x > 1.0f ? 1.0f : data->x;
1063  clamped_constant[1] = data->y < -1.0f ? -1.0f : data->y > 1.0f ? 1.0f : data->y;
1064  clamped_constant[2] = data->z < -1.0f ? -1.0f : data->z > 1.0f ? 1.0f : data->z;
1065  clamped_constant[3] = data->w < -1.0f ? -1.0f : data->w > 1.0f ? 1.0f : data->w;
1066 
1067  GL_EXTCALL(glUniform4fv(location, 1, clamped_constant));
1068 }
#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 10763 of file glsl_shader.c.

10764 {
10765  heap_free(heap->entries);
10766 }
struct constant_entry * entries
Definition: glsl_shader.c:111
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 10740 of file glsl_shader.c.

10741 {
10742  SIZE_T size = (constant_count + 1) * sizeof(*heap->entries)
10743  + constant_count * sizeof(*heap->contained)
10744  + constant_count * sizeof(*heap->positions);
10745  void *mem;
10746 
10747  if (!(mem = heap_alloc(size)))
10748  {
10749  ERR("Failed to allocate memory\n");
10750  return FALSE;
10751  }
10752 
10753  heap->entries = mem;
10754  heap->entries[1].version = 0;
10755  heap->contained = (BOOL *)(heap->entries + constant_count + 1);
10756  memset(heap->contained, 0, constant_count * sizeof(*heap->contained));
10757  heap->positions = (unsigned int *)(heap->contained + constant_count);
10758  heap->size = 1;
10759 
10760  return TRUE;
10761 }
struct constant_entry * entries
Definition: glsl_shader.c:111
#define TRUE
Definition: types.h:120
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int size
Definition: glsl_shader.c:114
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:112
unsigned int * positions
Definition: glsl_shader.c:113

Referenced by shader_glsl_alloc().

◆ debug_gl_shader_type()

static const char* debug_gl_shader_type ( GLenum  type)
static

Definition at line 346 of file glsl_shader.c.

347 {
348  switch (type)
349  {
350 #define WINED3D_TO_STR(u) case u: return #u
357 #undef WINED3D_TO_STR
358  default:
359  return wine_dbg_sprintf("UNKNOWN(%#x)", type);
360  }
361 }
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 6661 of file glsl_shader.c.

6663 {
6664  wine_rb_remove(&priv->program_lookup, &entry->program_lookup_entry);
6665 
6666  GL_EXTCALL(glDeleteProgram(entry->id));
6667  if (entry->vs.id)
6668  list_remove(&entry->vs.shader_entry);
6669  if (entry->hs.id)
6670  list_remove(&entry->hs.shader_entry);
6671  if (entry->ds.id)
6672  list_remove(&entry->ds.shader_entry);
6673  if (entry->gs.id)
6674  list_remove(&entry->gs.shader_entry);
6675  if (entry->ps.id)
6676  list_remove(&entry->ps.shader_entry);
6677  if (entry->cs.id)
6678  list_remove(&entry->cs.shader_entry);
6679  heap_free(entry);
6680 }
struct wine_rb_tree program_lookup
Definition: glsl_shader.c:122
#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 9907 of file glsl_shader.c.

9909 {
9910  struct glsl_shader_private *shader_data;
9911 
9912  if (!shader->backend_data)
9913  {
9914  WARN("Failed to find GLSL program for compute shader %p.\n", shader);
9916  {
9917  ERR("Failed to compile compute shader %p.\n", shader);
9918  return 0;
9919  }
9920  }
9921  shader_data = shader->backend_data;
9922  return shader_data->gl_shaders.cs[0].id;
9923 }
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:9827
struct glsl_cs_compiled_shader * cs
Definition: glsl_shader.c:319
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 8396 of file glsl_shader.c.

8398 {
8399  struct glsl_ds_compiled_shader *gl_shaders, *new_array;
8400  struct glsl_shader_private *shader_data;
8401  unsigned int i, new_size;
8402  GLuint ret;
8403 
8404  if (!shader->backend_data)
8405  {
8406  if (!(shader->backend_data = heap_alloc_zero(sizeof(*shader_data))))
8407  {
8408  ERR("Failed to allocate backend data.\n");
8409  return 0;
8410  }
8411  }
8412  shader_data = shader->backend_data;
8413  gl_shaders = shader_data->gl_shaders.ds;
8414 
8415  for (i = 0; i < shader_data->num_gl_shaders; ++i)
8416  {
8417  if (!memcmp(&gl_shaders[i].args, args, sizeof(*args)))
8418  return gl_shaders[i].id;
8419  }
8420 
8421  TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
8422 
8423  if (shader_data->num_gl_shaders)
8424  {
8425  new_size = shader_data->shader_array_size + 1;
8426  new_array = heap_realloc(shader_data->gl_shaders.ds, new_size * sizeof(*new_array));
8427  }
8428  else
8429  {
8430  new_array = heap_alloc(sizeof(*new_array));
8431  new_size = 1;
8432  }
8433 
8434  if (!new_array)
8435  {
8436  ERR("Failed to allocate GL shaders array.\n");
8437  return 0;
8438  }
8439  shader_data->gl_shaders.ds = new_array;
8440  shader_data->shader_array_size = new_size;
8441  gl_shaders = new_array;
8442 
8445  gl_shaders[shader_data->num_gl_shaders].args = *args;
8446  gl_shaders[shader_data->num_gl_shaders++].id = ret;
8447 
8448  return ret;
8449 }
unsigned int num_gl_shaders
Definition: glsl_shader.c:321
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:431
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:316
#define ERR(fmt,...)
Definition: debug.h:109
struct wined3d_string_buffer shader_buffer
Definition: glsl_shader.c:120
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:7930
#define args
Definition: format.c:66
unsigned int shader_array_size
Definition: glsl_shader.c:321

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 8451 of file glsl_shader.c.

8453 {
8454  struct glsl_gs_compiled_shader *gl_shaders, *new_array;
8455  struct glsl_shader_private *shader_data;
8456  unsigned int i, new_size;
8457  GLuint ret;
8458 
8459  if (!shader->backend_data)
8460  {
8461  if (!(shader->backend_data = heap_alloc_zero(sizeof(*shader_data))))
8462  {
8463  ERR("Failed to allocate backend data.\n");
8464  return 0;
8465  }
8466  }
8467  shader_data = shader->backend_data;
8468  gl_shaders = shader_data->gl_shaders.gs;
8469 
8470  for (i = 0; i < shader_data->num_gl_shaders; ++i)
8471  {
8472  if (!memcmp(&gl_shaders[i].args, args, sizeof(*args)))
8473  return gl_shaders[i].id;
8474  }
8475 
8476  TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
8477 
8478  if (shader_data->num_gl_shaders)
8479  {
8480  new_size = shader_data->shader_array_size + 1;
8481  new_array = heap_realloc(shader_data->gl_shaders.gs, new_size * sizeof(*new_array));
8482  }
8483  else
8484  {
8485  new_array = heap_alloc(sizeof(*new_array));
8486  new_size = 1;
8487  }
8488 
8489  if (!new_array)
8490  {
8491  ERR("Failed to allocate GL shaders array.\n");
8492  return 0;
8493  }
8494  shader_data->gl_shaders.gs = new_array;
8495  shader_data->shader_array_size = new_size;
8496  gl_shaders = new_array;
8497 
8500  gl_shaders[shader_data->num_gl_shaders].args = *args;
8501  gl_shaders[shader_data->num_gl_shaders++].id = ret;
8502 
8503  return ret;
8504 }
unsigned int num_gl_shaders
Definition: glsl_shader.c:321
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:317
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:431
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:120
unsigned int GLuint
Definition: gl.h:159
#define args
Definition: format.c:66
unsigned int shader_array_size
Definition: glsl_shader.c:321
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:8024

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 8351 of file glsl_shader.c.

8353 {
8354  struct glsl_hs_compiled_shader *gl_shaders, *new_array;
8355  struct glsl_shader_private *shader_data;
8356  unsigned int new_size;
8357  GLuint ret;
8358 
8359  if (!shader->backend_data)
8360  {
8361  if (!(shader->backend_data = heap_alloc_zero(sizeof(*shader_data))))
8362  {
8363  ERR("Failed to allocate backend data.\n");
8364  return 0;
8365  }
8366  }
8367  shader_data = shader->backend_data;
8368  gl_shaders = shader_data->gl_shaders.hs;
8369 
8370  if (shader_data->num_gl_shaders > 0)
8371  {
8372  assert(shader_data->num_gl_shaders == 1);
8373  return gl_shaders[0].id;
8374  }
8375 
8376  TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
8377 
8378  assert(!shader_data->gl_shaders.hs);
8379  new_size = 1;
8380  if (!(new_array = heap_alloc(sizeof(*new_array))))
8381  {
8382  ERR("Failed to allocate GL shaders array.\n");
8383  return 0;
8384  }
8385  shader_data->gl_shaders.hs = new_array;
8386  shader_data->shader_array_size = new_size;
8387  gl_shaders = new_array;
8388 
8391  gl_shaders[shader_data->num_gl_shaders++].id = ret;
8392 
8393  return ret;
8394 }
unsigned int num_gl_shaders
Definition: glsl_shader.c:321
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:7834
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
struct glsl_hs_compiled_shader * hs
Definition: glsl_shader.c:315
union glsl_shader_private::@261 gl_shaders
void string_buffer_clear(struct wined3d_string_buffer *buffer)
Definition: shader.c:431
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:120
unsigned int GLuint
Definition: gl.h:159
unsigned int shader_array_size
Definition: glsl_shader.c:321

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 8194 of file glsl_shader.c.

8198 {
8199  struct glsl_ps_compiled_shader *gl_shaders, *new_array;
8200  struct glsl_shader_private *shader_data;
8201  struct ps_np2fixup_info *np2fixup;
8202  UINT i;
8203  DWORD new_size;
8204  GLuint ret;
8205 
8206  if (!shader->backend_data)
8207  {
8208  if (!(shader->backend_data = heap_alloc_zero(sizeof(*shader_data))))
8209  {
8210  ERR("Failed to allocate backend data.\n");
8211  return 0;
8212  }
8213  }
8214  shader_data = shader->backend_data;
8215  gl_shaders = shader_data->gl_shaders.ps;
8216 
8217  /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
8218  * so a linear search is more performant than a hashmap or a binary search
8219  * (cache coherency etc)
8220  */
8221  for (i = 0; i < shader_data->num_gl_shaders; ++i)
8222  {
8223  if (!memcmp(&gl_shaders[i].args, args, sizeof(*args)))
8224  {
8225  if (args->np2_fixup)
8226  *np2fixup_info = &gl_shaders[i].np2fixup;
8227  return gl_shaders[i].id;
8228  }
8229  }
8230 
8231  TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
8232  if (shader_data->shader_array_size == shader_data->num_gl_shaders)
8233  {
8234  if (shader_data->num_gl_shaders)
8235  {
8236  new_size = shader_data->shader_array_size + max(1, shader_data->shader_array_size / 2);
8237  new_array = heap_realloc(shader_data->gl_shaders.ps, new_size * sizeof(*gl_shaders));
8238  }
8239  else
8240  {
8241  new_array = heap_alloc(sizeof(*gl_shaders));
8242  new_size = 1;
8243  }
8244 
8245  if(!new_array) {
8246  ERR("Out of memory\n");
8247  return 0;
8248  }
8249  shader_data->gl_shaders.ps = new_array;
8250  shader_data->shader_array_size = new_size;
8251  gl_shaders = new_array;
8252  }
8253 
8254  gl_shaders[shader_data->num_gl_shaders].args = *args;
8255 
8256  np2fixup = &gl_shaders[shader_data->num_gl_shaders].np2fixup;
8257  memset(np2fixup, 0, sizeof(*np2fixup));
8258  *np2fixup_info = args->np2_fixup ? np2fixup : NULL;
8259 
8261 
8263  ret = shader_glsl_generate_pshader(context, buffer, string_buffers, shader, args, np2fixup);
8264  gl_shaders[shader_data->num_gl_shaders++].id = ret;
8265 
8266  return ret;
8267 }
unsigned int num_gl_shaders
Definition: glsl_shader.c:321
#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:318
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:278
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:7357
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:4163
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:431
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:277
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:321

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 8287 of file glsl_shader.c.

8289 {
8290  UINT i;
8291  DWORD new_size;
8292  DWORD use_map = context->stream_info.use_map;
8293  struct glsl_vs_compiled_shader *gl_shaders, *new_array;
8294  struct glsl_shader_private *shader_data;
8295  GLuint ret;
8296 
8297  if (!shader->backend_data)
8298  {
8299  if (!(shader->backend_data = heap_alloc_zero(sizeof(*shader_data))))
8300  {
8301  ERR("Failed to allocate backend data.\n");
8302  return 0;
8303  }
8304  }
8305  shader_data = shader->backend_data;
8306  gl_shaders = shader_data->gl_shaders.vs;
8307 
8308  /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
8309  * so a linear search is more performant than a hashmap or a binary search
8310  * (cache coherency etc)
8311  */
8312  for (i = 0; i < shader_data->num_gl_shaders; ++i)
8313  {
8314  if (vs_args_equal(&gl_shaders[i].args, args, use_map))
8315  return gl_shaders[i].id;
8316  }
8317 
8318  TRACE("No matching GL shader found for shader %p, compiling a new shader.\n", shader);
8319 
8320  if (shader_data->shader_array_size == shader_data->num_gl_shaders)
8321  {
8322  if (shader_data->num_gl_shaders)
8323  {
8324  new_size = shader_data->shader_array_size + max(1, shader_data->shader_array_size / 2);
8325  new_array = heap_realloc(shader_data->gl_shaders.vs, new_size * sizeof(*gl_shaders));
8326  }
8327  else
8328  {
8329  new_array = heap_alloc(sizeof(*gl_shaders));
8330  new_size = 1;
8331  }
8332 
8333  if(!new_array) {
8334  ERR("Out of memory\n");
8335  return 0;
8336  }
8337  shader_data->gl_shaders.vs = new_array;
8338  shader_data->shader_array_size = new_size;
8339  gl_shaders = new_array;
8340  }
8341 
8342  gl_shaders[shader_data->num_gl_shaders].args = *args;
8343 
8346  gl_shaders[shader_data->num_gl_shaders++].id = ret;
8347 
8348  return ret;
8349 }
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:8269
unsigned int num_gl_shaders
Definition: glsl_shader.c:321
#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:314
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:431
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:7693
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:120
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:321

Referenced by set_glsl_shader_program().

◆ gen_nv12_read()

static void gen_nv12_read ( struct wined3d_string_buffer buffer,
const struct wined3d_gl_info gl_info,
const char tex_type 
)
static

Definition at line 12372 of file glsl_shader.c.

12374 {
12375  char component = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? 'w' : 'x';
12376  const char *tex = needs_legacy_glsl_syntax(gl_info) ? tex_type : "";
12377 
12378  /* NV12 surfaces contain a WxH sized luminance plane, followed by a
12379  * (W/2)x(H/2) sized plane where each component is an UV pair. So the
12380  * effective bitdepth is 12 bits per pixel. If the whole texture is
12381  * interpreted as luminance data it looks approximately like this:
12382  *
12383  * +----------------------------------+----
12384  * | |
12385  * | |
12386  * | |
12387  * | |
12388  * | | 2
12389  * | LUMINANCE | -
12390  * | | 3
12391  * | |
12392  * | |
12393  * | |
12394  * | |
12395  * +----------------------------------+----
12396  * |UVUVUVUVUVUVUVUVUVUVUVUVUVUVUVUVUV|
12397  * |UVUVUVUVUVUVUVUVUVUVUVUVUVUVUVUVUV|
12398  * | | 1
12399  * | | -
12400  * | | 3
12401  * | |
12402  * | |
12403  * +----------------------------------+---- */
12404 
12405  /* First sample the chroma values. */
12406  shader_addline(buffer, " texcoord.xy = out_texcoord.xy;\n");
12407  /* We only have half the number of chroma pixels. */
12408  shader_addline(buffer, " texcoord.x *= 0.5;\n");
12409  shader_addline(buffer, " texcoord.y = (texcoord.y + 2.0) / 3.0;\n");
12410 
12411  /* We must not allow filtering horizontally, this would mix U and V.
12412  * Vertical filtering is ok. However, bear in mind that the pixel center
12413  * is at 0.5, so add 0.5. */
12414 
12415  /* Convert to non-normalised coordinates so we can find the individual
12416  * pixel. */
12417  shader_addline(buffer, " texcoord.x = floor(texcoord.x * size.x);\n");
12418  /* Multiply by 2 since chroma components are stored in UV pixel pairs, add
12419  * 0.5 to hit the center of the pixel. Then convert back to normalised
12420  * coordinates. */
12421  shader_addline(buffer, " texcoord.x = (texcoord.x * 2.0 + 0.5) / size.x;\n");
12422  /* Clamp, keep the half pixel origin in mind. */
12423  shader_addline(buffer, " texcoord.y = max(texcoord.y, 2.0 / 3.0 + 0.5 / size.y);\n");
12424 
12425  shader_addline(buffer, " chroma.y = texture%s(sampler, texcoord.xy).%c;\n", tex, component);
12426  /* Add 1.0 / size.x to sample the adjacent texel. */
12427  shader_addline(buffer, " texcoord.x += 1.0 / size.x;\n");
12428  shader_addline(buffer, " chroma.x = texture%s(sampler, texcoord.xy).%c;\n", tex, component);
12429 
12430  /* Sample the luminance value. It is in the top 2/3rd of the texture, so
12431  * scale the y coordinate. Clamp the y coordinate to prevent the chroma
12432  * values from bleeding into the sampled luminance values due to
12433  * filtering. */
12434  shader_addline(buffer, " texcoord.xy = out_texcoord.xy;\n");
12435  /* Multiply the y coordinate by 2/3 and clamp it. */
12436  shader_addline(buffer, " texcoord.y = min(texcoord.y * 2.0 / 3.0, 2.0 / 3.0 - 0.5 / size.y);\n");
12437  shader_addline(buffer, " luminance = texture%s(sampler, texcoord.xy).%c;\n", tex, component);
12438 }
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:487
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1813
GLuint buffer
Definition: glext.h:5915
BOOL supported[WINED3D_GL_EXT_COUNT]
static const char * tex_type[]
Definition: shader.c:2184

Referenced by glsl_blitter_generate_yuv_shader().

◆ gen_packed_yuv_read()

static void gen_packed_yuv_read ( struct wined3d_string_buffer buffer,
const struct wined3d_gl_info gl_info,
const struct glsl_blitter_args args,
const char tex_type 
)
static

Definition at line 12193 of file glsl_shader.c.

12196 {
12198  char chroma, luminance;
12199  const char *tex;
12200 
12201  /* The YUY2 and UYVY formats contain two pixels packed into a 32 bit
12202  * macropixel, giving effectively 16 bits per pixel. The color consists of
12203  * a luminance(Y) and two chroma(U and V) values. Each macropixel has two
12204  * luminance values, one for each single pixel it contains, and one U and
12205  * one V value shared between both pixels.
12206  *
12207  * The data is loaded into an A8L8 texture. With YUY2, the luminance
12208  * component contains the luminance and alpha the chroma. With UYVY it is
12209  * vice versa. Thus take the format into account when generating the read
12210  * swizzles
12211  *
12212  * Reading the Y value is straightforward - just sample the texture. The
12213  * hardware takes care of filtering in the horizontal and vertical
12214  * direction.
12215  *
12216  * Reading the U and V values is harder. We have to avoid filtering
12217  * horizontally, because that would mix the U and V values of one pixel or
12218  * two adjacent pixels. Thus floor the texture coordinate and add 0.5 to
12219  * get an unfiltered read, regardless of the filtering setting. Vertical
12220  * filtering works automatically though - the U and V values of two rows
12221  * are mixed nicely.
12222  *
12223  * Apart of avoiding filtering issues, the code has to know which value it
12224  * just read, and where it can find the other one. To determine this, it
12225  * checks if it sampled an even or odd pixel, and shifts the 2nd read
12226  * accordingly.
12227  *
12228  * Handling horizontal filtering of U and V values requires reading a 2nd
12229  * pair of pixels, extracting U and V and mixing them. This is not
12230  * implemented yet.
12231  *
12232  * An alternative implementation idea is to load the texture as A8R8G8B8
12233  * texture, with width / 2. This way one read gives all 3 values, finding
12234  * U and V is easy in an unfiltered situation. Finding the luminance on
12235  * the other hand requires finding out if it is an odd or even pixel. The
12236  * real drawback of this approach is filtering. This would have to be
12237  * emulated completely in the shader, reading up two 2 packed pixels in up
12238  * to 2 rows and interpolating both horizontally and vertically. Beyond
12239  * that it would require adjustments to the texture handling code to deal
12240  * with the width scaling. */
12241 
12243  {
12244  chroma = 'x';
12245  luminance = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? 'w' : 'y';
12246  }
12247  else
12248  {
12249  chroma = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? 'w' : 'y';
12250  luminance = 'x';
12251  }
12252 
12253  tex = needs_legacy_glsl_syntax(gl_info) ? tex_type : "";
12254 
12255  /* First we have to read the chroma values. This means we need at least
12256  * two pixels (no filtering), or 4 pixels (with filtering). To get the
12257  * unmodified chroma, we have to rid ourselves of the filtering when we
12258  * sample the texture. */
12259  shader_addline(buffer, " texcoord.xy = out_texcoord.xy;\n");
12260  /* We must not allow filtering between pixel x and x+1, this would mix U
12261  * and V. Vertical filtering is ok. However, bear in mind that the pixel
12262  * center is at 0.5, so add 0.5. */
12263  shader_addline(buffer, " texcoord.x = (floor(texcoord.x * size.x) + 0.5) / size.x;\n");
12264  shader_addline(buffer, " luminance = texture%s(sampler, texcoord.xy).%c;\n", tex, chroma);
12265 
12266  /* Multiply the x coordinate by 0.5 and get the fraction. This gives 0.25
12267  * and 0.75 for the even and odd pixels respectively. */
12268  /* Put the value into either of the chroma values. */
12269  shader_addline(buffer, " bool even = fract(texcoord.x * size.x * 0.5) < 0.5;\n");
12270  shader_addline(buffer, " if (even)\n");
12271  shader_addline(buffer, " chroma.y = luminance;\n");
12272  shader_addline(buffer, " else\n");
12273  shader_addline(buffer, " chroma.x = luminance;\n");
12274 
12275  /* Sample pixel 2. If we read an even pixel, sample the pixel right to the
12276  * current one. Otherwise, sample the left pixel. */
12277  shader_addline(buffer, " texcoord.x += even ? 1.0 / size.x : -1.0 / size.x;\n");
12278  shader_addline(buffer, " luminance = texture%s(sampler, texcoord.xy).%c;\n", tex, chroma);
12279 
12280  /* Put the value into the other chroma. */
12281  shader_addline(buffer, " if (even)\n");
12282  shader_addline(buffer, " chroma.x = luminance;\n");
12283  shader_addline(buffer, " else\n");
12284  shader_addline(buffer, " chroma.y = luminance;\n");
12285 
12286  /* TODO: If filtering is enabled, sample a 2nd pair of pixels left or right of
12287  * the current one and lerp the two U and V values. */
12288 
12289  /* This gives the correctly filtered luminance value. */
12290  shader_addline(buffer, " luminance = texture%s(sampler, out_texcoord.xy).%c;\n", tex, luminance);
12291 }
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:487
complex_fixup
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1813
GLuint buffer
Definition: glext.h:5915
Definition: match.c:390
BOOL supported[WINED3D_GL_EXT_COUNT]
static const char * tex_type[]
Definition: shader.c:2184
static enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)

Referenced by glsl_blitter_generate_yuv_shader().

◆ gen_yv12_read()

static void gen_yv12_read ( struct wined3d_string_buffer buffer,
const struct wined3d_gl_info gl_info,
const char tex_type 
)
static

Definition at line 12293 of file glsl_shader.c.

12295 {
12296  char component = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? 'w' : 'x';
12297  const char *tex = needs_legacy_glsl_syntax(gl_info) ? tex_type : "";
12298 
12299  /* YV12 surfaces contain a WxH sized luminance plane, followed by a
12300  * (W/2)x(H/2) V and a (W/2)x(H/2) U plane, each with 8 bit per pixel. So
12301  * the effective bitdepth is 12 bits per pixel. Since the U and V planes
12302  * have only half the pitch of the luminance plane, the packing into the
12303  * gl texture is a bit unfortunate. If the whole texture is interpreted as
12304  * luminance data it looks approximately like this:
12305  *
12306  * +----------------------------------+----
12307  * | |
12308  * | |
12309  * | |
12310  * | |
12311  * | | 2
12312  * | LUMINANCE | -
12313  * | | 3
12314  * | |
12315  * | |
12316  * | |
12317  * | |
12318  * +----------------+-----------------+----
12319  * | | |
12320  * | V even rows | V odd rows |
12321  * | | | 1
12322  * +----------------+------------------ -
12323  * | | | 3
12324  * | U even rows | U odd rows |
12325  * | | |
12326  * +----------------+-----------------+----
12327  * | | |
12328  * | 0.5 | 0.5 |
12329  *
12330  * So it appears as if there are 4 chroma images, but in fact the odd rows
12331  * in the chroma images are in the same row as the even ones. So it is
12332  * kinda tricky to read. */
12333 
12334  /* First sample the chroma values. */
12335  shader_addline(buffer, " texcoord.xy = out_texcoord.xy;\n");
12336  /* The chroma planes have only half the width. */
12337  shader_addline(buffer, " texcoord.x *= 0.5;\n");
12338 
12339  /* The first value is between 2/3 and 5/6 of the texture's height, so
12340  * scale+bias the coordinate. Also read the right side of the image when
12341  * reading odd lines.
12342  *
12343  * Don't forget to clamp the y values in into the range, otherwise we'll
12344  * get filtering bleeding. */
12345 
12346  /* Read odd lines from the right side (add 0.5 to the x coordinate). */
12347  shader_addline(buffer, " if (fract(floor(texcoord.y * size.y) * 0.5 + 1.0 / 6.0) >= 0.5)\n");
12348  shader_addline(buffer, " texcoord.x += 0.5;\n");
12349 
12350  /* Clamp, keep the half pixel origin in mind. */
12351  shader_addline(buffer, " texcoord.y = clamp(2.0 / 3.0 + texcoord.y / 6.0, "
12352  "2.0 / 3.0 + 0.5 / size.y, 5.0 / 6.0 - 0.5 / size.y);\n");
12353 
12354  shader_addline(buffer, " chroma.x = texture%s(sampler, texcoord.xy).%c;\n", tex, component);
12355 
12356  /* The other chroma value is 1/6th of the texture lower, from 5/6th to
12357  * 6/6th No need to clamp because we're just reusing the already clamped
12358  * value from above. */
12359  shader_addline(buffer, " texcoord.y += 1.0 / 6.0;\n");
12360  shader_addline(buffer, " chroma.y = texture%s(sampler, texcoord.xy).%c;\n", tex, component);
12361 
12362  /* Sample the luminance value. It is in the top 2/3rd of the texture, so
12363  * scale the y coordinate. Clamp the y coordinate to prevent the chroma
12364  * values from bleeding into the sampled luminance values due to
12365  * filtering. */
12366  shader_addline(buffer, " texcoord.xy = out_texcoord.xy;\n");
12367  /* Multiply the y coordinate by 2/3 and clamp it. */
12368  shader_addline(buffer, " texcoord.y = min(texcoord.y * 2.0 / 3.0, 2.0 / 3.0 - 0.5 / size.y);\n");
12369  shader_addline(buffer, " luminance = texture%s(sampler, texcoord.xy).%c;\n", tex, component);
12370 }
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:487
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1813
GLuint buffer
Definition: glext.h:5915
BOOL supported[WINED3D_GL_EXT_COUNT]
static const char * tex_type[]
Definition: shader.c:2184

Referenced by glsl_blitter_generate_yuv_shader().

◆ get_attribute_keyword()

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

Definition at line 1829 of file glsl_shader.c.

1830 {
1831  return needs_legacy_glsl_syntax(gl_info) ? "attribute" : "in";
1832 }
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1813

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

◆ get_fragment_output()

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

Definition at line 1972 of file glsl_shader.c.

1973 {
1974  return needs_legacy_glsl_syntax(gl_info) ? "gl_FragData" : "ps_out";
1975 }
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1813

Referenced by glsl_blitter_generate_program().

◆ 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 6651 of file glsl_shader.c.

6653 {
6654  struct wine_rb_entry *entry;
6655 
6656  entry = wine_rb_get(&priv->program_lookup, key);
6657  return entry ? WINE_RB_ENTRY_VALUE(entry, struct glsl_shader_prog_link, program_lookup_entry) : NULL;
6658 }
struct wine_rb_tree program_lookup
Definition: glsl_shader.c:122
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 441 of file glsl_shader.c.

442 {
443  const char *p, *q;
444 
445  p = *ptr;
446  if (!(q = strstr(p, "\n")))
447  {
448  if (!*p) return NULL;
449  *ptr += strlen(p);
450  return p;
451  }
452  *ptr = q + 1;
453 
454  return p;
455 }
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 1448 of file glsl_shader.c.

1449 {
1450  int i, j;
1451 
1452  if (context->d3d_info->wined3d_creation_flags & WINED3D_LEGACY_FFP_LIGHTING)
1454  else
1455  invert_matrix(mat, mat);
1456  /* Tests show that singular modelview matrices are used unchanged as normal
1457  * matrices on D3D3 and older. There seems to be no clearly consistent
1458  * behavior on newer D3D versions so always follow older ddraw behavior. */
1459  for (i = 0; i < 3; ++i)
1460  for (j = 0; j < 3; ++j)
1461  normal[i * 3 + j] = (&mat->_11)[j * 4 + i];
1462 }
Definition: http.c:6587
BOOL invert_matrix_3d(struct wined3d_matrix *out, const struct wined3d_matrix *in)
Definition: utils.c:5373
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:5443
#define WINED3D_LEGACY_FFP_LIGHTING
Definition: wined3d.h:1325

Referenced by shader_glsl_load_constants().

◆ glsl_blitter_args_compare()

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

Definition at line 12134 of file glsl_shader.c.

12135 {
12136  const struct glsl_blitter_args *a = key;
12137  const struct glsl_blitter_args *b = &WINE_RB_ENTRY_VALUE(entry, const struct glsl_blitter_program, entry)->args;
12138 
12139  return memcmp(a, b, sizeof(*a));
12140 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#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
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by wined3d_glsl_blitter_create().

◆ glsl_blitter_blit()

static DWORD glsl_blitter_blit ( struct wined3d_blitter blitter,
enum wined3d_blit_op  op,
struct wined3d_context context,
struct wined3d_texture src_texture,
unsigned int  src_sub_resource_idx,
DWORD  src_location,
const RECT src_rect,
struct wined3d_texture dst_texture,
unsigned int  dst_sub_resource_idx,
DWORD  dst_location,
const RECT dst_rect,
const struct wined3d_color_key colour_key,
enum wined3d_texture_filter_type  filter 
)
static

Definition at line 12753 of file glsl_shader.c.

12758 {
12759  struct wined3d_device *device = dst_texture->resource.device;
12760  const struct wined3d_gl_info *gl_info = context->gl_info;
12761  struct wined3d_texture *staging_texture = NULL;
12762  struct wined3d_glsl_blitter *glsl_blitter;
12763  struct glsl_blitter_program *program;
12764  struct wined3d_blitter *next;
12765  unsigned int src_level;
12766  GLint location;
12767  RECT s, d;
12768 
12769  TRACE("blitter %p, op %#x, context %p, src_texture %p, src_sub_resource_idx %u, src_location %s, src_rect %s, "
12770  "dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_rect %s, colour_key %p, filter %s.\n",
12771  blitter, op, context, src_texture, src_sub_resource_idx, wined3d_debug_location(src_location),
12772  wine_dbgstr_rect(src_rect), dst_texture, dst_sub_resource_idx, wined3d_debug_location(dst_location),
12773  wine_dbgstr_rect(dst_rect), colour_key, debug_d3dtexturefiltertype(filter));
12774 
12775  if (!glsl_blitter_supported(op, context, src_texture, src_location, dst_texture, dst_location))
12776  {
12777  if (!(next = blitter->next))
12778  {
12779  ERR("No blitter to handle blit op %#x.\n", op);
12780  return dst_location;
12781  }
12782 
12783  TRACE("Forwarding to blitter %p.\n", next);
12784  return next->ops->blitter_blit(next, op, context, src_texture, src_sub_resource_idx, src_location,
12785  src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect, colour_key, filter);
12786  }
12787 
12788  glsl_blitter = CONTAINING_RECORD(blitter, struct wined3d_glsl_blitter, blitter);
12789 
12790  if (!(src_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU))
12791  {
12792  struct wined3d_resource_desc desc;
12793  struct wined3d_box upload_box;
12794  HRESULT hr;
12795 
12796  TRACE("Source texture is not GPU accessible, creating a staging texture.\n");
12797 
12798  src_level = src_sub_resource_idx % src_texture->level_count;
12799  desc.resource_type = WINED3D_RTYPE_TEXTURE_2D;
12800  desc.format = src_texture->resource.format->id;
12801  desc.multisample_type = src_texture->resource.multisample_type;
12802  desc.multisample_quality = src_texture->resource.multisample_quality;
12803  desc.usage = WINED3DUSAGE_PRIVATE;
12805  desc.width = wined3d_texture_get_level_width(src_texture, src_level);
12806  desc.height = wined3d_texture_get_level_height(src_texture, src_level);
12807  desc.depth = 1;
12808  desc.size = 0;
12809 
12810  if (FAILED(hr = wined3d_texture_create(device, &desc, 1, 1, 0,
12811  NULL, NULL, &wined3d_null_parent_ops, &staging_texture)))
12812  {
12813  ERR("Failed to create staging texture, hr %#x.\n", hr);
12814  return dst_location;
12815  }
12816 
12817  wined3d_box_set(&upload_box, 0, 0, desc.width, desc.height, 0, desc.depth);
12818  wined3d_texture_upload_from_texture(staging_texture, 0, 0, 0, 0,
12819  src_texture, src_sub_resource_idx, &upload_box);
12820 
12821  src_texture = staging_texture;
12822  src_sub_resource_idx = 0;
12823  }
12825  && (src_texture->sub_resources[src_sub_resource_idx].locations
12827  && !wined3d_resource_is_offscreen(&src_texture->resource))
12828  {
12829 
12830  /* Without FBO blits transferring from the drawable to the texture is
12831  * expensive, because we have to flip the data in sysmem. Since we can
12832  * flip in the blitter, we don't actually need that flip anyway. So we
12833  * use the surface's texture as scratch texture, and flip the source
12834  * rectangle instead. */
12835  texture2d_load_fb_texture(src_texture, src_sub_resource_idx, FALSE, context);
12836 
12837  s = *src_rect;
12838  src_level = src_sub_resource_idx % src_texture->level_count;
12839  s.top = wined3d_texture_get_level_height(src_texture, src_level) - s.top;
12840  s.bottom = wined3d_texture_get_level_height(src_texture, src_level) - s.bottom;
12841  src_rect = &s;
12842  }
12843  else
12844  {
12845  wined3d_texture_load(src_texture, context, FALSE);
12846  }
12847 
12849 
12850  if (dst_location == WINED3D_LOCATION_DRAWABLE)
12851  {
12852  d = *dst_rect;
12853  wined3d_texture_translate_drawable_coords(dst_texture, context->win_handle, &d);
12854  dst_rect = &d;
12855  }
12856 
12858  {
12859  GLenum buffer;
12860 
12861  if (dst_location == WINED3D_LOCATION_DRAWABLE)
12862  {
12863  TRACE("Destination texture %p is onscreen.\n", dst_texture);
12864  buffer = wined3d_texture_get_gl_buffer(dst_texture);
12865  }
12866  else
12867  {
12868  TRACE("Destination texture %p is offscreen.\n", dst_texture);
12870  }
12872  &dst_texture->resource, dst_sub_resource_idx, NULL, 0, dst_location);
12876  }
12877 
12878  if (!(program = glsl_blitter_get_program(glsl_blitter, context, src_texture)))
12879  {
12880  ERR("Failed to get blitter program.\n");
12881  return dst_location;
12882  }
12883  GL_EXTCALL(glUseProgram(program->id));
12884  switch (get_complex_fixup(program->args.fixup))
12885  {
12886  case COMPLEX_FIXUP_P8:
12887  glsl_blitter_upload_palette(glsl_blitter, context, src_texture);
12888  break;
12889 
12890  case COMPLEX_FIXUP_YUY2:
12891  case COMPLEX_FIXUP_UYVY:
12892  case COMPLEX_FIXUP_YV12:
12893  case COMPLEX_FIXUP_NV12:
12894  src_level = src_sub_resource_idx % src_texture->level_count;
12895  location = GL_EXTCALL(glGetUniformLocation(program->id, "size"));
12896  GL_EXTCALL(glUniform2f(location, wined3d_texture_get_level_pow2_width(src_texture, src_level),
12897  wined3d_texture_get_level_pow2_height(src_texture, src_level)));
12898  break;
12899 
12900  default:
12901  break;
12902  }
12903  context_draw_shaded_quad(context, src_texture, src_sub_resource_idx, src_rect, dst_rect, filter);
12904  GL_EXTCALL(glUseProgram(0));
12905 
12906  if (dst_texture->swapchain && (dst_texture->swapchain->front_buffer == dst_texture))
12907  gl_info->gl_ops.gl.p_glFlush();
12908 
12909  if (staging_texture)
12910  wined3d_texture_decref(staging_texture);
12911 
12912  return dst_location;
12913 }
#define ORM_FBO
void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device)
Definition: context.c:2748
static unsigned int wined3d_texture_get_level_height(const struct wined3d_texture *texture, unsigned int level)
struct opengl_funcs gl_ops
HRESULT hr
Definition: shlfolder.c:183
Definition: http.c:6587
struct wined3d_swapchain * swapchain
static unsigned int wined3d_texture_get_level_width(const struct wined3d_texture *texture, unsigned int level)
void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, struct wined3d_resource *rt, unsigned int rt_sub_resource_idx, struct wined3d_resource *ds, unsigned int ds_sub_resource_idx, DWORD location)
Definition: context.c:788
struct wined3d_blitter * next
struct wined3d_resource resource
GLuint buffer
Definition: glext.h:5915
void context_invalidate_state(struct wined3d_context *context, DWORD state)
Definition: context.c:1638
static BOOL glsl_blitter_supported(enum wined3d_blit_op blit_op, const struct wined3d_context *context, const struct wined3d_texture *src_texture, DWORD src_location, const struct wined3d_texture *dst_texture, DWORD dst_location)
static void wined3d_box_set(struct wined3d_box *box, unsigned int left, unsigned int top, unsigned int right, unsigned int bottom, unsigned int front, unsigned int back)
Definition: wined3d.h:2793
static struct glsl_blitter_program * glsl_blitter_get_program(struct wined3d_glsl_blitter *blitter, struct wined3d_context *context, const struct wined3d_texture *texture)
#define GL_COLOR_ATTACHMENT0
Definition: glext.h:1714
const char * wined3d_debug_location(DWORD location)
Definition: utils.c:6306
Definition: devices.h:37
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
#define WINED3D_LOCATION_DRAWABLE
void context_check_fbo_status(const struct wined3d_context *context, GLenum target)
Definition: context.c:382
void context_draw_shaded_quad(struct wined3d_context *context, struct wined3d_texture *texture, unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter)
Definition: context.c:5656
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static void glsl_blitter_upload_palette(struct wined3d_glsl_blitter *blitter, struct wined3d_context *context, const struct wined3d_texture *texture)
#define GL_DRAW_FRAMEBUFFER
Definition: glext.h:1699
#define GL_EXTCALL(f)
void texture2d_load_fb_texture(struct wined3d_texture *texture, unsigned int sub_resource_idx, BOOL srgb, struct wined3d_context *context)
Definition: surface.c:1215
#define TRACE(s)
Definition: solgame.cpp:4
#define d
Definition: ke_i.h:81
LONG HRESULT
Definition: typedefs.h:77
const char * debug_d3dtexturefiltertype(enum wined3d_texture_filter_type filter_type)
Definition: utils.c:4480
const char * wine_dbgstr_rect(const RECT *rect)
void wined3d_texture_upload_from_texture(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box)
Definition: texture.c:3528
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
Definition: resource.c:540
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture)
Definition: texture.c:91
void wined3d_texture_translate_drawable_coords(const struct wined3d_texture *texture, HWND window, RECT *rect)
Definition: texture.c:69
static unsigned int wined3d_texture_get_level_pow2_height(const struct wined3d_texture *texture, unsigned int level)
GLdouble s
Definition: gl.h:2039
unsigned int GLenum
Definition: gl.h:150
#define WINED3DUSAGE_PRIVATE
Definition: wined3d.h:925
#define WINED3D_RESOURCE_ACCESS_GPU
Definition: wined3d.h:55
#define location(file, line)
Definition: kmtest.h:18
struct wined3d_texture::wined3d_texture_sub_resource sub_resources[1]
#define ERR(fmt,...)
Definition: debug.h:109
static unsigned __int64 next
Definition: rand_nt.c:6
GLuint program
Definition: glext.h:6723
const struct wined3d_parent_ops wined3d_null_parent_ops
Definition: directx.c:6781
#define WINED3D_LOCATION_TEXTURE_RGB
void wined3d_texture_load(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
Definition: texture.c:1262
#define STATE_FRAMEBUFFER
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1219
int GLint
Definition: gl.h:156
UINT op
Definition: effect.c:223
void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer)
Definition: context.c:2470
static enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT layer_count, UINT level_count, DWORD flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
Definition: texture.c:3326
static unsigned int wined3d_texture_get_level_pow2_width(const struct wined3d_texture *texture, unsigned int level)

◆ glsl_blitter_clear()

static void glsl_blitter_clear ( struct wined3d_blitter blitter,
struct wined3d_device device,
unsigned int  rt_count,
const struct wined3d_fb_state fb,
unsigned int  rect_count,
const RECT clear_rects,
const RECT draw_rect,
DWORD  flags,
const struct wined3d_color color,
float  depth,
DWORD  stencil 
)
static

Definition at line 12915 of file glsl_shader.c.

12918 {
12919  struct wined3d_blitter *next;
12920 
12921  if ((next = blitter->next))
12922  next->ops->blitter_clear(next, device, rt_count, fb, rect_count,
12923  clear_rects, draw_rect, flags, color, depth, stencil);
12924 }
struct wined3d_blitter * next
GLint GLfloat GLint stencil
Definition: glext.h:6260
GLuint color
Definition: glext.h:6243
Definition: devices.h:37
GLbitfield flags
Definition: glext.h:7161
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
static unsigned __int64 next
Definition: rand_nt.c:6

◆ glsl_blitter_destroy()

static void glsl_blitter_destroy ( struct wined3d_blitter blitter,
struct wined3d_context context 
)
static

Definition at line 12155 of file glsl_shader.c.

12156 {
12157  const struct wined3d_gl_info *gl_info = context->gl_info;
12158  struct wined3d_glsl_blitter *glsl_blitter;
12159  struct wined3d_blitter *next;
12160 
12161  if ((next = blitter->next))
12162  next->ops->blitter_destroy(next, context);
12163 
12164  glsl_blitter = CONTAINING_RECORD(blitter, struct wined3d_glsl_blitter, blitter);
12165 
12166  if (glsl_blitter->palette_texture)
12167  gl_info->gl_ops.gl.p_glDeleteTextures(1, &glsl_blitter->palette_texture);
12168 
12171 
12172  heap_free(glsl_blitter);
12173 }
struct opengl_funcs gl_ops
Definition: http.c:6587
struct wined3d_blitter * next
struct wined3d_string_buffer_list string_buffers
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct wine_rb_tree programs
static void glsl_free_blitter_program(struct wine_rb_entry *entry, void *ctx)
static void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context)
Definition: rbtree.h:198
static unsigned __int64 next
Definition: rand_nt.c:6
void string_buffer_list_cleanup(struct wined3d_string_buffer_list *list)
Definition: shader.c:564
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ glsl_blitter_generate_p8_shader()

static void glsl_blitter_generate_p8_shader ( struct wined3d_string_buffer buffer,
const struct wined3d_gl_info gl_info,
const struct glsl_blitter_args args,
const char output,
const char tex_type,
const char swizzle 
)
static

Definition at line 12175 of file glsl_shader.c.

12178 {
12179  shader_addline(buffer, "uniform sampler1D sampler_palette;\n");
12180  shader_addline(buffer, "\nvoid main()\n{\n");
12181  /* The alpha-component contains the palette index. */
12182  shader_addline(buffer, " float index = texture%s(sampler, out_texcoord.%s).%c;\n",
12183  needs_legacy_glsl_syntax(gl_info) ? tex_type : "", swizzle,
12184  gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? 'w' : 'x');
12185  /* Scale the index by 255/256 and add a bias of 0.5 in order to sample in
12186  * the middle. */
12187  shader_addline(buffer, " index = (index * 255.0 + 0.5) / 256.0;\n");
12188  shader_addline(buffer, " %s = texture%s(sampler_palette, index);\n",
12189  output, needs_legacy_glsl_syntax(gl_info) ? "1D" : "");
12190  shader_addline(buffer, "}\n");
12191 }
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:487
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1813
GLuint buffer
Definition: glext.h:5915
BOOL supported[WINED3D_GL_EXT_COUNT]
static const char * tex_type[]
Definition: shader.c:2184
GLuint GLenum swizzle
Definition: glext.h:9511

Referenced by glsl_blitter_generate_program().

◆ glsl_blitter_generate_plain_shader()

static void glsl_blitter_generate_plain_shader ( struct wined3d_string_buffer buffer,
const struct wined3d_gl_info gl_info,
const struct glsl_blitter_args args,
const char output,
const char tex_type,
const char swizzle 
)
static

Definition at line 12487 of file glsl_shader.c.

12490 {
12491  shader_addline(buffer, "\nvoid main()\n{\n");
12492  shader_addline(buffer, " %s = texture%s(sampler, out_texcoord.%s);\n",
12493  output, needs_legacy_glsl_syntax(gl_info) ? tex_type : "", swizzle);
12495  shader_addline(buffer, "}\n");
12496 }
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:487
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1813
GLuint buffer
Definition: glext.h:5915
Definition: match.c:390
static const char * tex_type[]
Definition: shader.c:2184
#define WINED3DSP_WRITEMASK_ALL
static void shader_glsl_color_correction_ext(struct wined3d_string_buffer *buffer, const char *reg_name, DWORD mask, struct color_fixup_desc fixup)
Definition: glsl_shader.c:3383
GLuint GLenum swizzle
Definition: glext.h:9511

Referenced by glsl_blitter_generate_program().

◆ glsl_blitter_generate_program()

static GLuint glsl_blitter_generate_program ( struct wined3d_glsl_blitter blitter,
const struct wined3d_gl_info gl_info,
const struct glsl_blitter_args args 
)
static

Definition at line 12499 of file glsl_shader.c.

12501 {
12502  static const struct
12503  {
12504  GLenum texture_target;
12505  const char texture_type[7];
12506  const char texcoord_swizzle[4];
12507  }
12508  texture_data[] =
12509  {
12510  {GL_TEXTURE_2D, "2D", "xy"},
12511  {GL_TEXTURE_CUBE_MAP, "Cube", "xyz"},
12512  {GL_TEXTURE_RECTANGLE_ARB, "2DRect", "xy"},
12513  };
12514  static const char vshader_main[] =
12515  "\n"
12516  "void main()\n"
12517  "{\n"
12518  " gl_Position = vec4(pos, 0.0, 1.0);\n"
12519  " out_texcoord = texcoord;\n"
12520  "}\n";
12523  GLuint program, vshader_id, fshader_id;
12524  const char *tex_type, *swizzle, *ptr;
12525  unsigned int i;
12526  GLint loc;
12527 
12528  for (i = 0; i < ARRAY_SIZE(texture_data); ++i)
12529  {
12530  if (args->texture_type == texture_data[i].texture_target)
12531  {
12532  tex_type = texture_data[i].texture_type;
12533  swizzle = texture_data[i].texcoord_swizzle;
12534  break;
12535  }
12536  }
12537  if (i == ARRAY_SIZE(texture_data))
12538  {
12539  FIXME("Unsupported texture type %#x.\n", args->texture_type);
12540  return 0;
12541  }
12542 
12543  program = GL_EXTCALL(glCreateProgram());
12544 
12545  vshader_id = GL_EXTCALL(glCreateShader(GL_VERTEX_SHADER));
12546 
12549  shader_addline(buffer, "%s vec2 pos;\n", get_attribute_keyword(gl_info));
12550  shader_addline(buffer, "%s vec3 texcoord;\n", get_attribute_keyword(gl_info));
12551  declare_out_varying(gl_info, buffer, FALSE, "vec3 out_texcoord;\n");
12552  shader_addline(buffer, vshader_main);
12553 
12554  ptr = buffer->buffer;
12555  GL_EXTCALL(glShaderSource(vshader_id, 1, &ptr, NULL));
12556  GL_EXTCALL(glAttachShader(program, vshader_id));
12557  GL_EXTCALL(glDeleteShader(vshader_id));
12558 
12559  fshader_id = GL_EXTCALL(glCreateShader(GL_FRAGMENT_SHADER));
12560 
12563  shader_addline(buffer, "uniform sampler%s sampler;\n", tex_type);
12564  declare_in_varying(gl_info, buffer, FALSE, "vec3 out_texcoord;\n");
12565  if (!needs_legacy_glsl_syntax(gl_info))
12566  shader_addline(buffer, "out vec4 ps_out[1];\n");
12567 
12569  string_buffer_sprintf(output, "%s[0]", get_fragment_output(gl_info));
12570 
12571  switch (complex_fixup)
12572  {
12573  case COMPLEX_FIXUP_P8:
12575  break;
12576  case COMPLEX_FIXUP_YUY2:
12577  case COMPLEX_FIXUP_UYVY:
12578  case COMPLEX_FIXUP_YV12:
12579  case COMPLEX_FIXUP_NV12:
12581  break;
12582  case COMPLEX_FIXUP_NONE:
12584  }
12585 
12587 
12588  ptr = buffer->buffer;
12589  GL_EXTCALL(glShaderSource(fshader_id, 1, &ptr, NULL));
12591  GL_EXTCALL(glAttachShader(program, fshader_id));
12592  GL_EXTCALL(glDeleteShader(fshader_id));
12593 
12594  GL_EXTCALL(glBindAttribLocation(program, 0, "pos"));
12595  GL_EXTCALL(glBindAttribLocation(program, 1, "texcoord"));
12596 
12597  if (!needs_legacy_glsl_syntax(gl_info))
12598  GL_EXTCALL(glBindFragDataLocation(program, 0, "ps_out"));
12599 
12600  GL_EXTCALL(glCompileShader(vshader_id));
12601  print_glsl_info_log(gl_info, vshader_id, FALSE);
12602  GL_EXTCALL(glCompileShader(fshader_id));
12603  print_glsl_info_log(gl_info, fshader_id, FALSE);
12604  GL_EXTCALL(glLinkProgram(program));
12606 
12607  GL_EXTCALL(glUseProgram(program));
12608  loc = GL_EXTCALL(glGetUniformLocation(program, "sampler"));
12609  GL_EXTCALL(glUniform1i(loc, 0));
12611  {
12612  loc = GL_EXTCALL(glGetUniformLocation(program, "sampler_palette"));
12613  GL_EXTCALL(glUniform1i(loc, 1));
12614  }
12615 
12616  return program;
12617 }
struct wined3d_string_buffer * string_buffer_get(struct wined3d_string_buffer_list *list)
Definition: shader.c:504
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:487
void print_glsl_info_log(const struct wined3d_gl_info *gl_info, GLuint id, BOOL program)
Definition: glsl_shader.c:458
complex_fixup
static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1813
struct wined3d_string_buffer_list string_buffers
static const char * get_fragment_output(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1972
static const char * get_attribute_keyword(const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:1829
GLuint buffer
Definition: glext.h:5915
Definition: match.c:390
#define GL_VERTEX_SHADER
Definition: glext.h:420
#define GL_TEXTURE_RECTANGLE_ARB
Definition: glext.h:1614
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 shader_glsl_validate_link(const struct wined3d_gl_info *gl_info, GLuint program)
Definition: glsl_shader.c:576
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
static void glsl_blitter_generate_plain_shader(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *output, const char *tex_type, const char *swizzle)
void string_buffer_clear(struct wined3d_string_buffer *buffer)
Definition: shader.c:431
static void glsl_blitter_generate_p8_shader(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *output, const char *tex_type, const char *swizzle)
#define GL_EXTCALL(f)
static const char * tex_type[]
Definition: shader.c:2184
#define GL_TEXTURE_CUBE_MAP
Definition: gl.h:1788
void string_buffer_sprintf(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:535
unsigned int GLenum
Definition: gl.h:150
unsigned int GLuint
Definition: gl.h:159
GLuint program
Definition: glext.h:6723
#define ARRAY_SIZE(a)
Definition: main.h:24
#define GL_TEXTURE_2D
Definition: gl.h:645
GLuint GLenum swizzle
Definition: glext.h:9511
int GLint
Definition: gl.h:156
static enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)
void string_buffer_release(struct wined3d_string_buffer_list *list, struct wined3d_string_buffer *buffer)
Definition: shader.c:552
static void glsl_blitter_generate_yuv_shader(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *output, const char *tex_type, const char *swizzle)
#define GL_FRAGMENT_SHADER
Definition: glext.h:419
static void shader_glsl_add_version_declaration(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info)
Definition: glsl_shader.c:403

Referenced by glsl_blitter_get_program().

◆ glsl_blitter_generate_yuv_shader()

static void glsl_blitter_generate_yuv_shader ( struct wined3d_string_buffer buffer,
const struct wined3d_gl_info gl_info,
const struct glsl_blitter_args args,
const char output,
const char tex_type,
const char swizzle 
)
static

Definition at line 12440 of file glsl_shader.c.

12443 {
12445 
12446  shader_addline(buffer, "const vec4 yuv_coef = vec4(1.403, -0.344, -0.714, 1.770);\n");
12447  shader_addline(buffer, "float luminance;\n");
12448  shader_addline(buffer, "vec2 texcoord;\n");
12449  shader_addline(buffer, "vec2 chroma;\n");
12450  shader_addline(buffer, "uniform vec2 size;\n");
12451 
12452  shader_addline(buffer, "\nvoid main()\n{\n");
12453 
12454  switch (complex_fixup)
12455  {
12456  case COMPLEX_FIXUP_UYVY:
12457  case COMPLEX_FIXUP_YUY2:
12459  break;
12460 
12461  case COMPLEX_FIXUP_YV12:
12462  gen_yv12_read(buffer, gl_info, tex_type);
12463  break;
12464 
12465  case COMPLEX_FIXUP_NV12:
12466  gen_nv12_read(buffer, gl_info, tex_type);
12467  break;
12468 
12469  default:
12470  FIXME("Unsupported fixup %#x.\n", complex_fixup);
12472  return;
12473  }
12474 
12475  /* Calculate the final result. Formula is taken from
12476  * http://www.fourcc.org/fccyvrgb.php. Note that the chroma
12477  * ranges from -0.5 to 0.5. */
12478  shader_addline(buffer, "\n chroma.xy -= 0.5;\n");
12479 
12480  shader_addline(buffer, " %s.x = luminance + chroma.x * yuv_coef.x;\n", output);
12481  shader_addline(buffer, " %s.y = luminance + chroma.y * yuv_coef.y + chroma.x * yuv_coef.z;\n", output);
12482  shader_addline(buffer, " %s.z = luminance + chroma.y * yuv_coef.w;\n", output);
12483 
12484  shader_addline(buffer, "}\n");
12485 }
static void gen_packed_yuv_read(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args, const char *tex_type)
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:487
complex_fixup
GLuint buffer
Definition: glext.h:5915
Definition: match.c:390
#define FIXME(fmt,...)
Definition: debug.h:110
void string_buffer_free(struct wined3d_string_buffer *buffer)
Definition: shader.c:450
static void gen_nv12_read(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const char *tex_type)
static void gen_yv12_read(struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, const char *tex_type)
static const char * tex_type[]
Definition: shader.c:2184
static enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)

Referenced by glsl_blitter_generate_program().

◆ glsl_blitter_get_program()

static struct glsl_blitter_program* glsl_blitter_get_program ( struct wined3d_glsl_blitter blitter,
struct wined3d_context context,
const struct wined3d_texture texture 
)
static

Definition at line 12655 of file glsl_shader.c.

12657 {
12658  const struct wined3d_gl_info *gl_info = context->gl_info;
12659  struct glsl_blitter_program *program;
12660  struct glsl_blitter_args args;
12661  struct wine_rb_entry *entry;
12662 
12663  memset(&args, 0, sizeof(args));
12664  args.texture_type = texture->target;
12665  args.fixup = texture->resource.format->color_fixup;
12666 
12667  if ((entry = wine_rb_get(&blitter->programs, &args)))
12669 
12670  if (!(program = heap_alloc(sizeof(*program))))
12671  {
12672  ERR("Failed to allocate blitter program memory.\n");
12673  return NULL;
12674  }
12675 
12676  program->args = args;
12677  if (!(program->id = glsl_blitter_generate_program(blitter, gl_info, &args)))
12678  {
12679  WARN("Failed to generate blitter program.\n");
12680  heap_free(program);
12681  return NULL;
12682  }
12683 
12684  if (wine_rb_put(&blitter->programs, &program->args, &program->entry) == -1)
12685  {
12686  ERR("Failed to store blitter program.\n");
12687  GL_EXTCALL(glDeleteProgram(program->id));
12688  heap_free(program);
12689  return NULL;
12690  }
12691 
12692  return program;
12693 }
static GLuint glsl_blitter_generate_program(struct wined3d_glsl_blitter *blitter, const struct wined3d_gl_info *gl_info, const struct glsl_blitter_args *args)
Definition: http.c:6587
#define WARN(fmt,...)
Definition: debug.h:111
Definition: match.c:390
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
struct wine_rb_tree programs
#define GL_EXTCALL(f)
GLenum GLuint texture
Definition: glext.h:6295
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
uint32_t entry
Definition: isohybrid.c:63
#define ERR(fmt,...)
Definition: debug.h:109
GLuint program
Definition: glext.h:6723
Definition: rbtree.h:35
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
Definition: rbtree.h:215
static struct wine_rb_entry * wine_rb_get(const struct wine_rb_tree *tree, const void *key)
Definition: rbtree.h:203
#define memset(x, y, z)
Definition: compat.h:39
#define args
Definition: format.c:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by glsl_blitter_blit().

◆ glsl_blitter_supported()

static BOOL glsl_blitter_supported ( enum wined3d_blit_op  blit_op,
const struct wined3d_context context,
const struct wined3d_texture src_texture,
DWORD  src_location,
const struct wined3d_texture dst_texture,
DWORD  dst_location 
)
static

Definition at line 12695 of file glsl_shader.c.

12698 {
12699  const struct wined3d_resource *src_resource = &src_texture->resource;
12700  const struct wined3d_resource *dst_resource = &dst_texture->resource;
12701  const struct wined3d_format *src_format = src_resource->format;
12702  const struct wined3d_format *dst_format = dst_resource->format;
12703  BOOL decompress;
12704 
12705  if (blit_op == WINED3D_BLIT_OP_RAW_BLIT && dst_format->id == src_format->id)
12706  {
12708  blit_op = WINED3D_BLIT_OP_DEPTH_BLIT;
12709  else
12710  blit_op = WINED3D_BLIT_OP_COLOR_BLIT;
12711  }
12712 
12713  if (blit_op != WINED3D_BLIT_OP_COLOR_BLIT)
12714  {
12715  TRACE("Unsupported blit_op %#x.\n", blit_op);
12716  return FALSE;
12717  }
12718 
12719  if (src_resource->type != WINED3D_RTYPE_TEXTURE_2D)
12720  return FALSE;
12721 
12722  if (src_texture->target == GL_TEXTURE_2D_MULTISAMPLE
12723  || dst_texture->target == GL_TEXTURE_2D_MULTISAMPLE
12724  || src_texture->target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY
12725  || dst_texture->target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY)
12726  {
12727  TRACE("Multi-sample textures not supported.\n");
12728  return FALSE;
12729  }
12730 
12731  /* We don't necessarily want to blit from resources without
12732  * WINED3D_RESOURCE_ACCESS_GPU, but that may be the only way to decompress
12733  * compressed textures. */
12734  decompress = src_format && (src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED)
12736  if (!decompress && !(src_resource->access & dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU))
12737  {
12738  TRACE("Source or destination resource does not have GPU access.\n");
12739  return FALSE;
12740  }
12741 
12742  if (!is_identity_fixup(dst_format->color_fixup)
12743  && (dst_format->id != src_format->id || dst_location != WINED3D_LOCATION_DRAWABLE))
12744  {
12745  TRACE("Destination fixups are not supported.\n");
12746  return FALSE;
12747  }
12748 
12749  TRACE("Returning supported.\n");
12750  return TRUE;
12751 }
#define WINED3DFMT_FLAG_STENCIL
enum wined3d_resource_type type
#define TRUE
Definition: types.h:120
static const char * dst_format
Definition: dib.c:1133
unsigned int access
struct wined3d_resource resource
const struct wined3d_format * format
#define GL_TEXTURE_2D_MULTISAMPLE
Definition: glext.h:1939
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WINED3D_LOCATION_DRAWABLE
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL is_identity_fixup(struct color_fixup_desc fixup)
enum wined3d_format_id id
#define WINED3D_RESOURCE_ACCESS_GPU
Definition: wined3d.h:55
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY
Definition: glext.h:1941
#define WINED3DFMT_FLAG_COMPRESSED
unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]
#define WINED3DFMT_FLAG_DEPTH

Referenced by glsl_blitter_blit().

◆ glsl_blitter_upload_palette()

static void glsl_blitter_upload_palette ( struct wined3d_glsl_blitter blitter,
struct wined3d_context context,
const struct wined3d_texture texture 
)
static

Definition at line 12620 of file glsl_shader.c.

12622 {
12623  const struct wined3d_gl_info *gl_info = context->gl_info;
12624  const struct wined3d_palette *palette;
12625 
12626  palette = texture->swapchain ? texture->swapchain->palette : NULL;
12627 
12628  if (!blitter->palette_texture)
12629  gl_info->gl_ops.gl.p_glGenTextures(1, &blitter->palette_texture);
12630 
12631  context_active_texture(context, gl_info, 1);
12632  gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, blitter->palette_texture);
12633  gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
12634  gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
12635  gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
12636 
12637  if (palette)
12638  {
12639  gl_info->gl_ops.gl.p_glTexImage1D(GL_TEXTURE_1D, 0, GL_RGB, 256, 0, GL_BGRA,
12641  }
12642  else
12643  {
12644  static const DWORD black;
12645 
12646  FIXME("P8 texture loaded without a palette.\n");
12647  gl_info->gl_ops.gl.p_glTexImage1D(GL_TEXTURE_1D, 0, GL_RGB, 1, 0, GL_BGRA,
12648  GL_UNSIGNED_INT_8_8_8_8_REV, &black);
12649  }
12650 
12651  context_active_texture(context, gl_info, 0);
12652 }
struct opengl_funcs gl_ops
#define GL_CLAMP_TO_EDGE
Definition: gl.h:1481
Definition: http.c:6587
void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, unsigned int unit)
Definition: context.c:2486
#define GL_NEAREST
Definition: gl.h:678
#define GL_BGRA
Definition: gl.h:1485
#define GL_TEXTURE_1D
Definition: gl.h:644
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define GL_TEXTURE_MIN_FILTER
Definition: gl.h:649
GLenum GLuint texture
Definition: glext.h:6295
#define GL_TEXTURE_WRAP_S
Definition: gl.h:646
#define GL_UNSIGNED_INT_8_8_8_8_REV
Definition: gl.h:1495
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GL_RGB
Definition: gl.h:502
static HPALETTE palette
Definition: clipboard.c:1345
#define GL_TEXTURE_MAG_FILTER
Definition: gl.h:648

Referenced by glsl_blitter_blit().

◆ 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 11793 of file glsl_shader.c.

11794 {
11795  struct shader_glsl_priv *priv;
11796 
11797  if (shader_backend == &glsl_shader_backend)
11798  {
11799  priv = shader_priv;
11801  return priv;
11802  }
11803 
11804  FIXME("GLSL fragment pipe without GLSL shader backend not implemented.\n");
11805 
11806  return NULL;
11807 }
struct wine_rb_tree ffp_fragment_shaders
Definition: glsl_shader.c:131
#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:6140
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 12090 of file glsl_shader.c.

12091 {
12092  return TRUE;
12093 }
#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 11935 of file glsl_shader.c.

11937 {
11938  const struct wined3d_gl_info *gl_info = context->gl_info;
11939 
11940  if (state->render_states[WINED3D_RS_ALPHATESTENABLE])
11941  {
11942  gl_info->gl_ops.gl.p_glEnable(GL_ALPHA_TEST);
11943  checkGLcall("glEnable(GL_ALPHA_TEST)");
11944  }
11945  else
11946  {
11947  gl_info->gl_ops.gl.p_glDisable(GL_ALPHA_TEST);
11948  checkGLcall("glDisable(GL_ALPHA_TEST)");
11949  }
11950 }
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 11915 of file glsl_shader.c.

11917 {
11918  const struct wined3d_gl_info *gl_info = context->gl_info;
11920  float ref = state->render_states[WINED3D_RS_ALPHAREF] / 255.0f;
11921 
11922  if (func)
11923  {
11924  gl_info->gl_ops.gl.p_glAlphaFunc(func, ref);
11925  checkGLcall("glAlphaFunc");
11926  }
11927 }
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:344
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 11958 of file glsl_shader.c.

11960 {
11961  context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_COLOR_KEY;
11962 }
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 11929 of file glsl_shader.c.

11931 {
11932  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
11933 }
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 11952 of file glsl_shader.c.

11954 {
11955  context->constant_update_mask |= WINED3D_SHADER_CONST_PS_ALPHA_TEST;
11956 }
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 11745 of file glsl_shader.c.

11746 {
11747  /* Nothing to do. */
11748 }

◆ 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 11850 of file glsl_shader.c.

11852 {
11853  BOOL use_vshader = use_vs(state);
11854  enum fogsource new_source;
11855  DWORD fogstart = state->render_states[WINED3D_RS_FOGSTART];
11856  DWORD fogend = state->render_states[WINED3D_RS_FOGEND];
11857 
11858  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
11859 
11860  if (!state->render_states[WINED3D_RS_FOGENABLE])
11861  return;
11862 
11863  if (state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3D_FOG_NONE)
11864  {
11865  if (use_vshader)
11866  new_source = FOGSOURCE_VS;
11867  else if (state->render_states[WINED3D_RS_FOGVERTEXMODE] == WINED3D_FOG_NONE || context->stream_info.position_transformed)
11868  new_source = FOGSOURCE_COORD;
11869  else
11870  new_source = FOGSOURCE_FFP;
11871  }
11872  else
11873  {
11874  new_source = FOGSOURCE_FFP;
11875  }
11876 
11877  if (new_source != context->fog_source || fogstart == fogend)
11878  {
11879  context->fog_source = new_source;
11880  context->constant_update_mask |= WINED3D_SHADER_CONST_PS_FOG;
11881  }
11882 }
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 11844 of file glsl_shader.c.

11846 {
11847  context->constant_update_mask |= WINED3D_SHADER_CONST_PS_FOG;
11848 }
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 11826 of file glsl_shader.c.

11827 {
11828  struct shader_glsl_priv *priv = device->fragment_priv;
11829  struct glsl_ffp_destroy_ctx ctx;
11830 
11831  ctx.priv = priv;
11832  ctx.gl_info = &device->adapter->gl_info;
11833  wine_rb_destroy(&priv->ffp_fragment_shaders, shader_glsl_free_ffp_fragment_shader, &ctx);
11834 }
static void shader_glsl_free_ffp_fragment_shader(struct wine_rb_entry *entry, void *context)
struct shader_glsl_priv * priv
Definition: glsl_shader.c:340
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 12095 of file glsl_shader.c.

12096 {
12097 }

◆ 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 11750 of file glsl_shader.c.

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

◆ 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 11786 of file glsl_shader.c.

11787 {
11788  if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
11790  return 0;
11791 }
const struct wined3d_gl_info * gl_info
Definition: glsl_shader.c:341
#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