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
f84680e6
Commit
f84680e6
authored
Sep 18, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't try to draw with unsupported attribute data types.
parent
3862347b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
100 additions
and
7 deletions
+100
-7
drawprim.c
dlls/wined3d/drawprim.c
+11
-6
vertexdeclaration.c
dlls/wined3d/vertexdeclaration.c
+88
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/drawprim.c
View file @
f84680e6
...
@@ -219,17 +219,22 @@ void primitiveDeclarationConvertToStridedData(
...
@@ -219,17 +219,22 @@ void primitiveDeclarationConvertToStridedData(
stride_used
=
fixed_get_input
(
element
->
Usage
,
element
->
UsageIndex
,
&
idx
);
stride_used
=
fixed_get_input
(
element
->
Usage
,
element
->
UsageIndex
,
&
idx
);
if
(
stride_used
)
{
if
(
stride_used
)
{
TRACE
(
"Load
ed
%s array %u [usage=%s, usage_idx=%u, "
TRACE
(
"Load %s array %u [usage=%s, usage_idx=%u, "
"stream=%u, offset=%u, stride=%u, type=%s, VBO=%u]
\n
"
,
"stream=%u, offset=%u, stride=%u, type=%s, VBO=%u]
\n
"
,
useVertexShaderFunction
?
"shader"
:
"fixed function"
,
idx
,
useVertexShaderFunction
?
"shader"
:
"fixed function"
,
idx
,
debug_d3ddeclusage
(
element
->
Usage
),
element
->
UsageIndex
,
debug_d3ddeclusage
(
element
->
Usage
),
element
->
UsageIndex
,
element
->
Stream
,
element
->
Offset
,
stride
,
debug_d3ddecltype
(
element
->
Type
),
streamVBO
);
element
->
Stream
,
element
->
Offset
,
stride
,
debug_d3ddecltype
(
element
->
Type
),
streamVBO
);
strided
->
u
.
input
[
idx
].
lpData
=
data
;
if
(
!
useVertexShaderFunction
&&
!
vertexDeclaration
->
ffp_valid
[
i
])
{
strided
->
u
.
input
[
idx
].
dwType
=
element
->
Type
;
WARN
(
"Skipping unsupported fixed function element of type %s and usage %s
\n
"
,
strided
->
u
.
input
[
idx
].
dwStride
=
stride
;
debug_d3ddecltype
(
element
->
Type
),
debug_d3ddeclusage
(
element
->
Usage
));
strided
->
u
.
input
[
idx
].
VBO
=
streamVBO
;
}
else
{
strided
->
u
.
input
[
idx
].
streamNo
=
element
->
Stream
;
strided
->
u
.
input
[
idx
].
lpData
=
data
;
strided
->
u
.
input
[
idx
].
dwType
=
element
->
Type
;
strided
->
u
.
input
[
idx
].
dwStride
=
stride
;
strided
->
u
.
input
[
idx
].
VBO
=
streamVBO
;
strided
->
u
.
input
[
idx
].
streamNo
=
element
->
Stream
;
}
}
}
}
}
/* Now call PreLoad on all the vertex buffers. In the very rare case
/* Now call PreLoad on all the vertex buffers. In the very rare case
...
...
dlls/wined3d/vertexdeclaration.c
View file @
f84680e6
...
@@ -74,6 +74,7 @@ static ULONG WINAPI IWineD3DVertexDeclarationImpl_Release(IWineD3DVertexDeclarat
...
@@ -74,6 +74,7 @@ static ULONG WINAPI IWineD3DVertexDeclarationImpl_Release(IWineD3DVertexDeclarat
}
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pDeclarationWine
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pDeclarationWine
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
ffp_valid
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
return
ref
;
return
ref
;
...
@@ -118,6 +119,90 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_GetDeclaration(IWineD3DVerte
...
@@ -118,6 +119,90 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_GetDeclaration(IWineD3DVerte
return
hr
;
return
hr
;
}
}
static
BOOL
declaration_element_valid_ffp
(
const
WINED3DVERTEXELEMENT
*
element
)
{
switch
(
element
->
Usage
)
{
case
WINED3DDECLUSAGE_POSITION
:
case
WINED3DDECLUSAGE_POSITIONT
:
switch
(
element
->
Type
)
{
case
WINED3DDECLTYPE_FLOAT2
:
case
WINED3DDECLTYPE_FLOAT3
:
case
WINED3DDECLTYPE_FLOAT4
:
case
WINED3DDECLTYPE_SHORT2
:
case
WINED3DDECLTYPE_SHORT4
:
case
WINED3DDECLTYPE_FLOAT16_2
:
case
WINED3DDECLTYPE_FLOAT16_4
:
return
TRUE
;
default
:
return
FALSE
;
}
case
WINED3DDECLUSAGE_BLENDWEIGHT
:
switch
(
element
->
Type
)
{
case
WINED3DDECLTYPE_D3DCOLOR
:
case
WINED3DDECLTYPE_UBYTE4
:
case
WINED3DDECLTYPE_SHORT2
:
case
WINED3DDECLTYPE_SHORT4
:
case
WINED3DDECLTYPE_FLOAT16_2
:
case
WINED3DDECLTYPE_FLOAT16_4
:
return
TRUE
;
default
:
return
FALSE
;
}
case
WINED3DDECLUSAGE_NORMAL
:
switch
(
element
->
Type
)
{
case
WINED3DDECLTYPE_FLOAT3
:
case
WINED3DDECLTYPE_FLOAT4
:
case
WINED3DDECLTYPE_SHORT4
:
case
WINED3DDECLTYPE_FLOAT16_4
:
return
TRUE
;
default
:
return
FALSE
;
}
case
WINED3DDECLUSAGE_TEXCOORD
:
switch
(
element
->
Type
)
{
case
WINED3DDECLTYPE_FLOAT1
:
case
WINED3DDECLTYPE_FLOAT2
:
case
WINED3DDECLTYPE_FLOAT3
:
case
WINED3DDECLTYPE_FLOAT4
:
case
WINED3DDECLTYPE_SHORT2
:
case
WINED3DDECLTYPE_SHORT4
:
case
WINED3DDECLTYPE_FLOAT16_2
:
case
WINED3DDECLTYPE_FLOAT16_4
:
return
TRUE
;
default
:
return
FALSE
;
}
case
WINED3DDECLUSAGE_COLOR
:
switch
(
element
->
Type
)
{
case
WINED3DDECLTYPE_FLOAT3
:
case
WINED3DDECLTYPE_FLOAT4
:
case
WINED3DDECLTYPE_D3DCOLOR
:
case
WINED3DDECLTYPE_UBYTE4
:
case
WINED3DDECLTYPE_SHORT4
:
case
WINED3DDECLTYPE_UBYTE4N
:
case
WINED3DDECLTYPE_SHORT4N
:
case
WINED3DDECLTYPE_USHORT4N
:
case
WINED3DDECLTYPE_FLOAT16_4
:
return
TRUE
;
default
:
return
FALSE
;
}
default
:
return
FALSE
;
}
}
static
HRESULT
WINAPI
IWineD3DVertexDeclarationImpl_SetDeclaration
(
IWineD3DVertexDeclaration
*
iface
,
static
HRESULT
WINAPI
IWineD3DVertexDeclarationImpl_SetDeclaration
(
IWineD3DVertexDeclaration
*
iface
,
const
WINED3DVERTEXELEMENT
*
elements
,
UINT
element_count
)
{
const
WINED3DVERTEXELEMENT
*
elements
,
UINT
element_count
)
{
IWineD3DVertexDeclarationImpl
*
This
=
(
IWineD3DVertexDeclarationImpl
*
)
iface
;
IWineD3DVertexDeclarationImpl
*
This
=
(
IWineD3DVertexDeclarationImpl
*
)
iface
;
...
@@ -136,7 +221,8 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte
...
@@ -136,7 +221,8 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte
This
->
declarationWNumElements
=
element_count
;
This
->
declarationWNumElements
=
element_count
;
This
->
pDeclarationWine
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WINED3DVERTEXELEMENT
)
*
element_count
);
This
->
pDeclarationWine
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WINED3DVERTEXELEMENT
)
*
element_count
);
if
(
!
This
->
pDeclarationWine
)
{
This
->
ffp_valid
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
->
ffp_valid
)
*
element_count
);
if
(
!
This
->
pDeclarationWine
||
!
This
->
ffp_valid
)
{
ERR
(
"Memory allocation failed
\n
"
);
ERR
(
"Memory allocation failed
\n
"
);
return
WINED3DERR_OUTOFVIDEOMEMORY
;
return
WINED3DERR_OUTOFVIDEOMEMORY
;
}
else
{
}
else
{
...
@@ -149,6 +235,7 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte
...
@@ -149,6 +235,7 @@ static HRESULT WINAPI IWineD3DVertexDeclarationImpl_SetDeclaration(IWineD3DVerte
This
->
num_streams
=
0
;
This
->
num_streams
=
0
;
This
->
position_transformed
=
FALSE
;
This
->
position_transformed
=
FALSE
;
for
(
i
=
0
;
i
<
element_count
;
++
i
)
{
for
(
i
=
0
;
i
<
element_count
;
++
i
)
{
This
->
ffp_valid
[
i
]
=
declaration_element_valid_ffp
(
&
This
->
pDeclarationWine
[
i
]);
if
(
This
->
pDeclarationWine
[
i
].
Usage
==
WINED3DDECLUSAGE_POSITIONT
)
{
if
(
This
->
pDeclarationWine
[
i
].
Usage
==
WINED3DDECLUSAGE_POSITIONT
)
{
This
->
position_transformed
=
TRUE
;
This
->
position_transformed
=
TRUE
;
...
...
dlls/wined3d/wined3d_private.h
View file @
f84680e6
...
@@ -1500,6 +1500,7 @@ typedef struct IWineD3DVertexDeclarationImpl {
...
@@ -1500,6 +1500,7 @@ typedef struct IWineD3DVertexDeclarationImpl {
IWineD3DDeviceImpl
*
wineD3DDevice
;
IWineD3DDeviceImpl
*
wineD3DDevice
;
WINED3DVERTEXELEMENT
*
pDeclarationWine
;
WINED3DVERTEXELEMENT
*
pDeclarationWine
;
BOOL
*
ffp_valid
;
UINT
declarationWNumElements
;
UINT
declarationWNumElements
;
DWORD
streams
[
MAX_STREAMS
];
DWORD
streams
[
MAX_STREAMS
];
...
...
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