i965: Use _mesa_is_image_unit_valid() instead of gl_image_unit::_Valid.
authorFrancisco Jerez <currojerez@riseup.net>
Sat, 29 Aug 2015 14:01:11 +0000 (17:01 +0300)
committerFrancisco Jerez <currojerez@riseup.net>
Fri, 9 Oct 2015 14:48:52 +0000 (17:48 +0300)
gl_image_unit::_Valid will be removed in a future commit.

Tested-by: Ye Tian <yex.tian@intel.com>
CC: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_gs_surface_state.c
src/mesa/drivers/dri/i965/brw_vs_surface_state.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index 0bb307432d005eac59bd45794c547046ad72c710..00125c0f4055a96eb49d8cab14e54340adb0296c 100644 (file)
@@ -129,7 +129,7 @@ brw_upload_gs_image_surfaces(struct brw_context *brw)
       ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY];
 
    if (prog) {
-      /* BRW_NEW_GS_PROG_DATA, BRW_NEW_IMAGE_UNITS */
+      /* BRW_NEW_GS_PROG_DATA, BRW_NEW_IMAGE_UNITS, _NEW_TEXTURE */
       brw_upload_image_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_GEOMETRY],
                                 &brw->gs.base, &brw->gs.prog_data->base.base);
    }
@@ -137,6 +137,7 @@ brw_upload_gs_image_surfaces(struct brw_context *brw)
 
 const struct brw_tracked_state brw_gs_image_surfaces = {
    .dirty = {
+      .mesa = _NEW_TEXTURE,
       .brw = BRW_NEW_BATCH |
              BRW_NEW_GEOMETRY_PROGRAM |
              BRW_NEW_GS_PROG_DATA |
index 9bb48eb2e276cdbeb3e409c7ed15a5fd10c0eba1..f65258a52a5d8662e9aa90c0eed4606608b7d491 100644 (file)
@@ -201,7 +201,7 @@ brw_upload_vs_image_surfaces(struct brw_context *brw)
       ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
 
    if (prog) {
-      /* BRW_NEW_VS_PROG_DATA, BRW_NEW_IMAGE_UNITS */
+      /* BRW_NEW_VS_PROG_DATA, BRW_NEW_IMAGE_UNITS, _NEW_TEXTURE */
       brw_upload_image_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_VERTEX],
                                 &brw->vs.base, &brw->vs.prog_data->base.base);
    }
@@ -209,6 +209,7 @@ brw_upload_vs_image_surfaces(struct brw_context *brw)
 
 const struct brw_tracked_state brw_vs_image_surfaces = {
    .dirty = {
+      .mesa = _NEW_TEXTURE,
       .brw = BRW_NEW_BATCH |
              BRW_NEW_IMAGE_UNITS |
              BRW_NEW_VERTEX_PROGRAM |
index c671e23827ef5cde6065d9c03756d7a6c3434725..d73f657edc7cf934e0f47715f05924bea955b42f 100644 (file)
@@ -34,6 +34,7 @@
 #include "main/blend.h"
 #include "main/mtypes.h"
 #include "main/samplerobj.h"
+#include "main/shaderimage.h"
 #include "program/prog_parameter.h"
 #include "main/framebuffer.h"
 
@@ -1112,7 +1113,7 @@ brw_upload_cs_image_surfaces(struct brw_context *brw)
       ctx->_Shader->CurrentProgram[MESA_SHADER_COMPUTE];
 
    if (prog) {
-      /* BRW_NEW_CS_PROG_DATA, BRW_NEW_IMAGE_UNITS */
+      /* BRW_NEW_CS_PROG_DATA, BRW_NEW_IMAGE_UNITS, _NEW_TEXTURE */
       brw_upload_image_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_COMPUTE],
                                 &brw->cs.base, &brw->cs.prog_data->base);
    }
@@ -1120,7 +1121,7 @@ brw_upload_cs_image_surfaces(struct brw_context *brw)
 
 const struct brw_tracked_state brw_cs_image_surfaces = {
    .dirty = {
-      .mesa = _NEW_PROGRAM,
+      .mesa = _NEW_TEXTURE | _NEW_PROGRAM,
       .brw = BRW_NEW_BATCH |
              BRW_NEW_CS_PROG_DATA |
              BRW_NEW_IMAGE_UNITS
@@ -1253,7 +1254,7 @@ update_image_surface(struct brw_context *brw,
                      uint32_t *surf_offset,
                      struct brw_image_param *param)
 {
-   if (u->_Valid) {
+   if (_mesa_is_image_unit_valid(&brw->ctx, u)) {
       struct gl_texture_object *obj = u->TexObj;
       const unsigned format = get_image_format(brw, u->_ActualFormat, access);
 
@@ -1338,7 +1339,7 @@ brw_upload_wm_image_surfaces(struct brw_context *brw)
    struct gl_shader_program *prog = ctx->Shader._CurrentFragmentProgram;
 
    if (prog) {
-      /* BRW_NEW_FS_PROG_DATA, BRW_NEW_IMAGE_UNITS */
+      /* BRW_NEW_FS_PROG_DATA, BRW_NEW_IMAGE_UNITS, _NEW_TEXTURE */
       brw_upload_image_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_FRAGMENT],
                                 &brw->wm.base, &brw->wm.prog_data->base);
    }
@@ -1346,6 +1347,7 @@ brw_upload_wm_image_surfaces(struct brw_context *brw)
 
 const struct brw_tracked_state brw_wm_image_surfaces = {
    .dirty = {
+      .mesa = _NEW_TEXTURE,
       .brw = BRW_NEW_BATCH |
              BRW_NEW_FRAGMENT_PROGRAM |
              BRW_NEW_FS_PROG_DATA |