xref: /aosp_15_r20/external/mesa3d/src/gallium/drivers/freedreno/a3xx/fd3_texture.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright © 2013 Rob Clark <[email protected]>
3  * SPDX-License-Identifier: MIT
4  *
5  * Authors:
6  *    Rob Clark <[email protected]>
7  */
8 
9 #ifndef FD3_TEXTURE_H_
10 #define FD3_TEXTURE_H_
11 
12 #include "pipe/p_context.h"
13 
14 #include "freedreno_resource.h"
15 #include "freedreno_texture.h"
16 
17 #include "fd3_context.h"
18 #include "fd3_format.h"
19 
20 struct fd3_sampler_stateobj {
21    struct pipe_sampler_state base;
22    uint32_t texsamp0, texsamp1;
23    bool needs_border;
24 };
25 
26 static inline struct fd3_sampler_stateobj *
fd3_sampler_stateobj(struct pipe_sampler_state * samp)27 fd3_sampler_stateobj(struct pipe_sampler_state *samp)
28 {
29    return (struct fd3_sampler_stateobj *)samp;
30 }
31 
32 struct fd3_pipe_sampler_view {
33    struct pipe_sampler_view base;
34    uint32_t texconst0, texconst1, texconst2, texconst3;
35 };
36 
37 static inline struct fd3_pipe_sampler_view *
fd3_pipe_sampler_view(struct pipe_sampler_view * pview)38 fd3_pipe_sampler_view(struct pipe_sampler_view *pview)
39 {
40    return (struct fd3_pipe_sampler_view *)pview;
41 }
42 
43 unsigned fd3_get_const_idx(struct fd_context *ctx,
44                            struct fd_texture_stateobj *tex, unsigned samp_id);
45 
46 void fd3_texture_init(struct pipe_context *pctx);
47 
48 #endif /* FD3_TEXTURE_H_ */
49