wined3d: Make some more GLSL functions private to the backend.
This commit is contained in:
parent
a0940051eb
commit
5ba40c3d58
|
@ -882,6 +882,8 @@ void shader_generate_main(
|
|||
device->shader_backend->shader_color_correction(&hw_arg);
|
||||
|
||||
/* Process instruction modifiers for GLSL apps ( _sat, etc. ) */
|
||||
/* FIXME: This should be internal to the shader backend.
|
||||
* Also, right now this is the only reason "shader_mode" exists. */
|
||||
if (This->baseShader.shader_mode == SHADER_GLSL)
|
||||
shader_glsl_add_instruction_modifiers(&hw_arg);
|
||||
|
||||
|
|
|
@ -1426,7 +1426,7 @@ static void shader_glsl_color_correction(SHADER_OPCODE_ARG* arg) {
|
|||
****************************************************************************/
|
||||
|
||||
/* Generate GLSL arithmetic functions (dst = src1 + src2) */
|
||||
void shader_glsl_arith(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_arith(SHADER_OPCODE_ARG* arg) {
|
||||
CONST SHADER_OPCODE* curOpcode = arg->opcode;
|
||||
SHADER_BUFFER* buffer = arg->buffer;
|
||||
glsl_src_param_t src0_param;
|
||||
|
@ -1452,7 +1452,7 @@ void shader_glsl_arith(SHADER_OPCODE_ARG* arg) {
|
|||
}
|
||||
|
||||
/* Process the WINED3DSIO_MOV opcode using GLSL (dst = src) */
|
||||
void shader_glsl_mov(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_mov(SHADER_OPCODE_ARG* arg) {
|
||||
IWineD3DBaseShaderImpl* shader = (IWineD3DBaseShaderImpl*) arg->shader;
|
||||
SHADER_BUFFER* buffer = arg->buffer;
|
||||
glsl_src_param_t src0_param;
|
||||
|
@ -1487,7 +1487,7 @@ void shader_glsl_mov(SHADER_OPCODE_ARG* arg) {
|
|||
}
|
||||
|
||||
/* Process the dot product operators DP3 and DP4 in GLSL (dst = dot(src0, src1)) */
|
||||
void shader_glsl_dot(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_dot(SHADER_OPCODE_ARG* arg) {
|
||||
CONST SHADER_OPCODE* curOpcode = arg->opcode;
|
||||
SHADER_BUFFER* buffer = arg->buffer;
|
||||
glsl_src_param_t src0_param;
|
||||
|
@ -1517,7 +1517,7 @@ void shader_glsl_dot(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/* Note that this instruction has some restrictions. The destination write mask
|
||||
* can't contain the w component, and the source swizzles have to be .xyzw */
|
||||
void shader_glsl_cross(SHADER_OPCODE_ARG *arg) {
|
||||
static void shader_glsl_cross(SHADER_OPCODE_ARG *arg) {
|
||||
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
|
||||
glsl_src_param_t src0_param;
|
||||
glsl_src_param_t src1_param;
|
||||
|
@ -1533,7 +1533,7 @@ void shader_glsl_cross(SHADER_OPCODE_ARG *arg) {
|
|||
/* Process the WINED3DSIO_POW instruction in GLSL (dst = |src0|^src1)
|
||||
* Src0 and src1 are scalars. Note that D3D uses the absolute of src0, while
|
||||
* GLSL uses the value as-is. */
|
||||
void shader_glsl_pow(SHADER_OPCODE_ARG *arg) {
|
||||
static void shader_glsl_pow(SHADER_OPCODE_ARG *arg) {
|
||||
SHADER_BUFFER *buffer = arg->buffer;
|
||||
glsl_src_param_t src0_param;
|
||||
glsl_src_param_t src1_param;
|
||||
|
@ -1556,7 +1556,7 @@ void shader_glsl_pow(SHADER_OPCODE_ARG *arg) {
|
|||
/* Process the WINED3DSIO_LOG instruction in GLSL (dst = log2(|src0|))
|
||||
* Src0 is a scalar. Note that D3D uses the absolute of src0, while
|
||||
* GLSL uses the value as-is. */
|
||||
void shader_glsl_log(SHADER_OPCODE_ARG *arg) {
|
||||
static void shader_glsl_log(SHADER_OPCODE_ARG *arg) {
|
||||
SHADER_BUFFER *buffer = arg->buffer;
|
||||
glsl_src_param_t src0_param;
|
||||
DWORD dst_write_mask;
|
||||
|
@ -1575,7 +1575,7 @@ void shader_glsl_log(SHADER_OPCODE_ARG *arg) {
|
|||
}
|
||||
|
||||
/* Map the opcode 1-to-1 to the GL code (arg->dst = instruction(src0, src1, ...) */
|
||||
void shader_glsl_map2gl(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_map2gl(SHADER_OPCODE_ARG* arg) {
|
||||
CONST SHADER_OPCODE* curOpcode = arg->opcode;
|
||||
SHADER_BUFFER* buffer = arg->buffer;
|
||||
glsl_src_param_t src_param;
|
||||
|
@ -1626,7 +1626,7 @@ void shader_glsl_map2gl(SHADER_OPCODE_ARG* arg) {
|
|||
* For 2.0 shaders, just do this (honoring writemask and swizzle):
|
||||
* dst = 2^src; (partial precision is allowed, but optional)
|
||||
*/
|
||||
void shader_glsl_expp(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_expp(SHADER_OPCODE_ARG* arg) {
|
||||
IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)arg->shader;
|
||||
glsl_src_param_t src_param;
|
||||
|
||||
|
@ -1659,7 +1659,7 @@ void shader_glsl_expp(SHADER_OPCODE_ARG* arg) {
|
|||
}
|
||||
|
||||
/** Process the RCP (reciprocal or inverse) opcode in GLSL (dst = 1 / src) */
|
||||
void shader_glsl_rcp(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_rcp(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src_param;
|
||||
DWORD write_mask;
|
||||
unsigned int mask_size;
|
||||
|
@ -1675,7 +1675,7 @@ void shader_glsl_rcp(SHADER_OPCODE_ARG* arg) {
|
|||
}
|
||||
}
|
||||
|
||||
void shader_glsl_rsq(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_rsq(SHADER_OPCODE_ARG* arg) {
|
||||
SHADER_BUFFER* buffer = arg->buffer;
|
||||
glsl_src_param_t src_param;
|
||||
DWORD write_mask;
|
||||
|
@ -1694,7 +1694,7 @@ void shader_glsl_rsq(SHADER_OPCODE_ARG* arg) {
|
|||
}
|
||||
|
||||
/** Process signed comparison opcodes in GLSL. */
|
||||
void shader_glsl_compare(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_compare(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
glsl_src_param_t src1_param;
|
||||
DWORD write_mask;
|
||||
|
@ -1741,7 +1741,7 @@ void shader_glsl_compare(SHADER_OPCODE_ARG* arg) {
|
|||
}
|
||||
|
||||
/** Process CMP instruction in GLSL (dst = src0 >= 0.0 ? src1 : src2), per channel */
|
||||
void shader_glsl_cmp(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_cmp(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
glsl_src_param_t src1_param;
|
||||
glsl_src_param_t src2_param;
|
||||
|
@ -1817,7 +1817,7 @@ void shader_glsl_cmp(SHADER_OPCODE_ARG* arg) {
|
|||
/** Process the CND opcode in GLSL (dst = (src0 > 0.5) ? src1 : src2) */
|
||||
/* For ps 1.1-1.3, only a single component of src0 is used. For ps 1.4
|
||||
* the compare is done per component of src0. */
|
||||
void shader_glsl_cnd(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_cnd(SHADER_OPCODE_ARG* arg) {
|
||||
IWineD3DBaseShaderImpl* shader = (IWineD3DBaseShaderImpl*) arg->shader;
|
||||
glsl_src_param_t src0_param;
|
||||
glsl_src_param_t src1_param;
|
||||
|
@ -1863,7 +1863,7 @@ void shader_glsl_cnd(SHADER_OPCODE_ARG* arg) {
|
|||
}
|
||||
|
||||
/** GLSL code generation for WINED3DSIO_MAD: Multiply the first 2 opcodes, then add the last */
|
||||
void shader_glsl_mad(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_mad(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
glsl_src_param_t src1_param;
|
||||
glsl_src_param_t src2_param;
|
||||
|
@ -1879,7 +1879,7 @@ void shader_glsl_mad(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Handles transforming all WINED3DSIO_M?x? opcodes for
|
||||
Vertex shaders to GLSL codes */
|
||||
void shader_glsl_mnxn(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_mnxn(SHADER_OPCODE_ARG* arg) {
|
||||
int i;
|
||||
int nComponents = 0;
|
||||
SHADER_OPCODE_ARG tmpArg;
|
||||
|
@ -1932,7 +1932,7 @@ void shader_glsl_mnxn(SHADER_OPCODE_ARG* arg) {
|
|||
blend factor. Equation: (dst = src2 + src0 * (src1 - src2))
|
||||
This is equivalent to mix(src2, src1, src0);
|
||||
*/
|
||||
void shader_glsl_lrp(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_lrp(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
glsl_src_param_t src1_param;
|
||||
glsl_src_param_t src2_param;
|
||||
|
@ -1954,7 +1954,7 @@ void shader_glsl_lrp(SHADER_OPCODE_ARG* arg) {
|
|||
* dst.z = (src0.x > 0) ? ((src0.y > 0) ? pow(src0.y, src.w) : 0) : 0
|
||||
* where src.w is clamped at +- 128
|
||||
*/
|
||||
void shader_glsl_lit(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_lit(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
glsl_src_param_t src1_param;
|
||||
glsl_src_param_t src3_param;
|
||||
|
@ -1998,7 +1998,7 @@ void shader_glsl_lit(SHADER_OPCODE_ARG* arg) {
|
|||
* dst.z = src0.z
|
||||
* dst.w = src1.w
|
||||
*/
|
||||
void shader_glsl_dst(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_dst(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0y_param;
|
||||
glsl_src_param_t src0z_param;
|
||||
glsl_src_param_t src1y_param;
|
||||
|
@ -2026,7 +2026,7 @@ void shader_glsl_dst(SHADER_OPCODE_ARG* arg) {
|
|||
* dst.z = dst.z
|
||||
* dst.w = dst.w
|
||||
*/
|
||||
void shader_glsl_sincos(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_sincos(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
DWORD write_mask;
|
||||
|
||||
|
@ -2058,7 +2058,7 @@ void shader_glsl_sincos(SHADER_OPCODE_ARG* arg) {
|
|||
* Need to use a temporary variable for this operation.
|
||||
*/
|
||||
/* FIXME: I don't think nested loops will work correctly this way. */
|
||||
void shader_glsl_loop(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_loop(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src1_param;
|
||||
IWineD3DBaseShaderImpl* shader = (IWineD3DBaseShaderImpl*) arg->shader;
|
||||
DWORD regtype = shader_get_regtype(arg->src[1]);
|
||||
|
@ -2110,7 +2110,7 @@ void shader_glsl_loop(SHADER_OPCODE_ARG* arg) {
|
|||
shader->baseShader.cur_loop_regno++;
|
||||
}
|
||||
|
||||
void shader_glsl_end(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_end(SHADER_OPCODE_ARG* arg) {
|
||||
IWineD3DBaseShaderImpl* shader = (IWineD3DBaseShaderImpl*) arg->shader;
|
||||
|
||||
shader_addline(arg->buffer, "}\n");
|
||||
|
@ -2124,7 +2124,7 @@ void shader_glsl_end(SHADER_OPCODE_ARG* arg) {
|
|||
}
|
||||
}
|
||||
|
||||
void shader_glsl_rep(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_rep(SHADER_OPCODE_ARG* arg) {
|
||||
IWineD3DBaseShaderImpl* shader = (IWineD3DBaseShaderImpl*) arg->shader;
|
||||
glsl_src_param_t src0_param;
|
||||
|
||||
|
@ -2135,14 +2135,14 @@ void shader_glsl_rep(SHADER_OPCODE_ARG* arg) {
|
|||
shader->baseShader.cur_loop_depth++;
|
||||
}
|
||||
|
||||
void shader_glsl_if(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_if(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
|
||||
shader_glsl_add_src_param(arg, arg->src[0], arg->src_addr[0], WINED3DSP_WRITEMASK_0, &src0_param);
|
||||
shader_addline(arg->buffer, "if (%s) {\n", src0_param.param_str);
|
||||
}
|
||||
|
||||
void shader_glsl_ifc(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_ifc(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
glsl_src_param_t src1_param;
|
||||
|
||||
|
@ -2153,16 +2153,16 @@ void shader_glsl_ifc(SHADER_OPCODE_ARG* arg) {
|
|||
src0_param.param_str, shader_get_comp_op(arg->opcode_token), src1_param.param_str);
|
||||
}
|
||||
|
||||
void shader_glsl_else(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_else(SHADER_OPCODE_ARG* arg) {
|
||||
shader_addline(arg->buffer, "} else {\n");
|
||||
}
|
||||
|
||||
void shader_glsl_break(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_break(SHADER_OPCODE_ARG* arg) {
|
||||
shader_addline(arg->buffer, "break;\n");
|
||||
}
|
||||
|
||||
/* FIXME: According to MSDN the compare is done per component. */
|
||||
void shader_glsl_breakc(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_breakc(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
glsl_src_param_t src1_param;
|
||||
|
||||
|
@ -2173,19 +2173,19 @@ void shader_glsl_breakc(SHADER_OPCODE_ARG* arg) {
|
|||
src0_param.param_str, shader_get_comp_op(arg->opcode_token), src1_param.param_str);
|
||||
}
|
||||
|
||||
void shader_glsl_label(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_label(SHADER_OPCODE_ARG* arg) {
|
||||
|
||||
DWORD snum = (arg->src[0]) & WINED3DSP_REGNUM_MASK;
|
||||
shader_addline(arg->buffer, "}\n");
|
||||
shader_addline(arg->buffer, "void subroutine%u () {\n", snum);
|
||||
}
|
||||
|
||||
void shader_glsl_call(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_call(SHADER_OPCODE_ARG* arg) {
|
||||
DWORD snum = (arg->src[0]) & WINED3DSP_REGNUM_MASK;
|
||||
shader_addline(arg->buffer, "subroutine%u();\n", snum);
|
||||
}
|
||||
|
||||
void shader_glsl_callnz(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_callnz(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src1_param;
|
||||
|
||||
DWORD snum = (arg->src[0]) & WINED3DSP_REGNUM_MASK;
|
||||
|
@ -2196,7 +2196,7 @@ void shader_glsl_callnz(SHADER_OPCODE_ARG* arg) {
|
|||
/*********************************************
|
||||
* Pixel Shader Specific Code begins here
|
||||
********************************************/
|
||||
void pshader_glsl_tex(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_tex(SHADER_OPCODE_ARG* arg) {
|
||||
IWineD3DPixelShaderImpl* This = (IWineD3DPixelShaderImpl*) arg->shader;
|
||||
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device;
|
||||
DWORD hex_version = This->baseShader.hex_version;
|
||||
|
@ -2293,7 +2293,7 @@ void pshader_glsl_tex(SHADER_OPCODE_ARG* arg) {
|
|||
}
|
||||
}
|
||||
|
||||
void shader_glsl_texldl(SHADER_OPCODE_ARG* arg) {
|
||||
static void shader_glsl_texldl(SHADER_OPCODE_ARG* arg) {
|
||||
IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*)arg->shader;
|
||||
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device;
|
||||
glsl_sample_function_t sample_function;
|
||||
|
@ -2328,7 +2328,7 @@ void shader_glsl_texldl(SHADER_OPCODE_ARG* arg) {
|
|||
}
|
||||
}
|
||||
|
||||
void pshader_glsl_texcoord(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texcoord(SHADER_OPCODE_ARG* arg) {
|
||||
|
||||
/* FIXME: Make this work for more than just 2D textures */
|
||||
|
||||
|
@ -2380,7 +2380,7 @@ void pshader_glsl_texcoord(SHADER_OPCODE_ARG* arg) {
|
|||
/** Process the WINED3DSIO_TEXDP3TEX instruction in GLSL:
|
||||
* Take a 3-component dot product of the TexCoord[dstreg] and src,
|
||||
* then perform a 1D texture lookup from stage dstregnum, place into dst. */
|
||||
void pshader_glsl_texdp3tex(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texdp3tex(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
char dst_mask[6];
|
||||
glsl_sample_function_t sample_function;
|
||||
|
@ -2422,7 +2422,7 @@ void pshader_glsl_texdp3tex(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXDP3 instruction in GLSL:
|
||||
* Take a 3-component dot product of the TexCoord[dstreg] and src. */
|
||||
void pshader_glsl_texdp3(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texdp3(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
DWORD dstreg = arg->dst & WINED3DSP_REGNUM_MASK;
|
||||
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
|
||||
|
@ -2442,7 +2442,7 @@ void pshader_glsl_texdp3(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXDEPTH instruction in GLSL:
|
||||
* Calculate the depth as dst.x / dst.y */
|
||||
void pshader_glsl_texdepth(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texdepth(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_dst_param_t dst_param;
|
||||
|
||||
shader_glsl_add_dst_param(arg, arg->dst, 0, &dst_param);
|
||||
|
@ -2461,7 +2461,7 @@ void pshader_glsl_texdepth(SHADER_OPCODE_ARG* arg) {
|
|||
* Calculate tmp0.y = TexCoord[dstreg] . src.xyz; (tmp0.x has already been calculated)
|
||||
* depth = (tmp0.y == 0.0) ? 1.0 : tmp0.x / tmp0.y
|
||||
*/
|
||||
void pshader_glsl_texm3x2depth(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texm3x2depth(SHADER_OPCODE_ARG* arg) {
|
||||
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
|
||||
DWORD dstreg = arg->dst & WINED3DSP_REGNUM_MASK;
|
||||
glsl_src_param_t src0_param;
|
||||
|
@ -2474,7 +2474,7 @@ void pshader_glsl_texm3x2depth(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXM3X2PAD instruction in GLSL
|
||||
* Calculate the 1st of a 2-row matrix multiplication. */
|
||||
void pshader_glsl_texm3x2pad(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texm3x2pad(SHADER_OPCODE_ARG* arg) {
|
||||
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
|
||||
DWORD reg = arg->dst & WINED3DSP_REGNUM_MASK;
|
||||
SHADER_BUFFER* buffer = arg->buffer;
|
||||
|
@ -2486,7 +2486,7 @@ void pshader_glsl_texm3x2pad(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXM3X3PAD instruction in GLSL
|
||||
* Calculate the 1st or 2nd row of a 3-row matrix multiplication. */
|
||||
void pshader_glsl_texm3x3pad(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texm3x3pad(SHADER_OPCODE_ARG* arg) {
|
||||
|
||||
IWineD3DPixelShaderImpl* shader = (IWineD3DPixelShaderImpl*) arg->shader;
|
||||
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
|
||||
|
@ -2500,7 +2500,7 @@ void pshader_glsl_texm3x3pad(SHADER_OPCODE_ARG* arg) {
|
|||
current_state->texcoord_w[current_state->current_row++] = reg;
|
||||
}
|
||||
|
||||
void pshader_glsl_texm3x2tex(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texm3x2tex(SHADER_OPCODE_ARG* arg) {
|
||||
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
|
||||
DWORD reg = arg->dst & WINED3DSP_REGNUM_MASK;
|
||||
SHADER_BUFFER* buffer = arg->buffer;
|
||||
|
@ -2519,7 +2519,7 @@ void pshader_glsl_texm3x2tex(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXM3X3TEX instruction in GLSL
|
||||
* Perform the 3rd row of a 3x3 matrix multiply, then sample the texture using the calculated coordinates */
|
||||
void pshader_glsl_texm3x3tex(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texm3x3tex(SHADER_OPCODE_ARG* arg) {
|
||||
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
|
||||
glsl_src_param_t src0_param;
|
||||
char dst_mask[6];
|
||||
|
@ -2545,7 +2545,7 @@ void pshader_glsl_texm3x3tex(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXM3X3 instruction in GLSL
|
||||
* Perform the 3rd row of a 3x3 matrix multiply */
|
||||
void pshader_glsl_texm3x3(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texm3x3(SHADER_OPCODE_ARG* arg) {
|
||||
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
|
||||
glsl_src_param_t src0_param;
|
||||
char dst_mask[6];
|
||||
|
@ -2564,7 +2564,7 @@ void pshader_glsl_texm3x3(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXM3X3SPEC instruction in GLSL
|
||||
* Peform the final texture lookup based on the previous 2 3x3 matrix multiplies */
|
||||
void pshader_glsl_texm3x3spec(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texm3x3spec(SHADER_OPCODE_ARG* arg) {
|
||||
|
||||
IWineD3DPixelShaderImpl* shader = (IWineD3DPixelShaderImpl*) arg->shader;
|
||||
DWORD reg = arg->dst & WINED3DSP_REGNUM_MASK;
|
||||
|
@ -2598,7 +2598,7 @@ void pshader_glsl_texm3x3spec(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXM3X3VSPEC instruction in GLSL
|
||||
* Peform the final texture lookup based on the previous 2 3x3 matrix multiplies */
|
||||
void pshader_glsl_texm3x3vspec(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texm3x3vspec(SHADER_OPCODE_ARG* arg) {
|
||||
|
||||
IWineD3DPixelShaderImpl* shader = (IWineD3DPixelShaderImpl*) arg->shader;
|
||||
DWORD reg = arg->dst & WINED3DSP_REGNUM_MASK;
|
||||
|
@ -2635,7 +2635,7 @@ void pshader_glsl_texm3x3vspec(SHADER_OPCODE_ARG* arg) {
|
|||
* Apply a fake bump map transform.
|
||||
* texbem is pshader <= 1.3 only, this saves a few version checks
|
||||
*/
|
||||
void pshader_glsl_texbem(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texbem(SHADER_OPCODE_ARG* arg) {
|
||||
IWineD3DPixelShaderImpl* This = (IWineD3DPixelShaderImpl*) arg->shader;
|
||||
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device;
|
||||
char dst_swizzle[6];
|
||||
|
@ -2690,7 +2690,7 @@ void pshader_glsl_texbem(SHADER_OPCODE_ARG* arg) {
|
|||
}
|
||||
}
|
||||
|
||||
void pshader_glsl_bem(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_bem(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param, src1_param;
|
||||
DWORD sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK;
|
||||
|
||||
|
@ -2704,7 +2704,7 @@ void pshader_glsl_bem(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXREG2AR instruction in GLSL
|
||||
* Sample 2D texture at dst using the alpha & red (wx) components of src as texture coordinates */
|
||||
void pshader_glsl_texreg2ar(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texreg2ar(SHADER_OPCODE_ARG* arg) {
|
||||
|
||||
glsl_src_param_t src0_param;
|
||||
DWORD sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK;
|
||||
|
@ -2719,7 +2719,7 @@ void pshader_glsl_texreg2ar(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXREG2GB instruction in GLSL
|
||||
* Sample 2D texture at dst using the green & blue (yz) components of src as texture coordinates */
|
||||
void pshader_glsl_texreg2gb(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texreg2gb(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
DWORD sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK;
|
||||
char dst_mask[6];
|
||||
|
@ -2733,7 +2733,7 @@ void pshader_glsl_texreg2gb(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXREG2RGB instruction in GLSL
|
||||
* Sample texture at dst using the rgb (xyz) components of src as texture coordinates */
|
||||
void pshader_glsl_texreg2rgb(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texreg2rgb(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
char dst_mask[6];
|
||||
DWORD sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK;
|
||||
|
@ -2751,7 +2751,7 @@ void pshader_glsl_texreg2rgb(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_TEXKILL instruction in GLSL.
|
||||
* If any of the first 3 components are < 0, discard this pixel */
|
||||
void pshader_glsl_texkill(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_texkill(SHADER_OPCODE_ARG* arg) {
|
||||
IWineD3DPixelShaderImpl* This = (IWineD3DPixelShaderImpl*) arg->shader;
|
||||
DWORD hex_version = This->baseShader.hex_version;
|
||||
glsl_dst_param_t dst_param;
|
||||
|
@ -2772,7 +2772,7 @@ void pshader_glsl_texkill(SHADER_OPCODE_ARG* arg) {
|
|||
|
||||
/** Process the WINED3DSIO_DP2ADD instruction in GLSL.
|
||||
* dst = dot2(src0, src1) + src2 */
|
||||
void pshader_glsl_dp2add(SHADER_OPCODE_ARG* arg) {
|
||||
static void pshader_glsl_dp2add(SHADER_OPCODE_ARG* arg) {
|
||||
glsl_src_param_t src0_param;
|
||||
glsl_src_param_t src1_param;
|
||||
glsl_src_param_t src2_param;
|
||||
|
|
|
@ -2114,64 +2114,6 @@ extern HRESULT allocate_shader_constants(IWineD3DStateBlockImpl* object);
|
|||
/* GLSL helper functions */
|
||||
extern void shader_glsl_add_instruction_modifiers(SHADER_OPCODE_ARG *arg);
|
||||
|
||||
/** The following translate DirectX pixel/vertex shader opcodes to GLSL lines */
|
||||
extern void shader_glsl_cross(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_map2gl(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_arith(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_mov(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_mad(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_mnxn(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_lrp(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_dot(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_rcp(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_rsq(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_cnd(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_compare(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_def(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_defi(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_defb(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_expp(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_cmp(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_lit(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_dst(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_sincos(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_loop(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_end(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_if(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_ifc(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_else(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_break(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_breakc(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_rep(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_call(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_callnz(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_label(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_pow(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_log(SHADER_OPCODE_ARG* arg);
|
||||
extern void shader_glsl_texldl(SHADER_OPCODE_ARG* arg);
|
||||
|
||||
/** GLSL Pixel Shader Prototypes */
|
||||
extern void pshader_glsl_tex(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texcoord(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texdp3tex(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texdp3(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texdepth(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texm3x2depth(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texm3x2pad(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texm3x2tex(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texm3x3(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texm3x3pad(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texm3x3tex(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texm3x3spec(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texm3x3vspec(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texkill(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texbem(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_bem(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texreg2ar(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texreg2gb(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_texreg2rgb(SHADER_OPCODE_ARG* arg);
|
||||
extern void pshader_glsl_dp2add(SHADER_OPCODE_ARG* arg);
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirect3DBaseShader implementation structure
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue