#ifndef SWR_CONTEXT_H
#define SWR_CONTEXT_H
+#include "common/os.h"
+
#include "pipe/p_context.h"
#include "pipe/p_state.h"
#include "util/u_blitter.h"
uint32_t depth; // doubles as array size
uint32_t first_level;
uint32_t last_level;
- const void *base_ptr;
+ const uint8_t *base_ptr;
uint32_t row_stride[PIPE_MAX_TEXTURE_LEVELS];
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS];
uint32_t mip_offsets[PIPE_MAX_TEXTURE_LEVELS];
struct swr_draw_context {
const float *constantVS[PIPE_MAX_CONSTANT_BUFFERS];
- unsigned num_constantsVS[PIPE_MAX_CONSTANT_BUFFERS];
+ uint32_t num_constantsVS[PIPE_MAX_CONSTANT_BUFFERS];
const float *constantFS[PIPE_MAX_CONSTANT_BUFFERS];
- unsigned num_constantsFS[PIPE_MAX_CONSTANT_BUFFERS];
+ uint32_t num_constantsFS[PIPE_MAX_CONSTANT_BUFFERS];
swr_jit_texture texturesVS[PIPE_MAX_SHADER_SAMPLER_VIEWS];
swr_jit_sampler samplersVS[PIPE_MAX_SAMPLERS];
swr_jit_texture texturesFS[PIPE_MAX_SHADER_SAMPLER_VIEWS];
swr_jit_sampler samplersFS[PIPE_MAX_SAMPLERS];
+ float userClipPlanes[PIPE_MAX_CLIP_PLANES][4];
+
SWR_SURFACE_STATE renderTargets[SWR_NUM_ATTACHMENTS];
+ void *pStats;
};
+/* gen_llvm_types FINI */
+
struct swr_context {
struct pipe_context pipe; /**< base class */
struct pipe_framebuffer_state framebuffer;
struct pipe_poly_stipple poly_stipple;
struct pipe_scissor_state scissor;
+ SWR_RECT swr_scissor;
struct pipe_sampler_view *
sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
}
static INLINE void
-swr_update_draw_context(struct swr_context *ctx)
+swr_update_draw_context(struct swr_context *ctx,
+ struct swr_query_result *pqr = nullptr)
{
swr_draw_context *pDC =
(swr_draw_context *)SwrGetPrivateContextState(ctx->swrContext);
+ if (pqr)
+ ctx->swrDC.pStats = pqr;
memcpy(pDC, &ctx->swrDC, sizeof(swr_draw_context));
}