Commit 062541c0 authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

wined3d: Move D3DSIO structure into WINED3D namespace.

parent ffe966f3
......@@ -833,7 +833,7 @@ void pshader_hw_texm3x3spec(SHADER_OPCODE_ARG* arg) {
current_state->current_row = 0;
}
/** Handles transforming all D3DSIO_M?x? opcodes for
/** Handles transforming all WINED3DSIO_M?x? opcodes for
Vertex shaders to ARB_vertex_program codes */
void vshader_hw_mnxn(SHADER_OPCODE_ARG* arg) {
......@@ -852,25 +852,25 @@ void vshader_hw_mnxn(SHADER_OPCODE_ARG* arg) {
tmpArg.reg_maps = arg->reg_maps;
switch(arg->opcode->opcode) {
case D3DSIO_M4x4:
case WINED3DSIO_M4x4:
nComponents = 4;
tmpArg.opcode = &IWineD3DVertexShaderImpl_shader_ins[D3DSIO_DP4];
tmpArg.opcode = &IWineD3DVertexShaderImpl_shader_ins[WINED3DSIO_DP4];
break;
case D3DSIO_M4x3:
case WINED3DSIO_M4x3:
nComponents = 3;
tmpArg.opcode = &IWineD3DVertexShaderImpl_shader_ins[D3DSIO_DP4];
tmpArg.opcode = &IWineD3DVertexShaderImpl_shader_ins[WINED3DSIO_DP4];
break;
case D3DSIO_M3x4:
case WINED3DSIO_M3x4:
nComponents = 4;
tmpArg.opcode = &IWineD3DVertexShaderImpl_shader_ins[D3DSIO_DP3];
tmpArg.opcode = &IWineD3DVertexShaderImpl_shader_ins[WINED3DSIO_DP3];
break;
case D3DSIO_M3x3:
case WINED3DSIO_M3x3:
nComponents = 3;
tmpArg.opcode = &IWineD3DVertexShaderImpl_shader_ins[D3DSIO_DP3];
tmpArg.opcode = &IWineD3DVertexShaderImpl_shader_ins[WINED3DSIO_DP3];
break;
case D3DSIO_M3x2:
case WINED3DSIO_M3x2:
nComponents = 2;
tmpArg.opcode = &IWineD3DVertexShaderImpl_shader_ins[D3DSIO_DP3];
tmpArg.opcode = &IWineD3DVertexShaderImpl_shader_ins[WINED3DSIO_DP3];
break;
default:
break;
......@@ -896,7 +896,7 @@ void vshader_hw_map2gl(SHADER_OPCODE_ARG* arg) {
char tmpLine[256];
unsigned int i;
if (curOpcode->opcode == D3DSIO_MOV && dst_regtype == D3DSPR_ADDR)
if (curOpcode->opcode == WINED3DSIO_MOV && dst_regtype == D3DSPR_ADDR)
strcpy(tmpLine, "ARL");
else
strcpy(tmpLine, curOpcode->glname);
......
......@@ -218,7 +218,7 @@ HRESULT shader_get_registers_used(
++pToken;
/* Handle declarations */
} else if (D3DSIO_DCL == curOpcode->opcode) {
} else if (WINED3DSIO_DCL == curOpcode->opcode) {
DWORD usage = *pToken++;
DWORD param = *pToken++;
......@@ -247,7 +247,7 @@ HRESULT shader_get_registers_used(
} else if (D3DSPR_SAMPLER == regtype)
reg_maps->samplers[regnum] = usage;
} else if (D3DSIO_DEF == curOpcode->opcode) {
} else if (WINED3DSIO_DEF == curOpcode->opcode) {
local_constant* lconst = HeapAlloc(GetProcessHeap(), 0, sizeof(local_constant));
if (!lconst) return E_OUTOFMEMORY;
......@@ -256,7 +256,7 @@ HRESULT shader_get_registers_used(
list_add_head(&This->baseShader.constantsF, &lconst->entry);
pToken += curOpcode->num_params;
} else if (D3DSIO_DEFI == curOpcode->opcode) {
} else if (WINED3DSIO_DEFI == curOpcode->opcode) {
local_constant* lconst = HeapAlloc(GetProcessHeap(), 0, sizeof(local_constant));
if (!lconst) return E_OUTOFMEMORY;
......@@ -265,7 +265,7 @@ HRESULT shader_get_registers_used(
list_add_head(&This->baseShader.constantsI, &lconst->entry);
pToken += curOpcode->num_params;
} else if (D3DSIO_DEFB == curOpcode->opcode) {
} else if (WINED3DSIO_DEFB == curOpcode->opcode) {
local_constant* lconst = HeapAlloc(GetProcessHeap(), 0, sizeof(local_constant));
if (!lconst) return E_OUTOFMEMORY;
......@@ -275,13 +275,13 @@ HRESULT shader_get_registers_used(
pToken += curOpcode->num_params;
/* If there's a loop in the shader */
} else if (D3DSIO_LOOP == curOpcode->opcode ||
D3DSIO_REP == curOpcode->opcode) {
} else if (WINED3DSIO_LOOP == curOpcode->opcode ||
WINED3DSIO_REP == curOpcode->opcode) {
reg_maps->loop = 1;
pToken += curOpcode->num_params;
/* For subroutine prototypes */
} else if (D3DSIO_LABEL == curOpcode->opcode) {
} else if (WINED3DSIO_LABEL == curOpcode->opcode) {
DWORD snum = *pToken & D3DSP_REGNUM_MASK;
reg_maps->labels[snum] = 1;
......@@ -293,10 +293,10 @@ HRESULT shader_get_registers_used(
/* Declare 1.X samplers implicitly, based on the destination reg. number */
if (D3DSHADER_VERSION_MAJOR(This->baseShader.hex_version) == 1 &&
(D3DSIO_TEX == curOpcode->opcode ||
D3DSIO_TEXBEM == curOpcode->opcode ||
D3DSIO_TEXM3x2TEX == curOpcode->opcode ||
D3DSIO_TEXM3x3TEX == curOpcode->opcode)) {
(WINED3DSIO_TEX == curOpcode->opcode ||
WINED3DSIO_TEXBEM == curOpcode->opcode ||
WINED3DSIO_TEXM3x2TEX == curOpcode->opcode ||
WINED3DSIO_TEXM3x3TEX == curOpcode->opcode)) {
/* Fake sampler usage, only set reserved bit and ttype */
DWORD sampler_code = *pToken & D3DSP_REGNUM_MASK;
......@@ -330,8 +330,8 @@ HRESULT shader_get_registers_used(
}
} else if (D3DSHADER_VERSION_MAJOR(This->baseShader.hex_version) == 1 &&
(D3DSIO_TEXM3x3SPEC == curOpcode->opcode ||
D3DSIO_TEXM3x3VSPEC == curOpcode->opcode)) {
(WINED3DSIO_TEXM3x3SPEC == curOpcode->opcode ||
WINED3DSIO_TEXM3x3VSPEC == curOpcode->opcode)) {
/* 3D sampler usage, only set reserved bit and ttype
* FIXME: This could be either Cube or Volume, but we wouldn't know unless
......@@ -340,7 +340,7 @@ HRESULT shader_get_registers_used(
DWORD sampler_code = *pToken & D3DSP_REGNUM_MASK;
reg_maps->samplers[sampler_code] = (0x1 << 31) | WINED3DSTT_CUBE;
} else if (D3DSHADER_VERSION_MAJOR(This->baseShader.hex_version) == 1 &&
(D3DSIO_TEXDP3TEX == curOpcode->opcode)) {
(WINED3DSIO_TEXDP3TEX == curOpcode->opcode)) {
/* 1D Sampler usage */
DWORD sampler_code = *pToken & D3DSP_REGNUM_MASK;
......@@ -724,13 +724,13 @@ void shader_generate_main(
pToken += shader_skip_unrecognized(iface, pToken);
/* Nothing to do */
} else if (D3DSIO_DCL == curOpcode->opcode ||
D3DSIO_NOP == curOpcode->opcode ||
D3DSIO_DEF == curOpcode->opcode ||
D3DSIO_DEFI == curOpcode->opcode ||
D3DSIO_DEFB == curOpcode->opcode ||
D3DSIO_PHASE == curOpcode->opcode ||
D3DSIO_RET == curOpcode->opcode) {
} else if (WINED3DSIO_DCL == curOpcode->opcode ||
WINED3DSIO_NOP == curOpcode->opcode ||
WINED3DSIO_DEF == curOpcode->opcode ||
WINED3DSIO_DEFI == curOpcode->opcode ||
WINED3DSIO_DEFB == curOpcode->opcode ||
WINED3DSIO_PHASE == curOpcode->opcode ||
WINED3DSIO_RET == curOpcode->opcode) {
pToken += shader_skip_opcode(This, curOpcode, hw_arg.opcode_token);
......@@ -851,7 +851,7 @@ void shader_trace_init(
len += tokens_read;
} else {
if (curOpcode->opcode == D3DSIO_DCL) {
if (curOpcode->opcode == WINED3DSIO_DCL) {
DWORD usage = *pToken;
DWORD param = *(pToken + 1);
......@@ -863,7 +863,7 @@ void shader_trace_init(
pToken += 2;
len += 2;
} else if (curOpcode->opcode == D3DSIO_DEF) {
} else if (curOpcode->opcode == WINED3DSIO_DEF) {
unsigned int offset = shader_get_float_offset(*pToken);
......@@ -875,7 +875,7 @@ void shader_trace_init(
pToken += 5;
len += 5;
} else if (curOpcode->opcode == D3DSIO_DEFI) {
} else if (curOpcode->opcode == WINED3DSIO_DEFI) {
TRACE("defi i%u = %d, %d, %d, %d", *pToken & D3DSP_REGNUM_MASK,
*(pToken + 1),
......@@ -886,7 +886,7 @@ void shader_trace_init(
pToken += 5;
len += 5;
} else if (curOpcode->opcode == D3DSIO_DEFB) {
} else if (curOpcode->opcode == WINED3DSIO_DEFB) {
TRACE("defb b%u = %s", *pToken & D3DSP_REGNUM_MASK,
*(pToken + 1)? "true": "false");
......@@ -909,8 +909,8 @@ void shader_trace_init(
TRACE("%s", curOpcode->name);
if (curOpcode->opcode == D3DSIO_IFC ||
curOpcode->opcode == D3DSIO_BREAKC) {
if (curOpcode->opcode == WINED3DSIO_IFC ||
curOpcode->opcode == WINED3DSIO_BREAKC) {
DWORD op = (opcode_token & INST_CONTROLS_MASK) >> INST_CONTROLS_SHIFT;
switch (op) {
......
......@@ -39,6 +39,7 @@
#include "d3d9.h"
#include "d3d9types.h"
#include "wined3d_private_types.h"
#include "ddraw.h"
#include "wine/wined3d_interface.h"
#include "wine/wined3d_gl.h"
......@@ -1682,7 +1683,7 @@ inline static BOOL shader_is_vshader_version(DWORD token) {
}
inline static BOOL shader_is_comment(DWORD token) {
return D3DSIO_COMMENT == (token & D3DSI_OPCODE_MASK);
return WINED3DSIO_COMMENT == (token & D3DSI_OPCODE_MASK);
}
/* Internally used shader constants. Applications can use constants 0 to GL_LIMITS(vshader_constantsF) - 1,
......
/*
* Direct3D wine internal header: D3D equivalent types
*
* Copyright 2002-2003 Jason Edmeades
* Copyright 2002-2003 Raphael Junqueira
* Copyright 2005 Oliver Stieber
*
* 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
*/
#ifndef __WINE_WINED3D_TYPES_INTERNAL_H
#define __WINE_WINED3D_TYPES_INTERNAL_H
/** opcodes types for PS and VS */
typedef enum _WINED3DSHADER_INSTRUCTION_OPCODE_TYPE {
WINED3DSIO_NOP = 0,
WINED3DSIO_MOV = 1,
WINED3DSIO_ADD = 2,
WINED3DSIO_SUB = 3,
WINED3DSIO_MAD = 4,
WINED3DSIO_MUL = 5,
WINED3DSIO_RCP = 6,
WINED3DSIO_RSQ = 7,
WINED3DSIO_DP3 = 8,
WINED3DSIO_DP4 = 9,
WINED3DSIO_MIN = 10,
WINED3DSIO_MAX = 11,
WINED3DSIO_SLT = 12,
WINED3DSIO_SGE = 13,
WINED3DSIO_EXP = 14,
WINED3DSIO_LOG = 15,
WINED3DSIO_LIT = 16,
WINED3DSIO_DST = 17,
WINED3DSIO_LRP = 18,
WINED3DSIO_FRC = 19,
WINED3DSIO_M4x4 = 20,
WINED3DSIO_M4x3 = 21,
WINED3DSIO_M3x4 = 22,
WINED3DSIO_M3x3 = 23,
WINED3DSIO_M3x2 = 24,
WINED3DSIO_CALL = 25,
WINED3DSIO_CALLNZ = 26,
WINED3DSIO_LOOP = 27,
WINED3DSIO_RET = 28,
WINED3DSIO_ENDLOOP = 29,
WINED3DSIO_LABEL = 30,
WINED3DSIO_DCL = 31,
WINED3DSIO_POW = 32,
WINED3DSIO_CRS = 33,
WINED3DSIO_SGN = 34,
WINED3DSIO_ABS = 35,
WINED3DSIO_NRM = 36,
WINED3DSIO_SINCOS = 37,
WINED3DSIO_REP = 38,
WINED3DSIO_ENDREP = 39,
WINED3DSIO_IF = 40,
WINED3DSIO_IFC = 41,
WINED3DSIO_ELSE = 42,
WINED3DSIO_ENDIF = 43,
WINED3DSIO_BREAK = 44,
WINED3DSIO_BREAKC = 45,
WINED3DSIO_MOVA = 46,
WINED3DSIO_DEFB = 47,
WINED3DSIO_DEFI = 48,
WINED3DSIO_TEXCOORD = 64,
WINED3DSIO_TEXKILL = 65,
WINED3DSIO_TEX = 66,
WINED3DSIO_TEXBEM = 67,
WINED3DSIO_TEXBEML = 68,
WINED3DSIO_TEXREG2AR = 69,
WINED3DSIO_TEXREG2GB = 70,
WINED3DSIO_TEXM3x2PAD = 71,
WINED3DSIO_TEXM3x2TEX = 72,
WINED3DSIO_TEXM3x3PAD = 73,
WINED3DSIO_TEXM3x3TEX = 74,
WINED3DSIO_TEXM3x3DIFF = 75,
WINED3DSIO_TEXM3x3SPEC = 76,
WINED3DSIO_TEXM3x3VSPEC = 77,
WINED3DSIO_EXPP = 78,
WINED3DSIO_LOGP = 79,
WINED3DSIO_CND = 80,
WINED3DSIO_DEF = 81,
WINED3DSIO_TEXREG2RGB = 82,
WINED3DSIO_TEXDP3TEX = 83,
WINED3DSIO_TEXM3x2DEPTH = 84,
WINED3DSIO_TEXDP3 = 85,
WINED3DSIO_TEXM3x3 = 86,
WINED3DSIO_TEXDEPTH = 87,
WINED3DSIO_CMP = 88,
WINED3DSIO_BEM = 89,
WINED3DSIO_DP2ADD = 90,
WINED3DSIO_DSX = 91,
WINED3DSIO_DSY = 92,
WINED3DSIO_TEXLDD = 93,
WINED3DSIO_SETP = 94,
WINED3DSIO_TEXLDL = 95,
WINED3DSIO_BREAKP = 96,
WINED3DSIO_PHASE = 0xFFFD,
WINED3DSIO_COMMENT = 0xFFFE,
WINED3DSIO_END = 0XFFFF,
WINED3DSIO_FORCE_DWORD = 0X7FFFFFFF /** for 32-bit alignment */
} WINED3DSHADER_INSTRUCTION_OPCODE_TYPE;
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment