[Mesa-dev] [PATCH] st/mesa: fix dirty flags for atoms that can depend on mutable objects
Ilia Mirkin
imirkin at alum.mit.edu
Fri Jun 3 00:31:35 UTC 2016
Both textures and buffers can have their underlying resources
reallocated with a glTexImage*() or glBufferData(). Atoms that reference
these need to be notified that a change to the underlying resource has
occurred in order to be recreated. This means textures (which can
reference a buffer object), atomic/ssbo buffers, and images.
Also remove a hack in the driver BufferData() callback which manually
set dirty bits for arrays and ubo's - the issue goes further than that.
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
Not known to fix anything in particular... just from inspection. I suspect
it should at least fix
GL45-CTS.shader_image_size.advanced-changeSize
but that is purely based on theory as I have no access to the test.
src/mesa/state_tracker/st_atom_array.c | 2 +-
src/mesa/state_tracker/st_atom_atomicbuf.c | 12 ++++++------
src/mesa/state_tracker/st_atom_constbuf.c | 12 ++++++------
src/mesa/state_tracker/st_atom_image.c | 12 ++++++------
src/mesa/state_tracker/st_atom_storagebuf.c | 12 ++++++------
src/mesa/state_tracker/st_atom_texture.c | 12 ++++++------
src/mesa/state_tracker/st_cb_bufferobjects.c | 3 ---
7 files changed, 31 insertions(+), 34 deletions(-)
diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c
index 0847184..98e4906 100644
--- a/src/mesa/state_tracker/st_atom_array.c
+++ b/src/mesa/state_tracker/st_atom_array.c
@@ -692,7 +692,7 @@ static void update_array(struct st_context *st)
const struct st_tracked_state st_update_array = {
"st_update_array", /* name */
{ /* dirty */
- _NEW_CURRENT_ATTRIB, /* mesa */
+ _NEW_CURRENT_ATTRIB | _NEW_BUFFER_OBJECT, /* mesa */
ST_NEW_VERTEX_ARRAYS | ST_NEW_VERTEX_PROGRAM, /* st */
},
update_array /* update */
diff --git a/src/mesa/state_tracker/st_atom_atomicbuf.c b/src/mesa/state_tracker/st_atom_atomicbuf.c
index a27dbe0..d20dc92 100644
--- a/src/mesa/state_tracker/st_atom_atomicbuf.c
+++ b/src/mesa/state_tracker/st_atom_atomicbuf.c
@@ -81,7 +81,7 @@ bind_vs_atomics(struct st_context *st)
const struct st_tracked_state st_bind_vs_atomics = {
"st_bind_vs_atomics",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_VERTEX_PROGRAM | ST_NEW_ATOMIC_BUFFER,
},
bind_vs_atomics
@@ -99,7 +99,7 @@ bind_fs_atomics(struct st_context *st)
const struct st_tracked_state st_bind_fs_atomics = {
"st_bind_fs_atomics",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_FRAGMENT_PROGRAM | ST_NEW_ATOMIC_BUFFER,
},
bind_fs_atomics
@@ -117,7 +117,7 @@ bind_gs_atomics(struct st_context *st)
const struct st_tracked_state st_bind_gs_atomics = {
"st_bind_gs_atomics",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_GEOMETRY_PROGRAM | ST_NEW_ATOMIC_BUFFER,
},
bind_gs_atomics
@@ -135,7 +135,7 @@ bind_tcs_atomics(struct st_context *st)
const struct st_tracked_state st_bind_tcs_atomics = {
"st_bind_tcs_atomics",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_TESSCTRL_PROGRAM | ST_NEW_ATOMIC_BUFFER,
},
bind_tcs_atomics
@@ -153,7 +153,7 @@ bind_tes_atomics(struct st_context *st)
const struct st_tracked_state st_bind_tes_atomics = {
"st_bind_tes_atomics",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_TESSEVAL_PROGRAM | ST_NEW_ATOMIC_BUFFER,
},
bind_tes_atomics
@@ -171,7 +171,7 @@ bind_cs_atomics(struct st_context *st)
const struct st_tracked_state st_bind_cs_atomics = {
"st_bind_cs_atomics",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_COMPUTE_PROGRAM | ST_NEW_ATOMIC_BUFFER,
},
bind_cs_atomics
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c
index a980dbe..1a9836c 100644
--- a/src/mesa/state_tracker/st_atom_constbuf.c
+++ b/src/mesa/state_tracker/st_atom_constbuf.c
@@ -316,7 +316,7 @@ static void bind_vs_ubos(struct st_context *st)
const struct st_tracked_state st_bind_vs_ubos = {
"st_bind_vs_ubos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_VERTEX_PROGRAM | ST_NEW_UNIFORM_BUFFER,
},
bind_vs_ubos
@@ -336,7 +336,7 @@ static void bind_fs_ubos(struct st_context *st)
const struct st_tracked_state st_bind_fs_ubos = {
"st_bind_fs_ubos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_FRAGMENT_PROGRAM | ST_NEW_UNIFORM_BUFFER,
},
bind_fs_ubos
@@ -356,7 +356,7 @@ static void bind_gs_ubos(struct st_context *st)
const struct st_tracked_state st_bind_gs_ubos = {
"st_bind_gs_ubos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_GEOMETRY_PROGRAM | ST_NEW_UNIFORM_BUFFER,
},
bind_gs_ubos
@@ -376,7 +376,7 @@ static void bind_tcs_ubos(struct st_context *st)
const struct st_tracked_state st_bind_tcs_ubos = {
"st_bind_tcs_ubos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_TESSCTRL_PROGRAM | ST_NEW_UNIFORM_BUFFER,
},
bind_tcs_ubos
@@ -396,7 +396,7 @@ static void bind_tes_ubos(struct st_context *st)
const struct st_tracked_state st_bind_tes_ubos = {
"st_bind_tes_ubos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_TESSEVAL_PROGRAM | ST_NEW_UNIFORM_BUFFER,
},
bind_tes_ubos
@@ -417,7 +417,7 @@ static void bind_cs_ubos(struct st_context *st)
const struct st_tracked_state st_bind_cs_ubos = {
"st_bind_cs_ubos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_COMPUTE_PROGRAM | ST_NEW_UNIFORM_BUFFER,
},
bind_cs_ubos
diff --git a/src/mesa/state_tracker/st_atom_image.c b/src/mesa/state_tracker/st_atom_image.c
index 9b8f505..cc86449 100644
--- a/src/mesa/state_tracker/st_atom_image.c
+++ b/src/mesa/state_tracker/st_atom_image.c
@@ -148,7 +148,7 @@ static void bind_vs_images(struct st_context *st)
const struct st_tracked_state st_bind_vs_images = {
"st_bind_vs_images",
{
- 0,
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT,
ST_NEW_VERTEX_PROGRAM | ST_NEW_IMAGE_UNITS,
},
bind_vs_images
@@ -168,7 +168,7 @@ static void bind_fs_images(struct st_context *st)
const struct st_tracked_state st_bind_fs_images = {
"st_bind_fs_images",
{
- 0,
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT,
ST_NEW_FRAGMENT_PROGRAM | ST_NEW_IMAGE_UNITS,
},
bind_fs_images
@@ -188,7 +188,7 @@ static void bind_gs_images(struct st_context *st)
const struct st_tracked_state st_bind_gs_images = {
"st_bind_gs_images",
{
- 0,
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT,
ST_NEW_GEOMETRY_PROGRAM | ST_NEW_IMAGE_UNITS,
},
bind_gs_images
@@ -208,7 +208,7 @@ static void bind_tcs_images(struct st_context *st)
const struct st_tracked_state st_bind_tcs_images = {
"st_bind_tcs_images",
{
- 0,
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT,
ST_NEW_TESSCTRL_PROGRAM | ST_NEW_IMAGE_UNITS,
},
bind_tcs_images
@@ -228,7 +228,7 @@ static void bind_tes_images(struct st_context *st)
const struct st_tracked_state st_bind_tes_images = {
"st_bind_tes_images",
{
- 0,
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT,
ST_NEW_TESSEVAL_PROGRAM | ST_NEW_IMAGE_UNITS,
},
bind_tes_images
@@ -248,7 +248,7 @@ static void bind_cs_images(struct st_context *st)
const struct st_tracked_state st_bind_cs_images = {
"st_bind_cs_images",
{
- 0,
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT,
ST_NEW_COMPUTE_PROGRAM | ST_NEW_IMAGE_UNITS,
},
bind_cs_images
diff --git a/src/mesa/state_tracker/st_atom_storagebuf.c b/src/mesa/state_tracker/st_atom_storagebuf.c
index 37b4c4d..b03dae2 100644
--- a/src/mesa/state_tracker/st_atom_storagebuf.c
+++ b/src/mesa/state_tracker/st_atom_storagebuf.c
@@ -105,7 +105,7 @@ static void bind_vs_ssbos(struct st_context *st)
const struct st_tracked_state st_bind_vs_ssbos = {
"st_bind_vs_ssbos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_VERTEX_PROGRAM | ST_NEW_STORAGE_BUFFER,
},
bind_vs_ssbos
@@ -126,7 +126,7 @@ static void bind_fs_ssbos(struct st_context *st)
const struct st_tracked_state st_bind_fs_ssbos = {
"st_bind_fs_ssbos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_FRAGMENT_PROGRAM | ST_NEW_STORAGE_BUFFER,
},
bind_fs_ssbos
@@ -147,7 +147,7 @@ static void bind_gs_ssbos(struct st_context *st)
const struct st_tracked_state st_bind_gs_ssbos = {
"st_bind_gs_ssbos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_GEOMETRY_PROGRAM | ST_NEW_STORAGE_BUFFER,
},
bind_gs_ssbos
@@ -168,7 +168,7 @@ static void bind_tcs_ssbos(struct st_context *st)
const struct st_tracked_state st_bind_tcs_ssbos = {
"st_bind_tcs_ssbos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_TESSCTRL_PROGRAM | ST_NEW_STORAGE_BUFFER,
},
bind_tcs_ssbos
@@ -189,7 +189,7 @@ static void bind_tes_ssbos(struct st_context *st)
const struct st_tracked_state st_bind_tes_ssbos = {
"st_bind_tes_ssbos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_TESSEVAL_PROGRAM | ST_NEW_STORAGE_BUFFER,
},
bind_tes_ssbos
@@ -210,7 +210,7 @@ static void bind_cs_ssbos(struct st_context *st)
const struct st_tracked_state st_bind_cs_ssbos = {
"st_bind_cs_ssbos",
{
- 0,
+ _NEW_BUFFER_OBJECT,
ST_NEW_COMPUTE_PROGRAM | ST_NEW_STORAGE_BUFFER,
},
bind_cs_ssbos
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index 4b7ad77..2f31ef6 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -567,7 +567,7 @@ update_compute_textures(struct st_context *st)
const struct st_tracked_state st_update_fragment_texture = {
"st_update_texture", /* name */
{ /* dirty */
- _NEW_TEXTURE, /* mesa */
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT, /* mesa */
ST_NEW_FRAGMENT_PROGRAM | ST_NEW_SAMPLER_VIEWS, /* st */
},
update_fragment_textures /* update */
@@ -577,7 +577,7 @@ const struct st_tracked_state st_update_fragment_texture = {
const struct st_tracked_state st_update_vertex_texture = {
"st_update_vertex_texture", /* name */
{ /* dirty */
- _NEW_TEXTURE, /* mesa */
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT, /* mesa */
ST_NEW_VERTEX_PROGRAM | ST_NEW_SAMPLER_VIEWS, /* st */
},
update_vertex_textures /* update */
@@ -587,7 +587,7 @@ const struct st_tracked_state st_update_vertex_texture = {
const struct st_tracked_state st_update_geometry_texture = {
"st_update_geometry_texture", /* name */
{ /* dirty */
- _NEW_TEXTURE, /* mesa */
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT, /* mesa */
ST_NEW_GEOMETRY_PROGRAM | ST_NEW_SAMPLER_VIEWS, /* st */
},
update_geometry_textures /* update */
@@ -597,7 +597,7 @@ const struct st_tracked_state st_update_geometry_texture = {
const struct st_tracked_state st_update_tessctrl_texture = {
"st_update_tessctrl_texture", /* name */
{ /* dirty */
- _NEW_TEXTURE, /* mesa */
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT, /* mesa */
ST_NEW_TESSCTRL_PROGRAM | ST_NEW_SAMPLER_VIEWS, /* st */
},
update_tessctrl_textures /* update */
@@ -607,7 +607,7 @@ const struct st_tracked_state st_update_tessctrl_texture = {
const struct st_tracked_state st_update_tesseval_texture = {
"st_update_tesseval_texture", /* name */
{ /* dirty */
- _NEW_TEXTURE, /* mesa */
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT, /* mesa */
ST_NEW_TESSEVAL_PROGRAM | ST_NEW_SAMPLER_VIEWS, /* st */
},
update_tesseval_textures /* update */
@@ -617,7 +617,7 @@ const struct st_tracked_state st_update_tesseval_texture = {
const struct st_tracked_state st_update_compute_texture = {
"st_update_compute_texture", /* name */
{ /* dirty */
- _NEW_TEXTURE, /* mesa */
+ _NEW_TEXTURE | _NEW_BUFFER_OBJECT, /* mesa */
ST_NEW_COMPUTE_PROGRAM | ST_NEW_SAMPLER_VIEWS, /* st */
},
update_compute_textures /* update */
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 8bbc2f0..8668399 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -332,9 +332,6 @@ st_bufferobj_data(struct gl_context *ctx,
}
}
- /* BufferData may change an array or uniform buffer, need to update it */
- st->dirty.st |= ST_NEW_VERTEX_ARRAYS | ST_NEW_UNIFORM_BUFFER;
-
return GL_TRUE;
}
--
2.7.3
More information about the mesa-dev
mailing list