Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
aa9ce357
Commit
aa9ce357
authored
Nov 29, 2005
by
Oliver Stieber
Committed by
Alexandre Julliard
Nov 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for vertex and pixel shader constants that have no type
i.e. they haven't been set yet or are clear.
parent
45f0e062
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
7 deletions
+49
-7
device.c
dlls/wined3d/device.c
+30
-1
drawprim.c
dlls/wined3d/drawprim.c
+5
-3
stateblock.c
dlls/wined3d/stateblock.c
+6
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-3
wined3d_interface.h
include/wine/wined3d_interface.h
+4
-0
No files found.
dlls/wined3d/device.c
View file @
aa9ce357
...
...
@@ -3899,10 +3899,22 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetVertexShaderConstantF(IWineD3DDevice *iface
return
D3D_OK
;
}
HRESULT
WINAPI
IWineD3DDeviceImpl_SetVertexShaderConstantN
(
IWineD3DDevice
*
iface
,
UINT
StartRegister
,
UINT
VectorNCount
){
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
int
i
;
/* populate the bitmap that says which constant type we should load */
for
(
i
=
StartRegister
;
i
<
StartRegister
+
VectorNCount
;
++
i
)
{
This
->
updateStateBlock
->
changed
.
vertexShaderConstants
[
i
]
=
TRUE
;
This
->
updateStateBlock
->
set
.
vertexShaderConstants
[
i
]
=
TRUE
;
This
->
updateStateBlock
->
vertexShaderConstantT
[
i
]
=
WINESHADERCNST_NONE
;
TRACE
(
"(%p) : Setting vsf %d
\n
"
,
This
,
i
);
}
return
D3D_OK
;
}
#undef SET_SHADER_CONSTANT
#undef GET_SHADER_CONSTANT
HRESULT
WINAPI
IWineD3DDeviceImpl_SetPixelShader
(
IWineD3DDevice
*
iface
,
IWineD3DPixelShader
*
pShader
)
{
IUnknown
*
parent
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
...
...
@@ -4082,6 +4094,21 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetPixelShaderConstantF(IWineD3DDevice *iface,
return
D3D_OK
;
}
HRESULT
WINAPI
IWineD3DDeviceImpl_SetPixelShaderConstantN
(
IWineD3DDevice
*
iface
,
UINT
StartRegister
,
UINT
VectorNCount
){
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
int
i
;
/* populate the bitmap that says which constant type we should load */
for
(
i
=
StartRegister
;
i
<
StartRegister
+
VectorNCount
;
++
i
)
{
This
->
updateStateBlock
->
changed
.
pixelShaderConstants
[
i
]
=
TRUE
;
This
->
updateStateBlock
->
set
.
pixelShaderConstants
[
i
]
=
TRUE
;
This
->
updateStateBlock
->
pixelShaderConstantT
[
i
]
=
WINESHADERCNST_NONE
;
TRACE
(
"(%p) : Setting vsf %d
\n
"
,
This
,
i
);
}
return
D3D_OK
;
}
#undef SET_SHADER_CONSTANT
#undef GET_SHADER_CONSTANT
...
...
@@ -6443,6 +6470,7 @@ const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
IWineD3DDeviceImpl_GetPixelShaderConstantI
,
IWineD3DDeviceImpl_SetPixelShaderConstantF
,
IWineD3DDeviceImpl_GetPixelShaderConstantF
,
IWineD3DDeviceImpl_SetPixelShaderConstantN
,
IWineD3DDeviceImpl_SetRenderState
,
IWineD3DDeviceImpl_GetRenderState
,
IWineD3DDeviceImpl_SetRenderTarget
,
...
...
@@ -6473,6 +6501,7 @@ const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
IWineD3DDeviceImpl_GetVertexShaderConstantI
,
IWineD3DDeviceImpl_SetVertexShaderConstantF
,
IWineD3DDeviceImpl_GetVertexShaderConstantF
,
IWineD3DDeviceImpl_SetVertexShaderConstantN
,
IWineD3DDeviceImpl_SetViewport
,
IWineD3DDeviceImpl_GetViewport
,
IWineD3DDeviceImpl_MultiplyTransform
,
...
...
dlls/wined3d/drawprim.c
View file @
aa9ce357
...
...
@@ -1743,9 +1743,11 @@ UINT numberOfvertices, UINT numberOfIndicies, GLenum glPrimType, const void *idx
/* Update the constants */
for
(
i
=
0
;
i
<
WINED3D_VSHADER_MAX_CONSTANTS
;
i
++
)
{
/* TODO: add support for Integer and Boolean constants */
GL_EXTCALL
(
glProgramEnvParameter4fvARB
(
GL_VERTEX_PROGRAM_ARB
,
i
,
&
This
->
stateBlock
->
vertexShaderConstantF
[
i
*
4
]));
TRACE_
(
d3d_shader
)(
"Loading constants %u = %f %f %f %f
\n
"
,
i
,
This
->
stateBlock
->
vertexShaderConstantF
[
i
*
4
],
This
->
stateBlock
->
vertexShaderConstantF
[
i
*
4
+
1
],
This
->
stateBlock
->
vertexShaderConstantF
[
i
*
4
+
2
],
This
->
stateBlock
->
vertexShaderConstantF
[
i
*
4
+
3
]);
checkGLcall
(
"glProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB"
);
if
(
WINESHADERCNST_FLOAT
==
This
->
stateBlock
->
vertexShaderConstantT
[
i
])
{
GL_EXTCALL
(
glProgramEnvParameter4fvARB
(
GL_VERTEX_PROGRAM_ARB
,
i
,
&
This
->
stateBlock
->
vertexShaderConstantF
[
i
*
4
]));
TRACE_
(
d3d_shader
)(
"Loading constants %u = %f %f %f %f
\n
"
,
i
,
This
->
stateBlock
->
vertexShaderConstantF
[
i
*
4
],
This
->
stateBlock
->
vertexShaderConstantF
[
i
*
4
+
1
],
This
->
stateBlock
->
vertexShaderConstantF
[
i
*
4
+
2
],
This
->
stateBlock
->
vertexShaderConstantF
[
i
*
4
+
3
]);
checkGLcall
(
"glProgramEnvParameter4fvARB(GL_VERTEX_PROGRAM_ARB"
);
}
}
/* TODO: Vertex Shader 8 constants*/
...
...
dlls/wined3d/stateblock.c
View file @
aa9ce357
...
...
@@ -393,6 +393,9 @@ should really perform a delta so that only the changes get updated*/
case
WINESHADERCNST_INTEGER
:
IWineD3DDevice_SetVertexShaderConstantI
(
pDevice
,
i
,
This
->
vertexShaderConstantI
+
i
*
4
,
1
);
break
;
case
WINESHADERCNST_NONE
:
IWineD3DDevice_SetVertexShaderConstantN
(
pDevice
,
i
,
1
);
break
;
}
}
}
...
...
@@ -419,6 +422,9 @@ should really perform a delta so that only the changes get updated*/
case
WINESHADERCNST_INTEGER
:
IWineD3DDevice_SetPixelShaderConstantI
(
pDevice
,
i
,
This
->
pixelShaderConstantI
+
i
*
4
,
1
);
break
;
case
WINESHADERCNST_NONE
:
IWineD3DDevice_SetPixelShaderConstantN
(
pDevice
,
i
,
1
);
break
;
}
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
aa9ce357
...
...
@@ -888,9 +888,10 @@ typedef struct SAVEDSTATES {
}
SAVEDSTATES
;
typedef
enum
{
WINESHADERCNST_FLOAT
=
0
,
WINESHADERCNST_INTEGER
=
1
,
WINESHADERCNST_BOOL
=
2
WINESHADERCNST_NONE
=
0
,
WINESHADERCNST_FLOAT
=
1
,
WINESHADERCNST_INTEGER
=
2
,
WINESHADERCNST_BOOL
=
3
}
WINESHADERCNST
;
struct
IWineD3DStateBlockImpl
...
...
include/wine/wined3d_interface.h
View file @
aa9ce357
...
...
@@ -332,6 +332,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown)
STDMETHOD
(
GetPixelShaderConstantI
)(
THIS_
UINT
StartRegister
,
int
*
pConstantData
,
UINT
Vector4iCount
)
PURE
;
STDMETHOD
(
SetPixelShaderConstantF
)(
THIS_
UINT
StartRegister
,
CONST
float
*
pConstantData
,
UINT
Vector4fCount
)
PURE
;
STDMETHOD
(
GetPixelShaderConstantF
)(
THIS_
UINT
StartRegister
,
float
*
pConstantData
,
UINT
Vector4fCount
)
PURE
;
STDMETHOD
(
SetPixelShaderConstantN
)(
THIS_
UINT
StartRegister
,
UINT
VectorNCount
)
PURE
;
STDMETHOD
(
SetRenderState
)(
THIS_
D3DRENDERSTATETYPE
State
,
DWORD
Value
)
PURE
;
STDMETHOD
(
GetRenderState
)(
THIS_
D3DRENDERSTATETYPE
State
,
DWORD
*
pValue
)
PURE
;
STDMETHOD
(
SetRenderTarget
)(
THIS_
DWORD
RenderTargetIndex
,
struct
IWineD3DSurface
*
pRenderTarget
)
PURE
;
...
...
@@ -362,6 +363,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown)
STDMETHOD
(
GetVertexShaderConstantI
)(
THIS_
UINT
StartRegister
,
int
*
pConstantData
,
UINT
Vector4iCount
)
PURE
;
STDMETHOD
(
SetVertexShaderConstantF
)(
THIS_
UINT
StartRegister
,
CONST
float
*
pConstantData
,
UINT
Vector4fCount
)
PURE
;
STDMETHOD
(
GetVertexShaderConstantF
)(
THIS_
UINT
StartRegister
,
float
*
pConstantData
,
UINT
Vector4fCount
)
PURE
;
STDMETHOD
(
SetVertexShaderConstantN
)(
THIS_
UINT
StartRegister
,
UINT
VectorNCount
)
PURE
;
STDMETHOD
(
SetViewport
)(
THIS_
CONST
WINED3DVIEWPORT
*
pViewport
)
PURE
;
STDMETHOD
(
GetViewport
)(
THIS_
WINED3DVIEWPORT
*
pViewport
)
PURE
;
STDMETHOD
(
MultiplyTransform
)(
THIS_
D3DTRANSFORMSTATETYPE
State
,
CONST
D3DMATRIX
*
pMatrix
)
PURE
;
...
...
@@ -460,6 +462,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown)
#define IWineD3DDevice_GetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c)
#define IWineD3DDevice_SetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c)
#define IWineD3DDevice_GetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c)
#define IWineD3DDevice_SetPixelShaderConstantN(p,a,b) (p)->lpVtbl->SetPixelShaderConstantN(p,a,b)
#define IWineD3DDevice_GetRasterStatus(p,a,b) (p)->lpVtbl->GetRasterStatus(p,a,b)
#define IWineD3DDevice_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b)
#define IWineD3DDevice_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b)
...
...
@@ -492,6 +495,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown)
#define IWineD3DDevice_GetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c)
#define IWineD3DDevice_SetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c)
#define IWineD3DDevice_GetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c)
#define IWineD3DDevice_SetVertexShaderConstantN(p,a,b) (p)->lpVtbl->SetVertexShaderConstantN(p,a,b)
#define IWineD3DDevice_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a)
#define IWineD3DDevice_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a)
#define IWineD3DDevice_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment