Commit b7edf5b0 authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

wined3d: Add D3DSHADER_ADDRMODE masks to the WINED3D namespace.

parent 29aa316d
......@@ -388,7 +388,7 @@ static void vshader_program_add_param(SHADER_OPCODE_ARG *arg, const DWORD param,
strcat(hwLine, tmpReg);
break;
case WINED3DSPR_CONST:
sprintf(tmpReg, "C[%s%u]", (param & D3DVS_ADDRMODE_RELATIVE) ? "A0.x + " : "", reg);
sprintf(tmpReg, "C[%s%u]", (param & WINED3DSHADER_ADDRMODE_RELATIVE) ? "A0.x + " : "", reg);
strcat(hwLine, tmpReg);
break;
case WINED3DSPR_ADDR: /*case D3DSPR_TEXTURE:*/
......
......@@ -102,7 +102,7 @@ int shader_get_param(
IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface;
char rel_token = D3DSHADER_VERSION_MAJOR(This->baseShader.hex_version) >= 2 &&
((*pToken & D3DSHADER_ADDRESSMODE_MASK) == D3DSHADER_ADDRMODE_RELATIVE);
((*pToken & WINED3DSHADER_ADDRESSMODE_MASK) == WINED3DSHADER_ADDRMODE_RELATIVE);
*param = *pToken;
*addr_token = rel_token? *(pToken + 1): 0;
......@@ -480,7 +480,7 @@ static void shader_dump_arr_entry(
int input) {
char relative =
((param & D3DSHADER_ADDRESSMODE_MASK) == D3DSHADER_ADDRMODE_RELATIVE);
((param & WINED3DSHADER_ADDRESSMODE_MASK) == WINED3DSHADER_ADDRMODE_RELATIVE);
if (relative) {
TRACE("[");
......
......@@ -635,7 +635,7 @@ static void shader_glsl_get_register_name(
const char* prefix = pshader? "PC":"VC";
/* Relative addressing */
if (param & D3DVS_ADDRMODE_RELATIVE) {
if (param & WINED3DSHADER_ADDRMODE_RELATIVE) {
/* Relative addressing on shaders 2.0+ have a relative address token,
* prior to that, it was hard-coded as "A0.x" because there's only 1 register */
......
......@@ -926,7 +926,7 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_ExecuteSW(IWineD3DVertexShader* iface, W
p[i] = &input->V[reg];
break;
case WINED3DSPR_CONST:
if (pToken[i] & D3DVS_ADDRMODE_RELATIVE) {
if (pToken[i] & WINED3DSHADER_ADDRMODE_RELATIVE) {
p[i] = &This->data->C[(DWORD) A[0].x + reg];
} else {
p[i] = &This->data->C[reg];
......
......@@ -156,7 +156,18 @@ typedef enum _WINED3DSHADER_PARAM_DSTMOD_TYPE {
#define WINED3DSP_DSTSHIFT_SHIFT 24
#define WINED3DSP_DSTSHIFT_MASK (0xF << WINED3DSP_DSTSHIFT_SHIFT)
/** opcodes types for PS and VS */
/** Register addressing modes **/
#define WINED3DSHADER_ADDRESSMODE_SHIFT 13
#define WINED3DSHADER_ADDRESSMODE_MASK (1 << WINED3DSHADER_ADDRESSMODE_SHIFT)
typedef enum _WINED3DSHADER_ADDRESSMODE_TYPE {
WINED3DSHADER_ADDRMODE_ABSOLUTE = 0 << WINED3DSHADER_ADDRESSMODE_SHIFT,
WINED3DSHADER_ADDRMODE_RELATIVE = 1 << WINED3DSHADER_ADDRESSMODE_SHIFT,
WINED3DSHADER_ADDRMODE_FORCE_DWORD = 0x7FFFFFFF
} WINED3DSHADER_ADDRESSMODE_TYPE;
/** Opcode types */
typedef enum _WINED3DSHADER_INSTRUCTION_OPCODE_TYPE {
WINED3DSIO_NOP = 0,
WINED3DSIO_MOV = 1,
......
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