ReactOS  0.4.14-dev-57-g333b8f1
arb_program_shader.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include "wined3d_private.h"
Include dependency graph for arb_program_shader.c:

Go to the source code of this file.

Classes

struct  control_frame
 
struct  arb_ps_np2fixup_info
 
struct  arb_ps_compile_args
 
struct  stb_const_desc
 
struct  arb_ps_compiled_shader
 
struct  arb_vs_compile_args
 
struct  arb_vs_compiled_shader
 
struct  recorded_instruction
 
struct  shader_arb_ctx_priv
 
struct  ps_signature
 
struct  arb_pshader_private
 
struct  arb_vshader_private
 
struct  shader_arb_priv
 
struct  color_fixup_masks
 
struct  arbfp_ffp_desc
 
struct  arbfp_blit_type
 
struct  arbfp_blit_desc
 
struct  wined3d_arbfp_blitter
 

Macros

#define TEX_PROJ   0x1
 
#define TEX_BIAS   0x2
 
#define TEX_LOD   0x4
 
#define TEX_DERIV   0x10
 
#define ARB_FFP_CONST_TFACTOR   0
 
#define ARB_FFP_CONST_COLOR_KEY_LOW   ((ARB_FFP_CONST_TFACTOR) + 1)
 
#define ARB_FFP_CONST_COLOR_KEY_HIGH   ((ARB_FFP_CONST_COLOR_KEY_LOW) + 1)
 
#define ARB_FFP_CONST_SPECULAR_ENABLE   ((ARB_FFP_CONST_COLOR_KEY_HIGH) + 1)
 
#define ARB_FFP_CONST_CONSTANT(i)   ((ARB_FFP_CONST_SPECULAR_ENABLE) + 1 + i)
 
#define ARB_FFP_CONST_BUMPMAT(i)   ((ARB_FFP_CONST_CONSTANT(7)) + 1 + i)
 
#define ARB_FFP_CONST_LUMINANCE(i)   ((ARB_FFP_CONST_BUMPMAT(7)) + 1 + i)
 
#define ARBFP_BLIT_PARAM_SIZE   0
 
#define ARBFP_BLIT_PARAM_COLOR_KEY_LOW   1
 
#define ARBFP_BLIT_PARAM_COLOR_KEY_HIGH   2
 

Enumerations

enum  arb_helper_value {
  ARB_ZERO, ARB_ONE, ARB_TWO, ARB_0001,
  ARB_EPS, ARB_VS_REL_OFFSET
}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d_shader)
 
 WINE_DECLARE_DEBUG_CHANNEL (d3d_constants)
 
 WINE_DECLARE_DEBUG_CHANNEL (d3d)
 
 WINE_DECLARE_DEBUG_CHANNEL (d3d_perf)
 
static BOOL shader_is_pshader_version (enum wined3d_shader_type type)
 
static BOOL shader_is_vshader_version (enum wined3d_shader_type type)
 
static const charget_line (const char **ptr)
 
static const chararb_get_helper_value (enum wined3d_shader_type shader, enum arb_helper_value value)
 
static BOOL ffp_clip_emul (const struct wined3d_context *context)
 
