* \return number of float[4] constants put into the 'dest' buffer
*/
static unsigned
-svga_get_extra_constants_common(struct svga_context *svga,
+svga_get_extra_constants_common(const struct svga_context *svga,
const struct svga_shader_variant *variant,
enum pipe_shader_type shader, float *dest)
{
/* debug/sanity check */
assert(variant->key.tex[i].width_height_idx == count);
- *dest++ = 1.0 / (float)tex->width0;
- *dest++ = 1.0 / (float)tex->height0;
- *dest++ = 1.0;
- *dest++ = 1.0;
+ *dest++ = 1.0f / (float) tex->width0;
+ *dest++ = 1.0f / (float) tex->height0;
+ *dest++ = 1.0f;
+ *dest++ = 1.0f;
count++;
}
* \return number of float[4] constants put into the dest buffer
*/
static unsigned
-svga_get_extra_fs_constants(struct svga_context *svga, float *dest)
+svga_get_extra_fs_constants(const struct svga_context *svga, float *dest)
{
const struct svga_shader_variant *variant = svga->state.hw_draw.fs;
unsigned count = 0;
* will be returned in 'dest'.
*/
static unsigned
-svga_get_prescale_constants(struct svga_context *svga, float **dest)
+svga_get_prescale_constants(const struct svga_context *svga, float **dest)
{
memcpy(*dest, svga->state.hw_clear.prescale.scale, 4 * sizeof(float));
*dest += 4;
* Emit extra constants needed for point sprite emulation.
*/
static unsigned
-svga_get_pt_sprite_constants(struct svga_context *svga, float **dest)
+svga_get_pt_sprite_constants(const struct svga_context *svga, float **dest)
{
const struct svga_screen *screen = svga_screen(svga->pipe.screen);
float *dst = *dest;
* by '*dest'. The updated buffer pointer will be returned in 'dest'.
*/
static unsigned
-svga_get_clip_plane_constants(struct svga_context *svga,
+svga_get_clip_plane_constants(const struct svga_context *svga,
const struct svga_shader_variant *variant,
float **dest)
{
* \return number of float[4] constants put into the dest buffer
*/
static unsigned
-svga_get_extra_vs_constants(struct svga_context *svga, float *dest)
+svga_get_extra_vs_constants(const struct svga_context *svga, float *dest)
{
const struct svga_shader_variant *variant = svga->state.hw_draw.vs;
unsigned count = 0;
* to by 'dest'.
*/
static unsigned
-svga_get_extra_gs_constants(struct svga_context *svga, float *dest)
+svga_get_extra_gs_constants(const struct svga_context *svga, float *dest)
{
const struct svga_shader_variant *variant = svga->state.hw_draw.gs;
unsigned count = 0;
const struct svga_shader_variant *variant;
unsigned alloc_buf_size;
- assert(shader == PIPE_SHADER_VERTEX ||
- shader == PIPE_SHADER_GEOMETRY ||
- shader == PIPE_SHADER_FRAGMENT);
-
- cbuf = &svga->curr.constbufs[shader][0];
-
switch (shader) {
case PIPE_SHADER_VERTEX:
variant = svga->state.hw_draw.vs;
assert(variant);
+ cbuf = &svga->curr.constbufs[shader][0];
+
/* Compute extra constants size and offset in bytes */
extra_size = extra_count * 4 * sizeof(float);
extra_offset = 4 * sizeof(float) * variant->extra_const_start;