if (svga_have_gb_objects(svga)) {
struct svga_winsys_screen *sws = svga_screen(svga->pipe.screen)->sws;
+ enum pipe_error ret;
variant->gb_shader = sws->shader_create(sws, type,
variant->tokens, codeLen);
if (!variant->gb_shader)
return PIPE_ERROR_OUT_OF_MEMORY;
- return PIPE_OK;
+ ret = SVGA3D_BindGBShader(svga->swc, variant->gb_shader);
+ if (ret != PIPE_OK) {
+ sws->shader_destroy(sws, variant->gb_shader);
+ variant->gb_shader = NULL;
+ }
+
+ return ret;
}
else {
enum pipe_error ret;
if (variant != svga->state.hw_draw.fs) {
if (svga_have_gb_objects(svga)) {
- /*
- * Bind is necessary here only because pipebuffer_fenced may move
- * the shader contents around....
- */
- ret = SVGA3D_BindGBShader(svga->swc, variant->gb_shader);
- if (ret != PIPE_OK)
- return ret;
-
ret = SVGA3D_SetGBShader(svga->swc, SVGA3D_SHADERTYPE_PS,
variant->gb_shader);
if (ret != PIPE_OK)
if (svga_have_gb_objects(svga)) {
struct svga_winsys_gb_shader *gbshader =
variant ? variant->gb_shader : NULL;
-
- /*
- * Bind is necessary here only because pipebuffer_fenced may move
- * the shader contents around....
- */
- if (gbshader) {
- ret = SVGA3D_BindGBShader(svga->swc, gbshader);
- if (ret != PIPE_OK)
- return ret;
- }
-
ret = SVGA3D_SetGBShader(svga->swc, SVGA3D_SHADERTYPE_VS, gbshader);
if (ret != PIPE_OK)
return ret;