Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Mesa
mesa
Commits
0189cb2f
Commit
0189cb2f
authored
Apr 10, 2010
by
Keith Whitwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gallium: don't use generic get_transfer func for textures
It doesn't know and can't fill in the stride value.
parent
65bc6f88
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
2 deletions
+49
-2
src/gallium/auxiliary/util/u_transfer.c
src/gallium/auxiliary/util/u_transfer.c
+4
-0
src/gallium/drivers/i915/i915_resource_texture.c
src/gallium/drivers/i915/i915_resource_texture.c
+21
-1
src/gallium/drivers/i965/brw_resource_texture.c
src/gallium/drivers/i965/brw_resource_texture.c
+24
-1
No files found.
src/gallium/auxiliary/util/u_transfer.c
View file @
0189cb2f
...
...
@@ -90,6 +90,10 @@ struct pipe_transfer * u_default_get_transfer(struct pipe_context *context,
transfer
->
sr
=
sr
;
transfer
->
usage
=
usage
;
transfer
->
box
=
*
box
;
/* Note strides are zero, this is ok for buffers, but not for
* textures 2d & higher at least.
*/
return
transfer
;
}
...
...
src/gallium/drivers/i915/i915_resource_texture.c
View file @
0189cb2f
...
...
@@ -653,6 +653,26 @@ i915_texture_destroy(struct pipe_screen *screen,
FREE
(
tex
);
}
static
struct
pipe_transfer
*
i915_texture_get_transfer
(
struct
pipe_context
*
context
,
struct
pipe_resource
*
resource
,
struct
pipe_subresource
sr
,
unsigned
usage
,
const
struct
pipe_box
*
box
)
{
struct
i915_texture
*
tex
=
i915_texture
(
resource
);
struct
pipe_transfer
*
transfer
=
CALLOC_STRUCT
(
pipe_transfer
);
if
(
transfer
==
NULL
)
return
NULL
;
transfer
->
resource
=
resource
;
transfer
->
sr
=
sr
;
transfer
->
usage
=
usage
;
transfer
->
box
=
*
box
;
transfer
->
stride
=
tex
->
stride
;
return
transfer
;
}
static
void
*
...
...
@@ -707,7 +727,7 @@ struct u_resource_vtbl i915_texture_vtbl =
i915_texture_get_handle
,
/* get_handle */
i915_texture_destroy
,
/* resource_destroy */
NULL
,
/* is_resource_referenced */
u_default
_get_transfer
,
/* get_transfer */
i915_texture
_get_transfer
,
/* get_transfer */
u_default_transfer_destroy
,
/* transfer_destroy */
i915_texture_transfer_map
,
/* transfer_map */
u_default_transfer_flush_region
,
/* transfer_flush_region */
...
...
src/gallium/drivers/i965/brw_resource_texture.c
View file @
0189cb2f
...
...
@@ -270,6 +270,29 @@ static unsigned brw_texture_is_referenced( struct pipe_context *pipe,
* Transfer functions
*/
static
struct
pipe_transfer
*
brw_texture_get_transfer
(
struct
pipe_context
*
context
,
struct
pipe_resource
*
resource
,
struct
pipe_subresource
sr
,
unsigned
usage
,
const
struct
pipe_box
*
box
)
{
struct
brw_texture
*
tex
=
brw_texture
(
resource
);
struct
pipe_transfer
*
transfer
=
CALLOC_STRUCT
(
pipe_transfer
);
if
(
transfer
==
NULL
)
return
NULL
;
transfer
->
resource
=
resource
;
transfer
->
sr
=
sr
;
transfer
->
usage
=
usage
;
transfer
->
box
=
*
box
;
transfer
->
stride
=
tex
->
pitch
*
tex
->
cpp
;
return
transfer
;
}
static
void
*
brw_texture_transfer_map
(
struct
pipe_context
*
pipe
,
struct
pipe_transfer
*
transfer
)
...
...
@@ -331,7 +354,7 @@ struct u_resource_vtbl brw_texture_vtbl =
brw_texture_get_handle
,
/* get_handle */
brw_texture_destroy
,
/* resource_destroy */
brw_texture_is_referenced
,
/* is_resource_referenced */
u_default
_get_transfer
,
/* get_transfer */
brw_texture
_get_transfer
,
/* get_transfer */
u_default_transfer_destroy
,
/* transfer_destroy */
brw_texture_transfer_map
,
/* transfer_map */
u_default_transfer_flush_region
,
/* transfer_flush_region */
...
...
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