Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
mesa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2,324
Issues
2,324
List
Boards
Labels
Service Desk
Milestones
Merge Requests
640
Merge Requests
640
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mesa
mesa
Commits
e0a04969
Commit
e0a04969
authored
Oct 31, 2011
by
Brian Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
st/mesa: implement GL_ARB_texture_storage
parent
2ace9ffc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
0 deletions
+63
-0
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_cb_texture.c
+62
-0
src/mesa/state_tracker/st_extensions.c
src/mesa/state_tracker/st_extensions.c
+1
-0
No files found.
src/mesa/state_tracker/st_cb_texture.c
View file @
e0a04969
...
...
@@ -1842,6 +1842,66 @@ st_get_default_texture(struct st_context *st)
}
/**
* Called via ctx->Driver.AllocTextureStorage() to allocate texture memory
* for a whole mipmap stack.
*/
static
GLboolean
st_AllocTextureStorage
(
struct
gl_context
*
ctx
,
struct
gl_texture_object
*
texObj
,
GLsizei
levels
,
GLsizei
width
,
GLsizei
height
,
GLsizei
depth
)
{
const
GLuint
numFaces
=
(
texObj
->
Target
==
GL_TEXTURE_CUBE_MAP
)
?
6
:
1
;
struct
st_context
*
st
=
st_context
(
ctx
);
struct
st_texture_object
*
stObj
=
st_texture_object
(
texObj
);
GLuint
ptWidth
,
ptHeight
,
ptDepth
,
ptLayers
,
bindings
;
enum
pipe_format
fmt
;
GLint
level
;
assert
(
levels
>
0
);
/* Save the level=0 dimensions */
stObj
->
width0
=
width
;
stObj
->
height0
=
height
;
stObj
->
depth0
=
depth
;
stObj
->
lastLevel
=
levels
-
1
;
fmt
=
st_mesa_format_to_pipe_format
(
texObj
->
Image
[
0
][
0
]
->
TexFormat
);
bindings
=
default_bindings
(
st
,
fmt
);
st_gl_texture_dims_to_pipe_dims
(
texObj
->
Target
,
width
,
height
,
depth
,
&
ptWidth
,
&
ptHeight
,
&
ptDepth
,
&
ptLayers
);
stObj
->
pt
=
st_texture_create
(
st
,
gl_target_to_pipe
(
texObj
->
Target
),
fmt
,
levels
,
ptWidth
,
ptHeight
,
ptDepth
,
ptLayers
,
bindings
);
if
(
!
stObj
->
pt
)
return
GL_FALSE
;
/* Set image resource pointers */
for
(
level
=
0
;
level
<
levels
;
level
++
)
{
GLuint
face
;
for
(
face
=
0
;
face
<
numFaces
;
face
++
)
{
struct
st_texture_image
*
stImage
=
st_texture_image
(
texObj
->
Image
[
face
][
level
]);
pipe_resource_reference
(
&
stImage
->
pt
,
stObj
->
pt
);
}
}
return
GL_TRUE
;
}
void
st_init_texture_functions
(
struct
dd_function_table
*
functions
)
{
...
...
@@ -1879,4 +1939,6 @@ st_init_texture_functions(struct dd_function_table *functions)
/* XXX Temporary until we can query pipe's texture sizes */
functions
->
TestProxyTexImage
=
_mesa_test_proxy_teximage
;
functions
->
AllocTextureStorage
=
st_AllocTextureStorage
;
}
src/mesa/state_tracker/st_extensions.c
View file @
e0a04969
...
...
@@ -264,6 +264,7 @@ void st_init_extensions(struct st_context *st)
ctx
->
Extensions
.
ARB_texture_env_combine
=
GL_TRUE
;
ctx
->
Extensions
.
ARB_texture_env_crossbar
=
GL_TRUE
;
ctx
->
Extensions
.
ARB_texture_env_dot3
=
GL_TRUE
;
ctx
->
Extensions
.
ARB_texture_storage
=
GL_TRUE
;
ctx
->
Extensions
.
ARB_vertex_array_object
=
GL_TRUE
;
ctx
->
Extensions
.
ARB_vertex_program
=
GL_TRUE
;
ctx
->
Extensions
.
ARB_window_pos
=
GL_TRUE
;
...
...
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