Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
mesa
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1,902
Issues
1,902
List
Boards
Labels
Milestones
Merge Requests
318
Merge Requests
318
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mesa
mesa
Commits
a23985c2
Commit
a23985c2
authored
Mar 14, 2010
by
Keith Whitwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
identity: compiles with pipe_resources
parent
d0d63094
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
130 deletions
+66
-130
src/gallium/drivers/identity/id_context.c
src/gallium/drivers/identity/id_context.c
+26
-50
src/gallium/drivers/identity/id_objects.c
src/gallium/drivers/identity/id_objects.c
+4
-4
src/gallium/drivers/identity/id_objects.h
src/gallium/drivers/identity/id_objects.h
+1
-1
src/gallium/drivers/identity/id_screen.c
src/gallium/drivers/identity/id_screen.c
+35
-75
No files found.
src/gallium/drivers/identity/id_context.c
View file @
a23985c2
...
...
@@ -61,7 +61,7 @@ identity_draw_arrays(struct pipe_context *_pipe,
static
void
identity_draw_elements
(
struct
pipe_context
*
_pipe
,
struct
pipe_
buffer
*
_indexResource
,
struct
pipe_
resource
*
_indexResource
,
unsigned
indexSize
,
unsigned
prim
,
unsigned
start
,
...
...
@@ -587,7 +587,7 @@ identity_set_vertex_buffers(struct pipe_context *_pipe,
if
(
num_buffers
)
{
memcpy
(
unwrapped_buffers
,
_buffers
,
num_buffers
*
sizeof
(
*
_buffers
));
for
(
i
=
0
;
i
<
num_buffers
;
i
++
)
unwrapped_buffers
[
i
].
resource
=
identity_resource_unwrap
(
_resources
[
i
].
resource
);
unwrapped_buffers
[
i
].
buffer
=
identity_resource_unwrap
(
_buffers
[
i
].
buffer
);
buffers
=
unwrapped_buffers
;
}
...
...
@@ -678,44 +678,31 @@ identity_flush(struct pipe_context *_pipe,
}
static
unsigned
int
identity_is_
textur
e_referenced
(
struct
pipe_context
*
_pipe
,
struct
pipe_
textur
e
*
_texture
,
identity_is_
resourc
e_referenced
(
struct
pipe_context
*
_pipe
,
struct
pipe_
resourc
e
*
_texture
,
unsigned
face
,
unsigned
level
)
{
struct
identity_context
*
id_pipe
=
identity_context
(
_pipe
);
struct
identity_
texture
*
id_texture
=
identity_textur
e
(
_texture
);
struct
identity_
resource
*
id_resource
=
identity_resourc
e
(
_texture
);
struct
pipe_context
*
pipe
=
id_pipe
->
pipe
;
struct
pipe_
texture
*
texture
=
id_texture
->
textur
e
;
struct
pipe_
resource
*
texture
=
id_resource
->
resourc
e
;
return
pipe
->
is_
textur
e_referenced
(
pipe
,
return
pipe
->
is_
resourc
e_referenced
(
pipe
,
texture
,
face
,
level
);
}
static
unsigned
int
identity_is_resource_referenced
(
struct
pipe_context
*
_pipe
,
struct
pipe_resource
*
_resource
)
{
struct
identity_context
*
id_pipe
=
identity_context
(
_pipe
);
struct
identity_resource
*
id_resource
=
identity_resource
(
_resource
);
struct
pipe_context
*
pipe
=
id_pipe
->
pipe
;
struct
pipe_resource
*
resource
=
id_resource
->
resource
;
return
pipe
->
is_resource_referenced
(
pipe
,
resource
);
}
static
struct
pipe_sampler_view
*
identity_create_sampler_view
(
struct
pipe_context
*
pipe
,
struct
pipe_
textur
e
*
texture
,
struct
pipe_
resourc
e
*
texture
,
const
struct
pipe_sampler_view
*
templ
)
{
struct
identity_context
*
id_pipe
=
identity_context
(
pipe
);
struct
identity_
texture
*
id_texture
=
identity_textur
e
(
texture
);
struct
identity_
resource
*
id_resource
=
identity_resourc
e
(
texture
);
struct
pipe_context
*
pipe_unwrapped
=
id_pipe
->
pipe
;
struct
pipe_
texture
*
texture_unwrapped
=
id_texture
->
textur
e
;
struct
pipe_
resource
*
texture_unwrapped
=
id_resource
->
resourc
e
;
struct
identity_sampler_view
*
view
=
malloc
(
sizeof
(
struct
identity_sampler_view
));
view
->
sampler_view
=
pipe_unwrapped
->
create_sampler_view
(
pipe_unwrapped
,
...
...
@@ -725,7 +712,7 @@ identity_create_sampler_view(struct pipe_context *pipe,
view
->
base
=
*
templ
;
view
->
base
.
reference
.
count
=
1
;
view
->
base
.
texture
=
NULL
;
pipe_
textur
e_reference
(
&
view
->
base
.
texture
,
texture
);
pipe_
resourc
e_reference
(
&
view
->
base
.
texture
,
texture
);
view
->
base
.
context
=
pipe
;
return
&
view
->
base
;
...
...
@@ -743,42 +730,31 @@ identity_sampler_view_destroy(struct pipe_context *pipe,
pipe_unwrapped
->
sampler_view_destroy
(
pipe_unwrapped
,
view_unwrapped
);
pipe_
textur
e_reference
(
&
view
->
texture
,
NULL
);
pipe_
resourc
e_reference
(
&
view
->
texture
,
NULL
);
free
(
view
);
}
static
struct
pipe_transfer
*
identity_context_get_transfer
(
struct
pipe_context
*
_context
,
struct
pipe_texture
*
_texture
,
unsigned
face
,
unsigned
level
,
unsigned
zslice
,
enum
pipe_transfer_usage
usage
,
unsigned
x
,
unsigned
y
,
unsigned
w
,
unsigned
h
)
struct
pipe_resource
*
_texture
,
struct
pipe_subresource
sr
,
enum
pipe_transfer_usage
usage
,
const
struct
pipe_box
*
box
)
{
struct
identity_context
*
id_context
=
identity_context
(
_context
);
struct
identity_
texture
*
id_texture
=
identity_textur
e
(
_texture
);
struct
identity_
resource
*
id_resource
=
identity_resourc
e
(
_texture
);
struct
pipe_context
*
context
=
id_context
->
pipe
;
struct
pipe_
texture
*
texture
=
id_texture
->
textur
e
;
struct
pipe_
resource
*
texture
=
id_resource
->
resourc
e
;
struct
pipe_transfer
*
result
;
result
=
context
->
tex_transfer
(
context
,
texture
,
face
,
level
,
zslice
,
usage
,
x
,
y
,
w
,
h
);
result
=
context
->
get_transfer
(
context
,
texture
,
sr
,
usage
,
box
);
if
(
result
)
return
identity_transfer_create
(
id_context
,
id_
textur
e
,
result
);
return
identity_transfer_create
(
id_context
,
id_
resourc
e
,
result
);
return
NULL
;
}
...
...
@@ -878,11 +854,11 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
id_pipe
->
base
.
surface_fill
=
identity_surface_fill
;
id_pipe
->
base
.
clear
=
identity_clear
;
id_pipe
->
base
.
flush
=
identity_flush
;
id_pipe
->
base
.
is_
texture_referenced
=
identity_is_textur
e_referenced
;
id_pipe
->
base
.
is_
resource_referenced
=
identity_is_resourc
e_referenced
;
id_pipe
->
base
.
is_resource_referenced
=
identity_is_resource_referenced
;
id_pipe
->
base
.
create_sampler_view
=
identity_create_sampler_view
;
id_pipe
->
base
.
sampler_view_destroy
=
identity_sampler_view_destroy
;
id_pipe
->
base
.
tex
_transfer
=
identity_context_get_transfer
;
id_pipe
->
base
.
get
_transfer
=
identity_context_get_transfer
;
id_pipe
->
base
.
transfer_destroy
=
identity_context_transfer_destroy
;
id_pipe
->
base
.
transfer_map
=
identity_context_transfer_map
;
id_pipe
->
base
.
transfer_unmap
=
identity_context_transfer_unmap
;
...
...
src/gallium/drivers/identity/id_objects.c
View file @
a23985c2
...
...
@@ -79,7 +79,7 @@ identity_surface_create(struct identity_resource *id_resource,
if
(
!
surface
)
goto
error
;
assert
(
surface
->
resourc
e
==
id_resource
->
resource
);
assert
(
surface
->
textur
e
==
id_resource
->
resource
);
id_surface
=
CALLOC_STRUCT
(
identity_surface
);
if
(
!
id_surface
)
...
...
@@ -88,8 +88,8 @@ identity_surface_create(struct identity_resource *id_resource,
memcpy
(
&
id_surface
->
base
,
surface
,
sizeof
(
struct
pipe_surface
));
pipe_reference_init
(
&
id_surface
->
base
.
reference
,
1
);
id_surface
->
base
.
resourc
e
=
NULL
;
pipe_resource_reference
(
&
id_surface
->
base
.
resourc
e
,
&
id_resource
->
base
);
id_surface
->
base
.
textur
e
=
NULL
;
pipe_resource_reference
(
&
id_surface
->
base
.
textur
e
,
&
id_resource
->
base
);
id_surface
->
surface
=
surface
;
return
&
id_surface
->
base
;
...
...
@@ -102,7 +102,7 @@ error:
void
identity_surface_destroy
(
struct
identity_surface
*
id_surface
)
{
pipe_resource_reference
(
&
id_surface
->
base
.
resourc
e
,
NULL
);
pipe_resource_reference
(
&
id_surface
->
base
.
textur
e
,
NULL
);
pipe_surface_reference
(
&
id_surface
->
surface
,
NULL
);
FREE
(
id_surface
);
}
...
...
src/gallium/drivers/identity/id_objects.h
View file @
a23985c2
...
...
@@ -103,7 +103,7 @@ identity_surface(struct pipe_surface *_surface)
{
if
(
!
_surface
)
return
NULL
;
(
void
)
identity_resource
(
_surface
->
resourc
e
);
(
void
)
identity_resource
(
_surface
->
textur
e
);
return
(
struct
identity_surface
*
)
_surface
;
}
...
...
src/gallium/drivers/identity/id_screen.c
View file @
a23985c2
...
...
@@ -118,75 +118,76 @@ identity_screen_context_create(struct pipe_screen *_screen,
return
NULL
;
}
static
struct
pipe_
textur
e
*
identity_screen_
textur
e_create
(
struct
pipe_screen
*
_screen
,
const
struct
pipe_
textur
e
*
templat
)
static
struct
pipe_
resourc
e
*
identity_screen_
resourc
e_create
(
struct
pipe_screen
*
_screen
,
const
struct
pipe_
resourc
e
*
templat
)
{
struct
identity_screen
*
id_screen
=
identity_screen
(
_screen
);
struct
pipe_screen
*
screen
=
id_screen
->
screen
;
struct
pipe_
textur
e
*
result
;
struct
pipe_
resourc
e
*
result
;
result
=
screen
->
textur
e_create
(
screen
,
result
=
screen
->
resourc
e_create
(
screen
,
templat
);
if
(
result
)
return
identity_
textur
e_create
(
id_screen
,
result
);
return
identity_
resourc
e_create
(
id_screen
,
result
);
return
NULL
;
}
static
struct
pipe_
textur
e
*
identity_screen_
textur
e_from_handle
(
struct
pipe_screen
*
_screen
,
const
struct
pipe_
textur
e
*
templ
,
static
struct
pipe_
resourc
e
*
identity_screen_
resourc
e_from_handle
(
struct
pipe_screen
*
_screen
,
const
struct
pipe_
resourc
e
*
templ
,
struct
winsys_handle
*
handle
)
{
struct
identity_screen
*
id_screen
=
identity_screen
(
_screen
);
struct
pipe_screen
*
screen
=
id_screen
->
screen
;
struct
pipe_
textur
e
*
result
;
struct
pipe_
resourc
e
*
result
;
/* TODO trace call */
result
=
screen
->
textur
e_from_handle
(
screen
,
templ
,
handle
);
result
=
screen
->
resourc
e_from_handle
(
screen
,
templ
,
handle
);
result
=
identity_
textur
e_create
(
identity_screen
(
_screen
),
result
);
result
=
identity_
resourc
e_create
(
identity_screen
(
_screen
),
result
);
return
result
;
}
static
boolean
identity_screen_
textur
e_get_handle
(
struct
pipe_screen
*
_screen
,
struct
pipe_
textur
e
*
_texture
,
identity_screen_
resourc
e_get_handle
(
struct
pipe_screen
*
_screen
,
struct
pipe_
resourc
e
*
_texture
,
struct
winsys_handle
*
handle
)
{
struct
identity_screen
*
id_screen
=
identity_screen
(
_screen
);
struct
identity_
texture
*
id_texture
=
identity_textur
e
(
_texture
);
struct
identity_
resource
*
id_resource
=
identity_resourc
e
(
_texture
);
struct
pipe_screen
*
screen
=
id_screen
->
screen
;
struct
pipe_
texture
*
texture
=
id_texture
->
textur
e
;
struct
pipe_
resource
*
texture
=
id_resource
->
resourc
e
;
/* TODO trace call */
return
screen
->
textur
e_get_handle
(
screen
,
texture
,
handle
);
return
screen
->
resourc
e_get_handle
(
screen
,
texture
,
handle
);
}
static
void
identity_screen_texture_destroy
(
struct
pipe_texture
*
_texture
)
identity_screen_resource_destroy
(
struct
pipe_screen
*
screen
,
struct
pipe_resource
*
_texture
)
{
identity_
texture_destroy
(
identity_textur
e
(
_texture
));
identity_
resource_destroy
(
identity_resourc
e
(
_texture
));
}
static
struct
pipe_surface
*
identity_screen_get_tex_surface
(
struct
pipe_screen
*
_screen
,
struct
pipe_
textur
e
*
_texture
,
struct
pipe_
resourc
e
*
_texture
,
unsigned
face
,
unsigned
level
,
unsigned
zslice
,
unsigned
usage
)
{
struct
identity_screen
*
id_screen
=
identity_screen
(
_screen
);
struct
identity_
texture
*
id_texture
=
identity_textur
e
(
_texture
);
struct
identity_
resource
*
id_resource
=
identity_resourc
e
(
_texture
);
struct
pipe_screen
*
screen
=
id_screen
->
screen
;
struct
pipe_
texture
*
texture
=
id_texture
->
textur
e
;
struct
pipe_
resource
*
texture
=
id_resource
->
resourc
e
;
struct
pipe_surface
*
result
;
result
=
screen
->
get_tex_surface
(
screen
,
...
...
@@ -197,7 +198,7 @@ identity_screen_get_tex_surface(struct pipe_screen *_screen,
usage
);
if
(
result
)
return
identity_surface_create
(
id_
textur
e
,
result
);
return
identity_surface_create
(
id_
resourc
e
,
result
);
return
NULL
;
}
...
...
@@ -209,53 +210,28 @@ identity_screen_tex_surface_destroy(struct pipe_surface *_surface)
static
struct
pipe_
buffer
*
static
struct
pipe_
resource
*
identity_screen_user_buffer_create
(
struct
pipe_screen
*
_screen
,
void
*
ptr
,
unsigned
bytes
)
unsigned
bytes
,
unsigned
usage
)
{
struct
identity_screen
*
id_screen
=
identity_screen
(
_screen
);
struct
pipe_screen
*
screen
=
id_screen
->
screen
;
struct
pipe_
buffer
*
result
;
struct
pipe_
resource
*
result
;
result
=
screen
->
user_buffer_create
(
screen
,
ptr
,
bytes
);
bytes
,
usage
);
if
(
result
)
return
identity_
buffer
_create
(
id_screen
,
result
);
return
identity_
resource
_create
(
id_screen
,
result
);
return
NULL
;
}
static
struct
pipe_video_surface
*
identity_screen_video_surface_create
(
struct
pipe_screen
*
_screen
,
enum
pipe_video_chroma_format
chroma_format
,
unsigned
width
,
unsigned
height
)
{
struct
identity_screen
*
id_screen
=
identity_screen
(
_screen
);
struct
pipe_screen
*
screen
=
id_screen
->
screen
;
struct
pipe_video_surface
*
result
;
result
=
screen
->
video_surface_create
(
screen
,
chroma_format
,
width
,
height
);
if
(
result
)
{
return
identity_video_surface_create
(
id_screen
,
result
);
}
return
NULL
;
}
static
void
identity_screen_video_surface_destroy
(
struct
pipe_video_surface
*
_vsfc
)
{
identity_video_surface_destroy
(
identity_video_surface
(
_vsfc
));
}
static
void
identity_screen_flush_frontbuffer
(
struct
pipe_screen
*
_screen
,
struct
pipe_surface
*
_surface
,
...
...
@@ -329,29 +305,13 @@ identity_screen_create(struct pipe_screen *screen)
id_screen
->
base
.
get_paramf
=
identity_screen_get_paramf
;
id_screen
->
base
.
is_format_supported
=
identity_screen_is_format_supported
;
id_screen
->
base
.
context_create
=
identity_screen_context_create
;
id_screen
->
base
.
texture_create
=
identity_screen_textur
e_create
;
id_screen
->
base
.
texture_from_handle
=
identity_screen_textur
e_from_handle
;
id_screen
->
base
.
texture_get_handle
=
identity_screen_textur
e_get_handle
;
id_screen
->
base
.
texture_destroy
=
identity_screen_textur
e_destroy
;
id_screen
->
base
.
resource_create
=
identity_screen_resourc
e_create
;
id_screen
->
base
.
resource_from_handle
=
identity_screen_resourc
e_from_handle
;
id_screen
->
base
.
resource_get_handle
=
identity_screen_resourc
e_get_handle
;
id_screen
->
base
.
resource_destroy
=
identity_screen_resourc
e_destroy
;
id_screen
->
base
.
get_tex_surface
=
identity_screen_get_tex_surface
;
id_screen
->
base
.
tex_surface_destroy
=
identity_screen_tex_surface_destroy
;
id_screen
->
base
.
buffer_create
=
identity_screen_buffer_create
;
id_screen
->
base
.
user_buffer_create
=
identity_screen_user_buffer_create
;
if
(
screen
->
buffer_map
)
id_screen
->
base
.
buffer_map
=
identity_screen_buffer_map
;
if
(
screen
->
buffer_map_range
)
id_screen
->
base
.
buffer_map_range
=
identity_screen_buffer_map_range
;
if
(
screen
->
buffer_flush_mapped_range
)
id_screen
->
base
.
buffer_flush_mapped_range
=
identity_screen_buffer_flush_mapped_range
;
if
(
screen
->
buffer_unmap
)
id_screen
->
base
.
buffer_unmap
=
identity_screen_buffer_unmap
;
id_screen
->
base
.
buffer_destroy
=
identity_screen_buffer_destroy
;
if
(
screen
->
video_surface_create
)
{
id_screen
->
base
.
video_surface_create
=
identity_screen_video_surface_create
;
}
if
(
screen
->
video_surface_destroy
)
{
id_screen
->
base
.
video_surface_destroy
=
identity_screen_video_surface_destroy
;
}
id_screen
->
base
.
flush_frontbuffer
=
identity_screen_flush_frontbuffer
;
id_screen
->
base
.
fence_reference
=
identity_screen_fence_reference
;
id_screen
->
base
.
fence_signalled
=
identity_screen_fence_signalled
;
...
...
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