static BOOL need_rel_addr_const (const struct arb_vshader_private *shader_data, const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
 
static BOOL use_nv_clip (const struct wined3d_gl_info *gl_info)
 
static BOOL need_helper_const (const struct arb_vshader_private *shader_data, const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
 
static unsigned int reserved_vs_const (const struct arb_vshader_private *shader_data, const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
 
static unsigned int shader_arb_load_constants_f (const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, GLuint target_type, unsigned int max_constants, const struct wined3d_vec4 *constants, char *dirty_consts)
 
static void shader_arb_load_np2fixup_constants (const struct arb_ps_np2fixup_info *fixup, const struct wined3d_gl_info *gl_info, const struct wined3d_state *state)
 
static void shader_arb_ps_local_constants (const struct arb_ps_compiled_shader *gl_shader, const struct wined3d_context *context, const struct wined3d_state *state, UINT rt_height)
 
static void shader_arb_vs_local_constants (const struct arb_vs_compiled_shader *gl_shader, const struct wined3d_context *context, const struct wined3d_state *state)
 
static void shader_arb_select (void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
 
static void shader_arb_load_constants_internal (struct shader_arb_priv *priv, struct wined3d_context *context, const struct wined3d_state *state, BOOL usePixelShader, BOOL useVertexShader, BOOL from_shader_select)
 
static void shader_arb_load_constants (void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
 
static void shader_arb_update_float_vertex_constants (struct wined3d_device *device, UINT start, UINT count)
 
static void shader_arb_update_float_pixel_constants (struct wined3d_device *device, UINT start, UINT count)
 
static void shader_arb_append_imm_vec4 (struct wined3d_string_buffer *buffer, const float *values)
 
static void shader_generate_arb_declarations (const struct wined3d_shader *shader, const struct wined3d_shader_reg_maps *reg_maps, struct wined3d_string_buffer *buffer, const struct wined3d_gl_info *gl_info, DWORD *num_clipplanes, const struct shader_arb_ctx_priv *ctx)
 
static void shader_arb_get_write_mask (const struct wined3d_shader_instruction *ins, const struct wined3d_shader_dst_param *dst, char *write_mask)
 
static void shader_arb_get_swizzle (const struct wined3d_shader_src_param *param, BOOL fixup, char *swizzle_str)
 
static void shader_arb_request_a0 (const struct wined3d_shader_instruction *ins, const char *src)
 
static void shader_arb_get_src_param (const struct wined3d_shader_instruction *ins, const struct wined3d_shader_src_param *src, unsigned int tmpreg, char *outregstr)
 
static void shader_arb_get_register_name (const struct wined3d_shader_instruction *ins, const struct wined3d_shader_register *reg, char *register_name, BOOL *is_color)
 
static void shader_arb_get_dst_param (const struct wined3d_shader_instruction *ins, const struct wined3d_shader_dst_param *wined3d_dst, char *str)
 
static const charshader_arb_get_fixup_swizzle (enum fixup_channel_source channel_source)
 
static struct color_fixup_masks calc_color_correction (struct color_fixup_desc fixup, DWORD dst_mask)
 
static void gen_color_correction (struct wined3d_string_buffer *buffer, const char *dst, const char *src, const char *one, const char *two, struct color_fixup_desc fixup, struct color_fixup_masks masks)
 
static const charshader_arb_get_modifier (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_sample (const struct wined3d_shader_instruction *ins, DWORD sampler_idx, const char *dst_str, const char *coord_reg, WORD flags, const char *dsx, const char *dsy)
 
static void pshader_hw_bem (const struct wined3d_shader_instruction *ins)
 
static DWORD negate_modifiers (DWORD mod, char *extra_char)
 
static void pshader_hw_cnd (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_cmp (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_dp2add (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_map2gl (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_nop (const struct wined3d_shader_instruction *ins)
 
static DWORD shader_arb_select_component (DWORD swizzle, DWORD component)
 
static void shader_hw_mov (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texkill (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_tex (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texcoord (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texreg2ar (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texreg2gb (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texreg2rgb (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texbem (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texm3x2pad (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texm3x2tex (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texm3x3pad (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texm3x3tex (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texm3x3vspec (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texm3x3spec (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texdepth (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texdp3tex (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texdp3 (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texm3x3 (const struct wined3d_shader_instruction *ins)
 
static void pshader_hw_texm3x2depth (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_mnxn (const struct wined3d_shader_instruction *ins)
 
static DWORD abs_modifier (DWORD mod, BOOL *need_abs)
 
static void shader_hw_scalar_op (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_nrm (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_lrp (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_sincos (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_sgn (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_dsy (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_pow (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_loop (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_rep (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_endloop (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_endrep (const struct wined3d_shader_instruction *ins)
 
static const struct control_framefind_last_loop (const struct shader_arb_ctx_priv *priv)
 
static void shader_hw_break (const struct wined3d_shader_instruction *ins)
 
static const charget_compare (enum wined3d_shader_rel_op op)
 
static enum wined3d_shader_rel_op invert_compare (enum wined3d_shader_rel_op op)
 
static void shader_hw_breakc (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_ifc (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_else (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_endif (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_texldd (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_texldl (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_label (const struct wined3d_shader_instruction *ins)
 
static void vshader_add_footer (struct shader_arb_ctx_priv *priv_ctx, const struct arb_vshader_private *shader_data, const struct arb_vs_compile_args *args, const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer)
 
static void shader_hw_ret (const struct wined3d_shader_instruction *ins)
 
static void shader_hw_call (const struct wined3d_shader_instruction *ins)
 
static BOOL shader_arb_compile (const struct wined3d_gl_info *gl_info, GLenum target, const char *src)
 
static void arbfp_add_sRGB_correction (struct wined3d_string_buffer *buffer, const char *fragcolor, const char *tmp1, const char *tmp2, const char *tmp3, const char *tmp4, BOOL condcode)
 
static const DWORDfind_loop_control_values (const struct wined3d_shader *shader, DWORD idx)
 
static void init_ps_input (const struct wined3d_shader *shader, const struct arb_ps_compile_args *args, struct shader_arb_ctx_priv *priv)
 
static void arbfp_add_linear_fog (struct wined3d_string_buffer *buffer, const char *fragcolor, const char *tmp)
 
static GLuint shader_arb_generate_pshader (const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, const struct arb_ps_compile_args *args, struct arb_ps_compiled_shader *compiled)
 
static int compare_sig (const struct wined3d_shader_signature *sig1, const struct wined3d_shader_signature *sig2)
 
static void clone_sig (struct wined3d_shader_signature *new, const struct wined3d_shader_signature *sig)
 
static DWORD find_input_signature (struct shader_arb_priv *priv, const struct wined3d_shader_signature *sig)
 
static void init_output_registers (const struct wined3d_shader *shader, const struct wined3d_shader_signature *ps_input_sig, struct shader_arb_ctx_priv *priv_ctx, struct arb_vs_compiled_shader *compiled)
 
static GLuint shader_arb_generate_vshader (const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, const struct arb_vs_compile_args *args, struct arb_vs_compiled_shader *compiled, const struct wined3d_shader_signature *ps_input_sig)
 
static struct arb_ps_compiled_shaderfind_arb_pshader (struct wined3d_shader *shader, const struct arb_ps_compile_args *args)
 
static BOOL vs_args_equal (const struct arb_vs_compile_args *stored, const struct arb_vs_compile_args *new, const DWORD use_map, BOOL skip_int)
 
static struct arb_vs_compiled_shaderfind_arb_vshader (struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, DWORD use_map, const struct arb_vs_compile_args *args, const struct wined3d_shader_signature *ps_input_sig)
 
static void find_arb_ps_compile_args (const struct wined3d_state *state, const struct wined3d_context *context, const struct wined3d_shader *shader, struct arb_ps_compile_args *args)
 
static void find_arb_vs_compile_args (const struct wined3d_state *state, const struct wined3d_context *context, const struct wined3d_shader *shader, struct arb_vs_compile_args *args)
 
static void shader_arb_select_compute (void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state)
 
static void shader_arb_disable (void *shader_priv, struct wined3d_context *context)
 
static void shader_arb_destroy (struct wined3d_shader *shader)
 
static int sig_tree_compare (const void *key, const struct wine_rb_entry *entry)
 
static HRESULT shader_arb_alloc (struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe, const struct fragment_pipeline *fragment_pipe)
 
static void release_signature (struct wine_rb_entry *entry, void *context)
 
static void shader_arb_free (struct wined3d_device *device)
 
static BOOL shader_arb_allocate_context_data (struct wined3d_context *context)
 
static void shader_arb_free_context_data (struct wined3d_context *context)
 
static void shader_arb_init_context_state (struct wined3d_context *context)
 
static void shader_arb_get_caps (const struct wined3d_gl_info *gl_info, struct shader_caps *caps)
 
static BOOL shader_arb_color_fixup_supported (struct color_fixup_desc fixup)
 
static void shader_arb_add_instruction_modifiers (const struct wined3d_shader_instruction *ins)
 
static BOOL get_bool_const (const struct wined3d_shader_instruction *ins, const struct wined3d_shader *shader, DWORD idx)
 
static void get_loop_control_const (const struct wined3d_shader_instruction *ins, const struct wined3d_shader *shader, UINT idx, struct wined3d_shader_loop_control *loop_control)
 
static void record_instruction (struct list *list, const struct wined3d_shader_instruction *ins)
 
static void free_recorded_instruction (struct list *list)
 
static void pop_control_frame (const struct wined3d_shader_instruction *ins)
 
static void shader_arb_handle_instruction (const struct wined3d_shader_instruction *ins)
 
static BOOL shader_arb_has_ffp_proj_control (void *shader_priv)
 
static void shader_arb_precompile (void *shader_priv, struct wined3d_shader *shader)
 
static void arbfp_enable (const struct wined3d_gl_info *gl_info, BOOL enable)
 
static voidarbfp_alloc (const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv)
 
static void arbfp_free_ffpshader (struct wine_rb_entry *entry, void *context)
 
static void arbfp_free (struct wined3d_device *device)
 
static void arbfp_get_caps (const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
 
static DWORD arbfp_get_emul_mask (const struct wined3d_gl_info *gl_info)
 
static void state_texfactor_arbfp (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_tss_constant_arbfp (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_arb_specularenable (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void set_bumpmat_arbfp (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void tex_bumpenvlum_arbfp (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void alpha_test_arbfp (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void color_key_arbfp (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static const charget_argreg (struct wined3d_string_buffer *buffer, DWORD argnum, unsigned int stage, DWORD arg)
 
static void gen_ffp_instr (struct wined3d_string_buffer *buffer, unsigned int stage, BOOL color, BOOL alpha, DWORD dst, DWORD op, DWORD dw_arg0, DWORD dw_arg1, DWORD dw_arg2)
 
static const chararbfp_texture_target (enum wined3d_gl_resource_type type)
 
static GLuint gen_arbfp_ffp_shader (const struct ffp_frag_settings *settings, const struct wined3d_gl_info *gl_info)
 
static void fragment_prog_arbfp (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_arbfp_fog (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void textransform (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static BOOL arbfp_alloc_context_data (struct wined3d_context *context)
 
static void arbfp_free_context_data (struct wined3d_context *context)
 
static int arbfp_blit_type_compare (const void *key, const struct wine_rb_entry *entry)
 
static void arbfp_free_blit_shader (struct wine_rb_entry *entry, void *ctx)
 
static void arbfp_blitter_destroy (struct wined3d_blitter *blitter, struct wined3d_context *context)
 
static BOOL gen_planar_yuv_read (struct wined3d_string_buffer *buffer, const struct arbfp_blit_type *type, char *luminance)
 
static BOOL gen_yv12_read (struct wined3d_string_buffer *buffer, const struct arbfp_blit_type *type, char *luminance)
 
static BOOL gen_nv12_read (struct wined3d_string_buffer *buffer, const struct arbfp_blit_type *type, char *luminance)
 
static GLuint gen_p8_shader (const struct wined3d_gl_info *gl_info, const struct arbfp_blit_type *type)
 
static void upload_palette (struct wined3d_arbfp_blitter *blitter, const struct wined3d_texture *texture, struct wined3d_context *context)
 
static GLuint gen_yuv_shader (const struct wined3d_gl_info *gl_info, const struct arbfp_blit_type *type)
 
static GLuint arbfp_gen_plain_shader (const struct wined3d_gl_info *gl_info, const struct arbfp_blit_type *type)
 
static HRESULT arbfp_blit_set (struct wined3d_arbfp_blitter *blitter, struct wined3d_context *context, const struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_color_key *color_key)
 
static void arbfp_blit_unset (const struct wined3d_gl_info *gl_info)
 
static BOOL arbfp_blit_supported (enum wined3d_blit_op blit_op, const struct wined3d_context *context, const struct wined3d_resource *src_resource, DWORD src_location, const struct wined3d_resource *dst_resource, DWORD dst_location)
 
static DWORD arbfp_blitter_blit (struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context, struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect, const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter)
 
static void arbfp_blitter_clear (struct wined3d_blitter *blitter, struct wined3d_device *device, unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, const RECT *draw_rect, DWORD flags, const struct wined3d_color *colour, float depth, DWORD stencil)
 
void wined3d_arbfp_blitter_create (struct wined3d_blitter **next, const struct wined3d_device *device)
 

Variables

static const char *const shift_tab []
 
static const SHADER_HANDLER shader_arb_instruction_handler_table [WINED3DSIH_TABLE_SIZE]
 
const struct wined3d_shader_backend_ops arb_program_shader_backend
 
static const struct StateEntryTemplate arbfp_fragmentstate_template []
 
const struct fragment_pipeline arbfp_fragment_pipeline
 
static const struct wined3d_blitter_ops arbfp_blitter_ops
 

Macro Definition Documentation

◆ ARB_FFP_CONST_BUMPMAT

#define ARB_FFP_CONST_BUMPMAT (   i)    ((ARB_FFP_CONST_CONSTANT(7)) + 1 + i)

Definition at line 5694 of file arb_program_shader.c.

◆ ARB_FFP_CONST_COLOR_KEY_HIGH

#define ARB_FFP_CONST_COLOR_KEY_HIGH   ((ARB_FFP_CONST_COLOR_KEY_LOW) + 1)

Definition at line 5691 of file arb_program_shader.c.

◆ ARB_FFP_CONST_COLOR_KEY_LOW

#define ARB_FFP_CONST_COLOR_KEY_LOW   ((ARB_FFP_CONST_TFACTOR) + 1)

Definition at line 5690 of file arb_program_shader.c.

◆ ARB_FFP_CONST_CONSTANT

#define ARB_FFP_CONST_CONSTANT (   i)    ((ARB_FFP_CONST_SPECULAR_ENABLE) + 1 + i)

Definition at line 5693 of file arb_program_shader.c.

◆ ARB_FFP_CONST_LUMINANCE

#define ARB_FFP_CONST_LUMINANCE (   i)    ((ARB_FFP_CONST_BUMPMAT(7)) + 1 + i)

Definition at line 5695 of file arb_program_shader.c.

◆ ARB_FFP_CONST_SPECULAR_ENABLE

#define ARB_FFP_CONST_SPECULAR_ENABLE   ((ARB_FFP_CONST_COLOR_KEY_HIGH) + 1)

Definition at line 5692 of file arb_program_shader.c.

◆ ARB_FFP_CONST_TFACTOR

#define ARB_FFP_CONST_TFACTOR   0

Definition at line 5689 of file arb_program_shader.c.

◆ ARBFP_BLIT_PARAM_COLOR_KEY_HIGH

#define ARBFP_BLIT_PARAM_COLOR_KEY_HIGH   2

Definition at line 6878 of file arb_program_shader.c.

◆ ARBFP_BLIT_PARAM_COLOR_KEY_LOW

#define ARBFP_BLIT_PARAM_COLOR_KEY_LOW   1

Definition at line 6877 of file arb_program_shader.c.

◆ ARBFP_BLIT_PARAM_SIZE

#define ARBFP_BLIT_PARAM_SIZE   0

Definition at line 6876 of file arb_program_shader.c.

◆ TEX_BIAS

#define TEX_BIAS   0x2

Definition at line 1405 of file arb_program_shader.c.

◆ TEX_DERIV

#define TEX_DERIV   0x10

Definition at line 1407 of file arb_program_shader.c.

◆ TEX_LOD

#define TEX_LOD   0x4

Definition at line 1406 of file arb_program_shader.c.

◆ TEX_PROJ

#define TEX_PROJ   0x1

Definition at line 1404 of file arb_program_shader.c.

Enumeration Type Documentation

◆ arb_helper_value

Enumerator
ARB_ZERO 
ARB_ONE 
ARB_TWO 
ARB_0001 
ARB_EPS 
ARB_VS_REL_OFFSET 

Definition at line 68 of file arb_program_shader.c.

Function Documentation

◆ abs_modifier()

static DWORD abs_modifier ( DWORD  mod,
BOOL need_abs 
)
static

Definition at line 2511 of file arb_program_shader.c.

2512 {
2513  *need_abs = FALSE;
2514 
2515  switch(mod)
2516  {
2517  case WINED3DSPSM_NONE: return WINED3DSPSM_ABS;
2518  case WINED3DSPSM_NEG: return WINED3DSPSM_ABS;
2519  case WINED3DSPSM_BIAS: *need_abs = TRUE; return WINED3DSPSM_BIAS;
2520  case WINED3DSPSM_BIASNEG: *need_abs = TRUE; return WINED3DSPSM_BIASNEG;
2521  case WINED3DSPSM_SIGN: *need_abs = TRUE; return WINED3DSPSM_SIGN;
2522  case WINED3DSPSM_SIGNNEG: *need_abs = TRUE; return WINED3DSPSM_SIGNNEG;
2523  case WINED3DSPSM_COMP: *need_abs = TRUE; return WINED3DSPSM_COMP;
2524  case WINED3DSPSM_X2: *need_abs = TRUE; return WINED3DSPSM_X2;
2525  case WINED3DSPSM_X2NEG: *need_abs = TRUE; return WINED3DSPSM_X2NEG;
2526  case WINED3DSPSM_DZ: *need_abs = TRUE; return WINED3DSPSM_DZ;
2527  case WINED3DSPSM_DW: *need_abs = TRUE; return WINED3DSPSM_DW;
2528  case WINED3DSPSM_ABS: return WINED3DSPSM_ABS;
2529  case WINED3DSPSM_ABSNEG: return WINED3DSPSM_ABS;
2530  }
2531  FIXME("Unknown modifier %u\n", mod);
2532  return mod;
2533 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:110
static int mod
Definition: i386-dis.c:1273

Referenced by shader_hw_pow(), and shader_hw_scalar_op().

◆ alpha_test_arbfp()

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

Definition at line 5953 of file arb_program_shader.c.

5954 {
5955  const struct wined3d_gl_info *gl_info = context->gl_info;
5956  int glParm;
5957  float ref;
5958 
5959  TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
5960 
5961  if (state->render_states[WINED3D_RS_ALPHATESTENABLE])
5962  {
5963  gl_info->gl_ops.gl.p_glEnable(GL_ALPHA_TEST);
5964  checkGLcall("glEnable GL_ALPHA_TEST");
5965  }
5966  else
5967  {
5968  gl_info->gl_ops.gl.p_glDisable(GL_ALPHA_TEST);
5969  checkGLcall("glDisable GL_ALPHA_TEST");
5970  return;
5971  }
5972 
5973  ref = ((float)state->render_states[WINED3D_RS_ALPHAREF]) / 255.0f;
5974  glParm = wined3d_gl_compare_func(state->render_states[WINED3D_RS_ALPHAFUNC]);
5975 
5976  if (glParm)
5977  {
5978  gl_info->gl_ops.gl.p_glAlphaFunc(glParm, ref);
5979  checkGLcall("glAlphaFunc");
5980  }
5981 }
struct opengl_funcs gl_ops
Definition: http.c:6587
Definition: send.c:47
GLenum wined3d_gl_compare_func(enum wined3d_cmp_func f)
Definition: state.c:345
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
#define checkGLcall(A)
#define GL_ALPHA_TEST
Definition: gl.h:366

◆ arb_get_helper_value()

static const char* arb_get_helper_value ( enum wined3d_shader_type  shader,
enum arb_helper_value  value 
)
static

Definition at line 79 of file arb_program_shader.c.

80 {
82  {
83  ERR("Unsupported shader type '%s'.\n", debug_shader_type(shader));
84  return "bad";
85  }
86 
88  {
89  switch (value)
90  {
91  case ARB_ZERO: return "ps_helper_const.x";
92  case ARB_ONE: return "ps_helper_const.y";
93  case ARB_TWO: return "coefmul.x";
94  case ARB_0001: return "ps_helper_const.xxxy";
95  case ARB_EPS: return "ps_helper_const.z";
96  default: break;
97  }
98  }
99  else
100  {
101  switch (value)
102  {
103  case ARB_ZERO: return "helper_const.x";
104  case ARB_ONE: return "helper_const.y";
105  case ARB_TWO: return "helper_const.z";
106  case ARB_EPS: return "helper_const.w";
107  case ARB_0001: return "helper_const.xxxy";
108  case ARB_VS_REL_OFFSET: return "rel_addr_const.y";
109  }
110  }
111  FIXME("Unmanaged %s shader helper constant requested: %u.\n",
112  shader == WINED3D_SHADER_TYPE_PIXEL ? "pixel" : "vertex", value);
113  switch (value)
114  {
115  case ARB_ZERO: return "0.0";
116  case ARB_ONE: return "1.0";
117  case ARB_TWO: return "2.0";
118  case ARB_0001: return "{0.0, 0.0, 0.0, 1.0}";
119  case ARB_EPS: return "1e-8";
120  default: return "bad";
121  }
122 }
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint shader
Definition: glext.h:6030
#define ERR(fmt,...)
Definition: debug.h:109
const char * debug_shader_type(enum wined3d_shader_type type)
Definition: utils.c:4651

Referenced by pshader_hw_texdepth(), pshader_hw_texm3x2depth(), shader_arb_generate_vshader(), shader_arb_get_src_param(), shader_hw_mov(), shader_hw_nrm(), shader_hw_pow(), shader_hw_sample(), and vshader_add_footer().

◆ arbfp_add_linear_fog()

static void arbfp_add_linear_fog ( struct wined3d_string_buffer buffer,
const char fragcolor,
const char tmp 
)
static

Definition at line 3495 of file arb_program_shader.c.

3497 {
3498  shader_addline(buffer, "SUB %s.x, state.fog.params.z, fragment.fogcoord.x;\n", tmp);
3499  shader_addline(buffer, "MUL_SAT %s.x, %s.x, state.fog.params.w;\n", tmp, tmp);
3500  shader_addline(buffer, "LRP %s.rgb, %s.x, %s, state.fog.color;\n", fragcolor, tmp, fragcolor);
3501 }
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:478
GLuint buffer
Definition: glext.h:5915

Referenced by gen_arbfp_ffp_shader(), and shader_arb_generate_pshader().

◆ arbfp_add_sRGB_correction()

static void arbfp_add_sRGB_correction ( struct wined3d_string_buffer buffer,
const char fragcolor,
const char tmp1,
const char tmp2,
const char tmp3,
const char tmp4,
BOOL  condcode 
)
static

Definition at line 3354 of file arb_program_shader.c.

3356 {
3357  /* Perform sRGB write correction. See GLX_EXT_framebuffer_sRGB */
3358 
3359  if(condcode)
3360  {
3361  /* Sigh. MOVC CC doesn't work, so use one of the temps as dummy dest */
3362  shader_addline(buffer, "SUBC %s, %s.x, srgb_consts1.x;\n", tmp1, fragcolor);
3363  /* Calculate the > 0.0031308 case */
3364  shader_addline(buffer, "POW %s.x (GE), %s.x, srgb_consts0.x;\n", fragcolor, fragcolor);
3365  shader_addline(buffer, "POW %s.y (GE), %s.y, srgb_consts0.x;\n", fragcolor, fragcolor);
3366  shader_addline(buffer, "POW %s.z (GE), %s.z, srgb_consts0.x;\n", fragcolor, fragcolor);
3367  shader_addline(buffer, "MUL %s.xyz (GE), %s, srgb_consts0.y;\n", fragcolor, fragcolor);
3368  shader_addline(buffer, "SUB %s.xyz (GE), %s, srgb_consts0.z;\n", fragcolor, fragcolor);
3369  /* Calculate the < case */
3370  shader_addline(buffer, "MUL %s.xyz (LT), srgb_consts0.w, %s;\n", fragcolor, fragcolor);
3371  }
3372  else
3373  {
3374  /* Calculate the > 0.0031308 case */
3375  shader_addline(buffer, "POW %s.x, %s.x, srgb_consts0.x;\n", tmp1, fragcolor);
3376  shader_addline(buffer, "POW %s.y, %s.y, srgb_consts0.x;\n", tmp1, fragcolor);
3377  shader_addline(buffer, "POW %s.z, %s.z, srgb_consts0.x;\n", tmp1, fragcolor);
3378  shader_addline(buffer, "MUL %s, %s, srgb_consts0.y;\n", tmp1, tmp1);
3379  shader_addline(buffer, "SUB %s, %s, srgb_consts0.z;\n", tmp1, tmp1);
3380  /* Calculate the < case */
3381  shader_addline(buffer, "MUL %s, srgb_consts0.w, %s;\n", tmp2, fragcolor);
3382  /* Get 1.0 / 0.0 masks for > 0.0031308 and < 0.0031308 */
3383  shader_addline(buffer, "SLT %s, srgb_consts1.x, %s;\n", tmp3, fragcolor);
3384  shader_addline(buffer, "SGE %s, srgb_consts1.x, %s;\n", tmp4, fragcolor);
3385  /* Store the components > 0.0031308 in the destination */
3386  shader_addline(buffer, "MUL %s.xyz, %s, %s;\n", fragcolor, tmp1, tmp3);
3387  /* Add the components that are < 0.0031308 */
3388  shader_addline(buffer, "MAD %s.xyz, %s, %s, %s;\n", fragcolor, tmp2, tmp4, fragcolor);
3389  /* Move everything into result.color at once. Nvidia hardware cannot handle partial
3390  * result.color writes(.rgb first, then .a), or handle overwriting already written
3391  * components. The assembler uses a temporary register in this case, which is usually
3392  * not allocated from one of our registers that were used earlier.
3393  */
3394  }
3395  /* [0.0;1.0] clamping. Not needed, this is done implicitly */
3396 }
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:478
GLuint buffer
Definition: glext.h:5915

Referenced by gen_arbfp_ffp_shader(), and shader_arb_generate_pshader().

◆ arbfp_alloc()

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

Definition at line 5718 of file arb_program_shader.c.

5719 {
5720  struct shader_arb_priv *priv;
5721 
5722  /* Share private data between the shader backend and the pipeline
5723  * replacement, if both are the arb implementation. This is needed to
5724  * figure out whether ARBfp should be disabled if no pixel shader is bound
5725  * or not. */
5726  if (shader_backend == &arb_program_shader_backend)
5727  priv = shader_priv;
5728  else if (!(priv = heap_alloc_zero(sizeof(*priv))))
5729  return NULL;
5730 
5732  priv->use_arbfp_fixed_func = TRUE;
5733 
5734  return priv;
5735 }
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
struct wine_rb_tree fragment_shaders
static void wine_rb_init(struct wine_rb_tree *tree, wine_rb_compare_func_t compare)
Definition: rbtree.h:179
int wined3d_ffp_frag_program_key_compare(const void *key, const struct wine_rb_entry *entry)
Definition: utils.c:6223
const struct wined3d_shader_backend_ops arb_program_shader_backend

◆ arbfp_alloc_context_data()

static BOOL arbfp_alloc_context_data ( struct wined3d_context context)
static

Definition at line 6840 of file arb_program_shader.c.

6841 {
6842  return TRUE;
6843 }
#define TRUE
Definition: types.h:120

◆ arbfp_blit_set()

static HRESULT arbfp_blit_set ( struct wined3d_arbfp_blitter blitter,
struct wined3d_context context,
const struct wined3d_texture texture,
unsigned int  sub_resource_idx,
const struct wined3d_color_key color_key 
)
static

Definition at line 7569 of file arb_program_shader.c.

7572 {
7573  enum complex_fixup fixup;
7574  const struct wined3d_gl_info *gl_info = context->gl_info;
7575  struct wine_rb_entry *entry;
7576  struct arbfp_blit_type type;
7577  struct arbfp_blit_desc *desc;
7578  struct wined3d_color float_color_key[2];
7579  struct wined3d_vec4 size;
7580  unsigned int level;
7581  GLuint shader;
7582 
7583  level = sub_resource_idx % texture->level_count;
7586  size.z = 1.0f;
7587  size.w = 1.0f;
7588 
7589  if (is_complex_fixup(texture->resource.format->color_fixup))
7590  fixup = get_complex_fixup(texture->resource.format->color_fixup);
7591  else
7592  fixup = COMPLEX_FIXUP_NONE;
7593 
7594  switch (texture->target)
7595  {
7596  case GL_TEXTURE_1D:
7597  type.res_type = WINED3D_GL_RES_TYPE_TEX_1D;
7598  break;
7599 
7600  case GL_TEXTURE_2D:
7601  type.res_type = WINED3D_GL_RES_TYPE_TEX_2D;
7602  break;
7603 
7604  case GL_TEXTURE_3D:
7605  type.res_type = WINED3D_GL_RES_TYPE_TEX_3D;
7606  break;
7607 
7610  break;
7611 
7614  break;
7615 
7616  default:
7617  ERR("Unexpected GL texture type %#x.\n", texture->target);
7618  type.res_type = WINED3D_GL_RES_TYPE_TEX_2D;
7619  }
7620  type.fixup = fixup;
7621  type.use_color_key = !!color_key;
7622  type.padding = 0;
7623 
7624  if ((entry = wine_rb_get(&blitter->shaders, &type)))
7625  {
7627  shader = desc->shader;
7628  }
7629  else
7630  {
7631  switch (fixup)
7632  {
7633  case COMPLEX_FIXUP_NONE:
7634  if (!is_identity_fixup(texture->resource.format->color_fixup))
7635  FIXME("Implement support for sign or swizzle fixups.\n");
7636  shader = arbfp_gen_plain_shader(gl_info, &type);
7637  break;
7638 
7639  case COMPLEX_FIXUP_P8:
7640  shader = gen_p8_shader(gl_info, &type);
7641  break;
7642 
7643  case COMPLEX_FIXUP_YUY2:
7644  case COMPLEX_FIXUP_UYVY:
7645  case COMPLEX_FIXUP_YV12:
7646  case COMPLEX_FIXUP_NV12:
7647  shader = gen_yuv_shader(gl_info, &type);
7648  break;
7649  }
7650 
7651  if (!shader)
7652  {
7653  FIXME("Unsupported complex fixup %#x, not setting a shader\n", fixup);
7654  return E_NOTIMPL;
7655  }
7656 
7657  if (!(desc = heap_alloc(sizeof(*desc))))
7658  goto err_out;
7659 
7660  desc->type = type;
7661  desc->shader = shader;
7662  if (wine_rb_put(&blitter->shaders, &desc->type, &desc->entry) == -1)
7663  {
7664 err_out:
7665  ERR("Out of memory\n");
7666  GL_EXTCALL(glDeleteProgramsARB(1, &shader));
7667  checkGLcall("GL_EXTCALL(glDeleteProgramsARB(1, &shader))");
7668  GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0));
7669  checkGLcall("glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0)");
7670  heap_free(desc);
7671  return E_OUTOFMEMORY;
7672  }
7673  }
7674 
7675  if (fixup == COMPLEX_FIXUP_P8)
7676  upload_palette(blitter, texture, context);
7677 
7678  gl_info->gl_ops.gl.p_glEnable(GL_FRAGMENT_PROGRAM_ARB);
7679  checkGLcall("glEnable(GL_FRAGMENT_PROGRAM_ARB)");
7680  GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader));
7681  checkGLcall("glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader)");
7682  GL_EXTCALL(glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARBFP_BLIT_PARAM_SIZE, &size.x));
7683  checkGLcall("glProgramLocalParameter4fvARB");
7684  if (type.use_color_key)
7685  {
7686  wined3d_format_get_float_color_key(texture->resource.format, color_key, float_color_key);
7687  GL_EXTCALL(glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB,
7688  ARBFP_BLIT_PARAM_COLOR_KEY_LOW, &float_color_key[0].r));
7689  GL_EXTCALL(glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB,
7690  ARBFP_BLIT_PARAM_COLOR_KEY_HIGH, &float_color_key[1].r));
7691  checkGLcall("glProgramLocalParameter4fvARB");
7692  }
7693 
7694  return WINED3D_OK;
7695 }
#define ARBFP_BLIT_PARAM_SIZE
GLint level
Definition: gl.h:1546
#define ARBFP_BLIT_PARAM_COLOR_KEY_LOW
struct opengl_funcs gl_ops
Definition: http.c:6587
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
complex_fixup
void wined3d_format_get_float_color_key(const struct wined3d_format *format, const struct wined3d_color_key *key, struct wined3d_color *float_colors)
Definition: utils.c:5314
static BOOL is_complex_fixup(struct color_fixup_desc fixup)
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define GL_TEXTURE_CUBE_MAP_ARB
Definition: glext.h:1230
#define GL_TEXTURE_RECTANGLE_ARB
Definition: glext.h:1614
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define GL_TEXTURE_1D
Definition: gl.h:644
static GLuint gen_p8_shader(const struct wined3d_gl_info *gl_info, const struct arbfp_blit_type *type)
#define FIXME(fmt,...)
Definition: debug.h:110
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
#define GL_TEXTURE_3D
Definition: gl.h:1515
struct wine_rb_tree shaders
#define GL_EXTCALL(f)
GLuint shader
Definition: glext.h:6030
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint texture
Definition: glext.h:6295
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
#define WINED3D_OK
Definition: wined3d.h:37
static BOOL is_identity_fixup(struct color_fixup_desc fixup)
uint32_t entry
Definition: isohybrid.c:63
static unsigned int wined3d_texture_get_level_pow2_height(const struct wined3d_texture *texture, unsigned int level)
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int GLuint
Definition: gl.h:159
static void upload_palette(struct wined3d_arbfp_blitter *blitter, const struct wined3d_texture *texture, struct wined3d_context *context)
Definition: rbtree.h:35
#define E_NOTIMPL
Definition: ddrawi.h:99
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
Definition: rbtree.h:215
static GLuint arbfp_gen_plain_shader(const struct wined3d_gl_info *gl_info, const struct arbfp_blit_type *type)
#define checkGLcall(A)
#define GL_TEXTURE_2D
Definition: gl.h:645
static struct wine_rb_entry * wine_rb_get(const struct wine_rb_tree *tree, const void *key)
Definition: rbtree.h:203
#define ARBFP_BLIT_PARAM_COLOR_KEY_HIGH
static enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)
static GLuint gen_yuv_shader(const struct wined3d_gl_info *gl_info, const struct arbfp_blit_type *type)
static unsigned int wined3d_texture_get_level_pow2_width(const struct wined3d_texture *texture, unsigned int level)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define GL_FRAGMENT_PROGRAM_ARB
Definition: glext.h:1466

Referenced by arbfp_blitter_blit().

◆ arbfp_blit_supported()

static BOOL arbfp_blit_supported ( enum wined3d_blit_op  blit_op,
const struct wined3d_context context,
const struct wined3d_resource src_resource,
DWORD  src_location,
const struct wined3d_resource dst_resource,
DWORD  dst_location 
)
static

Definition at line 7704 of file arb_program_shader.c.

7707 {
7708  const struct wined3d_format *src_format = src_resource->format;
7709  const struct wined3d_format *dst_format = dst_resource->format;
7710  enum complex_fixup src_fixup;
7711  BOOL decompress;
7712 
7713  if (!context->gl_info->supported[ARB_FRAGMENT_PROGRAM])
7714  return FALSE;
7715 
7716  if (blit_op == WINED3D_BLIT_OP_RAW_BLIT && dst_format->id == src_format->id)
7717  {
7719  blit_op = WINED3D_BLIT_OP_DEPTH_BLIT;
7720  else
7721  blit_op = WINED3D_BLIT_OP_COLOR_BLIT;
7722  }
7723 
7724  switch (blit_op)
7725  {
7727  if (!context->d3d_info->shader_color_key)
7728  {
7729  /* The conversion modifies the alpha channel so the color key might no longer match. */
7730  TRACE("Color keying not supported with converted textures.\n");
7731  return FALSE;
7732  }
7735  break;
7736 
7737  default:
7738  TRACE("Unsupported blit_op=%d\n", blit_op);
7739  return FALSE;
7740  }
7741 
7742  decompress = src_format && (src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED)
7744  if (!decompress && !(src_resource->access & dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU))
7745  return FALSE;
7746 
7747  src_fixup = get_complex_fixup(src_format->color_fixup);
7748  if (TRACE_ON(d3d_shader) && TRACE_ON(d3d))
7749  {
7750  TRACE("Checking support for fixup:\n");
7751  dump_color_fixup_desc(src_format->color_fixup);
7752  }
7753 
7754  if (!is_identity_fixup(dst_format->color_fixup)
7755  && (dst_format->id != src_format->id || dst_location != WINED3D_LOCATION_DRAWABLE))
7756  {
7757  TRACE("Destination fixups are not supported\n");
7758  return FALSE;
7759  }
7760 
7761  if (is_identity_fixup(src_format->color_fixup))
7762  {
7763  TRACE("[OK]\n");
7764  return TRUE;
7765  }
7766 
7767  /* We only support YUV conversions. */
7768  if (!is_complex_fixup(src_format->color_fixup))
7769  {
7771  {
7772  WARN("Claiming fixup support because of ORM_BACKBUFFER.\n");
7773  return TRUE;
7774  }
7775 
7776  TRACE("[FAILED]\n");
7777  return FALSE;
7778  }
7779 
7780  switch(src_fixup)
7781  {
7782  case COMPLEX_FIXUP_YUY2:
7783  case COMPLEX_FIXUP_UYVY:
7784  case COMPLEX_FIXUP_YV12:
7785  case COMPLEX_FIXUP_NV12:
7786  case COMPLEX_FIXUP_P8:
7787  TRACE("[OK]\n");
7788  return TRUE;
7789 
7790  default:
7791  FIXME("Unsupported YUV fixup %#x\n", src_fixup);
7792  TRACE("[FAILED]\n");
7793  return FALSE;
7794  }
7795 }
#define WINED3DFMT_FLAG_STENCIL
#define TRUE
Definition: types.h:120
static const char * dst_format
Definition: dib.c:1133
Definition: http.c:6587
complex_fixup
unsigned int access
#define WARN(fmt,...)
Definition: debug.h:111
static BOOL is_complex_fixup(struct color_fixup_desc fixup)
const struct wined3d_format * format
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
#define ORM_BACKBUFFER
struct color_fixup_desc color_fixup
#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 WINED3DFMT_FLAG_COMPRESSED
unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]
#define WINED3DFMT_FLAG_DEPTH
static enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)
void dump_color_fixup_desc(struct color_fixup_desc fixup)
Definition: utils.c:4844
#define TRACE_ON(x)
Definition: compat.h:65

Referenced by arbfp_blitter_blit().

◆ arbfp_blit_type_compare()

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

Definition at line 6887 of file arb_program_shader.c.

6888 {
6889  const struct arbfp_blit_type *ka = key;
6890  const struct arbfp_blit_type *kb = &WINE_RB_ENTRY_VALUE(entry, const struct arbfp_blit_desc, entry)->type;
6891 
6892  return memcmp(ka, kb, sizeof(*ka));
6893 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#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

Referenced by wined3d_arbfp_blitter_create().

◆ arbfp_blit_unset()

static void arbfp_blit_unset ( const struct wined3d_gl_info gl_info)
static

Definition at line 7698 of file arb_program_shader.c.

7699 {
7700  gl_info->gl_ops.gl.p_glDisable(GL_FRAGMENT_PROGRAM_ARB);
7701  checkGLcall("glDisable(GL_FRAGMENT_PROGRAM_ARB)");
7702 }
struct opengl_funcs gl_ops
#define checkGLcall(A)
#define GL_FRAGMENT_PROGRAM_ARB
Definition: glext.h:1466

Referenced by arbfp_blitter_blit().

◆ arbfp_blitter_blit()

static DWORD arbfp_blitter_blit ( struct wined3d_blitter blitter,
enum wined3d_blit_op  op,
struct wined3d_context context,
struct wined3d_surface src_surface,
DWORD  src_location,
const RECT src_rect,
struct wined3d_surface dst_surface,
DWORD  dst_location,
const RECT dst_rect,
const struct wined3d_color_key color_key,
enum wined3d_texture_filter_type  filter 
)
static

Definition at line 7797 of file arb_program_shader.c.

7801 {
7802  unsigned int src_sub_resource_idx = surface_get_sub_resource_idx(src_surface);
7803  struct wined3d_texture *src_texture = src_surface->container;
7804  struct wined3d_texture *dst_texture = dst_surface->container;
7805  struct wined3d_device *device = dst_texture->resource.device;
7806  struct wined3d_arbfp_blitter *arbfp_blitter;
7807  struct wined3d_color_key alpha_test_key;
7808  struct wined3d_blitter *next;
7809  RECT s, d;
7810 
7811  if (!arbfp_blit_supported(op, context, &src_texture->resource, src_location,
7812  &dst_texture->resource, dst_location))
7813  {
7814  if ((next = blitter->next))
7815  return next->ops->blitter_blit(next, op, context, src_surface, src_location,
7816  src_rect, dst_surface, dst_location, dst_rect, color_key, filter);
7817  }
7818 
7819  arbfp_blitter = CONTAINING_RECORD(blitter, struct wined3d_arbfp_blitter, blitter);
7820 
7821  /* Now load the surface */
7823  && (surface_get_sub_resource(src_surface)->locations
7826  && !wined3d_resource_is_offscreen(&src_texture->resource))
7827  {
7828  unsigned int src_level = src_sub_resource_idx % src_texture->level_count;
7829 
7830  /* Without FBO blits transferring from the drawable to the texture is
7831  * expensive, because we have to flip the data in sysmem. Since we can
7832  * flip in the blitter, we don't actually need that flip anyway. So we
7833  * use the surface's texture as scratch texture, and flip the source
7834  * rectangle instead. */
7835  surface_load_fb_texture(src_surface, FALSE, context);
7836 
7837  s = *src_rect;
7838  s.top = wined3d_texture_get_level_height(src_texture, src_level) - s.top;
7839  s.bottom = wined3d_texture_get_level_height(src_texture, src_level) - s.bottom;
7840  src_rect = &s;
7841  }
7842  else
7843  wined3d_texture_load(src_texture, context, FALSE);
7844 
7846 
7847  if (dst_location == WINED3D_LOCATION_DRAWABLE)
7848  {
7849  d = *dst_rect;
7850  surface_translate_drawable_coords(dst_surface, context->win_handle, &d);
7851  dst_rect = &d;
7852  }
7853 
7855  {
7856  GLenum buffer;
7857 
7858  if (dst_location == WINED3D_LOCATION_DRAWABLE)
7859  {
7860  TRACE("Destination surface %p is onscreen.\n", dst_surface);
7861  buffer = wined3d_texture_get_gl_buffer(dst_texture);
7862  }
7863  else
7864  {
7865  TRACE("Destination surface %p is offscreen.\n", dst_surface);
7867  }
7868  context_apply_fbo_state_blit(context, GL_DRAW_FRAMEBUFFER, dst_surface, NULL, dst_location);
7872  }
7873 
7875  {
7876  const struct wined3d_format *fmt = src_texture->resource.format;
7877  alpha_test_key.color_space_low_value = 0;
7878  alpha_test_key.color_space_high_value = ~(((1u << fmt->alpha_size) - 1) << fmt->alpha_offset);
7879  color_key = &alpha_test_key;
7880  }
7881 
7882  arbfp_blit_set(arbfp_blitter, context, src_texture, src_sub_resource_idx, color_key);
7883 
7884  /* Draw a textured quad */
7885  draw_textured_quad(src_texture, src_sub_resource_idx, context, src_rect, dst_rect, filter);
7886 
7887  /* Leave the opengl state valid for blitting */
7888  arbfp_blit_unset(context->gl_info);
7889 
7891  || (dst_texture->swapchain && (dst_texture->swapchain->front_buffer == dst_texture)))
7892  context->gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
7893 
7894  return dst_location;
7895 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define ORM_FBO
void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device)
Definition: context.c:2981
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *old_ctx)
Definition: surface.c:1710
static unsigned int wined3d_texture_get_level_height(const struct wined3d_texture *texture, unsigned int level)
Definition: http.c:6587
struct wined3d_swapchain * swapchain
struct wined3d_blitter * next
LONG top
Definition: windef.h:292
struct wined3d_resource resource
GLuint buffer
Definition: glext.h:5915
void context_invalidate_state(struct wined3d_context *context, DWORD state)
Definition: context.c:1652
static struct wined3d_texture_sub_resource * surface_get_sub_resource(struct wined3d_surface *surface)
static HRESULT arbfp_blit_set(struct wined3d_arbfp_blitter *blitter, struct wined3d_context *context, const struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_color_key *color_key)
#define GL_COLOR_ATTACHMENT0
Definition: glext.h:1714
Definition: devices.h:37
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:381
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
#define GL_DRAW_FRAMEBUFFER
Definition: glext.h:1699
static BOOL arbfp_blit_supported(enum wined3d_blit_op blit_op, const struct wined3d_context *context, const struct wined3d_resource *src_resource, DWORD src_location, const struct wined3d_resource *dst_resource, DWORD dst_location)
#define TRACE(s)
Definition: solgame.cpp:4
#define d
Definition: ke_i.h:81
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
Definition: resource.c:547
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture)
Definition: texture.c:51
GLdouble s
Definition: gl.h:2039
GLsizei const GLint * locations
Definition: glext.h:10542
unsigned int GLenum
Definition: gl.h:150
static void arbfp_blit_unset(const struct wined3d_gl_info *gl_info)
void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location)
Definition: context.c:802
void draw_textured_quad(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter)
Definition: surface.c:188
static unsigned __int64 next
Definition: rand_nt.c:6
#define WINED3D_LOCATION_TEXTURE_RGB
void wined3d_texture_load(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
Definition: texture.c:1066
#define STATE_FRAMEBUFFER
UINT op
Definition: effect.c:223
void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer)
Definition: context.c:2701
struct wined3d_texture * container
static unsigned int surface_get_sub_resource_idx(const struct wined3d_surface *surface)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
Definition: dsound.c:943
void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect)
Definition: surface.c:2164

◆ arbfp_blitter_clear()

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

Definition at line 7897 of file arb_program_shader.c.

7900 {
7901  struct wined3d_blitter *next;
7902 
7903  if ((next = blitter->next))
7904  next->ops->blitter_clear(next, device, rt_count, fb, rect_count,
7905  clear_rects, draw_rect, flags, colour, depth, stencil);
7906 }
struct wined3d_blitter * next
GLint GLfloat GLint stencil
Definition: glext.h:6260
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

◆ arbfp_blitter_destroy()

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

Definition at line 6911 of file arb_program_shader.c.

6912 {
6913  const struct wined3d_gl_info *gl_info = context->gl_info;
6914  struct wined3d_arbfp_blitter *arbfp_blitter;
6915  struct wined3d_blitter *next;
6916 
6917  if ((next = blitter->next))
6918  next->ops->blitter_destroy(next, context);
6919 
6920  arbfp_blitter = CONTAINING_RECORD(blitter, struct wined3d_arbfp_blitter, blitter);
6921 
6923  checkGLcall("Delete blit programs");
6924 
6925  if (arbfp_blitter->palette_texture)
6926  gl_info->gl_ops.gl.p_glDeleteTextures(1, &arbfp_blitter->palette_texture);
6927 
6928  heap_free(arbfp_blitter);
6929 }
struct opengl_funcs gl_ops
Definition: http.c:6587
struct wined3d_blitter * next
static void arbfp_free_blit_shader(struct wine_rb_entry *entry, void *ctx)
struct wine_rb_tree shaders
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 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
#define checkGLcall(A)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ arbfp_enable()

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

Definition at line 5704 of file arb_program_shader.c.

5705 {
5706  if (enable)
5707  {
5708  gl_info->gl_ops.gl.p_glEnable(GL_FRAGMENT_PROGRAM_ARB);
5709  checkGLcall("glEnable(GL_FRAGMENT_PROGRAM_ARB)");
5710  }
5711  else
5712  {
5713  gl_info->gl_ops.gl.p_glDisable(GL_FRAGMENT_PROGRAM_ARB);
5714  checkGLcall("glDisable(GL_FRAGMENT_PROGRAM_ARB)");
5715  }
5716 }
struct opengl_funcs gl_ops
GLboolean enable
Definition: glext.h:11120
#define checkGLcall(A)
#define GL_FRAGMENT_PROGRAM_ARB
Definition: glext.h:1466

◆ arbfp_free()

static void arbfp_free ( struct wined3d_device device)
static

Definition at line 5749 of file arb_program_shader.c.

5750 {
5751  struct shader_arb_priv *priv = device->fragment_priv;
5752 
5753  wine_rb_destroy(&priv->fragment_shaders, arbfp_free_ffpshader, &device->adapter->gl_info);
5754  priv->use_arbfp_fixed_func = FALSE;
5755 
5756  if (device->shader_backend != &arb_program_shader_backend)
5757  heap_free(device->fragment_priv);
5758 }
static void arbfp_free_ffpshader(struct wine_rb_entry *entry, void *context)
Definition: devices.h:37
struct wine_rb_tree fragment_shaders
static void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context)
Definition: rbtree.h:198
const struct wined3d_shader_backend_ops arb_program_shader_backend
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ arbfp_free_blit_shader()

static void arbfp_free_blit_shader ( struct wine_rb_entry entry,
void ctx 
)
static

Definition at line 6896 of file arb_program_shader.c.

6897 {
6898  struct arbfp_blit_desc *entry_arb = WINE_RB_ENTRY_VALUE(entry, struct arbfp_blit_desc, entry);
6899  const struct wined3d_gl_info *gl_info;
6900  struct wined3d_context *context;
6901 
6902  context = ctx;
6903  gl_info = context->gl_info;
6904 
6905  GL_EXTCALL(glDeleteProgramsARB(1, &entry_arb->shader));
6906  checkGLcall("glDeleteProgramsARB(1, &entry_arb->shader)");
6907  heap_free(entry_arb);
6908 }
Definition: http.c:6587
#define GL_EXTCALL(f)
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
uint32_t entry
Definition: isohybrid.c:63
#define checkGLcall(A)
const struct wined3d_gl_info * gl_info
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by arbfp_blitter_destroy().

◆ arbfp_free_context_data()

static void arbfp_free_context_data ( struct wined3d_context context)
static

Definition at line 6845 of file arb_program_shader.c.

6846 {
6847 }

◆ arbfp_free_ffpshader()

static void arbfp_free_ffpshader ( struct wine_rb_entry entry,
void context 
)
static

Definition at line 5738 of file arb_program_shader.c.

5739 {
5740  const struct wined3d_gl_info *gl_info = context;
5741  struct arbfp_ffp_desc *entry_arb = WINE_RB_ENTRY_VALUE(entry, struct arbfp_ffp_desc, parent.entry);
5742 
5743  GL_EXTCALL(glDeleteProgramsARB(1, &entry_arb->shader));
5744  checkGLcall("glDeleteProgramsARB(1, &entry_arb->shader)");
5745  heap_free(entry_arb);
5746 }
Definition: http.c:6587
#define GL_EXTCALL(f)
r parent
Definition: btrfs.c:2897
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
uint32_t entry
Definition: isohybrid.c:63
#define checkGLcall(A)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by arbfp_free().

◆ arbfp_gen_plain_shader()

static GLuint arbfp_gen_plain_shader ( const struct wined3d_gl_info gl_info,
const struct arbfp_blit_type type 
)
static

Definition at line 7516 of file arb_program_shader.c.

7517 {
7518  GLuint shader;
7520  const char *tex_target = arbfp_texture_target(type->res_type);
7521 
7522  /* Shader header */
7523  if (!string_buffer_init(&buffer))
7524  {
7525  ERR("Failed to initialize shader buffer.\n");
7526  return 0;
7527  }
7528 
7529  GL_EXTCALL(glGenProgramsARB(1, &shader));
7530  if (!shader)
7531  {
7533  return 0;
7534  }
7535  GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader));
7536 
7537  shader_addline(&buffer, "!!ARBfp1.0\n");
7538 
7539  if (type->use_color_key)
7540  {
7541  shader_addline(&buffer, "TEMP color;\n");
7542  shader_addline(&buffer, "TEMP less, greater;\n");
7543  shader_addline(&buffer, "PARAM color_key_low = program.local[%u];\n", ARBFP_BLIT_PARAM_COLOR_KEY_LOW);
7544  shader_addline(&buffer, "PARAM color_key_high = program.local[%u];\n", ARBFP_BLIT_PARAM_COLOR_KEY_HIGH);
7545  shader_addline(&buffer, "TEX color, fragment.texcoord[0], texture[0], %s;\n", tex_target);
7546  shader_addline(&buffer, "SLT less, color, color_key_low;\n"); /* below low key */
7547  shader_addline(&buffer, "SGE greater, color, color_key_high;\n"); /* above high key */
7548  shader_addline(&buffer, "ADD less, less, greater;\n"); /* or */
7549  shader_addline(&buffer, "DP4 less.b, less, less;\n"); /* on any channel */
7550  shader_addline(&buffer, "SGE less, -less.b, 0.0;\n"); /* logical not */
7551  shader_addline(&buffer, "KIL -less;\n"); /* discard if true */
7552  shader_addline(&buffer, "MOV result.color, color;\n");
7553  }
7554  else
7555  {
7556  shader_addline(&buffer, "TEX result.color, fragment.texcoord[0], texture[0], %s;\n", tex_target);
7557  }
7558 
7559  shader_addline(&buffer, "END\n");
7560 
7562 
7564 
7565  return shader;
7566 }
#define ARBFP_BLIT_PARAM_COLOR_KEY_LOW
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:478
BOOL string_buffer_init(struct wined3d_string_buffer *buffer)
Definition: shader.c:428
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
static const char * arbfp_texture_target(enum wined3d_gl_resource_type type)
void string_buffer_free(struct wined3d_string_buffer *buffer)
Definition: shader.c:441
#define GL_EXTCALL(f)
GLuint shader
Definition: glext.h:6030
static BOOL shader_arb_compile(const struct wined3d_gl_info *gl_info, GLenum target, const char *src)
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int GLuint
Definition: gl.h:159
#define ARBFP_BLIT_PARAM_COLOR_KEY_HIGH
#define GL_FRAGMENT_PROGRAM_ARB
Definition: glext.h:1466

Referenced by arbfp_blit_set().

◆ arbfp_get_caps()

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

Definition at line 5760 of file arb_program_shader.c.

5761 {
5791 
5792  /* TODO: Implement WINED3DTEXOPCAPS_PREMODULATE */
5793 
5796 }
DWORD MaxTextureBlendStages
#define MAX_TEXTURES
#define WINED3D_FRAGMENT_CAP_PROJ_CONTROL
#define WINED3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA
Definition: wined3d.h:1165
#define WINED3DTEXOPCAPS_DISABLE
Definition: wined3d.h:1145
#define WINED3DTEXOPCAPS_BLENDCURRENTALPHA
Definition: wined3d.h:1160
#define WINED3DTEXOPCAPS_ADDSIGNED
Definition: wined3d.h:1152
#define WINED3DTEXOPCAPS_MODULATE
Definition: wined3d.h:1148
#define WINED3D_FRAGMENT_CAP_SRGB_WRITE
#define WINED3DTEXOPCAPS_ADDSIGNED2X
Definition: wined3d.h:1153
#define WINED3DTEXOPCAPS_BLENDDIFFUSEALPHA
Definition: wined3d.h:1156
#define WINED3DTEXOPCAPS_ADDSMOOTH
Definition: wined3d.h:1155
#define WINED3DTEXOPCAPS_SELECTARG2
Definition: wined3d.h:1147
#define WINED3DTEXOPCAPS_LERP
Definition: wined3d.h:1170
#define WINED3DTEXOPCAPS_BLENDFACTORALPHA
Definition: wined3d.h:1158
#define WINED3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR
Definition: wined3d.h:1164
#define WINED3DPMISCCAPS_TSSARGTEMP
Definition: wined3d.h:1101
#define WINED3DTEXOPCAPS_DOTPRODUCT3
Definition: wined3d.h:1168
#define WINED3DTEXOPCAPS_BLENDTEXTUREALPHAPM
Definition: wined3d.h:1159
#define WINED3DTEXOPCAPS_MODULATE4X
Definition: wined3d.h:1150
#define WINED3DTEXOPCAPS_SELECTARG1
Definition: wined3d.h:1146
#define WINED3DTEXOPCAPS_BUMPENVMAPLUMINANCE
Definition: wined3d.h:1167
#define WINED3DTEXOPCAPS_MULTIPLYADD
Definition: wined3d.h:1169
DWORD MaxSimultaneousTextures
#define WINED3DTEXOPCAPS_MODULATE2X
Definition: wined3d.h:1149
#define min(a, b)
Definition: monoChain.cc:55
#define WINED3DTEXOPCAPS_SUBTRACT
Definition: wined3d.h:1154
#define WINED3DTEXOPCAPS_MODULATECOLOR_ADDALPHA
Definition: wined3d.h:1163
struct wined3d_gl_limits limits
#define WINED3DTEXOPCAPS_BLENDTEXTUREALPHA
Definition: wined3d.h:1157
#define WINED3DTEXOPCAPS_BUMPENVMAP
Definition: wined3d.h:1166
#define WINED3D_FRAGMENT_CAP_COLOR_KEY
#define WINED3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR
Definition: wined3d.h:1162
#define WINED3DTEXOPCAPS_ADD
Definition: wined3d.h:1151

◆ arbfp_get_emul_mask()

static DWORD arbfp_get_emul_mask ( const struct wined3d_gl_info gl_info)
static

Definition at line 5798 of file arb_program_shader.c.

5799 {
5801 }
#define GL_EXT_EMUL_EXT_FOG_COORD
#define GL_EXT_EMUL_ARB_MULTITEXTURE

◆ arbfp_texture_target()

static const char* arbfp_texture_target ( enum wined3d_gl_resource_type  type)
static

Definition at line 6216 of file arb_program_shader.c.

6217 {
6218  switch(type)
6219  {
6221  return "1D";
6223  return "2D";
6225  return "3D";
6227  return "CUBE";
6229  return "RECT";
6230  default:
6231  return "unexpected_resource_type";
6232  }
6233 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by arbfp_gen_plain_shader(), gen_arbfp_ffp_shader(), gen_nv12_read(), gen_p8_shader(), gen_planar_yuv_read(), and gen_yv12_read().

◆ calc_color_correction()

static struct color_fixup_masks calc_color_correction ( struct color_fixup_desc  fixup,
DWORD  dst_mask 
)
static

Definition at line 1290 of file arb_program_shader.c.

1291 {
1292  struct color_fixup_masks masks = {0, 0};
1293 
1294  if (is_complex_fixup(fixup))
1295  {
1297  FIXME("Complex fixup (%#x) not supported\n", complex_fixup);
1298  return masks;
1299  }
1300 
1301  if (fixup.x_source != CHANNEL_SOURCE_X)
1302  masks.source |= WINED3DSP_WRITEMASK_0;
1303  if (fixup.y_source != CHANNEL_SOURCE_Y)
1304  masks.source |= WINED3DSP_WRITEMASK_1;
1305  if (fixup.z_source != CHANNEL_SOURCE_Z)
1306  masks.source |= WINED3DSP_WRITEMASK_2;
1307  if (fixup.w_source != CHANNEL_SOURCE_W)
1308  masks.source |= WINED3DSP_WRITEMASK_3;
1309  masks.source &= dst_mask;
1310 
1311  if (fixup.x_sign_fixup)
1312  masks.sign |= WINED3DSP_WRITEMASK_0;
1313  if (fixup.y_sign_fixup)
1314  masks.sign |= WINED3DSP_WRITEMASK_1;
1315  if (fixup.z_sign_fixup)
1316  masks.sign |= WINED3DSP_WRITEMASK_2;
1317  if (fixup.w_sign_fixup)
1318  masks.sign |= WINED3DSP_WRITEMASK_3;
1319  masks.sign &= dst_mask;
1320 
1321  return masks;
1322 }
unsigned short w_sign_fixup
unsigned short x_source
#define WINED3DSP_WRITEMASK_0
unsigned short z_sign_fixup
unsigned short w_source
complex_fixup
static BOOL is_complex_fixup(struct color_fixup_desc fixup)
unsigned short x_sign_fixup
#define FIXME(fmt,...)
Definition: debug.h:110
unsigned short z_source
unsigned short y_sign_fixup
#define WINED3DSP_WRITEMASK_1
#define WINED3DSP_WRITEMASK_2
static enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)
#define WINED3DSP_WRITEMASK_3
unsigned short y_source
static const BYTE masks[8]
Definition: dib.c:2760

Referenced by gen_arbfp_ffp_shader(), and shader_hw_sample().

◆ clone_sig()

static void clone_sig ( struct wined3d_shader_signature new,
const struct wined3d_shader_signature sig 
)
static

Definition at line 3877 of file arb_program_shader.c.

3878 {
3879  unsigned int i;
3880  char *name;
3881 
3882  new->element_count = sig->element_count;
3883  new->elements = heap_calloc(new->element_count, sizeof(*new->elements));
3884  for (i = 0; i < sig->element_count; ++i)
3885  {
3886  new->elements[i] = sig->elements[i];
3887 
3888  if (!new->elements[i].semantic_name)
3889  continue;
3890 
3891  /* Clone the semantic string */
3892  name = heap_alloc(strlen(sig->elements[i].semantic_name) + 1);
3893  strcpy(name, sig->elements[i].semantic_name);
3894  new->elements[i].semantic_name = name;
3895  }
3896 }
#define new(TYPE, numElems)
Definition: treelist.c:54
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void * heap_calloc(SIZE_T count, SIZE_T size)
Definition: heap.h:49
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
Definition: name.c:36
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
struct wined3d_shader_signature_element * elements
Definition: wined3d.h:2046
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by find_input_signature().

◆ color_key_arbfp()

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

Definition at line 5983 of file arb_program_shader.c.

5984 {
5985  const struct wined3d_texture *texture = state->textures[0];
5986  const struct wined3d_gl_info *gl_info = context->gl_info;
5987  struct wined3d_device *device = context->device;
5988  struct wined3d_color float_key[2];
5989 
5990  if (!texture)
5991  return;
5992 
5993  if (device->shader_backend == &arb_program_shader_backend)
5994  {
5995  struct shader_arb_priv *priv;
5996 
5997  /* Don't load the parameter if we're using an arbfp pixel shader,
5998  * otherwise we'll overwrite application provided constants. */
5999  if (use_ps(state))
6000  return;
6001 
6002  priv = device->shader_priv;
6006  }
6007 
6008  wined3d_format_get_float_color_key(texture->resource.format, &texture->async.src_blt_color_key, float_key);
6009 
6010  GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY_LOW, &float_key[0].r));
6011  checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY_LOW, &float_key[0].r)");
6012  GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY_HIGH, &float_key[1].r));
6013  checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY_HIGH, &float_key[1].r)");
6014 }
char pshader_const_dirty[WINED3D_MAX_PS_CONSTS_F]
#define max(a, b)
Definition: svc.c:63
unsigned int highest_dirty_ps_const
#define ARB_FFP_CONST_COLOR_KEY_LOW
Definition: http.c:6587
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
void wined3d_format_get_float_color_key(const struct wined3d_format *format, const struct wined3d_color_key *key, struct wined3d_color *float_colors)
Definition: utils.c:5314
Definition: devices.h:37
#define GL_EXTCALL(f)
GLenum GLuint texture
Definition: glext.h:6295
static int state
Definition: maze.c:121
static BOOL use_ps(const struct wined3d_state *state)
#define checkGLcall(A)
#define ARB_FFP_CONST_COLOR_KEY_HIGH
const struct wined3d_shader_backend_ops arb_program_shader_backend
#define GL_FRAGMENT_PROGRAM_ARB
Definition: glext.h:1466

Referenced by fragment_prog_arbfp().

◆ compare_sig()

static int compare_sig ( const struct wined3d_shader_signature sig1,
const struct wined3d_shader_signature sig2 
)
static

Definition at line 3837 of file arb_program_shader.c.

3838 {
3839  unsigned int i;
3840  int ret;
3841 
3842  if (sig1->element_count != sig2->element_count)
3843  return sig1->element_count < sig2->element_count ? -1 : 1;
3844 
3845  for (i = 0; i < sig1->element_count; ++i)
3846  {
3847  const struct wined3d_shader_signature_element *e1, *e2;
3848 
3849  e1 = &sig1->elements[i];
3850  e2 = &sig2->elements[i];
3851 
3852  if (!e1->semantic_name || !e2->semantic_name)
3853  {
3854  /* Compare pointers, not contents. One string is NULL (element
3855  * does not exist), the other one is not NULL. */
3856  if (e1->semantic_name != e2->semantic_name)
3857  return e1->semantic_name < e2->semantic_name ? -1 : 1;
3858  continue;
3859  }
3860 
3861  if ((ret = strcmp(e1->semantic_name, e2->semantic_name)))
3862  return ret;
3863  if (e1->semantic_idx != e2->semantic_idx)
3864  return e1->semantic_idx < e2->semantic_idx ? -1 : 1;
3865  if (e1->sysval_semantic != e2->sysval_semantic)
3866  return e1->sysval_semantic < e2->sysval_semantic ? -1 : 1;
3867  if (e1->component_type != e2->component_type)
3868  return e1->component_type < e2->component_type ? -1 : 1;
3869  if (e1->register_idx != e2->register_idx)
3870  return e1->register_idx < e2->register_idx ? -1 : 1;
3871  if (e1->mask != e2->mask)
3872  return e1->mask < e2->mask ? -1 : 1;
3873  }
3874  return 0;
3875 }
enum wined3d_component_type component_type
Definition: wined3d.h:2038
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
enum wined3d_sysval_semantic sysval_semantic
Definition: wined3d.h:2037
int ret
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
struct wined3d_shader_signature_element * elements
Definition: wined3d.h:2046

Referenced by sig_tree_compare().

◆ ffp_clip_emul()

static BOOL ffp_clip_emul ( const struct wined3d_context context)
inlinestatic

Definition at line 124 of file arb_program_shader.c.

125 {
126  return context->lowest_disabled_stage < 7;
127 }
Definition: http.c:6587

Referenced by find_arb_vs_compile_args().

◆ find_arb_ps_compile_args()

static void find_arb_ps_compile_args ( const struct wined3d_state state,
const struct wined3d_context context,
const struct wined3d_shader shader,
struct arb_ps_compile_args args 
)
static

Definition at line 4430 of file arb_program_shader.c.

4433 {
4434  const struct wined3d_gl_info *gl_info = context->gl_info;
4435  const struct wined3d_d3d_info *d3d_info = context->d3d_info;
4436  int i;
4437  WORD int_skip;
4438 
4439  find_ps_compile_args(state, shader, context->stream_info.position_transformed, &args->super, context);
4440 
4441  /* This forces all local boolean constants to 1 to make them stateblock independent */
4442  args->bools = shader->reg_maps.local_bool_consts;
4443 
4444  for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
4445  {
4446  if (state->ps_consts_b[i])
4447  args->bools |= ( 1u << i);
4448  }
4449 
4450  /* Only enable the clip plane emulation KIL if at least one clipplane is enabled. The KIL instruction
4451  * is quite expensive because it forces the driver to disable early Z discards. It is cheaper to
4452  * duplicate the shader than have a no-op KIL instruction in every shader
4453  */
4454  if (!d3d_info->vs_clipping && use_vs(state)
4455  && state->render_states[WINED3D_RS_CLIPPING]
4456  && state->render_states[WINED3D_RS_CLIPPLANEENABLE])
4457  args->clip = 1;
4458  else
4459  args->clip = 0;
4460 
4461  /* Skip if unused or local, or supported natively */
4462  int_skip = ~shader->reg_maps.integer_constants | shader->reg_maps.local_int_consts;
4463  if (int_skip == 0xffff || gl_info->supported[NV_FRAGMENT_PROGRAM_OPTION])
4464  {
4465  memset(args->loop_ctrl, 0, sizeof(args->loop_ctrl));
4466  return;
4467  }
4468 
4469  for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
4470  {
4471  if (int_skip & (1u << i))
4472  {
4473  args->loop_ctrl[i][0] = 0;
4474  args->loop_ctrl[i][1] = 0;
4475  args->loop_ctrl[i][2] = 0;
4476  }
4477  else
4478  {
4479  args->loop_ctrl[i][0] = state->ps_consts_i[i].x;
4480  args->loop_ctrl[i][1] = state->ps_consts_i[i].y;
4481  args->loop_ctrl[i][2] = state->ps_consts_i[i].z;
4482  }
4483  }
4484 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
Definition: http.c:6587
#define WINED3D_MAX_CONSTS_I
void find_ps_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, BOOL position_transformed, struct ps_compile_args *args, const struct wined3d_context *context)
Definition: shader.c:3782
Definition: match.c:390
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
BOOL supported[WINED3D_GL_EXT_COUNT]
GLuint shader
Definition: glext.h:6030
if(!(yy_init))
Definition: macro.lex.yy.c:714
unsigned short WORD
Definition: ntddk_ex.h:93
static int state
Definition: maze.c:121
#define WINED3D_MAX_CONSTS_B
static BOOL use_vs(const struct wined3d_state *state)
#define memset(x, y, z)
Definition: compat.h:39

Referenced by shader_arb_select().

◆ find_arb_pshader()

static struct arb_ps_compiled_shader* find_arb_pshader ( struct wined3d_shader shader,
const struct arb_ps_compile_args args 
)
static

Definition at line 4244 of file arb_program_shader.c.

4246 {
4247  struct wined3d_device *device = shader->device;
4248  const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
4249  const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
4250  UINT i;
4251  DWORD new_size;
4252  struct arb_ps_compiled_shader *new_array;
4254  struct arb_pshader_private *shader_data;
4255  GLuint ret;
4256 
4257  if (!shader->backend_data)
4258  {
4259  struct shader_arb_priv *priv = device->shader_priv;
4260 
4261  shader->backend_data = heap_alloc_zero(sizeof(*shader_data));
4262  shader_data = shader->backend_data;
4263  shader_data->clamp_consts = shader->reg_maps.shader_version.major == 1;
4264 
4265  if (shader->reg_maps.shader_version.major < 3)
4266  shader_data->input_signature_idx = ~0U;
4267  else
4268  shader_data->input_signature_idx = find_input_signature(priv, &shader->input_signature);
4269 
4270  TRACE("Shader got assigned input signature index %u\n", shader_data->input_signature_idx);
4271 
4272  if (!d3d_info->vs_clipping)
4274  d3d_info->limits.ffp_blend_stages - 1);
4275  else
4276  shader_data->clipplane_emulation = ~0U;
4277  }
4278  shader_data = shader->backend_data;
4279 
4280  /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
4281  * so a linear search is more performant than a hashmap or a binary search
4282  * (cache coherency etc)
4283  */
4284  for (i = 0; i < shader_data->num_gl_shaders; ++i)
4285  {
4286  if (!memcmp(&shader_data->gl_shaders[i].args, args, sizeof(*args)))
4287  return &shader_data->gl_shaders[i];
4288  }
4289 
4290  TRACE("No matching GL shader found, compiling a new shader\n");
4291  if(shader_data->shader_array_size == shader_data->num_gl_shaders) {
4292  if (shader_data->num_gl_shaders)
4293  {
4294  new_size = shader_data->shader_array_size + max(1, shader_data->shader_array_size / 2);
4295  new_array = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, shader_data->gl_shaders,
4296  new_size * sizeof(*shader_data->gl_shaders));
4297  }
4298  else
4299  {
4300  new_array = heap_alloc_zero(sizeof(*shader_data->gl_shaders));
4301  new_size = 1;
4302  }
4303 
4304  if(!new_array) {
4305  ERR("Out of memory\n");
4306  return 0;
4307  }
4308  shader_data->gl_shaders = new_array;
4309  shader_data->shader_array_size = new_size;
4310  }
4311 
4312  shader_data->gl_shaders[shader_data->num_gl_shaders].args = *args;
4313 
4314  pixelshader_update_resource_types(shader, args->super.tex_types);
4315 
4316  if (!string_buffer_init(&buffer))
4317  {
4318  ERR("Failed to initialize shader buffer.\n");
4319  return 0;
4320  }
4321 
4323  &shader_data->gl_shaders[shader_data->num_gl_shaders]);
4325  shader_data->gl_shaders[shader_data->num_gl_shaders].prgId = ret;
4326 
4327  return &shader_data->gl_shaders[shader_data->num_gl_shaders++];
4328 }
#define max(a, b)
Definition: svc.c:63
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
BOOL string_buffer_init(struct wined3d_string_buffer *buffer)
Definition: shader.c:428
#define U(x)
Definition: wordpad.c:44
GLuint buffer
Definition: glext.h:5915
Definition: match.c:390
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void pixelshader_update_resource_types(struct wined3d_shader *shader, WORD tex_types)
Definition: shader.c:4073
Definition: devices.h:37
void string_buffer_free(struct wined3d_string_buffer *buffer)
Definition: shader.c:441
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
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 wined3d_d3d_limits limits
#define HeapReAlloc
Definition: compat.h:393
struct arb_ps_compiled_shader * gl_shaders
unsigned int UINT
Definition: ndis.h:50
unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_maps *reg_maps, unsigned int max)
Definition: shader.c:1838
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static DWORD find_input_signature(struct shader_arb_priv *priv, const struct wined3d_shader_signature *sig)
static GLuint shader_arb_generate_pshader(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, const struct arb_ps_compile_args *args, struct arb_ps_compiled_shader *compiled)
#define args
Definition: format.c:66

Referenced by shader_arb_select().

◆ find_arb_vs_compile_args()

static void find_arb_vs_compile_args ( const struct wined3d_state state,
const struct wined3d_context context,
const struct wined3d_shader shader,
struct arb_vs_compile_args args 
)
static

Definition at line 4486 of file arb_program_shader.c.

4489 {
4490  const struct wined3d_device *device = shader->device;
4491  const struct wined3d_adapter *adapter = device->adapter;
4492  const struct wined3d_gl_info *gl_info = context->gl_info;
4493  const struct wined3d_d3d_info *d3d_info = context->d3d_info;
4494  int i;
4495  WORD int_skip;
4496 
4497  find_vs_compile_args(state, shader, context->stream_info.swizzle_map, &args->super, context);
4498 
4499  args->clip.boolclip_compare = 0;
4500  if (use_ps(state))
4501  {
4502  const struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL];
4503  const struct arb_pshader_private *shader_priv = ps->backend_data;
4504  args->ps_signature = shader_priv->input_signature_idx;
4505 
4506  args->clip.boolclip.clip_texcoord = shader_priv->clipplane_emulation + 1;
4507  }
4508  else
4509  {
4510  args->ps_signature = ~0;
4511  if (!d3d_info->vs_clipping && adapter->fragment_pipe == &arbfp_fragment_pipeline)
4512  args->clip.boolclip.clip_texcoord = ffp_clip_emul(context) ? d3d_info->limits.ffp_blend_stages : 0;
4513  /* Otherwise: Setting boolclip_compare set clip_texcoord to 0 */
4514  }
4515 
4516  if (args->clip.boolclip.clip_texcoord)
4517  {
4518  if (state->render_states[WINED3D_RS_CLIPPING])
4519  args->clip.boolclip.clipplane_mask = (unsigned char)state->render_states[WINED3D_RS_CLIPPLANEENABLE];
4520  /* clipplane_mask was set to 0 by setting boolclip_compare to 0 */
4521  }
4522 
4523  /* This forces all local boolean constants to 1 to make them stateblock independent */
4524  args->clip.boolclip.bools = shader->reg_maps.local_bool_consts;
4525  /* TODO: Figure out if it would be better to store bool constants as bitmasks in the stateblock */
4526  for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
4527  {
4528  if (state->vs_consts_b[i])
4529  args->clip.boolclip.bools |= (1u << i);
4530  }
4531 
4532  args->vertex.samplers[0] = context->tex_unit_map[MAX_FRAGMENT_SAMPLERS + 0];
4533  args->vertex.samplers[1] = context->tex_unit_map[MAX_FRAGMENT_SAMPLERS + 1];
4534  args->vertex.samplers[2] = context->tex_unit_map[MAX_FRAGMENT_SAMPLERS + 2];
4535  args->vertex.samplers[3] = 0;
4536 
4537  /* Skip if unused or local */
4538  int_skip = ~shader->reg_maps.integer_constants | shader->reg_maps.local_int_consts;
4539  /* This is about flow control, not clipping. */
4540  if (int_skip == 0xffff || gl_info->supported[NV_VERTEX_PROGRAM2_OPTION])
4541  {
4542  memset(args->loop_ctrl, 0, sizeof(args->loop_ctrl));
4543  return;
4544  }
4545 
4546  for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
4547  {
4548  if (int_skip & (1u << i))
4549  {
4550  args->loop_ctrl[i][0] = 0;
4551  args->loop_ctrl[i][1] = 0;
4552  args->loop_ctrl[i][2] = 0;
4553  }
4554  else
4555  {
4556  args->loop_ctrl[i][0] = state->vs_consts_i[i].x;
4557  args->loop_ctrl[i][1] = state->vs_consts_i[i].y;
4558  args->loop_ctrl[i][2] = state->vs_consts_i[i].z;
4559  }
4560  }
4561 }
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
struct wined3d_pixel_shader ps
#define WINED3D_MAX_CONSTS_I
Definition: match.c:390
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
Definition: devices.h:37
BOOL supported[WINED3D_GL_EXT_COUNT]
unsigned char
Definition: typeof.h:29
GLuint shader
Definition: glext.h:6030
#define MAX_FRAGMENT_SAMPLERS
unsigned short WORD
Definition: ntddk_ex.h:93
static BOOL ffp_clip_emul(const struct wined3d_context *context)
static int state
Definition: maze.c:121
static BOOL use_ps(const struct wined3d_state *state)
void find_vs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, WORD swizzle_map, struct vs_compile_args *args, const struct wined3d_context *context)
Definition: shader.c:3463
const struct fragment_pipeline arbfp_fragment_pipeline
struct wined3d_d3d_limits limits
const struct fragment_pipeline * fragment_pipe
#define WINED3D_MAX_CONSTS_B
#define memset(x, y, z)
Definition: compat.h:39

Referenced by shader_arb_select().

◆ find_arb_vshader()

static struct arb_vs_compiled_shader* find_arb_vshader ( struct wined3d_shader shader,
const struct wined3d_gl_info gl_info,
DWORD  use_map,
const struct arb_vs_compile_args args,
const struct wined3d_shader_signature ps_input_sig 
)
static

Definition at line 4343 of file arb_program_shader.c.

4346 {
4347  UINT i;
4348  DWORD new_size;
4349  struct arb_vs_compiled_shader *new_array;
4351  struct arb_vshader_private *shader_data;
4352  GLuint ret;
4353 
4354  if (!shader->backend_data)
4355  {
4356  const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
4357 
4358  shader->backend_data = heap_alloc_zero(sizeof(*shader_data));
4359  shader_data = shader->backend_data;
4360 
4361  if ((gl_info->quirks & WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT)
4362  && reg_maps->min_rel_offset <= reg_maps->max_rel_offset)
4363  {
4364  if (reg_maps->max_rel_offset - reg_maps->min_rel_offset > 127)
4365  {
4366  FIXME("The difference between the minimum and maximum relative offset is > 127.\n");
4367  FIXME("Which this OpenGL implementation does not support. Try using GLSL.\n");
4368  FIXME("Min: %u, Max: %u.\n", reg_maps->min_rel_offset, reg_maps->max_rel_offset);
4369  }
4370  else if (reg_maps->max_rel_offset - reg_maps->min_rel_offset > 63)
4371  shader_data->rel_offset = reg_maps->min_rel_offset + 63;
4372  else if (reg_maps->max_rel_offset > 63)
4373  shader_data->rel_offset = reg_maps->min_rel_offset;
4374  }
4375  }
4376  shader_data = shader->backend_data;
4377 
4378  /* Usually we have very few GL shaders for each d3d shader(just 1 or maybe 2),
4379  * so a linear search is more performant than a hashmap or a binary search
4380  * (cache coherency etc)
4381  */
4382  for(i = 0; i < shader_data->num_gl_shaders; i++) {
4383  if (vs_args_equal(&shader_data->gl_shaders[i].args, args,
4384  use_map, gl_info->supported[NV_VERTEX_PROGRAM2_OPTION]))
4385  {
4386  return &shader_data->gl_shaders[i];
4387  }
4388  }
4389 
4390  TRACE("No matching GL shader found, compiling a new shader\n");
4391 
4392  if(shader_data->shader_array_size == shader_data->num_gl_shaders) {
4393  if (shader_data->num_gl_shaders)
4394  {
4395  new_size = shader_data->shader_array_size + max(1, shader_data->shader_array_size / 2);
4396  new_array = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, shader_data->gl_shaders,
4397  new_size * sizeof(*shader_data->gl_shaders));
4398  }
4399  else
4400  {
4401  new_array = heap_alloc_zero(sizeof(*shader_data->gl_shaders));
4402  new_size = 1;
4403  }
4404 
4405  if(!new_array) {
4406  ERR("Out of memory\n");
4407  return 0;
4408  }
4409  shader_data->gl_shaders = new_array;
4410  shader_data->shader_array_size = new_size;
4411  }
4412 
4413  shader_data->gl_shaders[shader_data->num_gl_shaders].args = *args;
4414 
4415  if (!string_buffer_init(&buffer))
4416  {
4417  ERR("Failed to initialize shader buffer.\n");
4418  return 0;
4419  }
4420 
4422  &shader_data->gl_shaders[shader_data->num_gl_shaders],
4423  ps_input_sig);
4425  shader_data->gl_shaders[shader_data->num_gl_shaders].prgId = ret;
4426 
4427  return &shader_data->gl_shaders[shader_data->num_gl_shaders++];
4428 }
#define WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT
#define max(a, b)
Definition: svc.c:63
static BOOL vs_args_equal(const struct arb_vs_compile_args *stored, const struct arb_vs_compile_args *new, const DWORD use_map, BOOL skip_int)
BOOL string_buffer_init(struct wined3d_string_buffer *buffer)
Definition: shader.c:428
struct arb_vs_compiled_shader * gl_shaders
GLuint buffer
Definition: glext.h:5915
Definition: match.c:390
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
#define FIXME(fmt,...)
Definition: debug.h:110
BOOL supported[WINED3D_GL_EXT_COUNT]
void string_buffer_free(struct wined3d_string_buffer *buffer)
Definition: shader.c:441
static GLuint shader_arb_generate_vshader(const struct wined3d_shader *shader, const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, const struct arb_vs_compile_args *args, struct arb_vs_compiled_shader *compiled, const struct wined3d_shader_signature *ps_input_sig)
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int GLuint
Definition: gl.h:159
#define HeapReAlloc
Definition: compat.h:393
unsigned int UINT
Definition: ndis.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define args
Definition: format.c:66

Referenced by shader_arb_select().

◆ find_input_signature()

static DWORD find_input_signature ( struct shader_arb_priv priv,
const struct wined3d_shader_signature sig 
)
static

Definition at line 3898 of file arb_program_shader.c.

3899 {
3900  struct wine_rb_entry *entry = wine_rb_get(&priv->signature_tree, sig);
3901  struct ps_signature *found_sig;
3902 
3903  if (entry)
3904  {
3905  found_sig = WINE_RB_ENTRY_VALUE(entry, struct ps_signature, entry);
3906  TRACE("Found existing signature %u\n", found_sig->idx);
3907  return found_sig->idx;
3908  }
3909  found_sig = heap_alloc_zero(sizeof(*found_sig));
3910  clone_sig(&found_sig->sig, sig);
3911  found_sig->idx = priv->ps_sig_number++;
3912  TRACE("New signature stored and assigned number %u\n", found_sig->idx);
3913  if(wine_rb_put(&priv->signature_tree, sig, &found_sig->entry) == -1)
3914  {
3915  ERR("Failed to insert program entry.\n");
3916  }
3917  return found_sig->idx;
3918 }
struct wine_rb_tree signature_tree
static void clone_sig(struct wined3d_shader_signature *new, const struct wined3d_shader_signature *sig)
struct wined3d_shader_signature sig
#define TRACE(s)
Definition: solgame.cpp:4
#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
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
struct wine_rb_entry entry
static struct wine_rb_entry * wine_rb_get(const struct wine_rb_tree *tree, const void *key)
Definition: rbtree.h:203

Referenced by find_arb_pshader().

◆ find_last_loop()

static const struct control_frame* find_last_loop ( const struct shader_arb_ctx_priv priv)
static

Definition at line 2970 of file arb_program_shader.c.

2971 {
2972  struct control_frame *control_frame;
2973 
2975  {
2976  if(control_frame->type == LOOP || control_frame->type == REP) return control_frame;
2977  }
2978  ERR("Could not find loop for break\n");
2979  return NULL;
2980 }
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define REP
Definition: patmatch.h:52
smooth NULL
Definition: ftsmooth.c:416
enum control_frame::@251 type
uint32_t entry
Definition: isohybrid.c:63
#define ERR(fmt,...)
Definition: debug.h:109

Referenced by shader_hw_break(), and shader_hw_breakc().

◆ find_loop_control_values()

static const DWORD* find_loop_control_values ( const struct wined3d_shader shader,
DWORD  idx 
)
static

Definition at line 3398 of file arb_program_shader.c.

3399 {
3400  const struct wined3d_shader_lconst *constant;
3401 
3403  {
3404  if (constant->idx == idx)
3405  {
3406  return constant->value;
3407  }
3408  }
3409  return NULL;
3410 }
union constant::@229 value[4]
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
GLuint shader
Definition: glext.h:6030
uint32_t entry
Definition: isohybrid.c:63

Referenced by shader_arb_generate_pshader(), and shader_arb_generate_vshader().

◆ fragment_prog_arbfp()

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

Definition at line 6538 of file arb_program_shader.c.

6539 {
6540  const struct wined3d_gl_info *gl_info = context->gl_info;
6541  const struct wined3d_device *device = context->device;
6542  struct shader_arb_priv *priv = device->fragment_priv;
6543  BOOL use_pshader = use_ps(state);
6544  struct ffp_frag_settings settings;
6545  const struct arbfp_ffp_desc *desc;
6546  unsigned int i;
6547 
6548  TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
6549 
6551  {
6552  if (!use_pshader && device->shader_backend == &arb_program_shader_backend && context->last_was_pshader)
6553  {
6554  /* Reload fixed function constants since they collide with the
6555  * pixel shader constants. */
6556  for (i = 0; i < MAX_TEXTURES; ++i)
6557  {
6560  }
6564  }
6565  else if (use_pshader)
6566  {
6567  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
6568  }
6569  return;
6570  }
6571 
6572  if (!use_pshader)
6573  {
6574  /* Find or create a shader implementing the fixed function pipeline
6575  * settings, then activate it. */
6578  if (!desc)
6579  {
6580  struct arbfp_ffp_desc *new_desc;
6581 
6582  if (!(new_desc = heap_alloc(sizeof(*new_desc))))
6583  {
6584  ERR("Out of memory\n");
6585  return;
6586  }
6587 
6588  new_desc->parent.settings = settings;
6589  new_desc->shader = gen_arbfp_ffp_shader(&settings, gl_info);
6590  add_ffp_frag_shader(&priv->fragment_shaders, &new_desc->parent);
6591  TRACE("Allocated fixed function replacement shader descriptor %p\n", new_desc);
6592  desc = new_desc;
6593  }
6594 
6595  /* Now activate the replacement program. GL_FRAGMENT_PROGRAM_ARB is already active (however, note the
6596  * comment above the shader_select call below). If e.g. GLSL is active, the shader_select call will
6597  * deactivate it.
6598  */
6599  GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, desc->shader));
6600  checkGLcall("glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, desc->shader)");
6601  priv->current_fprogram_id = desc->shader;
6602 
6603  if (device->shader_backend == &arb_program_shader_backend && context->last_was_pshader)
6604  {
6605  /* Reload fixed function constants since they collide with the
6606  * pixel shader constants. */
6607  for (i = 0; i < MAX_TEXTURES; ++i)
6608  {
6611  }
6615  }
6616  context->last_was_pshader = FALSE;
6617  }
6618  else if (!context->last_was_pshader)
6619  {
6620  if (device->shader_backend == &arb_program_shader_backend)
6621  context->constant_update_mask |= WINED3D_SHADER_CONST_PS_F;
6622  context->last_was_pshader = TRUE;
6623  }
6624 
6625  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
6626 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define STATE_TEXTURESTAGE(stage, num)
struct mke2fs_defaults settings[]
#define MAX_TEXTURES
#define TRUE
Definition: types.h:120
struct ffp_frag_desc parent
Definition: http.c:6587
static void set_bumpmat_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
#define STATE_COLOR_KEY
static void state_texfactor_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: devices.h:37
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *desc)
Definition: utils.c:6076
static void state_tss_constant_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
struct wine_rb_tree fragment_shaders
#define GL_EXTCALL(f)
#define TRACE(s)
Definition: solgame.cpp:4
const struct ffp_frag_desc * find_ffp_frag_shader(const struct wine_rb_tree *fragment_shaders, const struct ffp_frag_settings *settings)
Definition: utils.c:6069
static void state_arb_specularenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static int state
Definition: maze.c:121
static BOOL use_ps(const struct wined3d_state *state)
#define STATE_RENDER(a)
#define ERR(fmt,...)
Definition: debug.h:109
#define WINED3D_SHADER_CONST_PS_F
#define checkGLcall(A)
static void color_key_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, const struct wined3d_gl_info *gl_info)
void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d_state *state, struct ffp_frag_settings *settings, BOOL ignore_textype)
Definition: utils.c:5744
const struct wined3d_shader_backend_ops arb_program_shader_backend
#define GL_FRAGMENT_PROGRAM_ARB
Definition: glext.h:1466

Referenced by state_arbfp_fog(), and textransform().

◆ free_recorded_instruction()

static void free_recorded_instruction ( struct list list)
static

Definition at line 5398 of file arb_program_shader.c.

5399 {
5400  struct recorded_instruction *rec_ins, *entry2;
5401  unsigned int i;
5402 
5403  LIST_FOR_EACH_ENTRY_SAFE(rec_ins, entry2, list, struct recorded_instruction, entry)
5404  {
5405  list_remove(&rec_ins->entry);
5406  if (rec_ins->ins.dst)
5407  {
5408  heap_free((void *)rec_ins->ins.dst->reg.idx[0].rel_addr);
5409  heap_free((void *)rec_ins->ins.dst);
5410  }
5411  if (rec_ins->ins.src)
5412  {
5413  for (i = 0; i < rec_ins->ins.src_count; ++i)
5414  {
5415  heap_free((void *)rec_ins->ins.src[i].reg.idx[0].rel_addr);
5416  }
5417  heap_free((void *)rec_ins->ins.src);
5418  }
5419  heap_free(rec_ins);
5420  }
5421 }
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
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
struct wined3d_shader_instruction ins
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by shader_arb_handle_instruction().

◆ gen_arbfp_ffp_shader()

static GLuint gen_arbfp_ffp_shader ( const struct ffp_frag_settings settings,
const struct wined3d_gl_info gl_info 
)
static

Definition at line 6235 of file arb_program_shader.c.

6236 {
6237  BYTE tex_read = 0, bump_used = 0, luminance_used = 0, constant_used = 0;
6238  BOOL tempreg_used = FALSE, tfactor_used = FALSE;
6239  unsigned int stage, lowest_disabled_stage;
6241  struct color_fixup_masks masks;
6242  BOOL custom_linear_fog = FALSE;
6243  const char *textype, *instr;
6244  DWORD arg0, arg1, arg2;
6245  char colorcor_dst[8];
6246  BOOL op_equal;
6247  GLuint ret;
6248 
6249  if (!string_buffer_init(&buffer))
6250  {
6251  ERR("Failed to initialize shader buffer.\n");
6252  return 0;
6253  }
6254 
6255  shader_addline(&buffer, "!!ARBfp1.0\n");
6256 
6257  if (settings->color_key_enabled)
6258  {
6259  shader_addline(&buffer, "PARAM color_key_low = program.env[%u];\n", ARB_FFP_CONST_COLOR_KEY_LOW);
6260  shader_addline(&buffer, "PARAM color_key_high = program.env[%u];\n", ARB_FFP_CONST_COLOR_KEY_HIGH);
6261  tex_read |= 1;
6262  }
6263 
6264  /* Find out which textures are read */
6265  for (stage = 0; stage < MAX_TEXTURES; ++stage)
6266  {
6267  if (settings->op[stage].cop == WINED3D_TOP_DISABLE)
6268  break;
6269 
6270  arg0 = settings->op[stage].carg0 & WINED3DTA_SELECTMASK;
6271  arg1 = settings->op[stage].carg1 & WINED3DTA_SELECTMASK;
6272  arg2 = settings->op[stage].carg2 & WINED3DTA_SELECTMASK;
6273 
6275  tex_read |= 1u << stage;
6276  if (settings->op[stage].dst == tempreg)
6277  tempreg_used = TRUE;
6278  if (arg0 == WINED3DTA_TEMP || arg1 == WINED3DTA_TEMP || arg2 == WINED3DTA_TEMP)
6279  tempreg_used = TRUE;
6281  tfactor_used = TRUE;
6283  constant_used |= 1u << stage;
6284 
6285  switch (settings->op[stage].cop)
6286  {
6288  luminance_used |= 1u << stage;
6289  /* fall through */
6291  bump_used |= 1u << stage;
6292  /* fall through */
6295  tex_read |= 1u << stage;
6296  break;
6297 
6299  tfactor_used = TRUE;
6300  break;
6301 
6302  default:
6303  break;
6304  }
6305 
6306  if (settings->op[stage].aop == WINED3D_TOP_DISABLE)
6307  continue;
6308 
6309  arg0 = settings->op[stage].aarg0 & WINED3DTA_SELECTMASK;
6310  arg1 = settings->op[stage].aarg1 & WINED3DTA_SELECTMASK;
6311  arg2 = settings->op[stage].aarg2 & WINED3DTA_SELECTMASK;
6312 
6314  tex_read |= 1u << stage;
6315  if (arg0 == WINED3DTA_TEMP || arg1 == WINED3DTA_TEMP || arg2 == WINED3DTA_TEMP)
6316  tempreg_used = TRUE;
6318  tfactor_used = TRUE;
6320  constant_used |= 1u << stage;
6321  }
6322  lowest_disabled_stage = stage;
6323 
6324  switch (settings->fog)
6325  {
6326  case WINED3D_FFP_PS_FOG_OFF: break;
6328  if (gl_info->quirks & WINED3D_QUIRK_BROKEN_ARB_FOG)
6329  {
6330  custom_linear_fog = TRUE;
6331  break;
6332  }
6333  shader_addline(&buffer, "OPTION ARB_fog_linear;\n");
6334  break;
6335 
6336  case WINED3D_FFP_PS_FOG_EXP: shader_addline(&buffer, "OPTION ARB_fog_exp;\n"); break;
6337  case WINED3D_FFP_PS_FOG_EXP2: shader_addline(&buffer, "OPTION ARB_fog_exp2;\n"); break;
6338  default: FIXME("Unexpected fog setting %d\n", settings->fog);
6339  }
6340 
6341  shader_addline(&buffer, "PARAM const = {1, 2, 4, 0.5};\n");
6342  shader_addline(&buffer, "TEMP TMP;\n");
6343  shader_addline(&buffer, "TEMP ret;\n");
6344  if (tempreg_used || settings->sRGB_write) shader_addline(&buffer, "TEMP tempreg;\n");
6345  shader_addline(&buffer, "TEMP arg0;\n");
6346  shader_addline(&buffer, "TEMP arg1;\n");
6347  shader_addline(&buffer, "TEMP arg2;\n");
6348  for (stage = 0; stage < MAX_TEXTURES; ++stage)
6349  {
6350  if (constant_used & (1u << stage))
6351  shader_addline(&buffer, "PARAM const%u = program.env[%u];\n", stage, ARB_FFP_CONST_CONSTANT(stage));
6352 
6353  if (!(tex_read & (1u << stage)))
6354  continue;
6355 
6356  shader_addline(&buffer, "TEMP tex%u;\n", stage);
6357 
6358  if (!(bump_used & (1u << stage)))
6359  continue;
6360  shader_addline(&buffer, "PARAM bumpmat%u = program.env[%u];\n", stage, ARB_FFP_CONST_BUMPMAT(stage));
6361 
6362  if (!(luminance_used & (1u << stage)))
6363  continue;
6364  shader_addline(&buffer, "PARAM luminance%u = program.env[%u];\n", stage, ARB_FFP_CONST_LUMINANCE(stage));
6365  }
6366  if (tfactor_used)
6367  shader_addline(&buffer, "PARAM tfactor = program.env[%u];\n", ARB_FFP_CONST_TFACTOR);
6368  shader_addline(&buffer, "PARAM specular_enable = program.env[%u];\n", ARB_FFP_CONST_SPECULAR_ENABLE);
6369 
6370  if (settings->sRGB_write)
6371  {
6372  shader_addline(&buffer, "PARAM srgb_consts0 = ");
6374  shader_addline(&buffer, ";\n");
6375  shader_addline(&buffer, "PARAM srgb_consts1 = ");
6377  shader_addline(&buffer, ";\n");
6378  }
6379 
6380  if (lowest_disabled_stage < 7 && settings->emul_clipplanes)
6381  shader_addline(&buffer, "KIL fragment.texcoord[7];\n");
6382 
6383  if (tempreg_used || settings->sRGB_write)
6384  shader_addline(&buffer, "MOV tempreg, 0.0;\n");
6385 
6386  /* Generate texture sampling instructions */
6387  for (stage = 0; stage < MAX_TEXTURES && settings->op[stage].cop != WINED3D_TOP_DISABLE; ++stage)
6388  {
6389  if (!(tex_read & (1u << stage)))
6390  continue;
6391 
6392  textype = arbfp_texture_target(settings->op[stage].tex_type);
6393 
6394  if(settings->op[stage].projected == proj_none) {
6395  instr = "TEX";
6396  } else if(settings->op[stage].projected == proj_count4 ||
6397  settings->op[stage].projected == proj_count3) {
6398  instr = "TXP";
6399  } else {
6400  FIXME("Unexpected projection mode %d\n", settings->op[stage].projected);
6401  instr = "TXP";
6402  }
6403 
6404  if (stage > 0
6405  && (settings->op[stage - 1].cop == WINED3D_TOP_BUMPENVMAP
6406  || settings->op[stage - 1].cop == WINED3D_TOP_BUMPENVMAP_LUMINANCE))
6407  {
6408  shader_addline(&buffer, "SWZ arg1, bumpmat%u, x, z, 0, 0;\n", stage - 1);
6409  shader_addline(&buffer, "DP3 ret.x, arg1, tex%u;\n", stage - 1);
6410  shader_addline(&buffer, "SWZ arg1, bumpmat%u, y, w, 0, 0;\n", stage - 1);
6411  shader_addline(&buffer, "DP3 ret.y, arg1, tex%u;\n", stage - 1);
6412 
6413  /* with projective textures, texbem only divides the static texture coord, not the displacement,
6414  * so multiply the displacement with the dividing parameter before passing it to TXP
6415  */
6416  if (settings->op[stage].projected != proj_none) {
6417  if(settings->op[stage].projected == proj_count4) {
6418  shader_addline(&buffer, "MOV ret.w, fragment.texcoord[%u].w;\n", stage);
6419  shader_addline(&buffer, "MUL ret.xyz, ret, fragment.texcoord[%u].w, fragment.texcoord[%u];\n", stage, stage);
6420  } else {
6421  shader_addline(&buffer, "MOV ret.w, fragment.texcoord[%u].z;\n", stage);
6422  shader_addline(&buffer, "MAD ret.xyz, ret, fragment.texcoord[%u].z, fragment.texcoord[%u];\n", stage, stage);
6423  }
6424  } else {
6425  shader_addline(&buffer, "ADD ret, ret, fragment.texcoord[%u];\n", stage);
6426  }
6427 
6428  shader_addline(&buffer, "%s tex%u, ret, texture[%u], %s;\n",
6429  instr, stage, stage, textype);
6430  if (settings->op[stage - 1].cop == WINED3D_TOP_BUMPENVMAP_LUMINANCE)
6431  {
6432  shader_addline(&buffer, "MAD_SAT ret.x, tex%u.z, luminance%u.x, luminance%u.y;\n",
6433  stage - 1, stage - 1, stage - 1);
6434  shader_addline(&buffer, "MUL tex%u, tex%u, ret.x;\n", stage, stage);
6435  }
6436  } else if(settings->op[stage].projected == proj_count3) {
6437  shader_addline(&buffer, "MOV ret, fragment.texcoord[%u];\n", stage);
6438  shader_addline(&buffer, "MOV ret.w, ret.z;\n");
6439  shader_addline(&buffer, "%s tex%u, ret, texture[%u], %s;\n",
6440  instr, stage, stage, textype);
6441  } else {
6442  shader_addline(&buffer, "%s tex%u, fragment.texcoord[%u], texture[%u], %s;\n",
6443  instr, stage, stage, stage, textype);
6444  }
6445 
6446  sprintf(colorcor_dst, "tex%u", stage);
6447  masks = calc_color_correction(settings->op[stage].color_fixup, WINED3DSP_WRITEMASK_ALL);
6448  gen_color_correction(&buffer, colorcor_dst, colorcor_dst, "const.x", "const.y",
6449  settings->op[stage].color_fixup, masks);
6450  }
6451 
6452  if (settings->color_key_enabled)
6453  {
6454  shader_addline(&buffer, "SLT TMP, tex0, color_key_low;\n"); /* below low key */
6455  shader_addline(&buffer, "SGE ret, tex0, color_key_high;\n"); /* above high key */
6456  shader_addline(&buffer, "ADD TMP, TMP, ret;\n"); /* or */
6457  shader_addline(&buffer, "DP4 TMP.b, TMP, TMP;\n"); /* on any channel */
6458  shader_addline(&buffer, "SGE TMP, -TMP.b, 0.0;\n"); /* logical not */
6459  shader_addline(&buffer, "KIL -TMP;\n"); /* discard if true */
6460  }
6461 
6462  shader_addline(&buffer, "MOV ret, fragment.color.primary;\n");
6463 
6464  /* Generate the main shader */
6465  for (stage = 0; stage < MAX_TEXTURES; ++stage)
6466  {
6467  if (settings->op[stage].cop == WINED3D_TOP_DISABLE)
6468  break;
6469 
6470  if (settings->op[stage].cop == WINED3D_TOP_SELECT_ARG1
6471  && settings->op[stage].aop == WINED3D_TOP_SELECT_ARG1)
6472  op_equal = settings->op[stage].carg1 == settings->op[stage].aarg1;
6473  else if (settings->op[stage].cop == WINED3D_TOP_SELECT_ARG1
6474  && settings->op[stage].aop == WINED3D_TOP_SELECT_ARG2)
6475  op_equal = settings->op[stage].carg1 == settings->op[stage].aarg2;
6476  else if (settings->op[stage].cop == WINED3D_TOP_SELECT_ARG2
6477  && settings->op[stage].aop == WINED3D_TOP_SELECT_ARG1)
6478  op_equal = settings->op[stage].carg2 == settings->op[stage].aarg1;
6479  else if (settings->op[stage].cop == WINED3D_TOP_SELECT_ARG2
6480  && settings->op[stage].aop == WINED3D_TOP_SELECT_ARG2)
6481  op_equal = settings->op[stage].carg2 == settings->op[stage].aarg2;
6482  else
6483  op_equal = settings->op[stage].aop == settings->op[stage].cop
6484  && settings->op[stage].carg0 == settings->op[stage].aarg0
6485  && settings->op[stage].carg1 == settings->op[stage].aarg1
6486  && settings->op[stage].carg2 == settings->op[stage].aarg2;
6487 
6488  if (settings->op[stage].aop == WINED3D_TOP_DISABLE)
6489  {
6490  gen_ffp_instr(&buffer, stage, TRUE, FALSE, settings->op[stage].dst,
6491  settings->op[stage].cop, settings->op[stage].carg0,
6492  settings->op[stage].carg1, settings->op[stage].carg2);
6493  }
6494  else if (op_equal)
6495  {
6496  gen_ffp_instr(&buffer, stage, TRUE, TRUE, settings->op[stage].dst,
6497  settings->op[stage].cop, settings->op[stage].carg0,
6498  settings->op[stage].carg1, settings->op[stage].carg2);
6499  }
6500  else if (settings->op[stage].cop != WINED3D_TOP_BUMPENVMAP
6501  && settings->op[stage].cop != WINED3D_TOP_BUMPENVMAP_LUMINANCE)
6502  {
6503  gen_ffp_instr(&buffer, stage, TRUE, FALSE, settings->op[stage].dst,
6504  settings->op[stage].cop, settings->op[stage].carg0,
6505  settings->op[stage].carg1, settings->op[stage].carg2);
6506  gen_ffp_instr(&buffer, stage, FALSE, TRUE, settings->op[stage].dst,
6507  settings->op[stage].aop, settings->op[stage].aarg0,
6508  settings->op[stage].aarg1, settings->op[stage].aarg2);
6509  }
6510  }
6511 
6512  if (settings->sRGB_write || custom_linear_fog)
6513  {
6514  shader_addline(&buffer, "MAD ret, fragment.color.secondary, specular_enable, ret;\n");
6515  if (settings->sRGB_write)
6516  arbfp_add_sRGB_correction(&buffer, "ret", "arg0", "arg1", "arg2", "tempreg", FALSE);
6517  if (custom_linear_fog)
6518  arbfp_add_linear_fog(&buffer, "ret", "arg0");
6519  shader_addline(&buffer, "MOV result.color, ret;\n");
6520  }
6521  else
6522  {
6523  shader_addline(&buffer, "MAD result.color, fragment.color.secondary, specular_enable, ret;\n");
6524  }
6525 
6526  /* Footer */
6527  shader_addline(&buffer, "END\n");
6528 
6529  /* Generate the shader */
6530  GL_EXTCALL(glGenProgramsARB(1, &ret));
6531  GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, ret));
6533 
6535  return ret;
6536 }
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
struct mke2fs_defaults settings[]
#define MAX_TEXTURES
#define TRUE
Definition: types.h:120
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:478
#define ARB_FFP_CONST_COLOR_KEY_LOW
struct x86_inst instr
#define WINED3DTA_CONSTANT
Definition: wined3d.h:873
#define ARB_FFP_CONST_TFACTOR
BOOL string_buffer_init(struct wined3d_string_buffer *buffer)
Definition: shader.c:428
GLuint buffer
Definition: glext.h:5915
static const char * arbfp_texture_target(enum wined3d_gl_resource_type type)
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
#define sprintf(buf, format,...)
Definition: sprintf.c:55
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
#define FIXME(fmt,...)
Definition: debug.h:110
void string_buffer_free(struct wined3d_string_buffer *buffer)
Definition: shader.c:441
#define WINED3DTA_TEXTURE
Definition: wined3d.h:869
#define ARB_FFP_CONST_CONSTANT(i)
const float wined3d_srgb_const0[]
Definition: shader.c:36
#define WINED3DTA_SELECTMASK
Definition: wined3d.h:866
#define GL_EXTCALL(f)
static void shader_arb_append_imm_vec4(struct wined3d_string_buffer *buffer, const float *values)
const float wined3d_srgb_const1[]
Definition: shader.c:38
static BOOL shader_arb_compile(const struct wined3d_gl_info *gl_info, GLenum target, const char *src)
#define WINED3D_QUIRK_BROKEN_ARB_FOG
#define ARB_FFP_CONST_SPECULAR_ENABLE
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WINED3DTA_TFACTOR
Definition: wined3d.h:870
#define ARB_FFP_CONST_LUMINANCE(i)
static struct color_fixup_masks calc_color_correction(struct color_fixup_desc fixup, DWORD dst_mask)
int ret
static void gen_color_correction(struct wined3d_string_buffer *buffer, const char *dst, const char *src, const char *one, const char *two, struct color_fixup_desc fixup, struct color_fixup_masks masks)
unsigned char BYTE
Definition: mem.h:68
#define WINED3DSP_WRITEMASK_ALL
static void arbfp_add_sRGB_correction(struct wined3d_string_buffer *buffer, const char *fragcolor, const char *tmp1, const char *tmp2, const char *tmp3, const char *tmp4, BOOL condcode)
#define ERR(fmt,...)
Definition: debug.h:109
static void arbfp_add_linear_fog(struct wined3d_string_buffer *buffer, const char *fragcolor, const char *tmp)
unsigned int GLuint
Definition: gl.h:159
#define ARB_FFP_CONST_BUMPMAT(i)
#define ARB_FFP_CONST_COLOR_KEY_HIGH
static void gen_ffp_instr(struct wined3d_string_buffer *buffer, unsigned int stage, BOOL color, BOOL alpha, DWORD dst, DWORD op, DWORD dw_arg0, DWORD dw_arg1, DWORD dw_arg2)
#define WINED3DTA_TEMP
Definition: wined3d.h:872
#define GL_FRAGMENT_PROGRAM_ARB
Definition: glext.h:1466
static const BYTE masks[8]
Definition: dib.c:2760

Referenced by fragment_prog_arbfp().

◆ gen_color_correction()

static void gen_color_correction ( struct wined3d_string_buffer buffer,
const char dst,
const char src,
const char one,
const char two,
struct color_fixup_desc  fixup,
struct color_fixup_masks  masks 
)
static

Definition at line 1324 of file arb_program_shader.c.

1327 {
1328  const char *sign_fixup_src = dst;
1329 
1330  if (masks.source)
1331  {
1332  if (masks.sign)
1333  sign_fixup_src = "TA";
1334 
1335  shader_addline(buffer, "SWZ %s, %s, %s, %s, %s, %s;\n", sign_fixup_src, src,
1338  }
1339  else if (masks.sign)
1340  {
1341  sign_fixup_src = src;
1342  }
1343 
1344  if (masks.sign)
1345  {
1346  char reg_mask[6];
1347  char *ptr = reg_mask;
1348 
1349  if (masks.sign != WINED3DSP_WRITEMASK_ALL)
1350  {
1351  *ptr++ = '.';
1352  if (masks.sign & WINED3DSP_WRITEMASK_0)
1353  *ptr++ = 'x';
1354  if (masks.sign & WINED3DSP_WRITEMASK_1)
1355  *ptr++ = 'y';
1356  if (masks.sign & WINED3DSP_WRITEMASK_2)
1357  *ptr++ = 'z';
1358  if (masks.sign & WINED3DSP_WRITEMASK_3)
1359  *ptr++ = 'w';
1360  }
1361  *ptr = '\0';
1362 
1363  shader_addline(buffer, "MAD %s%s, %s, %s, -%s;\n", dst, reg_mask, sign_fixup_src, two, one);
1364  }
1365 }
unsigned short x_source
#define WINED3DSP_WRITEMASK_0
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:478
unsigned short w_source
GLuint buffer
Definition: glext.h:5915
static double one
Definition: j0_y0.c:80
static double two
Definition: jn_yn.c:52
static PVOID ptr
Definition: dispmode.c:27
unsigned short z_source
#define WINED3DSP_WRITEMASK_1
#define WINED3DSP_WRITEMASK_2
GLenum src
Definition: glext.h:6340
#define WINED3DSP_WRITEMASK_ALL
GLenum GLenum dst
Definition: glext.h:6340
#define WINED3DSP_WRITEMASK_3
unsigned short y_source
static const char * shader_arb_get_fixup_swizzle(enum fixup_channel_source channel_source)
static const BYTE masks[8]
Definition: dib.c:2760

Referenced by gen_arbfp_ffp_shader(), and shader_hw_sample().

◆ gen_ffp_instr()

static void gen_ffp_instr ( struct wined3d_string_buffer buffer,
unsigned int  stage,
BOOL  color,
BOOL  alpha,
DWORD  dst,
DWORD  op,
DWORD  dw_arg0,
DWORD  dw_arg1,
DWORD  dw_arg2 
)
static

Definition at line 6086 of file arb_program_shader.c.

6088 {
6089  const char *dstmask, *dstreg, *arg0, *arg1, *arg2;
6090  unsigned int mul = 1;
6091 
6092  if(color && alpha) dstmask = "";
6093  else if(color) dstmask = ".xyz";
6094  else dstmask = ".w";
6095 
6096  if(dst == tempreg) dstreg = "tempreg";
6097  else dstreg = "ret";
6098 
6099  arg0 = get_argreg(buffer, 0, stage, dw_arg0);
6100  arg1 = get_argreg(buffer, 1, stage, dw_arg1);
6101  arg2 = get_argreg(buffer, 2, stage, dw_arg2);
6102 
6103  switch (op)
6104  {
6105  case WINED3D_TOP_DISABLE:
6106  break;
6107 
6109  arg1 = arg2;
6110  /* FALLTHROUGH */
6112  shader_addline(buffer, "MOV %s%s, %s;\n", dstreg, dstmask, arg1);
6113  break;
6114 
6116  mul = 2;
6117  /* FALLTHROUGH */
6119  mul *= 2;
6120  /* FALLTHROUGH */
6121  case WINED3D_TOP_MODULATE:
6122  shader_addline(buffer, "MUL %s%s, %s, %s;\n", dstreg, dstmask, arg1, arg2);
6123  break;
6124 
6126  mul = 2;
6127  /* FALLTHROUGH */
6129  shader_addline(buffer, "SUB arg2, %s, const.w;\n", arg2);
6130  arg2 = "arg2";
6131  /* FALLTHROUGH */
6132  case WINED3D_TOP_ADD:
6133  shader_addline(buffer, "ADD_SAT %s%s, %s, %s;\n", dstreg, dstmask, arg1, arg2);
6134  break;
6135 
6136  case WINED3D_TOP_SUBTRACT:
6137  shader_addline(buffer, "SUB_SAT %s%s, %s, %s;\n", dstreg, dstmask, arg1, arg2);
6138  break;
6139 
6141  shader_addline(buffer, "SUB arg1, const.x, %s;\n", arg1);
6142  shader_addline(buffer, "MAD_SAT %s%s, arg1, %s, %s;\n", dstreg, dstmask, arg2, arg1);
6143  break;
6144 
6146  arg0 = get_argreg(buffer, 0, stage, WINED3DTA_CURRENT);
6147  shader_addline(buffer, "LRP %s%s, %s.w, %s, %s;\n", dstreg, dstmask, arg0, arg1, arg2);
6148  break;
6150  arg0 = get_argreg(buffer, 0, stage, WINED3DTA_TFACTOR);
6151  shader_addline(buffer, "LRP %s%s, %s.w, %s, %s;\n", dstreg, dstmask, arg0, arg1, arg2);
6152  break;
6154  arg0 = get_argreg(buffer, 0, stage, WINED3DTA_TEXTURE);
6155  shader_addline(buffer, "LRP %s%s, %s.w, %s, %s;\n", dstreg, dstmask, arg0, arg1, arg2);
6156  break;
6158  arg0 = get_argreg(buffer, 0, stage, WINED3DTA_DIFFUSE);
6159  shader_addline(buffer, "LRP %s%s, %s.w, %s, %s;\n", dstreg, dstmask, arg0, arg1, arg2);
6160  break;
6161 
6163  arg0 = get_argreg(buffer, 0, stage, WINED3DTA_TEXTURE);
6164  shader_addline(buffer, "SUB arg0.w, const.x, %s.w;\n", arg0);
6165  shader_addline(buffer, "MAD_SAT %s%s, %s, arg0.w, %s;\n", dstreg, dstmask, arg2, arg1);
6166  break;
6167 
6168  /* D3DTOP_PREMODULATE ???? */
6169 
6171  shader_addline(buffer, "SUB arg0.w, const.x, %s;\n", arg1);
6172  shader_addline(buffer, "MAD_SAT %s%s, arg0.w, %s, %s;\n", dstreg, dstmask, arg2, arg1);
6173  break;
6175  shader_addline(buffer, "MAD_SAT %s%s, %s.w, %s, %s;\n", dstreg, dstmask, arg1, arg2, arg1);
6176  break;
6178  shader_addline(buffer, "SUB arg0, const.x, %s;\n", arg1);
6179  shader_addline(buffer, "MAD_SAT %s%s, arg0, %s, %s.w;\n", dstreg, dstmask, arg2, arg1);
6180  break;
6182  shader_addline(buffer, "MAD_SAT %s%s, %s, %s, %s.w;\n", dstreg, dstmask, arg1, arg2, arg1);
6183  break;
6184 
6186  mul = 4;
6187  shader_addline(buffer, "SUB arg1, %s, const.w;\n", arg1);
6188  shader_addline(buffer, "SUB arg2, %s, const.w;\n", arg2);
6189  shader_addline(buffer, "DP3_SAT %s%s, arg1, arg2;\n", dstreg, dstmask);
6190  break;
6191 
6193  shader_addline(buffer, "MAD_SAT %s%s, %s, %s, %s;\n", dstreg, dstmask, arg1, arg2, arg0);
6194  break;
6195 
6196  case WINED3D_TOP_LERP:
6197  /* The msdn is not quite right here */
6198  shader_addline(buffer, "LRP %s%s, %s, %s, %s;\n", dstreg, dstmask, arg0, arg1, arg2);
6199  break;
6200 
6203  /* Those are handled in the first pass of the shader(generation pass 1 and 2) already */
6204  break;
6205 
6206  default:
6207  FIXME("Unhandled texture op %08x\n", op);
6208  }
6209 
6210  if (mul == 2)
6211  shader_addline(buffer, "MUL_SAT %s%s, %s, const.y;\n", dstreg, dstmask, dstreg);
6212  else if (mul == 4)
6213  shader_addline(buffer, "MUL_SAT %s%s, %s, const.z;\n", dstreg, dstmask, dstreg);
6214 }
int shader_addline(struct wined3d_string_buffer *buffer, const char *format,...)
Definition: shader.c:478
GLuint buffer
Definition: glext.h:5915
#define WINED3DTA_CURRENT
Definition: wined3d.h:868
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
GLuint color
Definition: glext.h:6243
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
#define FIXME(fmt,...)
Definition: debug.h:110
#define WINED3DTA_TEXTURE
Definition: wined3d.h:869