ReactOS  0.4.13-dev-249-gcba1a2f
state.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include "wined3d_private.h"
Include dependency graph for state.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d)
 
ULONG CDECL wined3d_blend_state_incref (struct wined3d_blend_state *state)
 
static void wined3d_blend_state_destroy_object (void *object)
 
ULONG CDECL wined3d_blend_state_decref (struct wined3d_blend_state *state)
 
void *CDECL wined3d_blend_state_get_parent (const struct wined3d_blend_state *state)
 
HRESULT CDECL wined3d_blend_state_create (struct wined3d_device *device, const struct wined3d_blend_state_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_blend_state **state)
 
ULONG CDECL wined3d_rasterizer_state_incref (struct wined3d_rasterizer_state *state)
 
static void wined3d_rasterizer_state_destroy_object (void *object)
 
ULONG CDECL wined3d_rasterizer_state_decref (struct wined3d_rasterizer_state *state)
 
void *CDECL wined3d_rasterizer_state_get_parent (const struct wined3d_rasterizer_state *state)
 
HRESULT CDECL wined3d_rasterizer_state_create (struct wined3d_device *device, const struct wined3d_rasterizer_state_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rasterizer_state **state)
 
static void state_undefined (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_nop (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_fillmode (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_lighting (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_zenable (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_cullmode (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_shademode (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_ditherenable (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_zwriteenable (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
GLenum wined3d_gl_compare_func (enum wined3d_cmp_func f)
 
static void state_zfunc (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_ambient (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_blendop_w (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static GLenum gl_blend_op (const struct wined3d_gl_info *gl_info, enum wined3d_blend_op op)
 
static void state_blendop (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static GLenum gl_blend_factor (enum wined3d_blend factor, const struct wined3d_format *dst_format)
 
static void gl_blend_from_d3d (GLenum *src_blend, GLenum *dst_blend, enum wined3d_blend d3d_src_blend, enum wined3d_blend d3d_dst_blend, const struct wined3d_format *rt_format)
 
static void state_blend (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_blendfactor_w (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_blendfactor (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_blend_object (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_alpha_test (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_clipping (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_specularenable (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_texfactor (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void renderstate_stencil_twosided (struct wined3d_context *context, GLint face, GLint func, GLint ref, GLuint mask, GLint stencilFail, GLint depthFail, GLint stencilPass)
 
static GLenum gl_stencil_op (enum wined3d_stencil_op op)
 
static void state_stencil (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_stencilwrite2s_ext (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_stencilwrite (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_fog_vertexpart (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_fogstartend (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_fog_fragpart (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_fogcolor (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_fogdensity (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_colormat (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_linepattern (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_linepattern_w (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_normalize (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_psizemin_w (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_psizemin_ext (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_psizemin_arb (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_pscale (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_debug_monitor (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_colorwrite (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void set_color_mask (const struct wined3d_gl_info *gl_info, UINT index, DWORD mask)
 
static void state_colorwrite_i (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_localviewer (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_lastpixel (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_pointsprite_w (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_pointsprite (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_wrap (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_msaa_w (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_msaa (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_line_antialias (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_scissor (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_depthbias (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_zvisible (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_stippledalpha (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_antialias (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_multisampmask (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_patchedgestyle (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_patchsegments (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_positiondegree (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_normaldegree (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_tessellation (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_nvdb (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_wrapu (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_wrapv (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_monoenable (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_rop2 (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_planemask (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_subpixel (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_subpixelx (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_stippleenable (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_mipmaplodbias (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_anisotropy (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_flushbatch (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_translucentsi (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_extents (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_ckeyblend (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_swvp (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void get_src_and_opr (DWORD arg, BOOL is_alpha, GLenum *source, GLenum *operand)
 
static void set_tex_op (const struct wined3d_gl_info *gl_info, const struct wined3d_state *state, BOOL isAlpha, int Stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3)
 
static void tex_colorop (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void tex_alphaop (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void transform_texture (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void tex_coordindex (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void sampler_texmatrix (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static enum wined3d_texture_address wined3d_texture_address_mode (const struct wined3d_texture *texture, enum wined3d_texture_address t)
 
static void wined3d_sampler_desc_from_sampler_states (struct wined3d_sampler_desc *desc, const struct wined3d_context *context, const DWORD *sampler_states, const struct wined3d_texture *texture)
 
static void sampler (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void apply_pixelshader (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_compute_shader (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_shader (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void shader_bumpenv (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void transform_world (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void clipplane (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void transform_worldex (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_vertexblend_w (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void transform_view (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void transform_projection (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void streamsrc (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void vdecl_miscpart (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void vertexdeclaration (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void get_viewports (struct wined3d_context *context, const struct wined3d_state *state, unsigned int viewport_count, struct wined3d_viewport *viewports)
 
static void viewport_miscpart (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void viewport_miscpart_cc (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void viewport_vertexpart (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void light (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void scissorrect (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void indexbuffer (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void depth_clip (const struct wined3d_rasterizer_state *r, const struct wined3d_gl_info *gl_info)
 
static void rasterizer (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void rasterizer_cc (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void psorigin_w (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void psorigin (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_srgbwrite (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_cb (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_cb_warn (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_shader_resource_binding (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_cs_resource_binding (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_uav_binding (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_cs_uav_binding (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_uav_warn (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_so (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void state_so_warn (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void ffp_enable (const struct wined3d_gl_info *gl_info, BOOL enable)
 
static voidffp_alloc (const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv)
 
static void ffp_free (struct wined3d_device *device)
 
static void vp_ffp_get_caps (const struct wined3d_gl_info *gl_info, struct wined3d_vertex_caps *caps)
 
static DWORD vp_ffp_get_emul_mask (const struct wined3d_gl_info *gl_info)
 
static void ffp_fragment_get_caps (const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
 
static DWORD ffp_fragment_get_emul_mask (const struct wined3d_gl_info *gl_info)
 
static BOOL ffp_color_fixup_supported (struct color_fixup_desc fixup)
 
static BOOL ffp_none_context_alloc (struct wined3d_context *context)
 
static void ffp_none_context_free (struct wined3d_context *context)
 
static void none_enable (const struct wined3d_gl_info *gl_info, BOOL enable)
 
static voidnone_alloc (const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv)
 
static void none_free (struct wined3d_device *device)
 
static void vp_none_get_caps (const struct wined3d_gl_info *gl_info, struct wined3d_vertex_caps *caps)
 
static DWORD vp_none_get_emul_mask (const struct wined3d_gl_info *gl_info)
 
static void fp_none_get_caps (const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
 
static DWORD fp_none_get_emul_mask (const struct wined3d_gl_info *gl_info)
 
static BOOL fp_none_color_fixup_supported (struct color_fixup_desc fixup)
 
static unsigned int num_handlers (const APPLYSTATEFUNC *funcs)
 
static void multistate_apply_2 (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void multistate_apply_3 (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static void prune_invalid_states (struct StateEntry *state_table, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info)
 
static void validate_state_table (struct StateEntry *state_table)
 
HRESULT compile_state_table (struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, const struct wined3d_vertex_pipe_ops *vertex, const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc)
 

Variables

const struct StateEntryTemplate misc_state_template []
 
static const struct StateEntryTemplate vp_ffp_states []
 
static const struct StateEntryTemplate ffp_fragmentstate_template []
 
const struct wined3d_vertex_pipe_ops ffp_vertex_pipe
 
const struct fragment_pipeline ffp_fragment_pipeline
 
const struct wined3d_vertex_pipe_ops none_vertex_pipe
 
const struct fragment_pipeline none_fragment_pipe
 

Function Documentation

◆ apply_pixelshader()

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

Definition at line 3663 of file state.c.

3664 {
3665  unsigned int i;
3666 
3667  if (use_ps(state))
3668  {
3669  if (!context->last_was_pshader)
3670  {
3671  /* Former draw without a pixel shader, some samplers may be
3672  * disabled because of WINED3D_TSS_COLOR_OP = WINED3DTOP_DISABLE
3673  * make sure to enable them. */
3674  for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i)
3675  {
3678  }
3679  context->last_was_pshader = TRUE;
3680  }
3681  else
3682  {
3683  /* Otherwise all samplers were activated by the code above in
3684  * earlier draws, or by sampler() if a different texture was
3685  * bound. I don't have to do anything. */
3686  }
3687  }
3688  else
3689  {
3690  /* Disabled the pixel shader - color ops weren't applied while it was
3691  * enabled, so re-apply them. */
3692  for (i = 0; i < context->d3d_info->limits.ffp_blend_stages; ++i)
3693  {
3696  }
3697  context->last_was_pshader = FALSE;
3698  }
3699 
3700  context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
3701 }
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)
#define TRUE
Definition: types.h:120
Definition: http.c:6587
static BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
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
static void context_apply_state(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
#define MAX_FRAGMENT_SAMPLERS
static int state
Definition: maze.c:121
static BOOL use_ps(const struct wined3d_state *state)
#define STATE_SAMPLER(num)
static void sampler(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:3595

◆ clipplane()

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

Definition at line 3740 of file state.c.

3741 {
3742  const struct wined3d_gl_info *gl_info = context->gl_info;
3743  UINT index = state_id - STATE_CLIPPLANE(0);
3744  GLdouble plane[4];
3745 
3746  if (isStateDirty(context, STATE_TRANSFORM(WINED3D_TS_VIEW)) || index >= gl_info->limits.user_clip_distances)
3747  return;
3748 
3749  gl_info->gl_ops.gl.p_glMatrixMode(GL_MODELVIEW);
3750  gl_info->gl_ops.gl.p_glPushMatrix();
3751 
3752  /* Clip Plane settings are affected by the model view in OpenGL, the View transform in direct3d */
3753  if (!use_vs(state))
3754  gl_info->gl_ops.gl.p_glLoadMatrixf(&state->transforms[WINED3D_TS_VIEW]._11);
3755  else
3756  /* With vertex shaders, clip planes are not transformed in Direct3D,
3757  * while in OpenGL they are still transformed by the model view matrix. */
3758  gl_info->gl_ops.gl.p_glLoadIdentity();
3759 
3760  plane[0] = state->clip_planes[index].x;
3761  plane[1] = state->clip_planes[index].y;
3762  plane[2] = state->clip_planes[index].z;
3763  plane[3] = state->clip_planes[index].w;
3764 
3765  TRACE("Clipplane [%.8e, %.8e, %.8e, %.8e]\n",
3766  plane[0], plane[1], plane[2], plane[3]);
3767  gl_info->gl_ops.gl.p_glClipPlane(GL_CLIP_PLANE0 + index, plane);
3768  checkGLcall("glClipPlane");
3769 
3770  gl_info->gl_ops.gl.p_glPopMatrix();
3771 }
double GLdouble
Definition: gl.h:163
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
Definition: glfuncs.h:270
struct opengl_funcs gl_ops
Definition: http.c:6587
#define STATE_CLIPPLANE(a)
static BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
#define STATE_TRANSFORM(a)
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
#define GL_CLIP_PLANE0
Definition: gl.h:346
#define index(s, c)
Definition: various.h:29
static int state
Definition: maze.c:121
#define checkGLcall(A)
#define GL_MODELVIEW
Definition: gl.h:245
unsigned int UINT
Definition: ndis.h:50
static BOOL use_vs(const struct wined3d_state *state)
struct wined3d_gl_limits limits

Referenced by glsl_vertex_pipe_vdecl(), glsl_vertex_pipe_view(), transform_view(), and vertexdeclaration().

◆ compile_state_table()

HRESULT compile_state_table ( struct StateEntry StateTable,
APPLYSTATEFUNC **  dev_multistate_funcs,
const struct wined3d_gl_info gl_info,
const struct wined3d_d3d_info d3d_info,
const struct wined3d_vertex_pipe_ops vertex,
const struct fragment_pipeline fragment,
const struct StateEntryTemplate misc 
)

Definition at line 5543 of file state.c.

5547 {
5548  unsigned int i, type, handlers;
5549  APPLYSTATEFUNC multistate_funcs[STATE_HIGHEST + 1][3];
5550  const struct StateEntryTemplate *cur;
5551  BOOL set[STATE_HIGHEST + 1];
5552 
5553  memset(multistate_funcs, 0, sizeof(multistate_funcs));
5554 
5555  for(i = 0; i < STATE_HIGHEST + 1; i++) {
5556  StateTable[i].representative = 0;
5557  StateTable[i].apply = state_undefined;
5558  }
5559 
5560  for(type = 0; type < 3; type++) {
5561  /* This switch decides the order in which the states are applied */
5562  switch(type) {
5563  case 0: cur = misc; break;
5564  case 1: cur = fragment->states; break;
5565  case 2: cur = vertex->vp_states; break;
5566  default: cur = NULL; /* Stupid compiler */
5567  }
5568  if(!cur) continue;
5569 
5570  /* GL extension filtering should not prevent multiple handlers being applied from different
5571  * pipeline parts
5572  */
5573  memset(set, 0, sizeof(set));
5574 
5575  for(i = 0; cur[i].state; i++) {
5576  APPLYSTATEFUNC *funcs_array;
5577 
5578  /* Only use the first matching state with the available extension from one template.
5579  * e.g.
5580  * {D3DRS_FOOBAR, {D3DRS_FOOBAR, func1}, XYZ_FANCY},
5581  * {D3DRS_FOOBAR, {D3DRS_FOOBAR, func2}, 0 }
5582  *
5583  * if GL_XYZ_fancy is supported, ignore the 2nd line
5584  */
5585  if(set[cur[i].state]) continue;
5586  /* Skip state lines depending on unsupported extensions */
5587  if (!gl_info->supported[cur[i].extension]) continue;
5588  set[cur[i].state] = TRUE;
5589  /* In some cases having an extension means that nothing has to be
5590  * done for a state, e.g. if GL_ARB_texture_non_power_of_two is
5591  * supported, the texture coordinate fixup can be ignored. If the
5592  * apply function is used, mark the state set(done above) to prevent
5593  * applying later lines, but do not record anything in the state
5594  * table
5595  */
5596  if (!cur[i].content.representative) continue;
5597 
5598  handlers = num_handlers(multistate_funcs[cur[i].state]);
5599  multistate_funcs[cur[i].state][handlers] = cur[i].content.apply;
5600  switch(handlers) {
5601  case 0:
5602  StateTable[cur[i].state].apply = cur[i].content.apply;
5603  break;
5604  case 1:
5605  StateTable[cur[i].state].apply = multistate_apply_2;
5606  if (!(dev_multistate_funcs[cur[i].state] = heap_calloc(2, sizeof(**dev_multistate_funcs))))
5607  goto out_of_mem;
5608 
5609  dev_multistate_funcs[cur[i].state][0] = multistate_funcs[cur[i].state][0];
5610  dev_multistate_funcs[cur[i].state][1] = multistate_funcs[cur[i].state][1];
5611  break;
5612  case 2:
5613  StateTable[cur[i].state].apply = multistate_apply_3;
5614  if (!(funcs_array = heap_realloc(dev_multistate_funcs[cur[i].state],
5615  sizeof(**dev_multistate_funcs) * 3)))
5616  goto out_of_mem;
5617 
5618  dev_multistate_funcs[cur[i].state] = funcs_array;
5619  dev_multistate_funcs[cur[i].state][2] = multistate_funcs[cur[i].state][2];
5620  break;
5621  default:
5622  ERR("Unexpected amount of state handlers for state %u: %u\n",
5623  cur[i].state, handlers + 1);
5624  }
5625 
5626  if (StateTable[cur[i].state].representative
5627  && StateTable[cur[i].state].representative != cur[i].content.representative)
5628  {
5629  FIXME("State %s (%#x) has different representatives in different pipeline parts.\n",
5630  debug_d3dstate(cur[i].state), cur[i].state);
5631  }
5632  StateTable[cur[i].state].representative = cur[i].content.representative;
5633  }
5634  }
5635 
5636  prune_invalid_states(StateTable, gl_info, d3d_info);
5637  validate_state_table(StateTable);
5638 
5639  return WINED3D_OK;
5640 
5641 out_of_mem:
5642  for (i = 0; i <= STATE_HIGHEST; ++i)
5643  {
5644  heap_free(dev_multistate_funcs[i]);
5645  }
5646 
5647  memset(dev_multistate_funcs, 0, (STATE_HIGHEST + 1)*sizeof(*dev_multistate_funcs));
5648 
5649  return E_OUTOFMEMORY;
5650 }
const char * debug_d3dstate(DWORD state)
Definition: utils.c:4617
const struct StateEntryTemplate * states
#define STATE_HIGHEST
#define TRUE
Definition: types.h:120
Definition: mesh.c:4557
static xmlCharEncodingHandlerPtr * handlers
Definition: encoding.c:1297
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static void * heap_calloc(SIZE_T count, SIZE_T size)
Definition: heap.h:49
void(* APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id)
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
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 E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
static void multistate_apply_2(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:5398
#define FIXME(fmt,...)
Definition: debug.h:110
content
Definition: atl_ax.c:994
BOOL supported[WINED3D_GL_EXT_COUNT]
smooth NULL
Definition: ftsmooth.c:416
DWORD representative
static unsigned int num_handlers(const APPLYSTATEFUNC *funcs)
Definition: state.c:5391
static void multistate_apply_3(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:5404
#define WINED3D_OK
Definition: wined3d.h:37
static void state_undefined(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:164
static int state
Definition: maze.c:121
#define ERR(fmt,...)
Definition: debug.h:109
static void prune_invalid_states(struct StateEntry *state_table, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info)
Definition: state.c:5411
static void validate_state_table(struct StateEntry *state_table)
Definition: state.c:5441
Definition: _set.h:46
#define memset(x, y, z)
Definition: compat.h:39
APPLYSTATEFUNC apply
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by device_init().

◆ depth_clip()

static void depth_clip ( const struct wined3d_rasterizer_state r,
const struct wined3d_gl_info gl_info 
)
static

Definition at line 4330 of file state.c.

4331 {
4332  if (!gl_info->supported[ARB_DEPTH_CLAMP])
4333  {
4334  if (r && !r->desc.depth_clip)
4335  FIXME("Depth clamp not supported by this GL implementation.\n");
4336  return;
4337  }
4338 
4339  if (r && !r->desc.depth_clip)
4340  gl_info->gl_ops.gl.p_glEnable(GL_DEPTH_CLAMP);
4341  else
4342  gl_info->gl_ops.gl.p_glDisable(GL_DEPTH_CLAMP);
4343  checkGLcall("depth clip");
4344 }
#define GL_DEPTH_CLAMP
Definition: glext.h:1896
struct opengl_funcs gl_ops
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define FIXME(fmt,...)
Definition: debug.h:110
BOOL supported[WINED3D_GL_EXT_COUNT]
#define checkGLcall(A)

Referenced by rasterizer(), and rasterizer_cc().

◆ ffp_alloc()

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

Definition at line 5218 of file state.c.

5219 {
5220  return shader_priv;
5221 }

◆ ffp_color_fixup_supported()

static BOOL ffp_color_fixup_supported ( struct color_fixup_desc  fixup)
static

Definition at line 5307 of file state.c.

5308 {
5309  /* We only support identity conversions. */
5310  return is_identity_fixup(fixup);
5311 }
static BOOL is_identity_fixup(struct color_fixup_desc fixup)

◆ ffp_enable()

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

Definition at line 5216 of file state.c.

5216 {}

◆ ffp_fragment_get_caps()

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

Definition at line 5261 of file state.c.

5262 {
5263  caps->wined3d_caps = 0;
5264  caps->PrimitiveMiscCaps = 0;
5274 
5275  if (gl_info->supported[ARB_TEXTURE_ENV_COMBINE]
5276  || gl_info->supported[EXT_TEXTURE_ENV_COMBINE]
5277  || gl_info->supported[NV_TEXTURE_ENV_COMBINE4])
5278  {
5285  }
5286  if (gl_info->supported[ATI_TEXTURE_ENV_COMBINE3]
5287  || gl_info->supported[NV_TEXTURE_ENV_COMBINE4])
5288  {
5294  }
5295  if (gl_info->supported[ARB_TEXTURE_ENV_DOT3])
5297 
5298  caps->MaxTextureBlendStages = gl_info->limits.textures;
5299  caps->MaxSimultaneousTextures = gl_info->limits.textures;
5300 }
DWORD MaxTextureBlendStages
#define WINED3DTEXOPCAPS_DISABLE
Definition: wined3d.h:1147
#define WINED3DTEXOPCAPS_BLENDCURRENTALPHA
Definition: wined3d.h:1162
#define WINED3DTEXOPCAPS_ADDSIGNED
Definition: wined3d.h:1154
#define WINED3DTEXOPCAPS_MODULATE
Definition: wined3d.h:1150
#define WINED3DTEXOPCAPS_ADDSIGNED2X
Definition: wined3d.h:1155
#define WINED3DTEXOPCAPS_BLENDDIFFUSEALPHA
Definition: wined3d.h:1158
#define WINED3DTEXOPCAPS_ADDSMOOTH
Definition: wined3d.h:1157
#define WINED3DTEXOPCAPS_SELECTARG2
Definition: wined3d.h:1149
#define WINED3DTEXOPCAPS_LERP
Definition: wined3d.h:1172
#define WINED3DTEXOPCAPS_BLENDFACTORALPHA
Definition: wined3d.h:1160
BOOL supported[WINED3D_GL_EXT_COUNT]
#define WINED3DTEXOPCAPS_DOTPRODUCT3
Definition: wined3d.h:1170
#define WINED3DTEXOPCAPS_BLENDTEXTUREALPHAPM
Definition: wined3d.h:1161
#define WINED3DTEXOPCAPS_MODULATE4X
Definition: wined3d.h:1152
#define WINED3DTEXOPCAPS_SELECTARG1
Definition: wined3d.h:1148
#define WINED3DTEXOPCAPS_MULTIPLYADD
Definition: wined3d.h:1171
DWORD MaxSimultaneousTextures
#define WINED3DTEXOPCAPS_MODULATE2X
Definition: wined3d.h:1151
#define WINED3DTEXOPCAPS_SUBTRACT
Definition: wined3d.h:1156
#define WINED3DTEXOPCAPS_MODULATECOLOR_ADDALPHA
Definition: wined3d.h:1165
struct wined3d_gl_limits limits
#define WINED3DTEXOPCAPS_BLENDTEXTUREALPHA
Definition: wined3d.h:1159
#define WINED3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR
Definition: wined3d.h:1164
#define WINED3DTEXOPCAPS_ADD
Definition: wined3d.h:1153

◆ ffp_fragment_get_emul_mask()

static DWORD ffp_fragment_get_emul_mask ( const struct wined3d_gl_info gl_info)
static

Definition at line 5302 of file state.c.

5303 {
5305 }
#define GL_EXT_EMUL_EXT_FOG_COORD
#define GL_EXT_EMUL_ARB_MULTITEXTURE

◆ ffp_free()

static void ffp_free ( struct wined3d_device device)
static

Definition at line 5223 of file state.c.

5223 {}

◆ ffp_none_context_alloc()

static BOOL ffp_none_context_alloc ( struct wined3d_context context)
static

Definition at line 5313 of file state.c.

5314 {
5315  return TRUE;
5316 }
#define TRUE
Definition: types.h:120

◆ ffp_none_context_free()

static void ffp_none_context_free ( struct wined3d_context context)
static

Definition at line 5318 of file state.c.

5319 {
5320 }

◆ fp_none_color_fixup_supported()

static BOOL fp_none_color_fixup_supported ( struct color_fixup_desc  fixup)
static

Definition at line 5373 of file state.c.

5374 {
5375  return is_identity_fixup(fixup);
5376 }
static BOOL is_identity_fixup(struct color_fixup_desc fixup)

◆ fp_none_get_caps()

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

Definition at line 5363 of file state.c.

5364 {
5365  memset(caps, 0, sizeof(*caps));
5366 }
#define memset(x, y, z)
Definition: compat.h:39

◆ fp_none_get_emul_mask()

static DWORD fp_none_get_emul_mask ( const struct wined3d_gl_info gl_info)
static

Definition at line 5368 of file state.c.

5369 {
5370  return 0;
5371 }

◆ get_src_and_opr()

static void get_src_and_opr ( DWORD  arg,
BOOL  is_alpha,
GLenum source,
GLenum operand 
)
static

Definition at line 2038 of file state.c.

2038  {
2039  /* The WINED3DTA_ALPHAREPLICATE flag specifies the alpha component of the
2040  * input should be used for all input components. The WINED3DTA_COMPLEMENT
2041  * flag specifies the complement of the input should be used. */
2042  BOOL from_alpha = is_alpha || arg & WINED3DTA_ALPHAREPLICATE;
2043  BOOL complement = arg & WINED3DTA_COMPLEMENT;
2044 
2045  /* Calculate the operand */
2046  if (complement) {
2047  if (from_alpha) *operand = GL_ONE_MINUS_SRC_ALPHA;
2048  else *operand = GL_ONE_MINUS_SRC_COLOR;
2049  } else {
2050  if (from_alpha) *operand = GL_SRC_ALPHA;
2051  else *operand = GL_SRC_COLOR;
2052  }
2053 
2054  /* Calculate the source */
2055  switch (arg & WINED3DTA_SELECTMASK) {
2056  case WINED3DTA_CURRENT: *source = GL_PREVIOUS_EXT; break;
2058  case WINED3DTA_TEXTURE: *source = GL_TEXTURE; break;
2059  case WINED3DTA_TFACTOR: *source = GL_CONSTANT_EXT; break;
2060  case WINED3DTA_SPECULAR:
2061  /*
2062  * According to the GL_ARB_texture_env_combine specs, SPECULAR is
2063  * 'Secondary color' and isn't supported until base GL supports it
2064  * There is no concept of temp registers as far as I can tell
2065  */
2066  FIXME("Unhandled texture arg WINED3DTA_SPECULAR\n");
2067  *source = GL_TEXTURE;
2068  break;
2069  default:
2070  FIXME("Unrecognized texture arg %#x\n", arg);
2071  *source = GL_TEXTURE;
2072  break;
2073  }
2074 }
#define GL_PREVIOUS_EXT
Definition: glext.h:3237
#define WINED3DTA_COMPLEMENT
Definition: wined3d.h:883
#define WINED3DTA_CURRENT
Definition: wined3d.h:877
#define GL_PRIMARY_COLOR_EXT
Definition: glext.h:3236
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
#define WINED3DTA_TEXTURE
Definition: wined3d.h:878
#define GL_ONE_MINUS_SRC_COLOR
Definition: gl.h:377
#define WINED3DTA_SELECTMASK
Definition: wined3d.h:875
#define WINED3DTA_DIFFUSE
Definition: wined3d.h:876
#define WINED3DTA_SPECULAR
Definition: wined3d.h:880
#define WINED3DTA_TFACTOR
Definition: wined3d.h:879
#define GL_CONSTANT_EXT
Definition: glext.h:3235
static BOOL is_alpha(WCHAR val)
Definition: uri.c:262
#define WINED3DTA_ALPHAREPLICATE
Definition: wined3d.h:884
#define GL_ONE_MINUS_SRC_ALPHA
Definition: gl.h:379
#define GL_SRC_COLOR
Definition: gl.h:376
#define GL_SRC_ALPHA
Definition: gl.h:378
#define GL_TEXTURE
Definition: gl.h:247

Referenced by set_tex_op().

◆ get_viewports()

static void get_viewports ( struct wined3d_context context,
const struct wined3d_state state,
unsigned int  viewport_count,
struct wined3d_viewport viewports 
)
static

Definition at line 4006 of file state.c.

4008 {
4009  const struct wined3d_rendertarget_view *depth_stencil = state->fb->depth_stencil;
4010  const struct wined3d_rendertarget_view *target = state->fb->render_targets[0];
4011  unsigned int width, height, i;
4012 
4013  for (i = 0; i < viewport_count; ++i)
4014  viewports[i] = state->viewports[i];
4015 
4016  /* Note: GL uses a lower left origin while DirectX uses upper left. This
4017  * is reversed when using offscreen rendering. */
4018  if (context->render_offscreen)
4019  return;
4020 
4021  if (target)
4022  {
4024  }
4025  else if (depth_stencil)
4026  {
4027  height = depth_stencil->height;
4028  }
4029  else
4030  {
4031  FIXME("Could not get the height of render targets.\n");
4032  return;
4033  }
4034 
4035  for (i = 0; i < viewport_count; ++i)
4036  viewports[i].y = height - (viewports[i].y + viewports[i].height);
4037 }
GLint GLint GLsizei width
Definition: gl.h:1546
Definition: http.c:6587
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
void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view, const struct wined3d_context *context, unsigned int *width, unsigned int *height)
Definition: view.c:404
if(!(yy_init))
Definition: macro.lex.yy.c:714
static int state
Definition: maze.c:121
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLenum target
Definition: glext.h:7315

Referenced by viewport_miscpart(), and viewport_miscpart_cc().

◆ gl_blend_factor()

static GLenum gl_blend_factor ( enum wined3d_blend  factor,
const struct wined3d_format dst_format 
)
static

Definition at line 453 of file state.c.

454 {
455  switch (factor)
456  {
457  case WINED3D_BLEND_ZERO:
458  return GL_ZERO;
459  case WINED3D_BLEND_ONE:
460  return GL_ONE;
462  return GL_SRC_COLOR;
464  return GL_ONE_MINUS_SRC_COLOR;
466  return GL_SRC_ALPHA;
468  return GL_ONE_MINUS_SRC_ALPHA;
470  return GL_DST_COLOR;
472  return GL_ONE_MINUS_DST_COLOR;
473  /* To compensate for the lack of format switching with backbuffer
474  * offscreen rendering, and with onscreen rendering, we modify the
475  * alpha test parameters for (INV)DESTALPHA if the render target
476  * doesn't support alpha blending. A nonexistent alpha channel
477  * returns 1.0, so WINED3D_BLEND_DESTALPHA becomes GL_ONE, and
478  * WINED3D_BLEND_INVDESTALPHA becomes GL_ZERO. */
480  return dst_format->alpha_size ? GL_DST_ALPHA : GL_ONE;
482  return dst_format->alpha_size ? GL_ONE_MINUS_DST_ALPHA : GL_ZERO;
484  return GL_SRC_ALPHA_SATURATE;
486  return GL_CONSTANT_COLOR_EXT;
490  return GL_SRC1_COLOR;
494  return GL_SRC1_ALPHA;
497  default:
498  if (!factor)
499  WARN("Unhandled blend factor %#x.\n", factor);
500  else
501  FIXME("Unhandled blend factor %#x.\n", factor);
502  return GL_NONE;
503  }
504 }
#define GL_DST_COLOR
Definition: gl.h:382
#define GL_ONE_MINUS_DST_ALPHA
Definition: gl.h:381
#define GL_ONE
Definition: gl.h:375
static const char * dst_format
Definition: dib.c:1133
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 factor
Definition: glfuncs.h:178
#define WARN(fmt,...)
Definition: debug.h:111
#define GL_ONE_MINUS_SRC1_ALPHA
Definition: glext.h:2005
#define GL_ZERO
Definition: gl.h:374
#define FIXME(fmt,...)
Definition: debug.h:110
#define GL_ONE_MINUS_SRC_COLOR
Definition: gl.h:377
#define GL_ONE_MINUS_CONSTANT_COLOR_EXT
Definition: glext.h:2408
#define GL_NONE
Definition: gl.h:465
#define GL_DST_ALPHA
Definition: gl.h:380
#define GL_CONSTANT_COLOR_EXT
Definition: glext.h:2407
#define GL_ONE_MINUS_SRC_ALPHA
Definition: gl.h:379
#define GL_SRC_COLOR
Definition: gl.h:376
#define GL_SRC_ALPHA
Definition: gl.h:378
#define GL_ONE_MINUS_DST_COLOR
Definition: gl.h:383
#define GL_ONE_MINUS_SRC1_COLOR
Definition: glext.h:2004
#define GL_SRC1_COLOR
Definition: glext.h:2002
#define GL_SRC1_ALPHA
Definition: glext.h:381
#define GL_SRC_ALPHA_SATURATE
Definition: gl.h:384

Referenced by gl_blend_from_d3d().

◆ gl_blend_from_d3d()

static void gl_blend_from_d3d ( GLenum src_blend,
GLenum dst_blend,
enum wined3d_blend  d3d_src_blend,
enum wined3d_blend  d3d_dst_blend,
const struct wined3d_format rt_format 
)
static

Definition at line 506 of file state.c.

509 {
510  /* WINED3D_BLEND_BOTHSRCALPHA and WINED3D_BLEND_BOTHINVSRCALPHA are legacy
511  * source blending values which are still valid up to d3d9. They should
512  * not occur as dest blend values. */
513  if (d3d_src_blend == WINED3D_BLEND_BOTHSRCALPHA)
514  {
515  *src_blend = GL_SRC_ALPHA;
516  *dst_blend = GL_ONE_MINUS_SRC_ALPHA;
517  }
518  else if (d3d_src_blend == WINED3D_BLEND_BOTHINVSRCALPHA)
519  {
520  *src_blend = GL_ONE_MINUS_SRC_ALPHA;
521  *dst_blend = GL_SRC_ALPHA;
522  }
523  else
524  {
525  *src_blend = gl_blend_factor(d3d_src_blend, rt_format);
526  *dst_blend = gl_blend_factor(d3d_dst_blend, rt_format);
527  }
528 }
static GLenum gl_blend_factor(enum wined3d_blend factor, const struct wined3d_format *dst_format)
Definition: state.c:453
#define GL_ONE_MINUS_SRC_ALPHA
Definition: gl.h:379
#define GL_SRC_ALPHA
Definition: gl.h:378

Referenced by state_blend().

◆ gl_blend_op()

static GLenum gl_blend_op ( const struct wined3d_gl_info gl_info,
enum wined3d_blend_op  op 
)
static

Definition at line 400 of file state.c.

401 {
402  switch (op)
403  {
405  return GL_FUNC_ADD;
411  return gl_info->supported[EXT_BLEND_MINMAX] ? GL_MIN : GL_FUNC_ADD;
413  return gl_info->supported[EXT_BLEND_MINMAX] ? GL_MAX : GL_FUNC_ADD;
414  default:
415  if (!op)
416  WARN("Unhandled blend op %#x.\n", op);
417  else
418  FIXME("Unhandled blend op %#x.\n", op);
419  return GL_FUNC_ADD;
420  }
421 }
#define GL_FUNC_REVERSE_SUBTRACT
Definition: gl.h:1628
#define WARN(fmt,...)
Definition: debug.h:111
#define GL_MIN
Definition: gl.h:1624
#define GL_FUNC_ADD
Definition: gl.h:1626
#define FIXME(fmt,...)
Definition: debug.h:110
BOOL supported[WINED3D_GL_EXT_COUNT]
#define GL_MAX
Definition: gl.h:1625
#define GL_FUNC_SUBTRACT
Definition: gl.h:1627
UINT op
Definition: effect.c:223

Referenced by state_blendop().

◆ gl_stencil_op()

static GLenum gl_stencil_op ( enum wined3d_stencil_op  op)
static

Definition at line 876 of file state.c.

877 {
878  switch (op)
879  {
881  return GL_KEEP;
883  return GL_ZERO;
885  return GL_REPLACE;
887  return GL_INCR;
889  return GL_DECR;
891  return GL_INVERT;
893  return GL_INCR_WRAP;
895  return GL_DECR_WRAP;
896  default:
897  if (!op)
898  WARN("Unrecognized stencil op %#x.\n", op);
899  else
900  FIXME("Unrecognized stencil op %#x.\n", op);
901  return GL_KEEP;
902  }
903 }
#define WARN(fmt,...)
Definition: debug.h:111
#define GL_INCR
Definition: gl.h:461
#define GL_ZERO
Definition: gl.h:374
#define FIXME(fmt,...)
Definition: debug.h:110
#define GL_INVERT
Definition: gl.h:435
#define GL_REPLACE
Definition: gl.h:460
#define GL_DECR_WRAP
Definition: glext.h:297
#define GL_KEEP
Definition: gl.h:459
#define GL_INCR_WRAP
Definition: glext.h:296
UINT op
Definition: effect.c:223
#define GL_DECR
Definition: gl.h:462

Referenced by state_stencil().

◆ indexbuffer()

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

Definition at line 4314 of file state.c.

4315 {
4316  const struct wined3d_stream_info *stream_info = &context->stream_info;
4317  const struct wined3d_gl_info *gl_info = context->gl_info;
4318 
4319  if (!state->index_buffer || !stream_info->all_vbo)
4320  {
4321  GL_EXTCALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0));
4322  }
4323  else
4324  {
4325  struct wined3d_buffer *ib = state->index_buffer;
4326  GL_EXTCALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ib->buffer_object));
4327  }
4328 }
Definition: http.c:6587
static void stream_info(IStream *stream, HGLOBAL *hmem, int *size, int *pos)
#define GL_EXTCALL(f)
static int state
Definition: maze.c:121
#define GL_ELEMENT_ARRAY_BUFFER
Definition: glext.h:337

◆ light()

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

Definition at line 4139 of file state.c.

4140 {
4141  const struct wined3d_gl_info *gl_info = context->gl_info;
4142  UINT Index = state_id - STATE_ACTIVELIGHT(0);
4143  const struct wined3d_light_info *lightInfo = state->lights[Index];
4144 
4145  if (!lightInfo)
4146  {
4147  gl_info->gl_ops.gl.p_glDisable(GL_LIGHT0 + Index);
4148  checkGLcall("glDisable(GL_LIGHT0 + Index)");
4149  }
4150  else
4151  {
4152  float quad_att;
4153  float colRGBA[] = {0.0f, 0.0f, 0.0f, 0.0f};
4154 
4155  /* Light settings are affected by the model view in OpenGL, the View transform in direct3d*/
4156  gl_info->gl_ops.gl.p_glMatrixMode(GL_MODELVIEW);
4157  gl_info->gl_ops.gl.p_glPushMatrix();
4158  gl_info->gl_ops.gl.p_glLoadMatrixf(&state->transforms[WINED3D_TS_VIEW]._11);
4159 
4160  /* Diffuse: */
4161  colRGBA[0] = lightInfo->OriginalParms.diffuse.r;
4162  colRGBA[1] = lightInfo->OriginalParms.diffuse.g;
4163  colRGBA[2] = lightInfo->OriginalParms.diffuse.b;
4164  colRGBA[3] = lightInfo->OriginalParms.diffuse.a;
4165  gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_DIFFUSE, colRGBA);
4166  checkGLcall("glLightfv");
4167 
4168  /* Specular */
4169  colRGBA[0] = lightInfo->OriginalParms.specular.r;
4170  colRGBA[1] = lightInfo->OriginalParms.specular.g;
4171  colRGBA[2] = lightInfo->OriginalParms.specular.b;
4172  colRGBA[3] = lightInfo->OriginalParms.specular.a;
4173  gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_SPECULAR, colRGBA);
4174  checkGLcall("glLightfv");
4175 
4176  /* Ambient */
4177  colRGBA[0] = lightInfo->OriginalParms.ambient.r;
4178  colRGBA[1] = lightInfo->OriginalParms.ambient.g;
4179  colRGBA[2] = lightInfo->OriginalParms.ambient.b;
4180  colRGBA[3] = lightInfo->OriginalParms.ambient.a;
4181  gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_AMBIENT, colRGBA);
4182  checkGLcall("glLightfv");
4183 
4184  if ((lightInfo->OriginalParms.range * lightInfo->OriginalParms.range) >= FLT_MIN)
4185  quad_att = 1.4f / (lightInfo->OriginalParms.range * lightInfo->OriginalParms.range);
4186  else
4187  quad_att = 0.0f; /* 0 or MAX? (0 seems to be ok) */
4188 
4189  /* Do not assign attenuation values for lights that do not use them. D3D apps are free to pass any junk,
4190  * but gl drivers use them and may crash due to bad Attenuation values. Need for Speed most wanted sets
4191  * Attenuation0 to NaN and crashes in the gl lib
4192  */
4193 
4194  switch (lightInfo->OriginalParms.type)
4195  {
4196  case WINED3D_LIGHT_POINT:
4197  /* Position */
4198  gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_POSITION, &lightInfo->position.x);
4199  checkGLcall("glLightfv");
4200  gl_info->gl_ops.gl.p_glLightf(GL_LIGHT0 + Index, GL_SPOT_CUTOFF, lightInfo->cutoff);
4201  checkGLcall("glLightf");
4202  gl_info->gl_ops.gl.p_glLightf(GL_LIGHT0 + Index, GL_CONSTANT_ATTENUATION,
4203  lightInfo->OriginalParms.attenuation0);
4204  checkGLcall("glLightf");
4205  gl_info->gl_ops.gl.p_glLightf(GL_LIGHT0 + Index, GL_LINEAR_ATTENUATION,
4206  lightInfo->OriginalParms.attenuation1);
4207  checkGLcall("glLightf");
4208  if (quad_att < lightInfo->OriginalParms.attenuation2)
4209  quad_att = lightInfo->OriginalParms.attenuation2;
4210  gl_info->gl_ops.gl.p_glLightf(GL_LIGHT0 + Index, GL_QUADRATIC_ATTENUATION, quad_att);
4211  checkGLcall("glLightf");
4212  /* FIXME: Range */
4213  break;
4214 
4215  case WINED3D_LIGHT_SPOT:
4216  /* Position */
4217  gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_POSITION, &lightInfo->position.x);
4218  checkGLcall("glLightfv");
4219  /* Direction */
4220  gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_SPOT_DIRECTION, &lightInfo->direction.x);
4221  checkGLcall("glLightfv");
4222  gl_info->gl_ops.gl.p_glLightf(GL_LIGHT0 + Index, GL_SPOT_EXPONENT, lightInfo->exponent);
4223  checkGLcall("glLightf");
4224  gl_info->gl_ops.gl.p_glLightf(GL_LIGHT0 + Index, GL_SPOT_CUTOFF, lightInfo->cutoff);
4225  checkGLcall("glLightf");
4226  gl_info->gl_ops.gl.p_glLightf(GL_LIGHT0 + Index, GL_CONSTANT_ATTENUATION,
4227  lightInfo->OriginalParms.attenuation0);
4228  checkGLcall("glLightf");
4229  gl_info->gl_ops.gl.p_glLightf(GL_LIGHT0 + Index, GL_LINEAR_ATTENUATION,
4230  lightInfo->OriginalParms.attenuation1);
4231  checkGLcall("glLightf");
4232  if (quad_att < lightInfo->OriginalParms.attenuation2)
4233  quad_att = lightInfo->OriginalParms.attenuation2;
4234  gl_info->gl_ops.gl.p_glLightf(GL_LIGHT0 + Index, GL_QUADRATIC_ATTENUATION, quad_att);
4235  checkGLcall("glLightf");
4236  /* FIXME: Range */
4237  break;
4238 
4240  /* Direction */
4241  /* Note GL uses w position of 0 for direction! */
4242  gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_POSITION, &lightInfo->direction.x);
4243  checkGLcall("glLightfv");
4244  gl_info->gl_ops.gl.p_glLightf(GL_LIGHT0 + Index, GL_SPOT_CUTOFF, lightInfo->cutoff);
4245  checkGLcall("glLightf");
4246  gl_info->gl_ops.gl.p_glLightf(GL_LIGHT0 + Index, GL_SPOT_EXPONENT, 0.0f);
4247  checkGLcall("glLightf");
4248  break;
4249 
4250  default:
4251  FIXME("Unrecognized light type %#x.\n", lightInfo->OriginalParms.type);
4252  }
4253 
4254  /* Restore the modelview matrix */
4255  gl_info->gl_ops.gl.p_glPopMatrix();
4256 
4257  gl_info->gl_ops.gl.p_glEnable(GL_LIGHT0 + Index);
4258  checkGLcall("glEnable(GL_LIGHT0 + Index)");
4259  }
4260 }
#define GL_CONSTANT_ATTENUATION
Definition: gl.h:321
#define STATE_ACTIVELIGHT(a)
#define GL_SPOT_EXPONENT
Definition: gl.h:319
struct opengl_funcs gl_ops
Definition: http.c:6587
#define GL_SPOT_DIRECTION
Definition: gl.h:330
#define FLT_MIN
Definition: gcc_float.h:124
#define GL_SPOT_CUTOFF
Definition: gl.h:320
#define GL_DIFFUSE
Definition: gl.h:325
#define GL_LIGHT0
Definition: gl.h:311
#define FIXME(fmt,...)
Definition: debug.h:110
GLfloat f
Definition: glext.h:7540
#define GL_SPECULAR
Definition: gl.h:326
static const UCHAR Index[8]
Definition: usbohci.c:18
static int state
Definition: maze.c:121
#define GL_AMBIENT
Definition: gl.h:324
#define GL_QUADRATIC_ATTENUATION
Definition: gl.h:323
struct wined3d_vec4 position
struct wined3d_vec4 direction
struct wined3d_light OriginalParms
#define checkGLcall(A)
#define GL_MODELVIEW
Definition: gl.h:245
unsigned int UINT
Definition: ndis.h:50
#define GL_POSITION
Definition: gl.h:329
#define GL_LINEAR_ATTENUATION
Definition: gl.h:322

Referenced by transform_view().

◆ multistate_apply_2()

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

Definition at line 5398 of file state.c.

5399 {
5400  context->device->multistate_funcs[state_id][0](context, state, state_id);
5401  context->device->multistate_funcs[state_id][1](context, state, state_id);
5402 }
Definition: http.c:6587
static int state
Definition: maze.c:121

Referenced by compile_state_table().

◆ multistate_apply_3()

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

Definition at line 5404 of file state.c.

5405 {
5406  context->device->multistate_funcs[state_id][0](context, state, state_id);
5407  context->device->multistate_funcs[state_id][1](context, state, state_id);
5408  context->device->multistate_funcs[state_id][2](context, state, state_id);
5409 }
Definition: http.c:6587
static int state
Definition: maze.c:121

Referenced by compile_state_table().

◆ none_alloc()

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

Definition at line 5336 of file state.c.

5337 {
5338  return shader_priv;
5339 }

◆ none_enable()

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

Definition at line 5334 of file state.c.

5334 {}

◆ none_free()

static void none_free ( struct wined3d_device device)
static

Definition at line 5341 of file state.c.

5341 {}

◆ num_handlers()

static unsigned int num_handlers ( const APPLYSTATEFUNC funcs)
static

Definition at line 5391 of file state.c.

5392 {
5393  unsigned int i;
5394  for(i = 0; funcs[i]; i++);
5395  return i;
5396 }
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
static struct __wine_debug_functions funcs
Definition: debug.c:59

Referenced by compile_state_table().

◆ prune_invalid_states()

static void prune_invalid_states ( struct StateEntry state_table,
const struct wined3d_gl_info gl_info,
const struct wined3d_d3d_info d3d_info 
)
static

Definition at line 5411 of file state.c.

5413 {
5414  unsigned int start, last, i;
5415 
5416  start = STATE_TEXTURESTAGE(d3d_info->limits.ffp_blend_stages, 0);
5418  for (i = start; i <= last; ++i)
5419  {
5420  state_table[i].representative = 0;
5421  state_table[i].apply = state_undefined;
5422  }
5423 
5424  start = STATE_TRANSFORM(WINED3D_TS_TEXTURE0 + d3d_info->limits.ffp_blend_stages);
5426  for (i = start; i <= last; ++i)
5427  {
5428  state_table[i].representative = 0;
5429  state_table[i].apply = state_undefined;
5430  }
5431 
5432  start = STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(d3d_info->limits.ffp_vertex_blend_matrices));
5434  for (i = start; i <= last; ++i)
5435  {
5436  state_table[i].representative = 0;
5437  state_table[i].apply = state_undefined;
5438  }
5439 }
#define STATE_TEXTURESTAGE(stage, num)
#define WINED3D_TS_WORLD_MATRIX(index)
Definition: wined3d.h:673
#define MAX_TEXTURES
POINT last
Definition: font.c:46
static const struct @239 state_table[]
#define STATE_TRANSFORM(a)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static void state_undefined(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:164
struct wined3d_d3d_limits limits
GLuint start
Definition: gl.h:1545
#define WINED3D_HIGHEST_TEXTURE_STATE
Definition: wined3d.h:604

Referenced by compile_state_table().

◆ psorigin()

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

Definition at line 4383 of file state.c.

4384 {
4385  const struct wined3d_gl_info *gl_info = context->gl_info;
4386  GLint origin = context->render_offscreen ? GL_LOWER_LEFT : GL_UPPER_LEFT;
4387 
4388  GL_EXTCALL(glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, origin));
4389  checkGLcall("glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, ...)");
4390 }
#define GL_POINT_SPRITE_COORD_ORIGIN
Definition: glext.h:460
Definition: http.c:6587
voidpf uLong int origin
Definition: ioapi.h:142
#define GL_LOWER_LEFT
Definition: glext.h:461
#define GL_UPPER_LEFT
Definition: glext.h:462
#define GL_EXTCALL(f)
#define checkGLcall(A)
int GLint
Definition: gl.h:156

◆ psorigin_w()

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

Definition at line 4372 of file state.c.

4373 {
4374  static BOOL warned;
4375 
4376  if (!warned)
4377  {
4378  WARN("Point sprite coordinate origin switching not supported.\n");
4379  warned = TRUE;
4380  }
4381 }
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:111
unsigned int BOOL
Definition: ntddk_ex.h:94

◆ rasterizer()

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

Definition at line 4346 of file state.c.

4347 {
4348  const struct wined3d_gl_info *gl_info = context->gl_info;
4349  GLenum mode;
4350 
4351  mode = state->rasterizer_state && state->rasterizer_state->desc.front_ccw ? GL_CCW : GL_CW;
4352  if (context->render_offscreen)
4353  mode = (mode == GL_CW) ? GL_CCW : GL_CW;
4354 
4355  gl_info->gl_ops.gl.p_glFrontFace(mode);
4356  checkGLcall("glFrontFace");
4357  depth_clip(state->rasterizer_state, gl_info);
4358 }
struct opengl_funcs gl_ops
Definition: http.c:6587
static void depth_clip(const struct wined3d_rasterizer_state *r, const struct wined3d_gl_info *gl_info)
Definition: state.c:4330
#define GL_CCW
Definition: gl.h:269
static int state
Definition: maze.c:121
unsigned int GLenum
Definition: gl.h:150
GLenum mode
Definition: glext.h:6217
#define checkGLcall(A)
#define GL_CW
Definition: gl.h:268

◆ rasterizer_cc()

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

Definition at line 4360 of file state.c.

4361 {
4362  const struct wined3d_gl_info *gl_info = context->gl_info;
4363  GLenum mode;
4364 
4365  mode = state->rasterizer_state && state->rasterizer_state->desc.front_ccw ? GL_CCW : GL_CW;
4366 
4367  gl_info->gl_ops.gl.p_glFrontFace(mode);
4368  checkGLcall("glFrontFace");
4369  depth_clip(state->rasterizer_state, gl_info);
4370 }
struct opengl_funcs gl_ops
Definition: http.c:6587
static void depth_clip(const struct wined3d_rasterizer_state *r, const struct wined3d_gl_info *gl_info)
Definition: state.c:4330
#define GL_CCW
Definition: gl.h:269
static int state
Definition: maze.c:121
unsigned int GLenum
Definition: gl.h:150
GLenum mode
Definition: glext.h:6217
#define checkGLcall(A)
#define GL_CW
Definition: gl.h:268

◆ renderstate_stencil_twosided()

static void renderstate_stencil_twosided ( struct wined3d_context context,
GLint  face,
GLint  func,
GLint  ref,
GLuint  mask,
GLint  stencilFail,
GLint  depthFail,
GLint  stencilPass 
)
static

Definition at line 861 of file state.c.

863 {
864  const struct wined3d_gl_info *gl_info = context->gl_info;
865 
866  gl_info->gl_ops.gl.p_glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT);
867  checkGLcall("glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT)");
868  GL_EXTCALL(glActiveStencilFaceEXT(face));
869  checkGLcall("glActiveStencilFaceEXT(...)");
870  gl_info->gl_ops.gl.p_glStencilFunc(func, ref, mask);
871  checkGLcall("glStencilFunc(...)");
872  gl_info->gl_ops.gl.p_glStencilOp(stencilFail, depthFail, stencilPass);
873  checkGLcall("glStencilOp(...)");
874 }
GLenum func
Definition: glext.h:6028
struct opengl_funcs gl_ops
Definition: http.c:6587
Definition: send.c:47
#define GL_STENCIL_TEST_TWO_SIDE_EXT
Definition: glext.h:4210
GLenum GLint GLuint mask
Definition: glext.h:6028
#define GL_EXTCALL(f)
#define checkGLcall(A)
GLenum GLuint GLint GLenum face
Definition: glext.h:7025

Referenced by state_stencil().

◆ sampler()

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

Definition at line 3595 of file state.c.

3596 {
3597  DWORD sampler_idx = state_id - STATE_SAMPLER(0);
3598  DWORD mapped_stage = context->tex_unit_map[sampler_idx];
3599  const struct wined3d_gl_info *gl_info = context->gl_info;
3600 
3601  TRACE("Sampler %u.\n", sampler_idx);
3602 
3603  if (mapped_stage == WINED3D_UNMAPPED_STAGE)
3604  {
3605  TRACE("No sampler mapped to stage %u. Returning.\n", sampler_idx);
3606  return;
3607  }
3608 
3609  if (mapped_stage >= gl_info->limits.graphics_samplers)
3610  return;
3611  context_active_texture(context, gl_info, mapped_stage);
3612 
3613  if (state->textures[sampler_idx])
3614  {
3615  BOOL srgb = state->sampler_states[sampler_idx][WINED3D_SAMP_SRGB_TEXTURE];
3616  const DWORD *sampler_states = state->sampler_states[sampler_idx];
3617  struct wined3d_texture *texture = state->textures[sampler_idx];
3618  struct wined3d_device *device = context->device;
3619  struct wined3d_sampler_desc desc;
3620  struct wined3d_sampler *sampler;
3621  struct wine_rb_entry *entry;
3622 
3624 
3626 
3627  if ((entry = wine_rb_get(&device->samplers, &desc)))
3628  {
3630  }
3631  else
3632  {
3634  {
3635  ERR("Failed to create sampler.\n");
3636  return;
3637  }
3638  if (wine_rb_put(&device->samplers, &desc, &sampler->entry) == -1)
3639  {
3640  ERR("Failed to insert sampler.\n");
3642  return;
3643  }
3644  }
3645 
3646  wined3d_sampler_bind(sampler, mapped_stage, texture, context);
3647 
3648  /* Trigger shader constant reloading (for NP2 texcoord fixup) */
3649  if (!(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT))
3650  context->constant_update_mask |= WINED3D_SHADER_CONST_PS_NP2_FIXUP;
3651  }
3652  else
3653  {
3655  if (gl_info->supported[ARB_SAMPLER_OBJECTS])
3656  {
3657  GL_EXTCALL(glBindSampler(mapped_stage, 0));
3658  checkGLcall("glBindSampler");
3659  }
3660  }
3661 }
Definition: http.c:6587
void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, unsigned int unit)
Definition: context.c:2486
#define WINED3D_TEXTURE_POW2_MAT_IDENT
void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit, struct wined3d_texture *texture, const struct wined3d_context *context)
Definition: sampler.c:184
HRESULT CDECL wined3d_sampler_create(struct wined3d_device *device, const struct wined3d_sampler_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_sampler **sampler)
Definition: sampler.c:130
void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint name)
Definition: context.c:2503
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: devices.h:37
BOOL supported[WINED3D_GL_EXT_COUNT]
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
#define GL_EXTCALL(f)
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
#define WINED3D_SHADER_CONST_PS_NP2_FIXUP
ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler)
Definition: sampler.c:53
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GL_NONE
Definition: gl.h:465
static int state
Definition: maze.c:121
uint32_t entry
Definition: isohybrid.c:63
#define WINED3D_UNMAPPED_STAGE
static void wined3d_sampler_desc_from_sampler_states(struct wined3d_sampler_desc *desc, const struct wined3d_context *context, const DWORD *sampler_states, const struct wined3d_texture *texture)
Definition: state.c:3536
#define STATE_SAMPLER(num)
#define ERR(fmt,...)
Definition: debug.h:109
Definition: rbtree.h:35
const struct wined3d_parent_ops wined3d_null_parent_ops
Definition: directx.c:6781
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
Definition: rbtree.h:215
#define checkGLcall(A)
static struct wine_rb_entry * wine_rb_get(const struct wine_rb_tree *tree, const void *key)
Definition: rbtree.h:203
static void sampler(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:3595
void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
Definition: texture.c:925
struct wined3d_gl_limits limits
GLuint sampler
Definition: glext.h:7283

Referenced by apply_pixelshader(), and sampler_texmatrix().

◆ sampler_texmatrix()

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

Definition at line 3489 of file state.c.

3490 {
3491  const DWORD sampler = state_id - STATE_SAMPLER(0);
3492  const struct wined3d_texture *texture = state->textures[sampler];
3493 
3494  TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
3495 
3496  if (!texture)
3497  return;
3498 
3499  /* The fixed function np2 texture emulation uses the texture matrix to fix up the coordinates
3500  * wined3d_texture_apply_state_changes() multiplies the set matrix with a fixup matrix. Before the
3501  * scaling is reapplied or removed, the texture matrix has to be reapplied.
3502  */
3503  if (sampler < MAX_TEXTURES)
3504  {
3505  const BOOL tex_is_pow2 = !(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT);
3506 
3507  if (tex_is_pow2 || (context->lastWasPow2Texture & (1u << sampler)))
3508  {
3509  if (tex_is_pow2)
3510  context->lastWasPow2Texture |= 1u << sampler;
3511  else
3512  context->lastWasPow2Texture &= ~(1u << sampler);
3513 
3515  }
3516  }
3517 }
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)
#define MAX_TEXTURES
Definition: http.c:6587
#define WINED3D_TEXTURE_POW2_MAT_IDENT
static void transform_texture(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:3287
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
static int state
Definition: maze.c:121
#define STATE_SAMPLER(num)
static void sampler(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:3595
GLuint sampler
Definition: glext.h:7283

◆ scissorrect()

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

Definition at line 4262 of file state.c.

4263 {
4264  const struct wined3d_gl_info *gl_info = context->gl_info;
4265  unsigned int height = 0;
4266  const RECT *r;
4267 
4268  /* Warning: glScissor uses window coordinates, not viewport coordinates,
4269  * so our viewport correction does not apply. Warning2: Even in windowed
4270  * mode the coords are relative to the window, not the screen. */
4271 
4272  if (!context->render_offscreen)
4273  {
4274  const struct wined3d_rendertarget_view *target = state->fb->render_targets[0];
4275  unsigned int width;
4276 
4278  }
4279 
4280  if (gl_info->supported[ARB_VIEWPORT_ARRAY])
4281  {
4282  GLint sr[4 * WINED3D_MAX_VIEWPORTS];
4283  unsigned int i, reset_count = 0;
4284 
4285  for (i = 0; i < state->scissor_rect_count; ++i)
4286  {
4287  r = &state->scissor_rects[i];
4288 
4289  sr[i * 4] = r->left;
4290  sr[i * 4 + 1] = height ? height - r->top : r->top;
4291  sr[i * 4 + 2] = r->right - r->left;
4292  sr[i * 4 + 3] = r->bottom - r->top;
4293  }
4294 
4295  if (context->scissor_rect_count > state->scissor_rect_count)
4296  reset_count = context->scissor_rect_count - state->scissor_rect_count;
4297 
4298  if (reset_count)
4299  memset(&sr[state->scissor_rect_count * 4], 0, reset_count * 4 * sizeof(GLint));
4300 
4301  GL_EXTCALL(glScissorArrayv(0, state->scissor_rect_count + reset_count, sr));
4302  checkGLcall("glScissorArrayv");
4303  context->scissor_rect_count = state->scissor_rect_count;
4304  }
4305  else
4306  {
4307  r = &state->scissor_rects[0];
4308  gl_info->gl_ops.gl.p_glScissor(r->left, height ? height - r->top : r->top,
4309  r->right - r->left, r->bottom - r->top);
4310  checkGLcall("glScissor");
4311  }
4312 }
GLint GLint GLsizei width
Definition: gl.h:1546
struct opengl_funcs gl_ops
Definition: http.c:6587
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
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]
#define GL_EXTCALL(f)
void wined3d_rendertarget_view_get_drawable_size(const struct wined3d_rendertarget_view *view, const struct wined3d_context *context, unsigned int *width, unsigned int *height)
Definition: view.c:404
#define WINED3D_MAX_VIEWPORTS
Definition: wined3d.h:1579
static int state
Definition: maze.c:121
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define checkGLcall(A)
GLenum target
Definition: glext.h:7315
int GLint
Definition: gl.h:156
#define memset(x, y, z)
Definition: compat.h:39

◆ set_color_mask()

static void set_color_mask ( const struct wined3d_gl_info gl_info,
UINT  index,
DWORD  mask 
)
static

Definition at line 1584 of file state.c.

1585 {
1586  GL_EXTCALL(glColorMaski(index,
1591  checkGLcall("glColorMaski");
1592 }
#define GL_FALSE
Definition: gl.h:173
#define WINED3DCOLORWRITEENABLE_ALPHA
Definition: wined3d.h:864
GLenum GLint GLuint mask
Definition: glext.h:6028
#define WINED3DCOLORWRITEENABLE_RED
Definition: wined3d.h:861
#define WINED3DCOLORWRITEENABLE_GREEN
Definition: wined3d.h:862
GLuint index
Definition: glext.h:6031
#define GL_EXTCALL(f)
#define WINED3DCOLORWRITEENABLE_BLUE
Definition: wined3d.h:863
#define GL_TRUE
Definition: gl.h:174
#define checkGLcall(A)

Referenced by state_colorwrite_i().

◆ set_tex_op()

static void set_tex_op ( const struct wined3d_gl_info gl_info,
const struct wined3d_state state,
BOOL  isAlpha,
int  Stage,
enum wined3d_texture_op  op,
DWORD  arg1,
DWORD  arg2,
DWORD  arg3 
)
static

Definition at line 2077 of file state.c.

2079 {
2080  GLenum src1, src2, src3;
2081  GLenum opr1, opr2, opr3;
2082  GLenum comb_target;
2083  GLenum src0_target, src1_target, src2_target;
2084  GLenum opr0_target, opr1_target, opr2_target;
2085  GLenum scal_target;
2086  GLenum opr=0, invopr, src3_target, opr3_target;
2087  BOOL Handled = FALSE;
2088 
2089  TRACE("Alpha?(%d), Stage:%d Op(%s), a1(%d), a2(%d), a3(%d)\n", isAlpha, Stage, debug_d3dtop(op), arg1, arg2, arg3);
2090 
2091  /* Operations usually involve two args, src0 and src1 and are operations
2092  * of the form (a1 <operation> a2). However, some of the more complex
2093  * operations take 3 parameters. Instead of the (sensible) addition of a3,
2094  * Microsoft added in a third parameter called a0. Therefore these are
2095  * operations of the form a0 <operation> a1 <operation> a2. I.e., the new
2096  * parameter goes to the front.
2097  *
2098  * However, below we treat the new (a0) parameter as src2/opr2, so in the
2099  * actual functions below, expect their syntax to differ slightly to those
2100  * listed in the manuals. I.e., replace arg1 with arg3, arg2 with arg1 and
2101  * arg3 with arg2. This affects WINED3DTOP_MULTIPLYADD and WINED3DTOP_LERP. */
2102 
2103  if (isAlpha)
2104  {
2105  comb_target = GL_COMBINE_ALPHA;
2106  src0_target = GL_SOURCE0_ALPHA;
2107  src1_target = GL_SOURCE1_ALPHA;
2108  src2_target = GL_SOURCE2_ALPHA;
2109  opr0_target = GL_OPERAND0_ALPHA;
2110  opr1_target = GL_OPERAND1_ALPHA;
2111  opr2_target = GL_OPERAND2_ALPHA;
2112  scal_target = GL_ALPHA_SCALE;
2113  }
2114  else
2115  {
2116  comb_target = GL_COMBINE_RGB;
2117  src0_target = GL_SOURCE0_RGB;
2118  src1_target = GL_SOURCE1_RGB;
2119  src2_target = GL_SOURCE2_RGB;
2120  opr0_target = GL_OPERAND0_RGB;
2121  opr1_target = GL_OPERAND1_RGB;
2122  opr2_target = GL_OPERAND2_RGB;
2123  scal_target = GL_RGB_SCALE;
2124  }
2125 
2126  /* If a texture stage references an invalid texture unit the stage just
2127  * passes through the result from the previous stage */
2128  if (is_invalid_op(state, Stage, op, arg1, arg2, arg3))
2129  {
2132  }
2133 
2134  if (isAlpha && !state->textures[Stage] && arg1 == WINED3DTA_TEXTURE)
2135  {
2136  get_src_and_opr(WINED3DTA_DIFFUSE, isAlpha, &src1, &opr1);
2137  } else {
2138  get_src_and_opr(arg1, isAlpha, &src1, &opr1);
2139  }
2140  get_src_and_opr(arg2, isAlpha, &src2, &opr2);
2141  get_src_and_opr(arg3, isAlpha, &src3, &opr3);
2142 
2143  TRACE("ct(%x), 1:(%x,%x), 2:(%x,%x), 3:(%x,%x)\n", comb_target, src1, opr1, src2, opr2, src3, opr3);
2144 
2145  Handled = TRUE; /* Assume will be handled */
2146 
2147  /* Other texture operations require special extensions: */
2148  if (gl_info->supported[NV_TEXTURE_ENV_COMBINE4])
2149  {
2150  if (isAlpha) {
2151  opr = GL_SRC_ALPHA;
2152  invopr = GL_ONE_MINUS_SRC_ALPHA;
2153  src3_target = GL_SOURCE3_ALPHA_NV;
2154  opr3_target = GL_OPERAND3_ALPHA_NV;
2155  } else {
2156  opr = GL_SRC_COLOR;
2157  invopr = GL_ONE_MINUS_SRC_COLOR;
2158  src3_target = GL_SOURCE3_RGB_NV;
2159  opr3_target = GL_OPERAND3_RGB_NV;
2160  }
2161  switch (op)
2162  {
2163  case WINED3D_TOP_DISABLE: /* Only for alpha */
2164  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2165  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_REPLACE");
2166  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, GL_PREVIOUS_EXT);
2167  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2168  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, GL_SRC_ALPHA);
2169  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2170  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_ZERO);
2171  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2172  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2173  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2174  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_ZERO);
2175  checkGLcall("GL_TEXTURE_ENV, src2_target, GL_ZERO");
2176  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr);
2177  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr");
2178  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_ZERO);
2179  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_ZERO");
2180  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, opr);
2181  checkGLcall("GL_TEXTURE_ENV, opr3_target, opr");
2182  break;
2183 
2184  case WINED3D_TOP_SELECT_ARG1: /* = a1 * 1 + 0 * 0 */
2185  case WINED3D_TOP_SELECT_ARG2: /* = a2 * 1 + 0 * 0 */
2186  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2187  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2188  if (op == WINED3D_TOP_SELECT_ARG1)
2189  {
2190  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2191  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2192  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2193  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2194  }
2195  else
2196  {
2197  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src2);
2198  checkGLcall("GL_TEXTURE_ENV, src0_target, src2");
2199  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr2);
2200  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr2");
2201  }
2202  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_ZERO);
2203  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2204  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2205  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2206  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_ZERO);
2207  checkGLcall("GL_TEXTURE_ENV, src2_target, GL_ZERO");
2208  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr);
2209  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr");
2210  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_ZERO);
2211  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_ZERO");
2212  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, opr);
2213  checkGLcall("GL_TEXTURE_ENV, opr3_target, opr");
2214  break;
2215 
2216  case WINED3D_TOP_MODULATE:
2217  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2218  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD"); /* Add = a0*a1 + a2*a3 */
2219  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2220  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2221  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2222  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2223  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2224  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2225  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2226  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2227  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_ZERO);
2228  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2229  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr);
2230  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2231  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_ZERO);
2232  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_ZERO");
2233  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, opr);
2234  checkGLcall("GL_TEXTURE_ENV, opr3_target, opr1");
2235  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2236  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2237  break;
2239  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2240  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD"); /* Add = a0*a1 + a2*a3 */
2241  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2242  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2243  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2244  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2245  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2246  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2247  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2248  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2249  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_ZERO);
2250  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2251  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr);
2252  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2253  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_ZERO);
2254  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_ZERO");
2255  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, opr);
2256  checkGLcall("GL_TEXTURE_ENV, opr3_target, opr1");
2257  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 2);
2258  checkGLcall("GL_TEXTURE_ENV, scal_target, 2");
2259  break;
2261  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2262  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD"); /* Add = a0*a1 + a2*a3 */
2263  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2264  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2265  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2266  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2267  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2268  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2269  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2270  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2271  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_ZERO);
2272  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2273  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr);
2274  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2275  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_ZERO);
2276  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_ZERO");
2277  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, opr);
2278  checkGLcall("GL_TEXTURE_ENV, opr3_target, opr1");
2279  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 4);
2280  checkGLcall("GL_TEXTURE_ENV, scal_target, 4");
2281  break;
2282 
2283  case WINED3D_TOP_ADD:
2284  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2285  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2286  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2287  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2288  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2289  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2290  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_ZERO);
2291  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2292  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2293  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2294  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2295  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2296  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2297  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2298  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_ZERO);
2299  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_ZERO");
2300  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, invopr);
2301  checkGLcall("GL_TEXTURE_ENV, opr3_target, invopr");
2302  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2303  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2304  break;
2305 
2307  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED);
2308  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED");
2309  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2310  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2311  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2312  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2313  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_ZERO);
2314  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2315  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2316  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2317  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2318  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2319  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2320  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2321  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_ZERO);
2322  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_ZERO");
2323  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, invopr);
2324  checkGLcall("GL_TEXTURE_ENV, opr3_target, invopr");
2325  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2326  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2327  break;
2328 
2330  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED);
2331  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED");
2332  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2333  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2334  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2335  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2336  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_ZERO);
2337  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2338  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2339  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2340  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2341  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2342  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2343  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2344  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_ZERO);
2345  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_ZERO");
2346  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, invopr);
2347  checkGLcall("GL_TEXTURE_ENV, opr3_target, invopr");
2348  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 2);
2349  checkGLcall("GL_TEXTURE_ENV, scal_target, 2");
2350  break;
2351 
2353  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2354  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2355  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2356  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2357  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2358  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2359  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_ZERO);
2360  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2361  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2362  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2363  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2364  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2365  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2366  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2367  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, src1);
2368  checkGLcall("GL_TEXTURE_ENV, src3_target, src1");
2369  switch (opr1) {
2370  case GL_SRC_COLOR: opr = GL_ONE_MINUS_SRC_COLOR; break;
2371  case GL_ONE_MINUS_SRC_COLOR: opr = GL_SRC_COLOR; break;
2372  case GL_SRC_ALPHA: opr = GL_ONE_MINUS_SRC_ALPHA; break;
2373  case GL_ONE_MINUS_SRC_ALPHA: opr = GL_SRC_ALPHA; break;
2374  }
2375  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, opr);
2376  checkGLcall("GL_TEXTURE_ENV, opr3_target, opr");
2377  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2378  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2379  break;
2380 
2382  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2383  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2384  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2385  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2386  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2387  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2388  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_PRIMARY_COLOR);
2389  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_PRIMARY_COLOR");
2390  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2391  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2392  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2393  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2394  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2395  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2396  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_PRIMARY_COLOR);
2397  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_PRIMARY_COLOR");
2398  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA);
2399  checkGLcall("GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA");
2400  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2401  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2402  break;
2404  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2405  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2406  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2407  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2408  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2409  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2410  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_TEXTURE);
2411  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_TEXTURE");
2412  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2413  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2414  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2415  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2416  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2417  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2418  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_TEXTURE);
2419  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_TEXTURE");
2420  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA);
2421  checkGLcall("GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA");
2422  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2423  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2424  break;
2426  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2427  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2428  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2429  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2430  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2431  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2432  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_CONSTANT);
2433  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_CONSTANT");
2434  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2435  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2436  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2437  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2438  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2439  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2440  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_CONSTANT);
2441  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_CONSTANT");
2442  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA);
2443  checkGLcall("GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA");
2444  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2445  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2446  break;
2448  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2449  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2450  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2451  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2452  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2453  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2454  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_ZERO);
2455  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2456  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2457  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2458  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2459  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2460  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2461  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2462  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_TEXTURE);
2463  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_TEXTURE");
2464  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA);
2465  checkGLcall("GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA");
2466  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2467  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2468  break;
2470  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2471  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD"); /* Add = a0*a1 + a2*a3 */
2472  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1); /* a0 = src1/opr1 */
2473  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2474  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2475  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1"); /* a1 = 1 (see docs) */
2476  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_ZERO);
2477  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2478  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2479  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2480  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2); /* a2 = arg2 */
2481  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2482  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2483  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2"); /* a3 = src1 alpha */
2484  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, src1);
2485  checkGLcall("GL_TEXTURE_ENV, src3_target, src1");
2486  switch (opr) {
2487  case GL_SRC_COLOR: opr = GL_SRC_ALPHA; break;
2489  }
2490  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, opr);
2491  checkGLcall("GL_TEXTURE_ENV, opr3_target, opr");
2492  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2493  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2494  break;
2496  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2497  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2498  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2499  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2500  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2501  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2502  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2503  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2504  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2505  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2506  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src1);
2507  checkGLcall("GL_TEXTURE_ENV, src2_target, src1");
2508  switch (opr1) {
2509  case GL_SRC_COLOR: opr = GL_SRC_ALPHA; break;
2511  }
2512  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr);
2513  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr");
2514  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_ZERO);
2515  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_ZERO");
2516  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, invopr);
2517  checkGLcall("GL_TEXTURE_ENV, opr3_target, invopr");
2518  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2519  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2520  break;
2522  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2523  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2524  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2525  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2526  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2527  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2528  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_ZERO);
2529  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2530  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2531  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2532  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2533  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2534  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2535  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2536  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, src1);
2537  checkGLcall("GL_TEXTURE_ENV, src3_target, src1");
2538  switch (opr1) {
2539  case GL_SRC_COLOR: opr = GL_ONE_MINUS_SRC_ALPHA; break;
2540  case GL_ONE_MINUS_SRC_COLOR: opr = GL_SRC_ALPHA; break;
2541  case GL_SRC_ALPHA: opr = GL_ONE_MINUS_SRC_ALPHA; break;
2542  case GL_ONE_MINUS_SRC_ALPHA: opr = GL_SRC_ALPHA; break;
2543  }
2544  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, opr);
2545  checkGLcall("GL_TEXTURE_ENV, opr3_target, opr");
2546  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2547  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2548  break;
2550  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2551  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2552  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2553  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2554  switch (opr1) {
2555  case GL_SRC_COLOR: opr = GL_ONE_MINUS_SRC_COLOR; break;
2556  case GL_ONE_MINUS_SRC_COLOR: opr = GL_SRC_COLOR; break;
2557  case GL_SRC_ALPHA: opr = GL_ONE_MINUS_SRC_ALPHA; break;
2558  case GL_ONE_MINUS_SRC_ALPHA: opr = GL_SRC_ALPHA; break;
2559  }
2560  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr);
2561  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr");
2562  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2563  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2564  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2565  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2566  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src1);
2567  checkGLcall("GL_TEXTURE_ENV, src2_target, src1");
2568  switch (opr1) {
2569  case GL_SRC_COLOR: opr = GL_SRC_ALPHA; break;
2571  }
2572  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr);
2573  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr");
2574  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, GL_ZERO);
2575  checkGLcall("GL_TEXTURE_ENV, src3_target, GL_ZERO");
2576  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, invopr);
2577  checkGLcall("GL_TEXTURE_ENV, opr3_target, invopr");
2578  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2579  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2580  break;
2582  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2583  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2584  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src3);
2585  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2586  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr3);
2587  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2588  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, GL_ZERO);
2589  checkGLcall("GL_TEXTURE_ENV, src1_target, GL_ZERO");
2590  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, invopr);
2591  checkGLcall("GL_TEXTURE_ENV, opr1_target, invopr");
2592  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src1);
2593  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2594  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr1);
2595  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2596  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src3_target, src2);
2597  checkGLcall("GL_TEXTURE_ENV, src3_target, src3");
2598  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr3_target, opr2);
2599  checkGLcall("GL_TEXTURE_ENV, opr3_target, opr3");
2600  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2601  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2602  break;
2603 
2606  FIXME("Implement bump environment mapping in GL_NV_texture_env_combine4 path\n");
2607  Handled = FALSE;
2608  break;
2609 
2610  default:
2611  Handled = FALSE;
2612  }
2613  if (Handled)
2614  {
2615  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV);
2616  checkGLcall("GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV");
2617 
2618  return;
2619  }
2620  } /* GL_NV_texture_env_combine4 */
2621 
2622  Handled = TRUE; /* Again, assume handled */
2623  switch (op) {
2624  case WINED3D_TOP_DISABLE: /* Only for alpha */
2625  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_REPLACE);
2626  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_REPLACE");
2627  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, GL_PREVIOUS_EXT);
2628  checkGLcall("GL_TEXTURE_ENV, src0_target, GL_PREVIOUS_EXT");
2629  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, GL_SRC_ALPHA);
2630  checkGLcall("GL_TEXTURE_ENV, opr0_target, GL_SRC_ALPHA");
2631  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2632  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2633  break;
2635  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_REPLACE);
2636  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_REPLACE");
2637  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2638  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2639  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2640  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2641  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2642  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2643  break;
2645  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_REPLACE);
2646  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_REPLACE");
2647  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src2);
2648  checkGLcall("GL_TEXTURE_ENV, src0_target, src2");
2649  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr2);
2650  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr2");
2651  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2652  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2653  break;
2654  case WINED3D_TOP_MODULATE:
2655  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_MODULATE);
2656  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_MODULATE");
2657  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2658  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2659  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2660  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2661  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2662  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2663  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2664  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2665  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2666  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2667  break;
2669  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_MODULATE);
2670  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_MODULATE");
2671  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2672  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2673  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2674  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2675  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2676  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2677  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2678  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2679  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 2);
2680  checkGLcall("GL_TEXTURE_ENV, scal_target, 2");
2681  break;
2683  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_MODULATE);
2684  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_MODULATE");
2685  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2686  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2687  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2688  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2689  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2690  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2691  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2692  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2693  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 4);
2694  checkGLcall("GL_TEXTURE_ENV, scal_target, 4");
2695  break;
2696  case WINED3D_TOP_ADD:
2697  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
2698  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
2699  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2700  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2701  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2702  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2703  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2704  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2705  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2706  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2707  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2708  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2709  break;
2711  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED);
2712  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED");
2713  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2714  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2715  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2716  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2717  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2718  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2719  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2720  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2721  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2722  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2723  break;
2725  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED);
2726  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED");
2727  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2728  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2729  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2730  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2731  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2732  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2733  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2734  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2735  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 2);
2736  checkGLcall("GL_TEXTURE_ENV, scal_target, 2");
2737  break;
2738  case WINED3D_TOP_SUBTRACT:
2739  if (gl_info->supported[ARB_TEXTURE_ENV_COMBINE])
2740  {
2741  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_SUBTRACT);
2742  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_SUBTRACT");
2743  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2744  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2745  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2746  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2747  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2748  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2749  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2750  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2751  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2752  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2753  } else {
2754  FIXME("This version of opengl does not support GL_SUBTRACT\n");
2755  }
2756  break;
2757 
2759  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE);
2760  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE");
2761  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2762  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2763  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2764  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2765  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2766  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2767  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2768  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2769  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_PRIMARY_COLOR);
2770  checkGLcall("GL_TEXTURE_ENV, src2_target, GL_PRIMARY_COLOR");
2771  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA);
2772  checkGLcall("GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
2773  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2774  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2775  break;
2777  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE);
2778  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE");
2779  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2780  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2781  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2782  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2783  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2784  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2785  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2786  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2787  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_TEXTURE);
2788  checkGLcall("GL_TEXTURE_ENV, src2_target, GL_TEXTURE");
2789  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA);
2790  checkGLcall("GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
2791  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2792  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2793  break;
2795  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE);
2796  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE");
2797  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2798  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2799  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2800  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2801  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2802  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2803  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2804  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2805  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_CONSTANT);
2806  checkGLcall("GL_TEXTURE_ENV, src2_target, GL_CONSTANT");
2807  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA);
2808  checkGLcall("GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
2809  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2810  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2811  break;
2813  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE);
2814  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE");
2815  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2816  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2817  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2818  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2819  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2820  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2821  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2822  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2823  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_PREVIOUS);
2824  checkGLcall("GL_TEXTURE_ENV, src2_target, GL_PREVIOUS");
2825  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA);
2826  checkGLcall("GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
2827  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2828  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2829  break;
2831  if (gl_info->supported[ARB_TEXTURE_ENV_DOT3])
2832  {
2833  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA_ARB);
2834  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA_ARB");
2835  }
2836  else if (gl_info->supported[EXT_TEXTURE_ENV_DOT3])
2837  {
2838  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA_EXT);
2839  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA_EXT");
2840  } else {
2841  FIXME("This version of opengl does not support GL_DOT3\n");
2842  }
2843  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2844  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2845  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2846  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2847  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2848  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2849  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2850  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2851  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2852  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2853  break;
2854  case WINED3D_TOP_LERP:
2855  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE);
2856  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE");
2857  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2858  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2859  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2860  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2861  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src2);
2862  checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
2863  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
2864  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
2865  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src3);
2866  checkGLcall("GL_TEXTURE_ENV, src2_target, src3");
2867  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr3);
2868  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr3");
2869  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2870  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2871  break;
2873  if (gl_info->supported[ATI_TEXTURE_ENV_COMBINE3])
2874  {
2875  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI);
2876  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
2877  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2878  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2879  switch (opr1) {
2880  case GL_SRC_COLOR: opr = GL_ONE_MINUS_SRC_COLOR; break;
2881  case GL_ONE_MINUS_SRC_COLOR: opr = GL_SRC_COLOR; break;
2882  case GL_SRC_ALPHA: opr = GL_ONE_MINUS_SRC_ALPHA; break;
2883  case GL_ONE_MINUS_SRC_ALPHA: opr = GL_SRC_ALPHA; break;
2884  }
2885  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr);
2886  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr");
2887  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src1);
2888  checkGLcall("GL_TEXTURE_ENV, src1_target, src1");
2889  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr1);
2890  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr1");
2891  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2892  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2893  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2894  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2895  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2896  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2897  } else
2898  Handled = FALSE;
2899  break;
2901  if (gl_info->supported[ATI_TEXTURE_ENV_COMBINE3])
2902  {
2903  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI);
2904  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
2905  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, GL_TEXTURE);
2906  checkGLcall("GL_TEXTURE_ENV, src0_target, GL_TEXTURE");
2907  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, GL_ONE_MINUS_SRC_ALPHA);
2908  checkGLcall("GL_TEXTURE_ENV, opr0_target, GL_ONE_MINUS_SRC_APHA");
2909  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src1);
2910  checkGLcall("GL_TEXTURE_ENV, src1_target, src1");
2911  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr1);
2912  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr1");
2913  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2914  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2915  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2916  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2917  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2918  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2919  } else
2920  Handled = FALSE;
2921  break;
2923  if (gl_info->supported[ATI_TEXTURE_ENV_COMBINE3])
2924  {
2925  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI);
2926  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
2927  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2928  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2929  switch (opr1) {
2930  case GL_SRC_COLOR: opr = GL_SRC_ALPHA; break;
2932  case GL_SRC_ALPHA: opr = GL_SRC_ALPHA; break;
2934  }
2935  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr);
2936  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr");
2937  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src1);
2938  checkGLcall("GL_TEXTURE_ENV, src1_target, src1");
2939  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr1);
2940  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr1");
2941  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2942  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2943  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2944  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2945  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2946  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2947  } else
2948  Handled = FALSE;
2949  break;
2951  if (gl_info->supported[ATI_TEXTURE_ENV_COMBINE3])
2952  {
2953  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI);
2954  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
2955  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2956  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2957  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
2958  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
2959  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src1);
2960  checkGLcall("GL_TEXTURE_ENV, src1_target, src1");
2961  switch (opr1) {
2962  case GL_SRC_COLOR: opr = GL_SRC_ALPHA; break;
2964  case GL_SRC_ALPHA: opr = GL_SRC_ALPHA; break;
2966  }
2967  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr);
2968  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr");
2969  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2970  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2971  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
2972  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
2973  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
2974  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
2975  } else
2976  Handled = FALSE;
2977  break;
2979  if (gl_info->supported[ATI_TEXTURE_ENV_COMBINE3])
2980  {
2981  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI);
2982  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
2983  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
2984  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
2985  switch (opr1) {
2986  case GL_SRC_COLOR: opr = GL_ONE_MINUS_SRC_ALPHA; break;
2987  case GL_ONE_MINUS_SRC_COLOR: opr = GL_SRC_ALPHA; break;
2988  case GL_SRC_ALPHA: opr = GL_ONE_MINUS_SRC_ALPHA; break;
2989  case GL_ONE_MINUS_SRC_ALPHA: opr = GL_SRC_ALPHA; break;
2990  }
2991  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr);
2992  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr");
2993  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src1);
2994  checkGLcall("GL_TEXTURE_ENV, src1_target, src1");
2995  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr1);
2996  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr1");
2997  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
2998  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
2999  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
3000  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
3001  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
3002  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
3003  } else
3004  Handled = FALSE;
3005  break;
3007  if (gl_info->supported[ATI_TEXTURE_ENV_COMBINE3])
3008  {
3009  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI);
3010  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
3011  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
3012  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
3013  switch (opr1) {
3014  case GL_SRC_COLOR: opr = GL_ONE_MINUS_SRC_COLOR; break;
3015  case GL_ONE_MINUS_SRC_COLOR: opr = GL_SRC_COLOR; break;
3016  case GL_SRC_ALPHA: opr = GL_ONE_MINUS_SRC_ALPHA; break;
3017  case GL_ONE_MINUS_SRC_ALPHA: opr = GL_SRC_ALPHA; break;
3018  }
3019  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr);
3020  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr");
3021  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src1);
3022  checkGLcall("GL_TEXTURE_ENV, src1_target, src1");
3023  switch (opr1) {
3024  case GL_SRC_COLOR: opr = GL_SRC_ALPHA; break;
3026  case GL_SRC_ALPHA: opr = GL_SRC_ALPHA; break;
3028  }
3029  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr);
3030  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr");
3031  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
3032  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
3033  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
3034  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
3035  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
3036  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
3037  } else
3038  Handled = FALSE;
3039  break;
3041  if (gl_info->supported[ATI_TEXTURE_ENV_COMBINE3])
3042  {
3043  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI);
3044  checkGLcall("GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
3045  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
3046  checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
3047  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
3048  checkGLcall("GL_TEXTURE_ENV, opr0_target, opr1");
3049  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src1_target, src3);
3050  checkGLcall("GL_TEXTURE_ENV, src1_target, src3");
3051  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr3);
3052  checkGLcall("GL_TEXTURE_ENV, opr1_target, opr3");
3053  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, src2_target, src2);
3054  checkGLcall("GL_TEXTURE_ENV, src2_target, src2");
3055  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, opr2_target, opr2);
3056  checkGLcall("GL_TEXTURE_ENV, opr2_target, opr2");
3057  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
3058  checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
3059  } else
3060  Handled = FALSE;
3061  break;
3064  if (gl_info->supported[NV_TEXTURE_SHADER2])
3065  {
3066  /* Technically texture shader support without register combiners is possible, but not expected to occur
3067  * on real world cards, so for now a fixme should be enough
3068  */
3069  FIXME("Implement bump mapping with GL_NV_texture_shader in non register combiner path\n");
3070  }
3071  Handled = FALSE;
3072  break;
3073 
3074  default:
3075  Handled = FALSE;
3076  }
3077 
3078  if (Handled) {
3079  BOOL combineOK = TRUE;
3080  if (gl_info->supported[NV_TEXTURE_ENV_COMBINE4])
3081  {
3082  DWORD op2;
3083 
3084  if (isAlpha)
3085  op2 = state->texture_states[Stage][WINED3D_TSS_COLOR_OP];
3086  else
3087  op2 = state->texture_states[Stage][WINED3D_TSS_ALPHA_OP];
3088 
3089  /* Note: If COMBINE4 in effect can't go back to combine! */
3090  switch (op2)
3091  {
3099  /* Ignore those implemented in both cases */
3100  switch (op)
3101  {
3104  combineOK = FALSE;
3105  Handled = FALSE;
3106  break;
3107  default:
3108  FIXME("Can't use COMBINE4 and COMBINE together, thisop=%s, otherop=%s, isAlpha(%d)\n", debug_d3dtop(op), debug_d3dtop(op2), isAlpha);
3109  return;
3110  }
3111  }
3112  }
3113 
3114  if (combineOK)
3115  {
3116  gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
3117  checkGLcall("GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE");
3118 
3119  return;
3120  }
3121  }
3122 
3123  /* After all the extensions, if still unhandled, report fixme */
3124  FIXME("Unhandled texture operation %s\n", debug_d3dtop(op));
3125 }
#define GL_SUBTRACT
Definition: gl.h:1844
#define GL_PREVIOUS
Definition: gl.h:1847
#define TRUE
Definition: types.h:120
#define GL_MODULATE
Definition: gl.h:677
struct opengl_funcs gl_ops
static void get_src_and_opr(DWORD arg, BOOL is_alpha, GLenum *source, GLenum *operand)
Definition: state.c:2038
#define GL_SOURCE2_RGB
Definition: gl.h:1831
#define GL_PREVIOUS_EXT
Definition: glext.h:3237
#define GL_SOURCE2_ALPHA
Definition: gl.h:1834
#define GL_OPERAND2_RGB
Definition: gl.h:1837
#define GL_SOURCE3_ALPHA_NV
Definition: glext.h:3477
#define GL_OPERAND3_ALPHA_NV
Definition: glext.h:3479
#define GL_DOT3_RGBA_EXT
Definition: glext.h:3612
#define GL_OPERAND0_ALPHA
Definition: gl.h:1838
#define WINED3DTA_CURRENT
Definition: wined3d.h:877
#define GL_OPERAND0_RGB
Definition: gl.h:1835
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GL_OPERAND3_RGB_NV
Definition: glext.h:3478
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
#define GL_ZERO
Definition: gl.h:374
#define FIXME(fmt,...)
Definition: debug.h:110
BOOL supported[WINED3D_GL_EXT_COUNT]
#define GL_INTERPOLATE
Definition: gl.h:1843
#define GL_CONSTANT
Definition: gl.h:1845
#define WINED3DTA_TEXTURE
Definition: wined3d.h:878
#define GL_ONE_MINUS_SRC_COLOR
Definition: gl.h:377
BOOL is_invalid_op(const struct wined3d_state *state, int stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3)
Definition: utils.c:4806
#define GL_ADD
Definition: gl.h:360
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
Definition: glext.h:9515
#define GL_OPERAND1_ALPHA
Definition: gl.h:1839
#define TRACE(s)
Definition: solgame.cpp:4
_In_ BOOLEAN Handled
Definition: ketypes.h:337
#define GL_COMBINE4_NV
Definition: glext.h:3475
#define GL_TEXTURE_ENV_MODE
Definition: gl.h:643
#define GL_COMBINE
Definition: gl.h:1826
#define WINED3DTA_DIFFUSE
Definition: wined3d.h:876
#define GL_MODULATE_ADD_ATI
Definition: glext.h:4286
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GL_OPERAND2_ALPHA
Definition: gl.h:1840
#define GL_REPLACE
Definition: gl.h:460
static int state
Definition: maze.c:121
unsigned int GLenum
Definition: gl.h:150
#define GL_COMBINE_RGB
Definition: gl.h:1827
#define GL_SOURCE3_RGB_NV
Definition: glext.h:3476
#define GL_SOURCE0_ALPHA
Definition: gl.h:1832
#define GL_RGB_SCALE
Definition: gl.h:1841
#define GL_TEXTURE_ENV
Definition: gl.h:642
#define GL_COMBINE_ALPHA
Definition: gl.h:1828
#define checkGLcall(A)
const char * debug_d3dtop(enum wined3d_texture_op d3dtop)
Definition: utils.c:4530
#define GL_PRIMARY_COLOR
Definition: gl.h:1846
#define GL_DOT3_RGBA_ARB
Definition: glext.h:1355
#define GL_SOURCE1_RGB
Definition: gl.h:1830
#define GL_ADD_SIGNED
Definition: gl.h:1842
#define GL_SOURCE1_ALPHA
Definition: gl.h:1833
#define GL_ONE_MINUS_SRC_ALPHA
Definition: gl.h:379
#define GL_SRC_COLOR
Definition: gl.h:376
#define GL_SRC_ALPHA
Definition: gl.h:378
UINT op
Definition: effect.c:223
#define GL_SOURCE0_RGB
Definition: gl.h:1829
#define GL_TEXTURE
Definition: gl.h:247
#define GL_ALPHA_SCALE
Definition: gl.h:602
#define GL_OPERAND1_RGB
Definition: gl.h:1836

