Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nv40_state_blend.c 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "nv40_context.h"
  2. static boolean
  3. nv40_state_blend_validate(struct nv40_context *nv40)
  4. {
  5. so_ref(nv40->blend->so, &nv40->state.hw[NV40_STATE_BLEND]);
  6. return TRUE;
  7. }
  8. struct nv40_state_entry nv40_state_blend = {
  9. .validate = nv40_state_blend_validate,
  10. .dirty = {
  11. .pipe = NV40_NEW_BLEND,
  12. .hw = NV40_STATE_BLEND
  13. }
  14. };
  15. static boolean
  16. nv40_state_blend_colour_validate(struct nv40_context *nv40)
  17. {
  18. struct nouveau_stateobj *so = so_new(1, 1, 0);
  19. struct pipe_blend_color *bcol = &nv40->blend_colour;
  20. so_method(so, nv40->screen->curie, NV40TCL_BLEND_COLOR, 1);
  21. so_data (so, ((float_to_ubyte(bcol->color[3]) << 24) |
  22. (float_to_ubyte(bcol->color[0]) << 16) |
  23. (float_to_ubyte(bcol->color[1]) << 8) |
  24. (float_to_ubyte(bcol->color[2]) << 0)));
  25. so_ref(so, &nv40->state.hw[NV40_STATE_BCOL]);
  26. so_ref(NULL, &so);
  27. return TRUE;
  28. }
  29. struct nv40_state_entry nv40_state_blend_colour = {
  30. .validate = nv40_state_blend_colour_validate,
  31. .dirty = {
  32. .pipe = NV40_NEW_BCOL,
  33. .hw = NV40_STATE_BCOL
  34. }
  35. };