2008-07-04 23:15:18 +02:00
|
|
|
/*
|
|
|
|
* Fixed function pipeline replacement using GL_NV_register_combiners
|
|
|
|
* and GL_NV_texture_shader
|
|
|
|
*
|
|
|
|
* Copyright 2006 Henri Verbeet
|
2008-10-18 19:21:20 +02:00
|
|
|
* Copyright 2008 Stefan Dösinger(for CodeWeavers)
|
2008-07-04 23:15:18 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
#include "config.h"
|
2012-06-01 16:56:21 +02:00
|
|
|
#include "wine/port.h"
|
2008-07-04 23:15:18 +02:00
|
|
|
|
|
|
|
#include <math.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "wined3d_private.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
|
|
|
|
2012-12-10 21:54:36 +01:00
|
|
|
/* Context activation for state handlers is done by the caller. */
|
2009-05-14 19:40:56 +02:00
|
|
|
|
2010-10-01 12:25:48 +02:00
|
|
|
static void nvts_activate_dimensions(const struct wined3d_state *state, DWORD stage, struct wined3d_context *context)
|
2009-08-03 08:06:51 +02:00
|
|
|
{
|
2012-07-24 11:32:27 +02:00
|
|
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
2008-07-05 00:25:23 +02:00
|
|
|
BOOL bumpmap = FALSE;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
if (stage > 0
|
|
|
|
&& (state->texture_states[stage - 1][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_BUMPENVMAP_LUMINANCE
|
|
|
|
|| state->texture_states[stage - 1][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_BUMPENVMAP))
|
2010-09-16 11:19:57 +02:00
|
|
|
{
|
2008-07-05 00:25:23 +02:00
|
|
|
bumpmap = TRUE;
|
|
|
|
context->texShaderBumpMap |= (1 << stage);
|
|
|
|
} else {
|
|
|
|
context->texShaderBumpMap &= ~(1 << stage);
|
|
|
|
}
|
|
|
|
|
2010-10-01 12:25:48 +02:00
|
|
|
if (state->textures[stage])
|
2010-09-17 11:59:39 +02:00
|
|
|
{
|
2011-03-28 21:58:42 +02:00
|
|
|
switch (state->textures[stage]->target)
|
2010-09-17 11:59:39 +02:00
|
|
|
{
|
2008-07-05 00:25:23 +02:00
|
|
|
case GL_TEXTURE_2D:
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV,
|
|
|
|
bumpmap ? GL_OFFSET_TEXTURE_2D_NV : GL_TEXTURE_2D);
|
2008-07-05 00:25:23 +02:00
|
|
|
checkGLcall("glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, ...)");
|
|
|
|
break;
|
|
|
|
case GL_TEXTURE_RECTANGLE_ARB:
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV,
|
|
|
|
bumpmap ? GL_OFFSET_TEXTURE_2D_NV : GL_TEXTURE_RECTANGLE_ARB);
|
2008-07-05 00:25:23 +02:00
|
|
|
checkGLcall("glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, ...)");
|
|
|
|
break;
|
|
|
|
case GL_TEXTURE_3D:
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_3D);
|
2008-07-05 00:25:23 +02:00
|
|
|
checkGLcall("glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_3D)");
|
|
|
|
break;
|
|
|
|
case GL_TEXTURE_CUBE_MAP_ARB:
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_CUBE_MAP_ARB);
|
2008-07-05 00:25:23 +02:00
|
|
|
checkGLcall("glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_CUBE_MAP_ARB)");
|
|
|
|
break;
|
|
|
|
}
|
2012-07-24 11:32:27 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE);
|
2008-07-05 00:25:23 +02:00
|
|
|
checkGLcall("glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE)");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-03 22:27:22 +02:00
|
|
|
struct tex_op_args
|
|
|
|
{
|
2008-07-12 18:45:33 +02:00
|
|
|
GLenum input[3];
|
|
|
|
GLenum mapping[3];
|
|
|
|
GLenum component_usage[3];
|
2011-07-03 22:27:22 +02:00
|
|
|
};
|
2008-07-12 18:45:33 +02:00
|
|
|
|
|
|
|
static GLenum d3dta_to_combiner_input(DWORD d3dta, DWORD stage, INT texture_idx) {
|
|
|
|
switch (d3dta) {
|
|
|
|
case WINED3DTA_DIFFUSE:
|
|
|
|
return GL_PRIMARY_COLOR_NV;
|
|
|
|
|
|
|
|
case WINED3DTA_CURRENT:
|
|
|
|
if (stage) return GL_SPARE0_NV;
|
|
|
|
else return GL_PRIMARY_COLOR_NV;
|
|
|
|
|
|
|
|
case WINED3DTA_TEXTURE:
|
|
|
|
if (texture_idx > -1) return GL_TEXTURE0_ARB + texture_idx;
|
|
|
|
else return GL_PRIMARY_COLOR_NV;
|
|
|
|
|
|
|
|
case WINED3DTA_TFACTOR:
|
|
|
|
return GL_CONSTANT_COLOR0_NV;
|
|
|
|
|
|
|
|
case WINED3DTA_SPECULAR:
|
|
|
|
return GL_SECONDARY_COLOR_NV;
|
|
|
|
|
|
|
|
case WINED3DTA_TEMP:
|
|
|
|
return GL_SPARE1_NV;
|
|
|
|
|
|
|
|
case WINED3DTA_CONSTANT:
|
2012-01-09 22:16:51 +01:00
|
|
|
/* TODO: Support per stage constants (WINED3D_TSS_CONSTANT, NV_register_combiners2) */
|
2008-07-12 18:45:33 +02:00
|
|
|
FIXME("WINED3DTA_CONSTANT, not properly supported.\n");
|
|
|
|
return GL_CONSTANT_COLOR1_NV;
|
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME("Unrecognized texture arg %#x\n", d3dta);
|
|
|
|
return GL_TEXTURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GLenum invert_mapping(GLenum mapping) {
|
2008-08-14 23:29:47 +02:00
|
|
|
if (mapping == GL_UNSIGNED_INVERT_NV) return GL_UNSIGNED_IDENTITY_NV;
|
|
|
|
else if (mapping == GL_UNSIGNED_IDENTITY_NV) return GL_UNSIGNED_INVERT_NV;
|
2008-07-12 18:45:33 +02:00
|
|
|
|
|
|
|
FIXME("Unhandled mapping %#x\n", mapping);
|
|
|
|
return mapping;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void get_src_and_opr_nvrc(DWORD stage, DWORD arg, BOOL is_alpha, GLenum* input, GLenum* mapping, GLenum *component_usage, INT texture_idx) {
|
|
|
|
/* The WINED3DTA_COMPLEMENT flag specifies the complement of the input should
|
|
|
|
* be used. */
|
|
|
|
if (arg & WINED3DTA_COMPLEMENT) *mapping = GL_UNSIGNED_INVERT_NV;
|
2008-08-14 23:29:47 +02:00
|
|
|
else *mapping = GL_UNSIGNED_IDENTITY_NV; /* Clamp all values to positive ranges */
|
2008-07-12 18:45:33 +02:00
|
|
|
|
|
|
|
/* The WINED3DTA_ALPHAREPLICATE flag specifies the alpha component of the input
|
|
|
|
* should be used for all input components. */
|
|
|
|
if (is_alpha || arg & WINED3DTA_ALPHAREPLICATE) *component_usage = GL_ALPHA;
|
|
|
|
else *component_usage = GL_RGB;
|
|
|
|
|
|
|
|
*input = d3dta_to_combiner_input(arg & WINED3DTA_SELECTMASK, stage, texture_idx);
|
|
|
|
}
|
|
|
|
|
2010-09-23 11:48:03 +02:00
|
|
|
void set_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state, BOOL is_alpha,
|
2012-01-10 20:37:01 +01:00
|
|
|
int stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx, DWORD dst)
|
2010-09-23 11:48:03 +02:00
|
|
|
{
|
2011-07-03 22:27:22 +02:00
|
|
|
struct tex_op_args tex_op_args = {{0}, {0}, {0}};
|
2008-07-12 18:45:33 +02:00
|
|
|
GLenum portion = is_alpha ? GL_ALPHA : GL_RGB;
|
|
|
|
GLenum target = GL_COMBINER0_NV + stage;
|
|
|
|
GLenum output;
|
|
|
|
|
|
|
|
TRACE("stage %d, is_alpha %d, op %s, arg1 %#x, arg2 %#x, arg3 %#x, texture_idx %d\n",
|
|
|
|
stage, is_alpha, debug_d3dtop(op), arg1, arg2, arg3, texture_idx);
|
|
|
|
|
|
|
|
/* If a texture stage references an invalid texture unit the stage just
|
|
|
|
* passes through the result from the previous stage */
|
2010-09-23 11:48:03 +02:00
|
|
|
if (is_invalid_op(state, stage, op, arg1, arg2, arg3))
|
2010-09-23 11:48:02 +02:00
|
|
|
{
|
2008-07-12 18:45:33 +02:00
|
|
|
arg1 = WINED3DTA_CURRENT;
|
2012-01-10 20:37:01 +01:00
|
|
|
op = WINED3D_TOP_SELECT_ARG1;
|
2008-07-12 18:45:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
get_src_and_opr_nvrc(stage, arg1, is_alpha, &tex_op_args.input[0],
|
|
|
|
&tex_op_args.mapping[0], &tex_op_args.component_usage[0], texture_idx);
|
|
|
|
get_src_and_opr_nvrc(stage, arg2, is_alpha, &tex_op_args.input[1],
|
|
|
|
&tex_op_args.mapping[1], &tex_op_args.component_usage[1], texture_idx);
|
|
|
|
get_src_and_opr_nvrc(stage, arg3, is_alpha, &tex_op_args.input[2],
|
|
|
|
&tex_op_args.mapping[2], &tex_op_args.component_usage[2], texture_idx);
|
|
|
|
|
|
|
|
|
|
|
|
if(dst == WINED3DTA_TEMP) {
|
|
|
|
output = GL_SPARE1_NV;
|
|
|
|
} else {
|
|
|
|
output = GL_SPARE0_NV;
|
|
|
|
}
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
switch (op)
|
2008-07-12 18:45:33 +02:00
|
|
|
{
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_DISABLE:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Only for alpha */
|
2012-01-09 22:16:51 +01:00
|
|
|
if (!is_alpha)
|
|
|
|
ERR("Shouldn't be called for WINED3D_TSS_COLOR_OP (WINED3DTOP_DISABLE).\n");
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, prev_alpha*1 */
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_SPARE0_NV, GL_DISCARD_NV,
|
|
|
|
GL_DISCARD_NV, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_SELECT_ARG1:
|
|
|
|
case WINED3D_TOP_SELECT_ARG2:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, arg*1 */
|
2012-01-10 20:37:01 +01:00
|
|
|
if (op == WINED3D_TOP_SELECT_ARG1)
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0]));
|
2012-01-10 20:37:01 +01:00
|
|
|
else
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV,
|
|
|
|
GL_DISCARD_NV, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_MODULATE:
|
|
|
|
case WINED3D_TOP_MODULATE_2X:
|
|
|
|
case WINED3D_TOP_MODULATE_4X:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, arg1*arg2 */
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
|
|
|
|
/* Output */
|
2012-01-10 20:37:01 +01:00
|
|
|
if (op == WINED3D_TOP_MODULATE)
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV,
|
|
|
|
GL_DISCARD_NV, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
2012-01-10 20:37:01 +01:00
|
|
|
else if (op == WINED3D_TOP_MODULATE_2X)
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV,
|
|
|
|
GL_DISCARD_NV, GL_SCALE_BY_TWO_NV, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
2012-01-10 20:37:01 +01:00
|
|
|
else if (op == WINED3D_TOP_MODULATE_4X)
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV,
|
|
|
|
GL_DISCARD_NV, GL_SCALE_BY_FOUR_NV, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_ADD:
|
|
|
|
case WINED3D_TOP_ADD_SIGNED:
|
|
|
|
case WINED3D_TOP_ADD_SIGNED_2X:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, arg1*1+arg2*1 */
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
|
|
|
|
/* Output */
|
2012-01-10 20:37:01 +01:00
|
|
|
if (op == WINED3D_TOP_ADD)
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
2012-01-10 20:37:01 +01:00
|
|
|
else if (op == WINED3D_TOP_ADD_SIGNED)
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_NONE, GL_BIAS_BY_NEGATIVE_ONE_HALF_NV, GL_FALSE, GL_FALSE, GL_FALSE));
|
2012-01-10 20:37:01 +01:00
|
|
|
else if (op == WINED3D_TOP_ADD_SIGNED_2X)
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_SCALE_BY_TWO_NV, GL_BIAS_BY_NEGATIVE_ONE_HALF_NV, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_SUBTRACT:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, arg1*1+-arg2*1 */
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
|
|
|
|
tex_op_args.input[1], GL_SIGNED_NEGATE_NV, tex_op_args.component_usage[1]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_ADD_SMOOTH:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, arg1*1+(1-arg1)*arg2 */
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
|
|
|
|
tex_op_args.input[0], invert_mapping(tex_op_args.mapping[0]), tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_BLEND_DIFFUSE_ALPHA:
|
|
|
|
case WINED3D_TOP_BLEND_TEXTURE_ALPHA:
|
|
|
|
case WINED3D_TOP_BLEND_FACTOR_ALPHA:
|
|
|
|
case WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM:
|
|
|
|
case WINED3D_TOP_BLEND_CURRENT_ALPHA:
|
2008-07-12 18:45:33 +02:00
|
|
|
{
|
|
|
|
GLenum alpha_src = GL_PRIMARY_COLOR_NV;
|
2012-01-10 20:37:01 +01:00
|
|
|
if (op == WINED3D_TOP_BLEND_DIFFUSE_ALPHA)
|
|
|
|
alpha_src = d3dta_to_combiner_input(WINED3DTA_DIFFUSE, stage, texture_idx);
|
|
|
|
else if (op == WINED3D_TOP_BLEND_TEXTURE_ALPHA)
|
|
|
|
alpha_src = d3dta_to_combiner_input(WINED3DTA_TEXTURE, stage, texture_idx);
|
|
|
|
else if (op == WINED3D_TOP_BLEND_FACTOR_ALPHA)
|
|
|
|
alpha_src = d3dta_to_combiner_input(WINED3DTA_TFACTOR, stage, texture_idx);
|
|
|
|
else if (op == WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM)
|
|
|
|
alpha_src = d3dta_to_combiner_input(WINED3DTA_TEXTURE, stage, texture_idx);
|
|
|
|
else if (op == WINED3D_TOP_BLEND_CURRENT_ALPHA)
|
|
|
|
alpha_src = d3dta_to_combiner_input(WINED3DTA_CURRENT, stage, texture_idx);
|
|
|
|
else
|
|
|
|
FIXME("Unhandled texture op %s, shouldn't happen.\n", debug_d3dtop(op));
|
2008-07-12 18:45:33 +02:00
|
|
|
|
|
|
|
/* Input, arg1*alpha_src+arg2*(1-alpha_src) */
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0]));
|
2012-01-10 20:37:01 +01:00
|
|
|
if (op == WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM)
|
2008-07-12 18:45:33 +02:00
|
|
|
{
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
} else {
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
alpha_src, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA));
|
|
|
|
}
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
|
|
|
|
alpha_src, GL_UNSIGNED_INVERT_NV, GL_ALPHA));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_MODULATE_ALPHA_ADD_COLOR:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, arg1_alpha*arg2_rgb+arg1_rgb*1 */
|
2012-01-09 22:16:51 +01:00
|
|
|
if (is_alpha)
|
|
|
|
ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATEALPHA_ADDCOLOR).\n");
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], GL_ALPHA));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_MODULATE_COLOR_ADD_ALPHA:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, arg1_rgb*arg2_rgb+arg1_alpha*1 */
|
2012-01-09 22:16:51 +01:00
|
|
|
if (is_alpha)
|
|
|
|
ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATECOLOR_ADDALPHA).\n");
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], GL_ALPHA));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_MODULATE_INVALPHA_ADD_COLOR:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, (1-arg1_alpha)*arg2_rgb+arg1_rgb*1 */
|
2012-01-09 22:16:51 +01:00
|
|
|
if (is_alpha)
|
|
|
|
ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATEINVALPHA_ADDCOLOR).\n");
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[0], invert_mapping(tex_op_args.mapping[0]), GL_ALPHA));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_MODULATE_INVCOLOR_ADD_ALPHA:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, (1-arg1_rgb)*arg2_rgb+arg1_alpha*1 */
|
2012-01-09 22:16:51 +01:00
|
|
|
if (is_alpha)
|
|
|
|
ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATEINVCOLOR_ADDALPHA).\n");
|
2008-07-12 18:45:33 +02:00
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[0], invert_mapping(tex_op_args.mapping[0]), tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], GL_ALPHA));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_DOTPRODUCT3:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, arg1 . arg2 */
|
|
|
|
/* FIXME: DX7 uses a different calculation? */
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[0], GL_EXPAND_NORMAL_NV, tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
tex_op_args.input[1], GL_EXPAND_NORMAL_NV, tex_op_args.component_usage[1]));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV,
|
|
|
|
GL_DISCARD_NV, GL_NONE, GL_NONE, GL_TRUE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_MULTIPLY_ADD:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, arg3*1+arg1*arg2 */
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[2], tex_op_args.mapping[2], tex_op_args.component_usage[2]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_LERP:
|
2008-07-12 18:45:33 +02:00
|
|
|
/* Input, arg3*arg1+(1-arg3)*arg2 */
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[2], tex_op_args.mapping[2], tex_op_args.component_usage[2]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
tex_op_args.input[0], tex_op_args.mapping[0], tex_op_args.component_usage[0]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
|
|
|
|
tex_op_args.input[2], invert_mapping(tex_op_args.mapping[2]), tex_op_args.component_usage[2]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
|
|
|
|
/* Output */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_DISCARD_NV, GL_DISCARD_NV,
|
|
|
|
output, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2012-01-10 20:37:01 +01:00
|
|
|
case WINED3D_TOP_BUMPENVMAP_LUMINANCE:
|
|
|
|
case WINED3D_TOP_BUMPENVMAP:
|
2012-12-02 16:00:46 +01:00
|
|
|
if (!gl_info->supported[NV_TEXTURE_SHADER])
|
2009-10-29 10:37:11 +01:00
|
|
|
{
|
2012-12-02 16:00:46 +01:00
|
|
|
WARN("BUMPENVMAP requires GL_NV_texture_shader in this codepath\n");
|
2008-07-12 18:45:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-12-02 16:00:46 +01:00
|
|
|
/* The bump map stage itself isn't exciting, just read the texture. But tell the next stage to
|
|
|
|
* perform bump mapping and source from the current stage. Pretty much a SELECTARG2.
|
|
|
|
* ARG2 is passed through unmodified(apps will most likely use D3DTA_CURRENT for arg2, arg1
|
|
|
|
* (which will most likely be D3DTA_TEXTURE) is available as a texture shader input for the
|
|
|
|
* next stage */
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
|
|
|
|
tex_op_args.input[1], tex_op_args.mapping[1], tex_op_args.component_usage[1]));
|
|
|
|
GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
|
|
|
|
GL_ZERO, GL_UNSIGNED_INVERT_NV, portion));
|
|
|
|
/* Always pass through to CURRENT, ignore temp arg */
|
|
|
|
GL_EXTCALL(glCombinerOutputNV(target, portion, GL_SPARE0_NV, GL_DISCARD_NV,
|
|
|
|
GL_DISCARD_NV, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE));
|
|
|
|
break;
|
|
|
|
|
2008-07-12 18:45:33 +02:00
|
|
|
default:
|
2012-01-10 20:37:01 +01:00
|
|
|
FIXME("Unhandled texture op: stage %d, is_alpha %d, op %s (%#x), arg1 %#x, arg2 %#x, arg3 %#x, texture_idx %d.\n",
|
2008-07-12 18:45:33 +02:00
|
|
|
stage, is_alpha, debug_d3dtop(op), op, arg1, arg2, arg3, texture_idx);
|
|
|
|
}
|
|
|
|
|
2009-07-07 11:08:02 +02:00
|
|
|
checkGLcall("set_tex_op_nvrc()");
|
2008-07-12 18:45:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-07-14 01:02:48 +02:00
|
|
|
static void nvrc_colorop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
2009-08-03 08:06:51 +02:00
|
|
|
{
|
2010-09-28 12:00:24 +02:00
|
|
|
DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
2013-09-16 12:43:18 +02:00
|
|
|
BOOL tex_used = context->fixed_function_usage_map & (1 << stage);
|
|
|
|
DWORD mapped_stage = context->tex_unit_map[stage];
|
2009-10-22 10:09:54 +02:00
|
|
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
2008-07-06 01:31:34 +02:00
|
|
|
|
2010-09-28 12:00:24 +02:00
|
|
|
TRACE("Setting color op for stage %u.\n", stage);
|
2008-07-06 01:31:34 +02:00
|
|
|
|
2008-12-15 16:35:14 +01:00
|
|
|
/* Using a pixel shader? Don't care for anything here, the shader applying does it */
|
2010-09-28 12:00:24 +02:00
|
|
|
if (use_ps(state)) return;
|
2008-07-06 01:31:34 +02:00
|
|
|
|
|
|
|
if (stage != mapped_stage) WARN("Using non 1:1 mapping: %d -> %d!\n", stage, mapped_stage);
|
|
|
|
|
2009-03-09 14:31:28 +01:00
|
|
|
if (mapped_stage != WINED3D_UNMAPPED_STAGE)
|
|
|
|
{
|
2009-10-29 10:37:10 +01:00
|
|
|
if (tex_used && mapped_stage >= gl_info->limits.textures)
|
2009-10-22 10:09:54 +02:00
|
|
|
{
|
2008-12-16 13:18:49 +01:00
|
|
|
FIXME("Attempt to enable unsupported stage!\n");
|
2008-07-06 01:31:34 +02:00
|
|
|
return;
|
|
|
|
}
|
2011-08-03 01:34:15 +02:00
|
|
|
context_active_texture(context, gl_info, mapped_stage);
|
2008-07-06 01:31:34 +02:00
|
|
|
}
|
|
|
|
|
2013-10-06 17:33:06 +02:00
|
|
|
if (context->lowest_disabled_stage > 0)
|
2010-09-16 11:19:57 +02:00
|
|
|
{
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glEnable(GL_REGISTER_COMBINERS_NV);
|
2013-10-06 17:33:06 +02:00
|
|
|
GL_EXTCALL(glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV, context->lowest_disabled_stage));
|
2010-09-16 11:19:57 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glDisable(GL_REGISTER_COMBINERS_NV);
|
2008-07-06 01:31:34 +02:00
|
|
|
}
|
2013-10-06 17:33:06 +02:00
|
|
|
if (stage >= context->lowest_disabled_stage)
|
2010-09-16 11:19:57 +02:00
|
|
|
{
|
2008-07-06 01:31:34 +02:00
|
|
|
TRACE("Stage disabled\n");
|
2009-03-09 14:31:28 +01:00
|
|
|
if (mapped_stage != WINED3D_UNMAPPED_STAGE)
|
|
|
|
{
|
2008-07-06 01:31:34 +02:00
|
|
|
/* Disable everything here */
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
|
2008-07-06 01:31:34 +02:00
|
|
|
checkGLcall("glDisable(GL_TEXTURE_2D)");
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
|
2008-07-06 01:31:34 +02:00
|
|
|
checkGLcall("glDisable(GL_TEXTURE_3D)");
|
2009-10-29 10:37:11 +01:00
|
|
|
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
|
|
|
|
{
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB);
|
2008-07-06 01:31:34 +02:00
|
|
|
checkGLcall("glDisable(GL_TEXTURE_CUBE_MAP_ARB)");
|
|
|
|
}
|
2009-10-29 10:37:11 +01:00
|
|
|
if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
|
|
|
|
{
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
|
2008-07-06 01:31:34 +02:00
|
|
|
checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)");
|
|
|
|
}
|
2009-10-29 10:37:10 +01:00
|
|
|
if (gl_info->supported[NV_TEXTURE_SHADER2] && mapped_stage < gl_info->limits.textures)
|
2009-10-22 10:09:54 +02:00
|
|
|
{
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE);
|
2008-07-06 01:31:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/* All done */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The sampler will also activate the correct texture dimensions, so no need to do it here
|
|
|
|
* if the sampler for this stage is dirty
|
|
|
|
*/
|
2009-10-29 10:37:11 +01:00
|
|
|
if (!isStateDirty(context, STATE_SAMPLER(stage)))
|
|
|
|
{
|
|
|
|
if (tex_used)
|
|
|
|
{
|
|
|
|
if (gl_info->supported[NV_TEXTURE_SHADER2])
|
|
|
|
{
|
2010-10-01 12:25:48 +02:00
|
|
|
nvts_activate_dimensions(state, stage, context);
|
2009-10-29 10:37:11 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-10-01 12:25:48 +02:00
|
|
|
texture_activate_dimensions(state->textures[stage], gl_info);
|
2008-07-05 00:25:23 +02:00
|
|
|
}
|
|
|
|
}
|
2008-07-06 01:31:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Set the texture combiners */
|
2010-10-01 12:25:48 +02:00
|
|
|
set_tex_op_nvrc(gl_info, state, FALSE, stage,
|
2012-01-09 22:16:51 +01:00
|
|
|
state->texture_states[stage][WINED3D_TSS_COLOR_OP],
|
|
|
|
state->texture_states[stage][WINED3D_TSS_COLOR_ARG1],
|
|
|
|
state->texture_states[stage][WINED3D_TSS_COLOR_ARG2],
|
|
|
|
state->texture_states[stage][WINED3D_TSS_COLOR_ARG0],
|
2010-09-16 11:19:57 +02:00
|
|
|
mapped_stage,
|
2012-01-09 22:16:51 +01:00
|
|
|
state->texture_states[stage][WINED3D_TSS_RESULT_ARG]);
|
2008-07-06 01:31:34 +02:00
|
|
|
|
|
|
|
/* In register combiners bump mapping is done in the stage AFTER the one that has the bump map operation set,
|
|
|
|
* thus the texture shader may have to be updated
|
|
|
|
*/
|
2009-10-29 10:37:11 +01:00
|
|
|
if (gl_info->supported[NV_TEXTURE_SHADER2])
|
|
|
|
{
|
2012-01-10 20:37:01 +01:00
|
|
|
BOOL usesBump = (state->texture_states[stage][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_BUMPENVMAP_LUMINANCE
|
|
|
|
|| state->texture_states[stage][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_BUMPENVMAP);
|
2010-09-16 11:19:57 +02:00
|
|
|
BOOL usedBump = !!(context->texShaderBumpMap & 1 << (stage + 1));
|
|
|
|
if (usesBump != usedBump)
|
|
|
|
{
|
2011-08-03 01:34:15 +02:00
|
|
|
context_active_texture(context, gl_info, mapped_stage + 1);
|
2010-10-01 12:25:48 +02:00
|
|
|
nvts_activate_dimensions(state, stage + 1, context);
|
2011-08-03 01:34:15 +02:00
|
|
|
context_active_texture(context, gl_info, mapped_stage);
|
2008-07-06 01:31:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-02 07:14:46 +01:00
|
|
|
static void nvrc_resultarg(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
|
|
|
{
|
|
|
|
DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
|
|
|
|
|
|
|
TRACE("Setting result arg for stage %u.\n", stage);
|
|
|
|
|
|
|
|
if (!isStateDirty(context, STATE_TEXTURESTAGE(stage, WINED3D_TSS_COLOR_OP)))
|
|
|
|
{
|
|
|
|
context_apply_state(context, state, STATE_TEXTURESTAGE(stage, WINED3D_TSS_COLOR_OP));
|
|
|
|
}
|
|
|
|
if (!isStateDirty(context, STATE_TEXTURESTAGE(stage, WINED3D_TSS_ALPHA_OP)))
|
|
|
|
{
|
|
|
|
context_apply_state(context, state, STATE_TEXTURESTAGE(stage, WINED3D_TSS_ALPHA_OP));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-14 01:02:48 +02:00
|
|
|
static void nvts_texdim(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
2009-08-03 08:06:51 +02:00
|
|
|
{
|
2010-10-01 12:25:48 +02:00
|
|
|
DWORD sampler = state_id - STATE_SAMPLER(0);
|
2013-09-16 12:43:18 +02:00
|
|
|
DWORD mapped_stage = context->tex_unit_map[sampler];
|
2008-07-05 00:25:23 +02:00
|
|
|
|
|
|
|
/* No need to enable / disable anything here for unused samplers. The tex_colorop
|
|
|
|
* handler takes care. Also no action is needed with pixel shaders, or if tex_colorop
|
2012-01-09 22:16:51 +01:00
|
|
|
* will take care of this business. */
|
|
|
|
if (mapped_stage == WINED3D_UNMAPPED_STAGE || mapped_stage >= context->gl_info->limits.textures)
|
|
|
|
return;
|
2013-10-06 17:33:06 +02:00
|
|
|
if (sampler >= context->lowest_disabled_stage)
|
2012-01-09 22:16:51 +01:00
|
|
|
return;
|
|
|
|
if (isStateDirty(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP)))
|
|
|
|
return;
|
2008-07-05 00:25:23 +02:00
|
|
|
|
2010-10-01 12:25:48 +02:00
|
|
|
nvts_activate_dimensions(state, sampler, context);
|
2008-07-05 00:25:23 +02:00
|
|
|
}
|
|
|
|
|
2011-07-14 01:02:48 +02:00
|
|
|
static void nvts_bumpenvmat(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
2009-08-03 08:06:51 +02:00
|
|
|
{
|
2011-07-14 01:02:48 +02:00
|
|
|
DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
2013-09-16 12:43:18 +02:00
|
|
|
DWORD mapped_stage = context->tex_unit_map[stage + 1];
|
2010-05-24 09:56:37 +02:00
|
|
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
2008-07-06 01:31:34 +02:00
|
|
|
float mat[2][2];
|
|
|
|
|
2008-07-05 22:23:47 +02:00
|
|
|
/* Direct3D sets the matrix in the stage reading the perturbation map. The result is used to
|
|
|
|
* offset the destination stage(always stage + 1 in d3d). In GL_NV_texture_shader, the bump
|
|
|
|
* map offsetting is done in the stage reading the bump mapped texture, and the perturbation
|
|
|
|
* map is read from a specified source stage(always stage - 1 for d3d). Thus set the matrix
|
|
|
|
* for stage + 1. Keep the nvrc tex unit mapping in mind too
|
|
|
|
*/
|
2010-05-24 09:56:37 +02:00
|
|
|
if (mapped_stage < gl_info->limits.textures)
|
2009-10-22 10:09:54 +02:00
|
|
|
{
|
2011-08-03 01:34:15 +02:00
|
|
|
context_active_texture(context, gl_info, mapped_stage);
|
2008-07-05 22:23:47 +02:00
|
|
|
|
2011-07-14 01:02:48 +02:00
|
|
|
/* We can't just pass a pointer to the state to GL due to the
|
2010-09-16 11:19:57 +02:00
|
|
|
* different matrix format (column major vs row major). */
|
2012-01-09 22:16:51 +01:00
|
|
|
mat[0][0] = *((float *)&state->texture_states[stage][WINED3D_TSS_BUMPENV_MAT00]);
|
|
|
|
mat[1][0] = *((float *)&state->texture_states[stage][WINED3D_TSS_BUMPENV_MAT01]);
|
|
|
|
mat[0][1] = *((float *)&state->texture_states[stage][WINED3D_TSS_BUMPENV_MAT10]);
|
|
|
|
mat[1][1] = *((float *)&state->texture_states[stage][WINED3D_TSS_BUMPENV_MAT11]);
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, (float *)mat);
|
2008-07-05 22:23:47 +02:00
|
|
|
checkGLcall("glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, mat)");
|
2008-07-06 01:31:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-14 01:02:48 +02:00
|
|
|
static void nvrc_texfactor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
2009-08-03 08:06:51 +02:00
|
|
|
{
|
2010-05-24 09:56:37 +02:00
|
|
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
2008-07-06 01:31:34 +02:00
|
|
|
float col[4];
|
2011-12-19 21:00:09 +01:00
|
|
|
|
|
|
|
D3DCOLORTOGLFLOAT4(state->render_states[WINED3D_RS_TEXTUREFACTOR], col);
|
2008-07-06 01:31:34 +02:00
|
|
|
GL_EXTCALL(glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, &col[0]));
|
|
|
|
}
|
|
|
|
|
2009-06-26 10:07:12 +02:00
|
|
|
/* Context activation is done by the caller. */
|
2012-07-24 11:32:26 +02:00
|
|
|
static void nvrc_enable(const struct wined3d_gl_info *gl_info, BOOL enable)
|
2012-01-20 00:36:25 +01:00
|
|
|
{
|
|
|
|
if (enable)
|
|
|
|
{
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glEnable(GL_REGISTER_COMBINERS_NV);
|
2012-01-20 00:36:25 +01:00
|
|
|
checkGLcall("glEnable(GL_REGISTER_COMBINERS_NV)");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glDisable(GL_REGISTER_COMBINERS_NV);
|
2012-01-20 00:36:25 +01:00
|
|
|
checkGLcall("glDisable(GL_REGISTER_COMBINERS_NV)");
|
|
|
|
}
|
|
|
|
}
|
2008-07-04 23:15:18 +02:00
|
|
|
|
2012-12-10 21:54:36 +01:00
|
|
|
/* Context activation is done by the caller. */
|
2012-07-24 11:32:26 +02:00
|
|
|
static void nvts_enable(const struct wined3d_gl_info *gl_info, BOOL enable)
|
2010-12-01 20:50:45 +01:00
|
|
|
{
|
2012-07-24 11:32:26 +02:00
|
|
|
nvrc_enable(gl_info, enable);
|
2012-01-20 00:36:25 +01:00
|
|
|
if (enable)
|
|
|
|
{
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_SHADER_NV);
|
2008-07-04 23:15:18 +02:00
|
|
|
checkGLcall("glEnable(GL_TEXTURE_SHADER_NV)");
|
2012-01-20 00:36:25 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-07-24 11:32:27 +02:00
|
|
|
gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_SHADER_NV);
|
2008-07-04 23:15:18 +02:00
|
|
|
checkGLcall("glDisable(GL_TEXTURE_SHADER_NV)");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-26 19:24:15 +02:00
|
|
|
static void nvrc_fragment_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
|
2008-11-25 14:36:09 +01:00
|
|
|
{
|
2013-01-21 09:08:36 +01:00
|
|
|
caps->wined3d_caps = 0;
|
2011-04-26 19:24:15 +02:00
|
|
|
caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP;
|
2010-04-29 23:41:28 +02:00
|
|
|
|
|
|
|
/* The caps below can be supported but aren't handled yet in utils.c
|
|
|
|
* 'd3dta_to_combiner_input', disable them until support is fixed */
|
|
|
|
#if 0
|
|
|
|
if (gl_info->supported[NV_REGISTER_COMBINERS2])
|
2011-04-26 19:24:15 +02:00
|
|
|
caps->PrimitiveMiscCaps |= WINED3DPMISCCAPS_PERSTAGECONSTANT;
|
2010-04-29 23:41:28 +02:00
|
|
|
#endif
|
|
|
|
|
2011-04-26 19:24:15 +02:00
|
|
|
caps->TextureOpCaps = WINED3DTEXOPCAPS_ADD
|
|
|
|
| WINED3DTEXOPCAPS_ADDSIGNED
|
|
|
|
| WINED3DTEXOPCAPS_ADDSIGNED2X
|
|
|
|
| WINED3DTEXOPCAPS_MODULATE
|
|
|
|
| WINED3DTEXOPCAPS_MODULATE2X
|
|
|
|
| WINED3DTEXOPCAPS_MODULATE4X
|
|
|
|
| WINED3DTEXOPCAPS_SELECTARG1
|
|
|
|
| WINED3DTEXOPCAPS_SELECTARG2
|
|
|
|
| WINED3DTEXOPCAPS_DISABLE
|
|
|
|
| WINED3DTEXOPCAPS_BLENDDIFFUSEALPHA
|
|
|
|
| WINED3DTEXOPCAPS_BLENDTEXTUREALPHA
|
|
|
|
| WINED3DTEXOPCAPS_BLENDFACTORALPHA
|
|
|
|
| WINED3DTEXOPCAPS_BLENDCURRENTALPHA
|
|
|
|
| WINED3DTEXOPCAPS_LERP
|
|
|
|
| WINED3DTEXOPCAPS_SUBTRACT
|
|
|
|
| WINED3DTEXOPCAPS_ADDSMOOTH
|
|
|
|
| WINED3DTEXOPCAPS_MULTIPLYADD
|
|
|
|
| WINED3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR
|
|
|
|
| WINED3DTEXOPCAPS_MODULATECOLOR_ADDALPHA
|
|
|
|
| WINED3DTEXOPCAPS_BLENDTEXTUREALPHAPM
|
|
|
|
| WINED3DTEXOPCAPS_DOTPRODUCT3
|
|
|
|
| WINED3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR
|
|
|
|
| WINED3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA;
|
2008-07-04 23:15:18 +02:00
|
|
|
|
2009-10-29 10:37:11 +01:00
|
|
|
if (gl_info->supported[NV_TEXTURE_SHADER2])
|
|
|
|
{
|
2008-07-04 23:15:18 +02:00
|
|
|
/* Bump mapping is supported already in NV_TEXTURE_SHADER, but that extension does
|
|
|
|
* not support 3D textures. This asks for trouble if an app uses both bump mapping
|
|
|
|
* and 3D textures. It also allows us to keep the code simpler by having texture
|
2011-04-26 19:24:15 +02:00
|
|
|
* shaders constantly enabled. */
|
|
|
|
caps->TextureOpCaps |= WINED3DTEXOPCAPS_BUMPENVMAP;
|
2008-07-04 23:15:18 +02:00
|
|
|
/* TODO: Luminance bump map? */
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* FIXME: Add
|
2011-04-26 19:24:15 +02:00
|
|
|
caps->TextureOpCaps |= WINED3DTEXOPCAPS_BUMPENVMAPLUMINANCE
|
2008-07-04 23:15:18 +02:00
|
|
|
WINED3DTEXOPCAPS_PREMODULATE */
|
|
|
|
#endif
|
|
|
|
|
2011-04-26 19:24:15 +02:00
|
|
|
caps->MaxTextureBlendStages = min(MAX_TEXTURES, gl_info->limits.general_combiners);
|
|
|
|
caps->MaxSimultaneousTextures = gl_info->limits.textures;
|
2008-07-04 23:15:18 +02:00
|
|
|
}
|
|
|
|
|
2012-10-28 20:54:54 +01:00
|
|
|
static void *nvrc_fragment_alloc(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv)
|
|
|
|
{
|
|
|
|
return shader_priv;
|
|
|
|
}
|
|
|
|
|
2009-06-26 10:07:12 +02:00
|
|
|
/* Context activation is done by the caller. */
|
2011-05-16 23:01:23 +02:00
|
|
|
static void nvrc_fragment_free(struct wined3d_device *device) {}
|
2008-07-04 23:15:18 +02:00
|
|
|
|
|
|
|
/* Two fixed function pipeline implementations using GL_NV_register_combiners and
|
|
|
|
* GL_NV_texture_shader. The nvts_fragment_pipeline assumes that both extensions
|
|
|
|
* are available(geforce 3 and newer), while nvrc_fragment_pipeline uses only the
|
|
|
|
* register combiners extension(Pre-GF3).
|
|
|
|
*/
|
2008-07-06 01:31:34 +02:00
|
|
|
|
2008-12-03 14:53:43 +01:00
|
|
|
static BOOL nvts_color_fixup_supported(struct color_fixup_desc fixup)
|
|
|
|
{
|
|
|
|
if (TRACE_ON(d3d))
|
|
|
|
{
|
|
|
|
TRACE("Checking support for fixup:\n");
|
|
|
|
dump_color_fixup_desc(fixup);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We only support identity conversions. */
|
|
|
|
if (is_identity_fixup(fixup))
|
|
|
|
{
|
|
|
|
TRACE("[OK]\n");
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
TRACE("[FAILED]\n");
|
2008-08-07 21:51:35 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2012-01-09 22:16:51 +01:00
|
|
|
static const struct StateEntryTemplate nvrc_fragmentstate_template[] =
|
|
|
|
{
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(0, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
2013-11-02 07:14:46 +01:00
|
|
|
{ STATE_TEXTURESTAGE(0, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(0, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE },
|
2012-01-09 22:16:51 +01:00
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(1, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(1, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
2013-11-02 07:14:46 +01:00
|
|
|
{ STATE_TEXTURESTAGE(1, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(1, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE },
|
2012-01-09 22:16:51 +01:00
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(2, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(2, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
2013-11-02 07:14:46 +01:00
|
|
|
{ STATE_TEXTURESTAGE(2, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(2, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE },
|
2012-01-09 22:16:51 +01:00
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(3, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(3, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
2013-11-02 07:14:46 +01:00
|
|
|
{ STATE_TEXTURESTAGE(3, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(3, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE },
|
2012-01-09 22:16:51 +01:00
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(4, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(4, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
2013-11-02 07:14:46 +01:00
|
|
|
{ STATE_TEXTURESTAGE(4, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(4, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE },
|
2012-01-09 22:16:51 +01:00
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(5, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(5, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
2013-11-02 07:14:46 +01:00
|
|
|
{ STATE_TEXTURESTAGE(5, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(5, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE },
|
2012-01-09 22:16:51 +01:00
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(6, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(6, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
2013-11-02 07:14:46 +01:00
|
|
|
{ STATE_TEXTURESTAGE(6, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(6, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE },
|
2012-01-09 22:16:51 +01:00
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_OP), { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_OP), nvrc_colorop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_ARG1), { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_ARG2), { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_OP), { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_OP), tex_alphaop }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_ARG1), { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_ARG2), { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00), { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00), nvts_bumpenvmat }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT01), { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT10), { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT11), { STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00), NULL }, NV_TEXTURE_SHADER2 },
|
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_ARG0), { STATE_TEXTURESTAGE(7, WINED3D_TSS_COLOR_OP), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_ARG0), { STATE_TEXTURESTAGE(7, WINED3D_TSS_ALPHA_OP), NULL }, WINED3D_GL_EXT_NONE },
|
2013-11-02 07:14:46 +01:00
|
|
|
{ STATE_TEXTURESTAGE(7, WINED3D_TSS_RESULT_ARG), { STATE_TEXTURESTAGE(7, WINED3D_TSS_RESULT_ARG), nvrc_resultarg }, WINED3D_GL_EXT_NONE },
|
2013-10-09 10:39:38 +02:00
|
|
|
{ STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), { STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), apply_pixelshader }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE), { STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), NULL }, WINED3D_GL_EXT_NONE },
|
2011-12-19 21:00:09 +01:00
|
|
|
{ STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), { STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), nvrc_texfactor }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_RENDER(WINED3D_RS_FOGCOLOR), { STATE_RENDER(WINED3D_RS_FOGCOLOR), state_fogcolor }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_RENDER(WINED3D_RS_FOGDENSITY), { STATE_RENDER(WINED3D_RS_FOGDENSITY), state_fogdensity }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_RENDER(WINED3D_RS_FOGENABLE), { STATE_RENDER(WINED3D_RS_FOGENABLE), state_fog_fragpart }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_RENDER(WINED3D_RS_FOGTABLEMODE), { STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_RENDER(WINED3D_RS_FOGVERTEXMODE), { STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_RENDER(WINED3D_RS_FOGSTART), { STATE_RENDER(WINED3D_RS_FOGSTART), state_fogstartend }, WINED3D_GL_EXT_NONE },
|
|
|
|
{ STATE_RENDER(WINED3D_RS_FOGEND), { STATE_RENDER(WINED3D_RS_FOGSTART), NULL }, WINED3D_GL_EXT_NONE },
|
2008-07-05 22:20:10 +02:00
|
|
|
{ STATE_SAMPLER(0), { STATE_SAMPLER(0), nvts_texdim }, NV_TEXTURE_SHADER2 },
|
2009-06-04 10:16:21 +02:00
|
|
|
{ STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler_texdim }, WINED3D_GL_EXT_NONE },
|
2008-07-05 22:20:10 +02:00
|
|
|
{ STATE_SAMPLER(1), { STATE_SAMPLER(1), nvts_texdim }, NV_TEXTURE_SHADER2 },
|
2009-06-04 10:16:21 +02:00
|
|
|
{ STATE_SAMPLER(1), { STATE_SAMPLER(1), sampler_texdim }, WINED3D_GL_EXT_NONE },
|
2008-07-05 22:20:10 +02:00
|
|
|
{ STATE_SAMPLER(2), { STATE_SAMPLER(2), nvts_texdim }, NV_TEXTURE_SHADER2 },
|
2009-06-04 10:16:21 +02:00
|
|
|
{ STATE_SAMPLER(2), { STATE_SAMPLER(2), sampler_texdim }, WINED3D_GL_EXT_NONE },
|
2008-07-05 22:20:10 +02:00
|
|
|
{ STATE_SAMPLER(3), { STATE_SAMPLER(3), nvts_texdim }, NV_TEXTURE_SHADER2 },
|
2009-06-04 10:16:21 +02:00
|
|
|
{ STATE_SAMPLER(3), { STATE_SAMPLER(3), sampler_texdim }, WINED3D_GL_EXT_NONE },
|
2008-07-05 22:20:10 +02:00
|
|
|
{ STATE_SAMPLER(4), { STATE_SAMPLER(4), nvts_texdim }, NV_TEXTURE_SHADER2 },
|
2009-06-04 10:16:21 +02:00
|
|
|
{ STATE_SAMPLER(4), { STATE_SAMPLER(4), sampler_texdim }, WINED3D_GL_EXT_NONE },
|
2008-07-05 22:20:10 +02:00
|
|
|
{ STATE_SAMPLER(5), { STATE_SAMPLER(5), nvts_texdim }, NV_TEXTURE_SHADER2 },
|
2009-06-04 10:16:21 +02:00
|
|
|
{ STATE_SAMPLER(5), { STATE_SAMPLER(5), sampler_texdim }, WINED3D_GL_EXT_NONE },
|
2008-07-05 22:20:10 +02:00
|
|
|
{ STATE_SAMPLER(6), { STATE_SAMPLER(6), nvts_texdim }, NV_TEXTURE_SHADER2 },
|
2009-06-04 10:16:21 +02:00
|
|
|
{ STATE_SAMPLER(6), { STATE_SAMPLER(6), sampler_texdim }, WINED3D_GL_EXT_NONE },
|
2008-07-05 22:20:10 +02:00
|
|
|
{ STATE_SAMPLER(7), { STATE_SAMPLER(7), nvts_texdim }, NV_TEXTURE_SHADER2 },
|
2009-06-04 10:16:21 +02:00
|
|
|
{ STATE_SAMPLER(7), { STATE_SAMPLER(7), sampler_texdim }, WINED3D_GL_EXT_NONE },
|
|
|
|
{0 /* Terminate */, { 0, 0 }, WINED3D_GL_EXT_NONE },
|
2008-07-04 23:15:18 +02:00
|
|
|
};
|
|
|
|
|
2008-07-05 22:20:10 +02:00
|
|
|
const struct fragment_pipeline nvts_fragment_pipeline = {
|
|
|
|
nvts_enable,
|
|
|
|
nvrc_fragment_get_caps,
|
|
|
|
nvrc_fragment_alloc,
|
|
|
|
nvrc_fragment_free,
|
2008-12-03 14:53:43 +01:00
|
|
|
nvts_color_fixup_supported,
|
2008-08-23 22:41:51 +02:00
|
|
|
nvrc_fragmentstate_template,
|
2008-07-05 22:20:10 +02:00
|
|
|
};
|
2008-07-06 01:31:34 +02:00
|
|
|
|
2008-07-04 23:15:18 +02:00
|
|
|
const struct fragment_pipeline nvrc_fragment_pipeline = {
|
|
|
|
nvrc_enable,
|
|
|
|
nvrc_fragment_get_caps,
|
|
|
|
nvrc_fragment_alloc,
|
|
|
|
nvrc_fragment_free,
|
2008-12-03 14:53:43 +01:00
|
|
|
nvts_color_fixup_supported,
|
2008-08-23 22:41:51 +02:00
|
|
|
nvrc_fragmentstate_template,
|
2008-07-04 23:15:18 +02:00
|
|
|
};
|