summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/drivers/vc4/vc4_resource.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-04-02 10:42:24 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-04-02 10:42:24 +0000
commita3f73acb9d2cdc62692af7ff93c51f910dff2d0d (patch)
tree303d205e8e6ed9676bdcbe006a402c23bf668f6c /lib/mesa/src/gallium/drivers/vc4/vc4_resource.c
parentf54e142455cb3c9d1662dae7e096a32a47e5409b (diff)
Merge Mesa 23.3.6
Diffstat (limited to 'lib/mesa/src/gallium/drivers/vc4/vc4_resource.c')
-rw-r--r--lib/mesa/src/gallium/drivers/vc4/vc4_resource.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/mesa/src/gallium/drivers/vc4/vc4_resource.c b/lib/mesa/src/gallium/drivers/vc4/vc4_resource.c
index 65bf7ca53..e2acc4ad4 100644
--- a/lib/mesa/src/gallium/drivers/vc4/vc4_resource.c
+++ b/lib/mesa/src/gallium/drivers/vc4/vc4_resource.c
@@ -26,6 +26,7 @@
#include "util/u_memory.h"
#include "util/format/u_format.h"
#include "util/u_inlines.h"
+#include "util/u_resource.h"
#include "util/u_surface.h"
#include "util/u_transfer_helper.h"
#include "util/u_upload_mgr.h"
@@ -239,7 +240,7 @@ vc4_texture_subdata(struct pipe_context *pctx,
const struct pipe_box *box,
const void *data,
unsigned stride,
- unsigned layer_stride)
+ uintptr_t layer_stride)
{
struct vc4_resource *rsc = vc4_resource(prsc);
struct vc4_resource_slice *slice = &rsc->slices[level];
@@ -350,18 +351,22 @@ vc4_resource_get_param(struct pipe_screen *pscreen,
enum pipe_resource_param param,
unsigned usage, uint64_t *value)
{
- struct vc4_resource *rsc = vc4_resource(prsc);
+ struct vc4_resource *rsc =
+ (struct vc4_resource *)util_resource_at_index(prsc, plane);
switch (param) {
case PIPE_RESOURCE_PARAM_STRIDE:
*value = rsc->slices[level].stride;
return true;
case PIPE_RESOURCE_PARAM_OFFSET:
- *value = 0;
+ *value = rsc->slices[level].offset;
return true;
case PIPE_RESOURCE_PARAM_MODIFIER:
*value = vc4_resource_modifier(rsc);
return true;
+ case PIPE_RESOURCE_PARAM_NPLANES:
+ *value = util_resource_num(prsc);
+ return true;
default:
return false;
}
@@ -1075,7 +1080,7 @@ vc4_update_shadow_baselevel_texture(struct pipe_context *pctx,
},
.format = orig->base.format,
},
- .mask = ~0,
+ .mask = util_format_get_mask(orig->base.format),
};
pctx->blit(pctx, &info);
}