48 TRACE(
"%p increasing refcount to %u.\n",
state, refcount);
63 TRACE(
"%p decreasing refcount to %u.\n",
state, refcount);
67 state->parent_ops->wined3d_object_destroyed(
state->parent);
87 TRACE(
"device %p, desc %p, parent %p, parent_ops %p, state %p.\n",
90 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
99 TRACE(
"Created blend state %p.\n",
object);
124 TRACE(
"%p decreasing refcount to %u.\n",
state, refcount);
128 state->parent_ops->wined3d_object_destroyed(
state->parent);
139 return state->parent;
148 TRACE(
"device %p, desc %p, parent %p, parent_ops %p, state %p.\n",
151 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
154 object->refcount = 1;
155 object->desc = *
desc;
160 TRACE(
"Created rasterizer state %p.\n",
object);
187 checkGLcall(
"glPolygonMode(GL_FRONT_AND_BACK, GL_POINT)");
191 checkGLcall(
"glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)");
195 checkGLcall(
"glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)");
198 FIXME(
"Unrecognized fill mode %#x.\n",
mode);
215 && !
context->stream_info.position_transformed)
233 if (!
state->fb->depth_stencil)
235 TRACE(
"No Z buffer - disabling depth test\n");
252 FIXME(
"W buffer is not well handled\n");
255 FIXME(
"Unrecognized depth buffer type %#x.\n", zenable);
288 FIXME(
"Unrecognized cull mode %#x.\n",
311 FIXME(
"Unrecognized shade mode %#x.\n",
338 gl_info->
gl_ops.gl.p_glDepthMask(1);
343 gl_info->
gl_ops.gl.p_glDepthMask(0);
370 WARN(
"Unrecognized compare function %#x.\n",
f);
372 FIXME(
"Unrecognized compare function %#x.\n",
f);
382 if (!depth_func)
return;
384 gl_info->
gl_ops.gl.p_glDepthFunc(depth_func);
401 WARN(
"Unsupported in local OpenGL implementation: glBlendEquation\n");
420 WARN(
"Unhandled blend op %#x.\n",
op);
422 FIXME(
"Unhandled blend op %#x.\n",
op);
437 WARN(
"Unsupported in local OpenGL implementation: glBlendEquationSeparate.\n");
443 TRACE(
"blend_equation %#x, blend_equation_alpha %#x.\n", blend_equation, blend_equation_alpha);
447 GL_EXTCALL(glBlendEquationSeparate(blend_equation, blend_equation_alpha));
503 WARN(
"Unhandled blend factor %#x.\n",
factor);
538 GLenum src_blend, dst_blend;
539 unsigned int rt_fmt_flags;
540 BOOL enable_dual_blend;
546 if (enable_blend && !enable_dual_blend)
548 rt_fmt_flags =
state->fb->render_targets[0]->format_flags;
554 enable_blend =
FALSE;
558 if (
context->last_was_dual_blend != enable_dual_blend)
561 context->last_was_dual_blend = enable_dual_blend;
574 rt_format =
state->fb->render_targets[0]->format;
585 GLenum src_blend_alpha, dst_blend_alpha;
590 WARN(
"Unsupported in local OpenGL implementation: glBlendFuncSeparate.\n");
598 GL_EXTCALL(glBlendFuncSeparate(src_blend, dst_blend, src_blend_alpha, dst_blend_alpha));
603 TRACE(
"glBlendFunc src=%x, dst=%x.\n", src_blend, dst_blend);
604 gl_info->
gl_ops.gl.p_glBlendFunc(src_blend, dst_blend);
616 WARN(
"Unsupported in local OpenGL implementation: glBlendColor.\n");
639 if (
state->blend_state)
672 if (enable_ckey ||
context->last_was_ckey)
674 context->last_was_ckey = enable_ckey;
704 gl_info->
gl_ops.gl.p_glAlphaFunc(glParm,
ref);
711 unsigned int enable_mask;
724 FIXME(
"Clipping not supported with vertex shaders.\n");
775 TRACE(
"Setting specular enable state and materials\n");
781 if (
state->material.power > gl_info->
limits.shininess)
789 WARN(
"Material power = %.8e, limit %.8e\n",
state->material.power, gl_info->
limits.shininess);
801 TRACE(
"Specular colors cannot be enabled in this version of opengl\n");
810 static const GLfloat black[] = {0.0f, 0.0f, 0.0f, 0.0f};
820 TRACE(
"Specular colors cannot be disabled in this version of opengl\n");
854 for (
i = 0;
i <
context->d3d_info->limits.ffp_blend_stages; ++
i)
861 checkGLcall(
"glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color);");
871 checkGLcall(
"glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT)");
876 gl_info->
gl_ops.gl.p_glStencilOp(stencilFail, depthFail, stencilPass);
902 WARN(
"Unrecognized stencil op %#x.\n",
op);
904 FIXME(
"Unrecognized stencil op %#x.\n",
op);
912 DWORD onesided_enable;
913 DWORD twosided_enable;
919 GLint stencilFail_back;
921 GLint stencilPass_back;
923 GLint depthFail_back;
926 if (!
state->fb->depth_stencil)
948 TRACE(
"(onesided %d, twosided %d, ref %x, mask %x, "
949 "GL_FRONT: func: %x, fail %x, zfail %x, zpass %x "
950 "GL_BACK: func: %x, fail %x, zfail %x, zpass %x)\n",
951 onesided_enable, twosided_enable,
ref,
mask,
952 func, stencilFail, depthFail, stencilPass,
953 func_back, stencilFail_back, depthFail_back, stencilPass_back);
955 if (twosided_enable && onesided_enable)
965 GL_EXTCALL(glStencilOpSeparate(
GL_BACK, stencilFail_back, depthFail_back, stencilPass_back));
977 func_back,
ref,
mask, stencilFail_back, depthFail_back, stencilPass_back);
979 func,
ref,
mask, stencilFail, depthFail, stencilPass);
986 checkGLcall(
"glStencilOpSeparateATI(GL_FRONT, ...)");
987 GL_EXTCALL(glStencilOpSeparateATI(
GL_BACK, stencilFail_back, depthFail_back, stencilPass_back));
988 checkGLcall(
"glStencilOpSeparateATI(GL_BACK, ...)");
992 FIXME(
"Separate (two sided) stencil not supported on this version of OpenGL. Caps weren't honored?\n");
995 else if(onesided_enable)
1000 checkGLcall(
"glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT)");
1010 gl_info->
gl_ops.gl.p_glStencilOp(stencilFail, depthFail, stencilPass);
1059 checkGLcall(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)");
1067 checkGLcall(
"glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_PLANE_ABSOLUTE_NV)");
1081 checkGLcall(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT)");
1091 checkGLcall(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)");
1100 checkGLcall(
"glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_RADIAL_NV)");
1104 WARN(
"Range fog enabled, but not supported by this GL implementation.\n");
1110 checkGLcall(
"glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_PLANE_ABSOLUTE_NV)");
1118 float fogstart, fogend;
1124 TRACE(
"Fog Start == %f\n", fogstart);
1128 TRACE(
"Fog End == %f\n", fogend);
1248 FIXME(
"Unexpected WINED3D_RS_FOGVERTEXMODE %#x.\n",
1275 FIXME(
"Unexpected WINED3D_RS_FOGTABLEMODE %#x.\n",
1282 if (new_source !=
context->fog_source || fogstart == fogend)
1284 context->fog_source = new_source;
1309 checkGLcall(
"glFogf(GL_FOG_DENSITY, (float) Value)");
1325 context->num_untracked_materials = 0;
1329 TRACE(
"diff %d, amb %d, emis %d, spec %d\n",
1344 context->num_untracked_materials++;
1349 context->num_untracked_materials++;
1358 context->num_untracked_materials++;
1363 context->num_untracked_materials++;
1372 context->num_untracked_materials++;
1382 if (Parm ==
context->tracking_parm)
return;
1392 checkGLcall(
"glColorMaterial(GL_FRONT_AND_BACK, Parm)");
1399 switch (
context->tracking_parm)
1431 static const GLfloat black[] = {0.0f, 0.0f, 0.0f, 0.0f};
1438 context->tracking_parm = Parm;
1451 TRACE(
"Line pattern: repeat %d bits %x.\n", tmppattern.lp.repeat_factor, tmppattern.lp.line_pattern);
1453 if (tmppattern.lp.repeat_factor)
1455 gl_info->
gl_ops.gl.p_glLineStipple(tmppattern.lp.repeat_factor, tmppattern.lp.line_pattern);
1456 checkGLcall(
"glLineStipple(repeat, linepattern)");
1469 static unsigned int once;
1472 FIXME(
"Setting line patterns is not supported in OpenGL core contexts.\n");
1506 FIXME(
"WINED3D_RS_POINTSIZE_MIN value %.8e not supported on this OpenGL implementation.\n",
min);
1508 FIXME(
"WINED3D_RS_POINTSIZE_MAX value %.8e not supported on this OpenGL implementation.\n",
max);
1548 checkGLcall(
"glPointParameterfvARB(GL_DISTANCE_ATTENUATION_ARB, ...)");
1553 checkGLcall(
"glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...)");
1557 WARN(
"POINT_PARAMETERS not supported in this version of opengl\n");
1574 TRACE(
"Color mask: r(%d) g(%d) b(%d) a(%d)\n",
1609 WARN(
"Ignoring color write value for index %d, because gpu only supports %d render targets\n",
index, gl_info->
limits.buffers);
1621 checkGLcall(
"glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1)");
1626 checkGLcall(
"glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 0)");
1634 TRACE(
"Last Pixel Drawing Enabled\n");
1640 FIXME(
"Last Pixel Drawing Disabled, not handled yet\n");
1643 TRACE(
"Last Pixel Drawing Disabled, not handled yet\n");
1656 FIXME(
"Point sprites not supported\n");
1679 static unsigned int once;
1698 FIXME(
"(WINED3D_RS_WRAP0) Texture wrapping not yet supported.\n");
1704 WARN(
"Multisample antialiasing not supported by GL.\n");
1785 } scale_bias, const_bias, bias_clamp;
1801 TRACE(
"Depth format %s, using depthbias scale of %.8e.\n",
1807 TRACE(
"No depth stencil, using depth bias scale of 0.0.\n");
1824 WARN(
"EXT_polygon_offset_clamp extension missing, no support for depth bias clamping.\n");
1856 FIXME(
"Depth clamping not supported by GL.\n");
1862 FIXME(
"WINED3D_RS_ZVISIBLE not implemented.\n");
1868 FIXME(
"Stippled Alpha not supported yet.\n");
1874 FIXME(
"Antialias not supported yet.\n");
1880 FIXME(
"WINED3D_RS_MULTISAMPLEMASK %#x not yet implemented.\n",
1887 FIXME(
"WINED3D_RS_PATCHEDGESTYLE %#x not yet implemented.\n",
1905 FIXME(
"(WINED3D_RS_PATCHSEGMENTS,%f) not yet implemented\n", tmpvalue.f);
1914 FIXME(
"WINED3D_RS_POSITIONDEGREE %#x not yet implemented.\n",
1921 FIXME(
"WINED3D_RS_NORMALDEGREE %#x not yet implemented.\n",
1928 FIXME(
"WINED3D_RS_ENABLEADAPTIVETESSELLATION %#x not yet implemented.\n",
1948 if (zmin.f <=
zmax.f)
1951 checkGLcall(
"glEnable(GL_DEPTH_BOUNDS_TEST_EXT)");
1958 checkGLcall(
"glDisable(GL_DEPTH_BOUNDS_TEST_EXT)");
1964 checkGLcall(
"glDisable(GL_DEPTH_BOUNDS_TEST_EXT)");
1973 FIXME(
"Render state WINED3D_RS_WRAPU not implemented yet.\n");
1979 FIXME(
"Render state WINED3D_RS_WRAPV not implemented yet.\n");
1985 FIXME(
"Render state WINED3D_RS_MONOENABLE not implemented yet.\n");
1991 FIXME(
"Render state WINED3D_RS_ROP2 not implemented yet.\n");
1997 FIXME(
"Render state WINED3D_RS_PLANEMASK not implemented yet.\n");
2003 FIXME(
"Render state WINED3D_RS_SUBPIXEL not implemented yet.\n");
2009 FIXME(
"Render state WINED3D_RS_SUBPIXELX not implemented yet.\n");
2015 FIXME(
"Render state WINED3D_RS_STIPPLEENABLE not implemented yet.\n");
2021 FIXME(
"Render state WINED3D_RS_MIPMAPLODBIAS not implemented yet.\n");
2027 FIXME(
"Render state WINED3D_RS_ANISOTROPY not implemented yet.\n");
2033 FIXME(
"Render state WINED3D_RS_FLUSHBATCH not implemented yet.\n");
2039 FIXME(
"Render state WINED3D_RS_TRANSLUCENTSORTINDEPENDENT not implemented yet.\n");
2045 FIXME(
"Render state WINED3D_RS_EXTENTS not implemented yet.\n");
2051 FIXME(
"Render state WINED3D_RS_COLORKEYBLENDENABLE not implemented yet.\n");
2060 FIXME(
"Software vertex processing not implemented.\n");
2092 FIXME(
"Unhandled texture arg WINED3DTA_SPECULAR\n");
2096 FIXME(
"Unrecognized texture arg %#x\n",
arg);
2109 GLenum src0_target, src1_target, src2_target;
2110 GLenum opr0_target, opr1_target, opr2_target;
2112 GLenum opr=0, invopr, src3_target, opr3_target;
2115 TRACE(
"Alpha?(%d), Stage:%d Op(%s), a1(%d), a2(%d), a3(%d)\n", isAlpha, Stage,
debug_d3dtop(
op),
arg1,
arg2,
arg3);
2169 TRACE(
"ct(%x), 1:(%x,%x), 2:(%x,%x), 3:(%x,%x)\n", comb_target, src1, opr1, src2, opr2, src3, opr3);
2191 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_REPLACE");
2197 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2199 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2201 checkGLcall(
"GL_TEXTURE_ENV, src2_target, GL_ZERO");
2205 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_ZERO");
2213 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2229 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2231 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2233 checkGLcall(
"GL_TEXTURE_ENV, src2_target, GL_ZERO");
2237 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_ZERO");
2244 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2250 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2252 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2258 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_ZERO");
2266 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2272 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2274 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2280 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_ZERO");
2288 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2294 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2296 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2302 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_ZERO");
2311 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2317 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2319 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2325 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_ZERO");
2327 checkGLcall(
"GL_TEXTURE_ENV, opr3_target, invopr");
2334 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED");
2340 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2342 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2348 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_ZERO");
2350 checkGLcall(
"GL_TEXTURE_ENV, opr3_target, invopr");
2357 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED");
2363 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2365 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2371 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_ZERO");
2373 checkGLcall(
"GL_TEXTURE_ENV, opr3_target, invopr");
2380 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2386 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2388 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2409 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2415 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_PRIMARY_COLOR");
2417 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2423 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_PRIMARY_COLOR");
2425 checkGLcall(
"GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA");
2431 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2437 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_TEXTURE");
2439 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2445 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_TEXTURE");
2447 checkGLcall(
"GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA");
2453 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2459 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_CONSTANT");
2461 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2467 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_CONSTANT");
2469 checkGLcall(
"GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA");
2475 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2481 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2483 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2489 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_TEXTURE");
2491 checkGLcall(
"GL_TEXTURE_ENV, opr3_target, GL_ONE_MINUS_SRC_ALPHA");
2497 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2503 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2505 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2523 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2541 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_ZERO");
2543 checkGLcall(
"GL_TEXTURE_ENV, opr3_target, invopr");
2549 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2555 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2557 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2577 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2601 checkGLcall(
"GL_TEXTURE_ENV, src3_target, GL_ZERO");
2603 checkGLcall(
"GL_TEXTURE_ENV, opr3_target, invopr");
2609 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2615 checkGLcall(
"GL_TEXTURE_ENV, src1_target, GL_ZERO");
2617 checkGLcall(
"GL_TEXTURE_ENV, opr1_target, invopr");
2632 FIXME(
"Implement bump environment mapping in GL_NV_texture_env_combine4 path\n");
2642 checkGLcall(
"GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV");
2652 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_REPLACE");
2654 checkGLcall(
"GL_TEXTURE_ENV, src0_target, GL_PREVIOUS_EXT");
2656 checkGLcall(
"GL_TEXTURE_ENV, opr0_target, GL_SRC_ALPHA");
2662 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_REPLACE");
2672 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_REPLACE");
2682 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_MODULATE");
2696 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_MODULATE");
2710 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_MODULATE");
2724 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD");
2738 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED");
2752 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_ADD_SIGNED");
2768 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_SUBTRACT");
2780 FIXME(
"This version of opengl does not support GL_SUBTRACT\n");
2786 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE");
2796 checkGLcall(
"GL_TEXTURE_ENV, src2_target, GL_PRIMARY_COLOR");
2798 checkGLcall(
"GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
2804 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE");
2814 checkGLcall(
"GL_TEXTURE_ENV, src2_target, GL_TEXTURE");
2816 checkGLcall(
"GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
2822 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE");
2832 checkGLcall(
"GL_TEXTURE_ENV, src2_target, GL_CONSTANT");
2834 checkGLcall(
"GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
2840 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE");
2850 checkGLcall(
"GL_TEXTURE_ENV, src2_target, GL_PREVIOUS");
2852 checkGLcall(
"GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
2860 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA_ARB");
2865 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_DOT3_RGBA_EXT");
2867 FIXME(
"This version of opengl does not support GL_DOT3\n");
2882 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_INTERPOLATE");
2902 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
2930 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
2932 checkGLcall(
"GL_TEXTURE_ENV, src0_target, GL_TEXTURE");
2934 checkGLcall(
"GL_TEXTURE_ENV, opr0_target, GL_ONE_MINUS_SRC_APHA");
2952 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
2980 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
3008 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
3036 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
3070 checkGLcall(
"GL_TEXTURE_ENV, comb_target, GL_MODULATE_ADD_ATI");
3095 FIXME(
"Implement bump mapping with GL_NV_texture_shader in non register combiner path\n");
3143 checkGLcall(
"GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE");
3157 BOOL tex_used =
context->fixed_function_usage_map & (1u << stage);
3161 TRACE(
"Setting color op for stage %d\n", stage);
3166 if (stage != mapped_stage)
WARN(
"Using non 1:1 mapping: %d -> %d!\n", stage, mapped_stage);
3170 if (tex_used && mapped_stage >= gl_info->
limits.textures)
3172 FIXME(
"Attempt to enable unsupported stage!\n");
3178 if (stage >=
context->lowest_disabled_stage)
3180 TRACE(
"Stage disabled\n");
3191 checkGLcall(
"glDisable(GL_TEXTURE_CUBE_MAP_ARB)");
3196 checkGLcall(
"glDisable(GL_TEXTURE_RECTANGLE_ARB)");
3218 BOOL tex_used =
context->fixed_function_usage_map & (1u << stage);
3223 TRACE(
"Setting alpha op for stage %d\n", stage);
3227 if (tex_used && mapped_stage >= gl_info->
limits.textures)
3229 FIXME(
"Attempt to enable unsupported stage!\n");
3301 TRACE(
"Setting alpha op for stage %d\n", stage);
3317 unsigned int mapped_stage =
context->tex_unit_map[tex];
3323 TRACE(
"Using a vertex shader, or stream sources not sorted out yet, skipping\n");
3328 if (mapped_stage >= gl_info->
limits.textures)
return;
3336 gl_info->
gl_ops.gl.p_glLoadMatrixf(&
mat._11);
3342 unsigned int texture_idx;
3344 for (texture_idx = 0; texture_idx < gl_info->
limits.texture_coords; ++texture_idx)
3355 unsigned int mapped_stage = 0;
3356 unsigned int textureNo;
3358 for (textureNo = 0; textureNo <
context->d3d_info->limits.ffp_blend_stages; ++textureNo)
3362 mapped_stage =
context->tex_unit_map[textureNo];
3365 if (mapped_stage >= gl_info->
limits.texture_coords)
3367 FIXME(
"Attempted to load unsupported texture coordinate %u\n", mapped_stage);
3375 TRACE(
"Setting up texture %u, idx %d, coordindx %u, data {%#x:%p}.\n",
3376 textureNo, mapped_stage, coordIdx,
e->data.buffer_object,
e->data.addr);
3378 if (*curVBO !=
e->data.buffer_object)
3382 *curVBO =
e->data.buffer_object;
3389 gl_info->
gl_ops.gl.p_glTexCoordPointer(
e->format->gl_vtx_format,
e->format->gl_vtx_type,
e->stride,
3390 e->data.addr +
state->load_base_vertex_index *
e->stride);
3401 for (textureNo = mapped_stage + 1; textureNo < gl_info->
limits.textures; ++textureNo)
3413 static const GLfloat s_plane[] = { 1.0f, 0.0f, 0.0f, 0.0f };
3414 static const GLfloat t_plane[] = { 0.0f, 1.0f, 0.0f, 0.0f };
3415 static const GLfloat r_plane[] = { 0.0f, 0.0f, 1.0f, 0.0f };
3416 static const GLfloat q_plane[] = { 0.0f, 0.0f, 0.0f, 1.0f };
3422 TRACE(
"No texture unit mapped to stage %d. Skipping texture coordinates.\n", stage);
3428 WARN(
"stage %u not mapped to a valid texture unit (%u)\n", stage, mapped_stage);
3451 checkGLcall(
"WINED3DTSS_TCI_PASSTHRU - Disable texgen.");
3460 gl_info->
gl_ops.gl.p_glPushMatrix();
3461 gl_info->
gl_ops.gl.p_glLoadIdentity();
3466 gl_info->
gl_ops.gl.p_glPopMatrix();
3467 checkGLcall(
"WINED3DTSS_TCI_CAMERASPACEPOSITION - Set eye plane.");
3472 checkGLcall(
"WINED3DTSS_TCI_CAMERASPACEPOSITION - Set texgen mode.");
3477 checkGLcall(
"WINED3DTSS_TCI_CAMERASPACEPOSITION - Enable texgen.");
3486 FIXME(
"WINED3DTSS_TCI_CAMERASPACENORMAL not supported.\n");
3491 gl_info->
gl_ops.gl.p_glPushMatrix();
3492 gl_info->
gl_ops.gl.p_glLoadIdentity();
3497 gl_info->
gl_ops.gl.p_glPopMatrix();
3498 checkGLcall(
"WINED3DTSS_TCI_CAMERASPACENORMAL - Set eye plane.");
3503 checkGLcall(
"WINED3DTSS_TCI_CAMERASPACENORMAL - Set texgen mode.");
3508 checkGLcall(
"WINED3DTSS_TCI_CAMERASPACENORMAL - Enable texgen.");
3517 FIXME(
"WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR not supported.\n");
3522 gl_info->
gl_ops.gl.p_glPushMatrix();
3523 gl_info->
gl_ops.gl.p_glLoadIdentity();
3528 gl_info->
gl_ops.gl.p_glPopMatrix();
3529 checkGLcall(
"WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR - Set eye plane.");
3534 checkGLcall(
"WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR - Set texgen mode.");
3539 checkGLcall(
"WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR - Enable texgen.");
3546 checkGLcall(
"WINED3DTSS_TCI_SPHEREMAP - Set texgen mode.");
3551 checkGLcall(
"WINED3DTSS_TCI_SPHEREMAP - Enable texgen.");
3556 FIXME(
"Unhandled WINED3D_TSS_TEXCOORD_INDEX %#x.\n",
3603 if (tex_is_pow2 || (
context->lastWasPow2Texture & (1u <<
sampler)))
3620 FIXME(
"Unrecognized or unsupported texture address mode %#x.\n",
t);