Referenced by tex_alphaop(), and tex_colorop().

◆ shader_bumpenv()

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

Definition at line 3714 of file state.c.

3715 {
3716  context->constant_update_mask |= WINED3D_SHADER_CONST_PS_BUMP_ENV;
3717 }
Definition: http.c:6587
#define WINED3D_SHADER_CONST_PS_BUMP_ENV

◆ state_alpha_test()

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

Definition at line 649 of file state.c.

650 {
651  const struct wined3d_gl_info *gl_info = context->gl_info;
652  int glParm = 0;
653  float ref;
654  BOOL enable_ckey = FALSE;
655 
656  TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
657 
658  /* Find out if the texture on the first stage has a ckey set. The alpha
659  * state func reads the texture settings, even though alpha and texture
660  * are not grouped together. This is to avoid making a huge alpha +
661  * texture + texture stage + ckey block due to the hardly used
662  * WINED3D_RS_COLORKEYENABLE state(which is d3d <= 3 only). The texture
663  * function will call alpha in case it finds some texture + colorkeyenable
664  * combination which needs extra care. */
665  if (state->textures[0] && (state->textures[0]->async.color_key_flags & WINED3D_CKEY_SRC_BLT))
666  enable_ckey = TRUE;
667 
668  if (enable_ckey || context->last_was_ckey)
670  context->last_was_ckey = enable_ckey;
671 
672  if (state->render_states[WINED3D_RS_ALPHATESTENABLE]
673  || (state->render_states[WINED3D_RS_COLORKEYENABLE] && enable_ckey))
674  {
675  gl_info->gl_ops.gl.p_glEnable(GL_ALPHA_TEST);
676  checkGLcall("glEnable GL_ALPHA_TEST");
677  }
678  else
679  {
680  gl_info->gl_ops.gl.p_glDisable(GL_ALPHA_TEST);
681  checkGLcall("glDisable GL_ALPHA_TEST");
682  /* Alpha test is disabled, don't bother setting the params - it will happen on the next
683  * enable call
684  */
685  return;
686  }
687 
688  if (state->render_states[WINED3D_RS_COLORKEYENABLE] && enable_ckey)
689  {
690  glParm = GL_NOTEQUAL;
691  ref = 0.0f;
692  }
693  else
694  {
695  ref = ((float)state->render_states[WINED3D_RS_ALPHAREF]) / 255.0f;
696  glParm = wined3d_gl_compare_func(state->render_states[WINED3D_RS_ALPHAFUNC]);
697  }
698  if (glParm)
699  {
700  gl_info->gl_ops.gl.p_glAlphaFunc(glParm, ref);
701  checkGLcall("glAlphaFunc");
702  }
703 }
#define STATE_TEXTURESTAGE(stage, num)
#define TRUE
Definition: types.h:120
struct opengl_funcs gl_ops
Definition: http.c:6587
#define WINED3D_CKEY_SRC_BLT
Definition: wined3d.h:1336
Definition: send.c:47
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum wined3d_gl_compare_func(enum wined3d_cmp_func f)
Definition: state.c:344
GLenum GLint ref
Definition: glext.h:6028
static void context_apply_state(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
#define GL_NOTEQUAL
Definition: gl.h:298
#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

◆ state_ambient()

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

Definition at line 384 of file state.c.

385 {
386  const struct wined3d_gl_info *gl_info = context->gl_info;
387  struct wined3d_color color;
388 
390  TRACE("Setting ambient to %s.\n", debug_color(&color));
391  gl_info->gl_ops.gl.p_glLightModelfv(GL_LIGHT_MODEL_AMBIENT, &color.r);
392  checkGLcall("glLightModel for MODEL_AMBIENT");
393 }
struct opengl_funcs gl_ops
Definition: http.c:6587
const char * debug_color(const struct wined3d_color *color)
Definition: utils.c:3890
GLuint color
Definition: glext.h:6243
#define GL_LIGHT_MODEL_AMBIENT
Definition: gl.h:335
#define TRACE(s)
Definition: solgame.cpp:4
static int state
Definition: maze.c:121
#define checkGLcall(A)
static void wined3d_color_from_d3dcolor(struct wined3d_color *wined3d_color, DWORD d3d_color)

◆ state_anisotropy()

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

Definition at line 1998 of file state.c.

1999 {
2000  if (state->render_states[WINED3D_RS_ANISOTROPY])
2001  FIXME("Render state WINED3D_RS_ANISOTROPY not implemented yet.\n");
2002 }
#define FIXME(fmt,...)
Definition: debug.h:110
static int state
Definition: maze.c:121

◆ state_antialias()

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

Definition at line 1845 of file state.c.

1846 {
1847  if (state->render_states[WINED3D_RS_ANTIALIAS])
1848  FIXME("Antialias not supported yet.\n");
1849 }
#define FIXME(fmt,...)
Definition: debug.h:110
static int state
Definition: maze.c:121

◆ state_blend()

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

Definition at line 530 of file state.c.

531 {