summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_resource.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-10-02 22:14:03 -0700
committerEric Anholt <[email protected]>2014-10-19 08:42:33 +0100
commit572fba95e4cd85aebdde9bd757c17f719af2af04 (patch)
tree9a8e72c55c67b4a9190e9812ab3e38fc98d5a462 /src/gallium/drivers/vc4/vc4_resource.h
parent15eb4c59f6504473989e6a064fda11d6c009ed8f (diff)
vc4: Add support for rebasing texture levels so firstlevel == 0.
GLES2 doesn't have GL_TEXTURE_BASE_LEVEL, so the hardware doesn't. Fixes piglit levelclamp, tex-miplevel-selection, and texture-storage/2D mipmap rendering.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_resource.h')
-rw-r--r--src/gallium/drivers/vc4/vc4_resource.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_resource.h b/src/gallium/drivers/vc4/vc4_resource.h
index 01f481d15c4..7cc16a4540b 100644
--- a/src/gallium/drivers/vc4/vc4_resource.h
+++ b/src/gallium/drivers/vc4/vc4_resource.h
@@ -61,6 +61,16 @@ struct vc4_resource {
bool tiled;
/** One of VC4_TEXTURE_TYPE_* */
enum vc4_texture_data_type vc4_format;
+
+ /**
+ * Number of times the resource has been written to.
+ *
+ * This is used to track when we need to update this shadow resource
+ * from its parent in the case of GL_TEXTURE_BASE_LEVEL (which we
+ * can't support in hardware).
+ */
+ uint64_t writes;
+ struct pipe_resource *shadow_parent;
};
static INLINE struct vc4_resource *
@@ -83,5 +93,9 @@ vc4_transfer(struct pipe_transfer *ptrans)
void vc4_resource_screen_init(struct pipe_screen *pscreen);
void vc4_resource_context_init(struct pipe_context *pctx);
+struct pipe_resource *vc4_resource_create(struct pipe_screen *pscreen,
+ const struct pipe_resource *tmpl);
+void vc4_update_shadow_baselevel_texture(struct pipe_context *pctx,
+ struct pipe_sampler_view *view);
#endif /* VC4_RESOURCE_H */